archives

« Bugzilla Issues Index

#4232 — 22.1.3.24 Array.prototype.sort: Term "different behaviour" is unclear


22.1.3.24 Array.prototype.sort (comparefn)

> If obj is an exotic object (including Proxy exotic objects) whose behaviour for [[Get]], [[Set]], [[Delete]],
> and [[GetOwnProperty]] is different from the ordinary object behaviour for these internal methods.


It's not clear to me what "different behaviour" means in this context. For example does a Proxy object which only adds logging, like:

p = new Proxy({}, {
get(t, pk, r) { print("get trap"); return Reflect.get(t, pk, r); }
});

count as "different behaviour"?


fixed in rev37 editor's draft

changed "is different from" to "is not"

It really mans what it says. Sorting of any proxy falls into the implementation dependent bucket.


In Rev37