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
Here the notation old[j] is used to refer to the hypothetical result of calling obj.[[Get]](j) before this function is executed, and the notation new[j] to refer to the hypothetical result of calling obj.[[Get]](j) after this function has been executed.
Now, obj.[[Get]](j) in the sentence doesn't have the 2nd argument receiver, so I guess that this in accessor properties are undefined in sorting. For example:
constimpl=Symbol()classMyArrayLike{constructor(){this[impl]=[1,2]}get0(){returnthis[impl][0]}// this `this` is undefined in sorting.set0(value){this[impl][0]=value}get1(){returnthis[impl][1]}set1(value){this[impl][1]=value}getlength(){return2}}constxs=newMyArrayLike()Array.prototype.sort.call(xs)
However, those thiss are not undefined in real world.
I'm suspecting that we should fix those obj.[[Get]](j) to obj.[[Get]](j, obj).
The text was updated successfully, but these errors were encountered:
In https://tc39.github.io/ecma262/#sec-array.prototype.sort section, the following sentence exists:
Now,
obj.[[Get]](j)
in the sentence doesn't have the 2nd argumentreceiver
, so I guess thatthis
in accessor properties areundefined
in sorting. For example:However, those
this
s are notundefined
in real world.I'm suspecting that we should fix those
obj.[[Get]](j)
toobj.[[Get]](j, obj)
.The text was updated successfully, but these errors were encountered: