mirror of https://github.com/tc39/test262.git
Prevent harness code not loading when async/generator/asyncGenerator not supported (#4164)
* Dont throw when async/generato/asyncGenerator not supported * Apply suggestions from code review
This commit is contained in:
parent
d8aa2e4ef7
commit
f55e99796f
|
@ -10,6 +10,18 @@ defines:
|
|||
- GeneratorFunction
|
||||
---*/
|
||||
|
||||
var AsyncFunction = Object.getPrototypeOf(async function () {}).constructor;
|
||||
var AsyncGeneratorFunction = Object.getPrototypeOf(async function* () {}).constructor;
|
||||
var GeneratorFunction = Object.getPrototypeOf(function* () {}).constructor;
|
||||
var AsyncFunction;
|
||||
var AsyncGeneratorFunction;
|
||||
var GeneratorFunction;
|
||||
|
||||
try {
|
||||
AsyncFunction = Object.getPrototypeOf(new Function('async function () {}')).constructor;
|
||||
} catch(e) {}
|
||||
|
||||
try {
|
||||
AsyncGeneratorFunction = Object.getPrototypeOf(new Function('async function* () {}')).constructor;
|
||||
} catch(e) {}
|
||||
|
||||
try {
|
||||
GeneratorFunction = Object.getPrototypeOf(new Function('function* () {}')).constructor;
|
||||
} catch(e) {}
|
||||
|
|
Loading…
Reference in New Issue