Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove 'AsyncArrowFunction' test #4045

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

linusg
Copy link
Member

@linusg linusg commented Apr 8, 2024

Fixes #4044

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
```

Closes tc39#4044.
@linusg linusg requested a review from a team as a code owner April 8, 2024 17:16
@ljharb ljharb requested a review from a team April 8, 2024 17:55
Copy link
Contributor

@Ms2ger Ms2ger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please ensure there is a test that Object.getPrototypeOf(async () => {}) and Object.getPrototypeOf(async function () {}) match.

@nicolo-ribaudo
Copy link
Member

There is an implementation-contributed one at

// Let functionPrototype be the intrinsic object %AsyncFunctionPrototype%.
async function asyncFunctionForProto() {}
assertEquals(AsyncFunction.prototype,
Object.getPrototypeOf(asyncFunctionForProto));
assertEquals(AsyncFunction.prototype,
Object.getPrototypeOf(async function() {}));
assertEquals(AsyncFunction.prototype, Object.getPrototypeOf(async () => {}));
assertEquals(AsyncFunction.prototype,
Object.getPrototypeOf({ async method() {} }.method));
assertEquals(AsyncFunction.prototype, Object.getPrototypeOf(AsyncFunction()));
assertEquals(AsyncFunction.prototype,
Object.getPrototypeOf(new AsyncFunction()));

@ptomato
Copy link
Contributor

ptomato commented Apr 9, 2024

This ties into something else I've been trying to figure out; do implementations actually execute those implementation-contributed tests?

@anba
Copy link
Contributor

anba commented Apr 9, 2024

[...] do implementations actually execute those implementation-contributed tests?

No, because the tests contain implementation internal functions and syntax.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Remove non-existend "AsyncArrowFunction" constructor
6 participants