mirror of https://github.com/tc39/test262.git
Remove 'AsyncArrowFunction' test
There is no such hidden constructor, it's the same as the hidden AsyncFunction constructor. In other words: ```js Object.getPrototypeOf(async () => {}).constructor === Object.getPrototypeOf(async function () {}).constructor ``` Also add a test to ensure that %AsyncFunction.prototype% is indeed the prototype of an async arrow function. Closes #4044.
This commit is contained in:
parent
3d5c52e112
commit
a82f5382ff
|
@ -5,13 +5,11 @@
|
|||
description: |
|
||||
Provides uniform access to built-in constructors that are not exposed to the global object.
|
||||
defines:
|
||||
- AsyncArrowFunction
|
||||
- AsyncFunction
|
||||
- AsyncGeneratorFunction
|
||||
- GeneratorFunction
|
||||
---*/
|
||||
|
||||
var AsyncArrowFunction = Object.getPrototypeOf(async () => {}).constructor;
|
||||
var AsyncFunction = Object.getPrototypeOf(async function () {}).constructor;
|
||||
var AsyncGeneratorFunction = Object.getPrototypeOf(async function* () {}).constructor;
|
||||
var GeneratorFunction = Object.getPrototypeOf(function* () {}).constructor;
|
||||
|
|
|
@ -1,24 +0,0 @@
|
|||
// Copyright (C) 2020 Rick Waldron. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-ecmascript-standard-built-in-objects
|
||||
description: >
|
||||
The AsyncArrowFunction constructor implements [[Construct]]
|
||||
info: |
|
||||
IsConstructor ( argument )
|
||||
|
||||
The abstract operation IsConstructor takes argument argument (an ECMAScript language value).
|
||||
It determines if argument is a function object with a [[Construct]] internal method.
|
||||
It performs the following steps when called:
|
||||
|
||||
If Type(argument) is not Object, return false.
|
||||
If argument has a [[Construct]] internal method, return true.
|
||||
Return false.
|
||||
includes: [isConstructor.js, hidden-constructors.js]
|
||||
features: [Reflect.construct]
|
||||
---*/
|
||||
|
||||
assert.sameValue(isConstructor(AsyncArrowFunction), true, 'isConstructor(AsyncArrowFunction) must return true');
|
||||
new AsyncArrowFunction();
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
// Copyright (C) 2024 Linus Groh. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-async-arrow-function-definitions-runtime-semantics-evaluation
|
||||
description: The prototype of an async arrow function is %AsyncFunction.prototype%.
|
||||
info: |
|
||||
AsyncArrowFunction : async AsyncArrowBindingIdentifier => AsyncConciseBody
|
||||
|
||||
...
|
||||
6. Let closure be OrdinaryFunctionCreate(%AsyncFunction.prototype%, sourceText, parameters,
|
||||
AsyncConciseBody, lexical-this, env, privateEnv).
|
||||
...
|
||||
includes: [hidden-constructors.js]
|
||||
---*/
|
||||
|
||||
assert.sameValue(Object.getPrototypeOf(async () => {}), AsyncFunction.prototype);
|
Loading…
Reference in New Issue