Index: src/parsing/parser-base.h |
diff --git a/src/parsing/parser-base.h b/src/parsing/parser-base.h |
index 5ce82407ca79bd54b3e7219c97b3062e2c017117..033fe40fbf7dd46b53453b5a98502e814c21ac69 100644 |
--- a/src/parsing/parser-base.h |
+++ b/src/parsing/parser-base.h |
@@ -2528,6 +2528,8 @@ typename ParserBase<Impl>::ExpressionT ParserBase<Impl>::ParseObjectLiteral( |
typename Types::ObjectPropertyList properties = |
impl()->NewObjectPropertyList(4); |
int number_of_boilerplate_properties = 0; |
+ int number_of_total_properties = 0; |
+ |
bool has_computed_names = false; |
ObjectLiteralChecker checker(this); |
@@ -2544,9 +2546,13 @@ typename ParserBase<Impl>::ExpressionT ParserBase<Impl>::ParseObjectLiteral( |
has_computed_names = true; |
} |
- // Count CONSTANT or COMPUTED properties to maintain the enumeration order. |
- if (!has_computed_names && impl()->IsBoilerplateProperty(property)) { |
- number_of_boilerplate_properties++; |
+ if (impl()->IsBoilerplateProperty(property)) { |
+ number_of_total_properties++; |
Toon Verwaest
2017/01/18 08:49:53
So this isn't needed given we do properties->Add a
Franzi
2017/01/18 14:23:10
Deleted.
|
+ // Count CONSTANT or COMPUTED properties to maintain the enumeration |
+ // order. |
+ if (!has_computed_names) { |
+ number_of_boilerplate_properties++; |
+ } |
} |
properties->Add(property, zone()); |
@@ -2562,10 +2568,9 @@ typename ParserBase<Impl>::ExpressionT ParserBase<Impl>::ParseObjectLiteral( |
// Computation of literal_index must happen before pre parse bailout. |
int literal_index = function_state_->NextMaterializedLiteralIndex(); |
- return factory()->NewObjectLiteral(properties, |
- literal_index, |
+ return factory()->NewObjectLiteral(properties, literal_index, |
number_of_boilerplate_properties, |
- pos); |
+ number_of_total_properties, pos); |
} |
template <typename Impl> |