Skip to content

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

Closed
@mgaudet

Description

@mgaudet

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.

Activity

ptomato

ptomato commented on Mar 31, 2023

@ptomato

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

michaelficarra commented on Apr 14, 2023

@michaelficarra
Member

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

js-choi

js-choi commented on May 6, 2023

@js-choi
Collaborator

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.

locked as resolved and limited conversation to collaborators on Aug 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Participants

      @js-choi@michaelficarra@ptomato@mgaudet

      Issue actions

        Spec Tidy Suggestion: Don't Double Construct A · Issue #35 · tc39/proposal-array-from-async