Closed mgaudet closed 1 year ago
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
I've opened #41 to fix this and added it to the May agenda for approval by committee.
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.
As written, the spec -may- double counstruct A:
It will be constructed first as part of Step 3.{e,f}; then if
iteratorRecord
isundefined
, it's constructed again in Step 3.k.{iv,v}.Probably that first construction could be sunk into 3.j.