Index: src/json-parser.h |
diff --git a/src/json-parser.h b/src/json-parser.h |
index a7dbd3ab8651d2cb9995bb994a7c1c158e4c6e7f..8c19bc847454751413cd0dfc539f6cfe991d675f 100644 |
--- a/src/json-parser.h |
+++ b/src/json-parser.h |
@@ -415,7 +415,15 @@ Handle<Object> JsonParser<seq_ascii>::ParseJsonObject() { |
if (value->IsSmi() && expected_representation.IsDouble()) { |
value = factory()->NewHeapNumber( |
Handle<Smi>::cast(value)->value()); |
+ } else if (expected_representation.IsHeapObject() && |
+ !target->instance_descriptors()->GetFieldType( |
+ descriptor)->NowContains(value)) { |
+ Handle<HeapType> value_type(value->OptimalType( |
+ isolate(), expected_representation)); |
+ Map::GeneralizeFieldType(target, descriptor, value_type); |
} |
+ ASSERT(target->instance_descriptors()->GetFieldType( |
+ descriptor)->NowContains(value)); |
properties.Add(value, zone()); |
map = target; |
continue; |