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

Unified Diff: src/preparser.h

Issue 858673002: Fix issue with __proto__ when using ES6 object literals (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: git rebase Created 5 years, 11 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 | « src/ia32/full-codegen-ia32.cc ('k') | test/mjsunit/harmony/object-literals-method.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/preparser.h
diff --git a/src/preparser.h b/src/preparser.h
index 09f6b1dc3d51c26b9cc1b7badc3b11a9139bf78a..5e37d632fdb8bffbf9e767da466a1eff34ec3c1e 100644
--- a/src/preparser.h
+++ b/src/preparser.h
@@ -1049,10 +1049,10 @@ class PreParserFactory {
int pos) {
return PreParserExpression::Default();
}
- PreParserExpression NewObjectLiteralProperty(bool is_getter,
- PreParserExpression key,
+ PreParserExpression NewObjectLiteralProperty(PreParserExpression key,
PreParserExpression value,
- int pos, bool is_static,
+ ObjectLiteralProperty::Kind kind,
+ bool is_static,
bool is_computed_name) {
return PreParserExpression::Default();
}
@@ -2141,6 +2141,10 @@ ParserBase<Traits>::ParsePropertyDefinition(ObjectLiteralChecker* checker,
FunctionLiteral::NORMAL_ARITY,
CHECK_OK_CUSTOM(EmptyObjectLiteralProperty));
+ return factory()->NewObjectLiteralProperty(name_expression, value,
+ ObjectLiteralProperty::COMPUTED,
+ is_static, *is_computed_name);
+
} else if (in_class && name_is_static && !is_static) {
// static MethodDefinition
return ParsePropertyDefinition(checker, true, true, is_computed_name, NULL,
@@ -2189,12 +2193,18 @@ ParserBase<Traits>::ParsePropertyDefinition(ObjectLiteralChecker* checker,
}
return factory()->NewObjectLiteralProperty(
- is_get, name_expression, value, next_pos, is_static, *is_computed_name);
+ name_expression, value,
+ is_get ? ObjectLiteralProperty::GETTER : ObjectLiteralProperty::SETTER,
+ is_static, *is_computed_name);
} else if (!in_class && allow_harmony_object_literals_ &&
Token::IsIdentifier(name_token, strict_mode(),
this->is_generator())) {
+ DCHECK(!*is_computed_name);
+ DCHECK(!is_static);
value = this->ExpressionFromIdentifier(name, next_pos, scope_, factory());
+ return factory()->NewObjectLiteralProperty(
+ name_expression, value, ObjectLiteralProperty::COMPUTED, false, false);
} else {
Token::Value next = Next();
« no previous file with comments | « src/ia32/full-codegen-ia32.cc ('k') | test/mjsunit/harmony/object-literals-method.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698