tc39 / proposal-setmap-offrom

https://tc39.es/proposal-setmap-offrom/
39 stars 9 forks source link

CreateCollectionFrom: arity conflict calling add method #5

Closed allenwb closed 8 years ago

allenwb commented 8 years ago

The value of _add__ is either "add" or "set" and is called as: Call(add, targetObj, « mappedValue » )(

but, the Map set method requires two arguments while the and the Set add method only takes one. You don't take that into account.

leobalter commented 8 years ago

The new abstraction creates a temporary array to parse the items through the mapping function and calls the constructor using it. The adder method is not necessary anymore in this case.

Ref https://leobalter.github.io/proposal-setmap-offrom/#sec-collectioncreatefrom%20aoid=