aboutsummaryrefslogtreecommitdiff
path: root/src/json-parser.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/json-parser.cc')
-rw-r--r--src/json-parser.cc9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/json-parser.cc b/src/json-parser.cc
index 5e79b611..2ec79cae 100644
--- a/src/json-parser.cc
+++ b/src/json-parser.cc
@@ -399,8 +399,8 @@ Handle<Object> JsonParser<seq_one_byte>::ParseJsonObject() {
->NowContains(value)) {
Handle<FieldType> value_type(
value->OptimalType(isolate(), expected_representation));
- Map::GeneralizeFieldType(target, descriptor,
- expected_representation, value_type);
+ Map::GeneralizeField(target, descriptor, details.constness(),
+ expected_representation, value_type);
}
DCHECK(target->instance_descriptors()
->GetFieldType(descriptor)
@@ -478,11 +478,12 @@ void JsonParser<seq_one_byte>::CommitStateToJsonObject(
DCHECK(!json_object->map()->is_dictionary_map());
DisallowHeapAllocation no_gc;
-
+ DescriptorArray* descriptors = json_object->map()->instance_descriptors();
int length = properties->length();
for (int i = 0; i < length; i++) {
Handle<Object> value = (*properties)[i];
- json_object->WriteToField(i, *value);
+ // Initializing store.
+ json_object->WriteToField(i, descriptors->GetDetails(i), *value);
}
}