Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1016)

Unified Diff: src/json-parser.h

Issue 11194080: Get the target field index when transitioning. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/objects.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/json-parser.h
diff --git a/src/json-parser.h b/src/json-parser.h
index 326a771db9600c90915d7bfc8c4a4562e68b4787..245dfbfecb944748bff97a4713f0da8e5f668fb1 100644
--- a/src/json-parser.h
+++ b/src/json-parser.h
@@ -289,7 +289,6 @@ 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() {
- int current_index = 0;
Handle<Object> prototype;
Handle<JSFunction> object_constructor(
isolate()->native_context()->object_function());
@@ -339,11 +338,11 @@ Handle<Object> JsonParser<seq_ascii>::ParseJsonObject() {
prototype = value;
} else {
if (JSObject::TryTransitionToField(json_object, key)) {
- json_object->FastPropertyAtPut(current_index++, *value);
+ int index = json_object->LastAddedFieldIndex();
+ json_object->FastPropertyAtPut(index, *value);
} else {
JSObject::SetLocalPropertyIgnoreAttributes(
json_object, key, value, NONE);
- current_index = json_object->NumberOfLocalProperties();
}
}
}
« no previous file with comments | « no previous file | src/objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698