summaryrefslogtreecommitdiff
path: root/deps/v8/src/json.js
diff options
context:
space:
mode:
authorisaacs <i@izs.me>2012-09-18 15:20:38 -0700
committerBert Belder <bertbelder@gmail.com>2012-09-21 01:52:24 +0200
commit3411a03dd114d635800cc50749d2351cd734eb2a (patch)
tree0ba1e52ab2236286894b33400302181ece91b63a /deps/v8/src/json.js
parentcc1b09d6b7c3cc6b8729804cbf644634ba5d0815 (diff)
downloadnode-3411a03dd114d635800cc50749d2351cd734eb2a.tar.gz
V8: Upgrade to 3.13.7.1
Diffstat (limited to 'deps/v8/src/json.js')
-rw-r--r--deps/v8/src/json.js33
1 files changed, 17 insertions, 16 deletions
diff --git a/deps/v8/src/json.js b/deps/v8/src/json.js
index ccef4456d..85224b0f0 100644
--- a/deps/v8/src/json.js
+++ b/deps/v8/src/json.js
@@ -247,22 +247,23 @@ function BasicSerializeObject(value, stack, builder) {
}
builder.push("{");
var first = true;
- for (var p in value) {
- if (%HasLocalProperty(value, p)) {
- if (!first) {
- builder.push(%QuoteJSONStringComma(p));
- } else {
- builder.push(%QuoteJSONString(p));
- }
- builder.push(":");
- var before = builder.length;
- BasicJSONSerialize(p, value[p], stack, builder);
- if (before == builder.length) {
- builder.pop();
- builder.pop();
- } else {
- first = false;
- }
+ var keys = %ObjectKeys(value);
+ var len = keys.length;
+ for (var i = 0; i < len; i++) {
+ var p = keys[i];
+ if (!first) {
+ builder.push(%QuoteJSONStringComma(p));
+ } else {
+ builder.push(%QuoteJSONString(p));
+ }
+ builder.push(":");
+ var before = builder.length;
+ BasicJSONSerialize(p, value[p], stack, builder);
+ if (before == builder.length) {
+ builder.pop();
+ builder.pop();
+ } else {
+ first = false;
}
}
stack.pop();