Skip to content

Commit

Permalink
Fix escaped index JSON parsing
Browse files Browse the repository at this point in the history
BUG=416449
LOG=y
R=yangguo@chromium.org

Review URL: https://codereview.chromium.org/592813002

git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@24125 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
  • Loading branch information
verwaest committed Sep 22, 2014
1 parent 269c46e commit 83f64e8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
3 changes: 1 addition & 2 deletions src/json-parser.h
Expand Up @@ -426,8 +426,7 @@ Handle<Object> JsonParser<seq_one_byte>::ParseJsonObject() {
if (value.is_null()) return ReportUnexpectedCharacter();
}

JSObject::SetOwnPropertyIgnoreAttributes(
json_object, key, value, NONE).Assert();
Runtime::DefineObjectProperty(json_object, key, value, NONE).Check();
} while (MatchSkipWhiteSpace(','));
if (c0_ != '}') {
return ReportUnexpectedCharacter();
Expand Down
6 changes: 6 additions & 0 deletions test/mjsunit/regress/regress-json-parse-index.js
@@ -0,0 +1,6 @@
// Copyright 2014 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

var o = JSON.parse('{"\\u0030":100}');
assertEquals(100, o[0]);

0 comments on commit 83f64e8

Please sign in to comment.