-
Notifications
You must be signed in to change notification settings - Fork 48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Array.concat() works incorrectly on proxies under V8 #19
Comments
This is because As with issue #6 I'm not sure whether ES6 will eventually end up auto-unwrapping proxies for these cases. I'll consider patching |
You both probably already know this but for anyone else following along it's IMHO worth showing what that
|
Thanks Tom for the quick and clear reply. Is there an up-to-date list anywhere of all of the built-in routines that are currently "broken" for similar reasons? Such a list would make it easy for me to avoid filing bugs one on issues like this one that are (apparently) already known. |
There is no such list that I know of. A quick search through the ES5 spec for any text testing explicitly whether an object's
Given that I already patch Patching the |
Fixed in v0.0.9. Essentially, the patched By creating a copy, we will trigger the same sequence of trap invocations on the proxy-for-array handler that would have occurred if the real Array.prototype.concat would have copied it. The patched version should have little overhead compared to the built-in version if none of the arguments are proxies. |
Thanks, Tom. I've grabbed v0.0.9 and it indeed fixes the issue we had. |
Calling the builtin function 'sort' on an array wrapped in an ES6 proxy results in "illegal access" being thrown (a string, not an Error). This is probably related in some way to these issues: tvcutsem/harmony-reflect#6 tvcutsem/harmony-reflect#19 This change fixes the problem for the time being through a rather explicit workaround; if the issue also occurs for other functions, it will likely surface again. (also, the change in Session.js makes sure error log entry is nicely formatted even when strings are thrown)
Something is wrong with Array.concat when it operates on a proxy. This may be a special case of issue #6 but I'm opening a new issue so we can more easily track the details.
I've confirmed that this bug exists with the latest version of harmony-reflect (0.0.7) and with today's trunk version of V8.
The text was updated successfully, but these errors were encountered: