| Index: src/parser.cc
|
| diff --git a/src/parser.cc b/src/parser.cc
|
| index 7a88c5270da7ddc02f0564b2cfb91e1085cbe7fd..cdda832aedfe9983657a8647bb22204b9a551f9d 100644
|
| --- a/src/parser.cc
|
| +++ b/src/parser.cc
|
| @@ -648,6 +648,45 @@ Expression* ParserTraits::ClassExpression(
|
| start_position, end_position);
|
| }
|
|
|
| +
|
| +Expression* ParserTraits::DefaultConstructor(
|
| + bool call_super, Scope* scope,
|
| + AstNodeFactory<AstConstructionVisitor>* factory) {
|
| + Scope* function_scope = NewScope(scope, FUNCTION_SCOPE);
|
| + // Set position and force eager compilation since lazy parsing tries to
|
| + // parse the content which does not exist.
|
| + function_scope->set_start_position(0);
|
| + function_scope->set_end_position(0);
|
| + // function_scope->SetScopeName(name);
|
| + function_scope->ForceEagerCompilation();
|
| +
|
| + int pos = RelocInfo::kNoPosition;
|
| +
|
| + Zone* zone = parser_->zone();
|
| + ZoneList<Statement*>* body = new (zone) ZoneList<Statement*>(1, zone);
|
| + if (call_super) {
|
| + Expression* prop = SuperReference(function_scope, factory, pos);
|
| + ZoneList<Expression*>* args = new (zone) ZoneList<Expression*>(0, zone);
|
| + Expression* call_expression = factory->NewCall(prop, args, pos);
|
| + body->Add(factory->NewExpressionStatement(call_expression, pos), zone);
|
| + }
|
| +
|
| + int materialized_literal_count = 0;
|
| + int expected_property_count = 0;
|
| + int handler_count = 0;
|
| + int parameter_count = 0;
|
| +
|
| + const AstRawString* name = ast_value_factory()->empty_string();
|
| +
|
| + return factory->NewFunctionLiteral(
|
| + name, ast_value_factory(), function_scope, body,
|
| + materialized_literal_count, expected_property_count, handler_count,
|
| + parameter_count, FunctionLiteral::kNoDuplicateParameters,
|
| + FunctionLiteral::ANONYMOUS_EXPRESSION, FunctionLiteral::kIsFunction,
|
| + FunctionLiteral::kNotParenthesized, FunctionKind::kNormalFunction, pos);
|
| +}
|
| +
|
| +
|
| Literal* ParserTraits::ExpressionFromLiteral(
|
| Token::Value token, int pos,
|
| Scanner* scanner,
|
|
|