You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Right now the spec will check @@isConcatSpreadable on Tuple.prototype when passed a tuple, before defaulting to returning true for tuples:
1. If Type(O) is not Object or Tuple, return false.
2. Let spreadable be ? GetV(O, @@isConcatSpreadable).
3. If spreadable is not undefined, return ! ToBoolean(spreadable).
4. If ! IsTuple(O), return true.
5. Return ? IsArray(O).
This means that if someone creates Tuple.prototype[Symbol.isConcatSpreadable] and returns false, it would change how Tuples behave in concat. It might make sense to do an early return for IsTuple and always return true - keeping the behavior 'static'.
It would be confusing if someone did that, and Tuple concat still spreaded tuples but Array concat didnt. If both are hardcoding it, then it would still be confusing that primitive Tuple spread but boxed tuples dont.
I think they should just be looked up via the symbol.
Right now the spec will check
@@isConcatSpreadable
onTuple.prototype
when passed a tuple, before defaulting to returningtrue
for tuples:This means that if someone creates
Tuple.prototype[Symbol.isConcatSpreadable]
and returns false, it would change how Tuples behave in concat. It might make sense to do an early return forIsTuple
and always return true - keeping the behavior 'static'.cc: @michaelficarra
The text was updated successfully, but these errors were encountered: