hidden-constructors.js 666 B

1234567891011121314151617
  1. // Copyright (C) 2020 Rick Waldron. All rights reserved.
  2. // This code is governed by the BSD license found in the LICENSE file.
  3. /*---
  4. description: |
  5. Provides uniform access to built-in constructors that are not exposed to the global object.
  6. defines:
  7. - AsyncArrowFunction
  8. - AsyncFunction
  9. - AsyncGeneratorFunction
  10. - GeneratorFunction
  11. ---*/
  12. var AsyncArrowFunction = Object.getPrototypeOf(async () => {}).constructor;
  13. var AsyncFunction = Object.getPrototypeOf(async function () {}).constructor;
  14. var AsyncGeneratorFunction = Object.getPrototypeOf(async function* () {}).constructor;
  15. var GeneratorFunction = Object.getPrototypeOf(function* () {}).constructor;