Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign upInteger Indexed Exotic Objects inconsistent wrt Reflect.get/set/has #347
Comments
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
allenwb
Feb 2, 2016
Member
I think the second alternative is probably a good idea.
The receiver check is enforcing that typed array element access do not occur when a typed array is access via prototype lookup.
When this was specified we were trying to clean up array access corner cases and implementation differences of typed arrays. Apparently at the time I thought that inheriting access to typed array elements was one of the things we wanted to precluded.
However, It isn't clear to me now why this case is important and it does create the inconsistency you have identified. I suspect that at least some implementation have not implemented it which case it is probably pretty safe to change. However, somebody should test the current status of implementions WRT the receiver check.
|
I think the second alternative is probably a good idea. The receiver check is enforcing that typed array element access do not occur when a typed array is access via prototype lookup. When this was specified we were trying to clean up array access corner cases and implementation differences of typed arrays. Apparently at the time I thought that inheriting access to typed array elements was one of the things we wanted to precluded. However, It isn't clear to me now why this case is important and it does create the inconsistency you have identified. I suspect that at least some implementation have not implemented it which case it is probably pretty safe to change. However, somebody should test the current status of implementions WRT the receiver check. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
|
V8 does not implement it yet, which is why this came up.
|
pushed a commit
to paul99/v8mips
that referenced
this issue
Feb 3, 2016
bterlson
added
normative change
snapshot blocking
labels
Feb 18, 2016
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
evilpie
Feb 20, 2016
Contributor
SpiderMonkey never had this check: https://bugzilla.mozilla.org/show_bug.cgi?id=1216621
|
SpiderMonkey never had this check: https://bugzilla.mozilla.org/show_bug.cgi?id=1216621 |
verwaest commentedFeb 2, 2016
According to the spec,
[[get]](9.4.5.4) and[[set]] (9.4.5.5) only ignore CanonicalNumericIndexStrings ifSameValue(O, Receiver).[[HasProperty]]however does not have such a check since it doesn't even get passed in the Receiver.This is inconsistent. I see two options to make this more consistent:
SameValue(O, Receiver)from[[get]]and[[set]].I personally prefer the second, since we can't pre-check whether target is receiver in the context of
Reflect.get. You can easily doReflect.get(target, <CanonicalNumericIndexString>, typed_array_in_prototype_chain_of_target), causing the[[get]]to be blocked once we reach the typed array.