2020-10-02 17:35:57 +02:00
|
|
|
// Copyright (C) 2020 Rick Waldron. All rights reserved.
|
|
|
|
// This code is governed by the BSD license found in the LICENSE file.
|
|
|
|
|
|
|
|
/*---
|
|
|
|
description: |
|
|
|
|
Provides uniform access to built-in constructors that are not exposed to the global object.
|
|
|
|
defines:
|
|
|
|
- AsyncFunction
|
|
|
|
- AsyncGeneratorFunction
|
|
|
|
- GeneratorFunction
|
|
|
|
---*/
|
|
|
|
|
2024-07-24 18:18:02 +02:00
|
|
|
var AsyncFunction;
|
|
|
|
var AsyncGeneratorFunction;
|
|
|
|
var GeneratorFunction;
|
|
|
|
|
|
|
|
try {
|
2024-07-24 19:29:51 +02:00
|
|
|
AsyncFunction = Object.getPrototypeOf(new Function('return async function dummy() {}')()).constructor;
|
2024-07-24 18:18:02 +02:00
|
|
|
} catch(e) {}
|
|
|
|
|
|
|
|
try {
|
2024-07-24 19:29:51 +02:00
|
|
|
AsyncGeneratorFunction = Object.getPrototypeOf(new Function('return async function* dummy() {}')()).constructor;
|
2024-07-24 18:18:02 +02:00
|
|
|
} catch(e) {}
|
|
|
|
|
|
|
|
try {
|
2024-07-24 19:29:51 +02:00
|
|
|
GeneratorFunction = Object.getPrototypeOf(new Function('return function* dummy() {}')()).constructor;
|
2024-07-24 18:18:02 +02:00
|
|
|
} catch(e) {}
|