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
Some of the tuple methods, such as Tuple.prototype.map, are defined with explicit steps and, when they have a callback, they pass the result of thisTupleValue(this) as the last parameter.
Other tuple methods, such as Tuple.prototype.forEach, are defined as a diff from the relative Array method, with references to this replaced with thisTupleVaue(this). However, array methods call ToObject(this) (which thus ends up being ToObject(thisTupleVaue(this)))) and pass the resulting object as the last parameter to the callback function.
In practice, this means that #[1].forEach((v, i, tup) => console.log(typeof tup)) logs "object" instead of "tuple": we should fix how we define those methods to make sure that the last parameter is correctly a primitive tuple.
Some of the tuple methods, such as Tuple.prototype.map, are defined with explicit steps and, when they have a callback, they pass the result of
thisTupleValue(this)
as the last parameter.Other tuple methods, such as Tuple.prototype.forEach, are defined as a diff from the relative Array method, with references to
this
replaced withthisTupleVaue(this)
. However, array methods callToObject(this)
(which thus ends up beingToObject(thisTupleVaue(this)))
) and pass the resulting object as the last parameter to the callback function.In practice, this means that
#[1].forEach((v, i, tup) => console.log(typeof tup))
logs"object"
instead of"tuple"
: we should fix how we define those methods to make sure that the last parameter is correctly a primitive tuple.Ref #317 (comment)
The text was updated successfully, but these errors were encountered: