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

Unified Diff: src/js/json.js

Issue 1748633002: [json] Fix iteration over object keys in InternalizeJSONProperty. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 10 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/regress/regress-4769.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/js/json.js
diff --git a/src/js/json.js b/src/js/json.js
index 73d7802be964164adb7611e5bc3b130ba7bfac5f..ddd081bab11bf7dfa5c0fcef7385c247e56443f3 100644
--- a/src/js/json.js
+++ b/src/js/json.js
@@ -51,7 +51,9 @@ function InternalizeJSONProperty(holder, name, reviver) {
}
}
} else {
- for (var p of %object_keys(val)) {
+ var keys = %object_keys(val);
caitp (gmail) 2016/02/29 16:48:10 I believe this is still observable, eg if accessor
caitp (gmail) 2016/02/29 17:01:09 Okay, I guess accessors on the prototype don't mat
+ for (var i = 0; i < keys.length; i++) {
+ var p = keys[i];
var newElement = InternalizeJSONProperty(val, p, reviver);
if (IS_UNDEFINED(newElement)) {
%reflect_delete_property(val, p);
@@ -122,7 +124,9 @@ function SerializeObject(value, replacer, stack, indent, gap) {
}
}
} else {
- for (var p of %object_keys(value)) {
+ var keys = %object_keys(value);
+ for (var i = 0; i < keys.length; i++) {
+ var p = keys[i];
var strP = JSONSerialize(p, value, replacer, stack, indent, gap);
if (!IS_UNDEFINED(strP)) {
var member = %QuoteJSONString(p) + ":";
« no previous file with comments | « no previous file | test/mjsunit/regress/regress-4769.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698