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

Spec Tidy Suggestion: Don't Double Construct A #35

Closed
mgaudet opened this issue Oct 18, 2022 · 3 comments · Fixed by #41
Closed

Spec Tidy Suggestion: Don't Double Construct A #35

mgaudet opened this issue Oct 18, 2022 · 3 comments · Fixed by #41

Comments

@mgaudet
Copy link

mgaudet commented Oct 18, 2022

As written, the spec -may- double counstruct A:

It will be constructed first as part of Step 3.{e,f}; then if iteratorRecord is undefined, it's constructed again in Step 3.k.{iv,v}.

Probably that first construction could be sunk into 3.j.

@ptomato
Copy link

ptomato commented Mar 31, 2023

I found this as well, while writing test262 tests. Here's a code snippet showing how it's observable from JS:

class MyArray {
  constructor(...args) {
    console.log('called with', args);
  }
}
await Array.fromAsync.call(MyArray, {
  length: 2,
  0: 1,
  1: 2
});

This logs:

called with 
called with 2

@michaelficarra
Copy link
Member

I've opened #41 to fix this and added it to the May agenda for approval by committee.

@js-choi
Copy link
Collaborator

js-choi commented May 6, 2023

My apologies for being absent from the discussion. This is a great catch, and #41 looks good to me.
@michaelficarra: I’ll get in touch on Element regarding next week’s plenary presentation.

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 a pull request may close this issue.

4 participants