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

Unified Diff: src/parser.cc

Issue 631433002: Classes runtime (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Remove kConstructorFunction Created 6 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 | « src/parser.h ('k') | src/preparser.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/parser.cc
diff --git a/src/parser.cc b/src/parser.cc
index 2b91443775795fafaec6e2846db8a01cc904820a..04efd1ec747089ac0106596972f043a6e212bbe8 100644
--- a/src/parser.cc
+++ b/src/parser.cc
@@ -646,7 +646,7 @@ Expression* ParserTraits::SuperReference(
pos);
}
-Expression* ParserTraits::ClassLiteral(
+Expression* ParserTraits::ClassExpression(
const AstRawString* name, Expression* extends, Expression* constructor,
ZoneList<ObjectLiteral::Property*>* properties, int pos,
AstNodeFactory<AstConstructionVisitor>* factory) {
@@ -1956,21 +1956,18 @@ Statement* Parser::ParseClassDeclaration(ZoneList<const AstRawString*>* names,
Expression* value = ParseClassLiteral(name, scanner()->location(),
is_strict_reserved, pos, CHECK_OK);
- Block* block = factory()->NewBlock(NULL, 1, true, pos);
- VariableMode mode = LET;
- VariableProxy* proxy = NewUnresolved(name, mode, Interface::NewValue());
+ VariableProxy* proxy = NewUnresolved(name, LET, Interface::NewValue());
Declaration* declaration =
- factory()->NewVariableDeclaration(proxy, mode, scope_, pos);
+ factory()->NewVariableDeclaration(proxy, LET, scope_, pos);
Declare(declaration, true, CHECK_OK);
+ proxy->var()->set_initializer_position(pos);
Token::Value init_op = Token::INIT_LET;
Assignment* assignment = factory()->NewAssignment(init_op, proxy, value, pos);
- block->AddStatement(
- factory()->NewExpressionStatement(assignment, RelocInfo::kNoPosition),
- zone());
-
+ Statement* assignment_statement =
+ factory()->NewExpressionStatement(assignment, RelocInfo::kNoPosition);
if (names) names->Add(name, zone());
- return block;
+ return assignment_statement;
}
« no previous file with comments | « src/parser.h ('k') | src/preparser.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698