Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1488)

Unified Diff: src/v8natives.js

Issue 10453053: Proxies: Fix ToStringArray function so that it does not reject some keys. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | test/mjsunit/harmony/proxies.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/v8natives.js
diff --git a/src/v8natives.js b/src/v8natives.js
index f1e8084a53038dff8d8c33a888d2e1bf41311af4..86f07a195ae499ace4efdb430547493e07184133 100644
--- a/src/v8natives.js
+++ b/src/v8natives.js
@@ -337,7 +337,7 @@ function ObjectKeys(obj) {
if (%IsJSProxy(obj)) {
var handler = %GetHandler(obj);
var names = CallTrap0(handler, "keys", DerivedKeysTrap);
- return ToStringArray(names);
+ return ToStringArray(names, "keys");
}
return %LocalKeys(obj);
}
@@ -963,7 +963,7 @@ function ToStringArray(obj, trap) {
var names = {}; // TODO(rossberg): use sets once they are ready.
for (var index = 0; index < n; index++) {
var s = ToString(obj[index]);
- if (s in names) {
+ if (%HasLocalProperty(names, s)) {
throw MakeTypeError("proxy_repeated_prop_name", [obj, trap, s]);
}
array[index] = s;
« no previous file with comments | « no previous file | test/mjsunit/harmony/proxies.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698