| Index: src/json-parser.h
|
| diff --git a/src/json-parser.h b/src/json-parser.h
|
| index 8d9dddac664220fea3c856f7ebce09f7db17e63e..22f4c7042178e0c383713d5ebae6256f72767977 100644
|
| --- a/src/json-parser.h
|
| +++ b/src/json-parser.h
|
| @@ -291,6 +291,7 @@ Handle<Object> JsonParser<seq_ascii>::ParseJsonValue() {
|
| // Parse a JSON object. Position must be right at '{'.
|
| template <bool seq_ascii>
|
| Handle<Object> JsonParser<seq_ascii>::ParseJsonObject() {
|
| + Handle<Object> prototype;
|
| Handle<JSObject> json_object =
|
| factory()->NewJSObject(object_constructor(), pretenure_);
|
| ASSERT_EQ(c0_, '{');
|
| @@ -345,17 +346,22 @@ Handle<Object> JsonParser<seq_ascii>::ParseJsonObject() {
|
| Handle<Object> value = ParseJsonValue();
|
| if (value.is_null()) return ReportUnexpectedCharacter();
|
|
|
| - if (JSObject::TryTransitionToField(json_object, key)) {
|
| - int index = json_object->LastAddedFieldIndex();
|
| - json_object->FastPropertyAtPut(index, *value);
|
| + if (key->Equals(isolate()->heap()->Proto_symbol())) {
|
| + prototype = value;
|
| } else {
|
| - JSObject::SetLocalPropertyIgnoreAttributes(
|
| - json_object, key, value, NONE);
|
| + if (JSObject::TryTransitionToField(json_object, key)) {
|
| + int index = json_object->LastAddedFieldIndex();
|
| + json_object->FastPropertyAtPut(index, *value);
|
| + } else {
|
| + JSObject::SetLocalPropertyIgnoreAttributes(
|
| + json_object, key, value, NONE);
|
| + }
|
| }
|
| } while (MatchSkipWhiteSpace(','));
|
| if (c0_ != '}') {
|
| return ReportUnexpectedCharacter();
|
| }
|
| + if (!prototype.is_null()) SetPrototype(json_object, prototype);
|
| }
|
| AdvanceSkipWhitespace();
|
| return json_object;
|
|
|