mirror of
https://github.com/tc39/test262.git
synced 2025-07-27 07:54:41 +02:00
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
|
- GeneratorFunction
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
var AsyncFunction = Object.getPrototypeOf(async function () {}).constructor;
|
var AsyncFunction;
|
||||||
var AsyncGeneratorFunction = Object.getPrototypeOf(async function* () {}).constructor;
|
var AsyncGeneratorFunction;
|
||||||
var GeneratorFunction = Object.getPrototypeOf(function* () {}).constructor;
|
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…
x
Reference in New Issue
Block a user