Commit e752c31e authored by adamk's avatar adamk Committed by Commit bot

Remove unnecessary language_mode arg from Parser::DefaultConstructor

This looks like it was leftover from strong mode; default class
constructors are always in strict mode.

R=littledan@chromium.org

Review-Url: https://codereview.chromium.org/2601123002
Cr-Commit-Position: refs/heads/master@{#41994}
parent cd79924d
...@@ -165,9 +165,8 @@ void Parser::SetCachedData(ParseInfo* info) { ...@@ -165,9 +165,8 @@ void Parser::SetCachedData(ParseInfo* info) {
} }
FunctionLiteral* Parser::DefaultConstructor(const AstRawString* name, FunctionLiteral* Parser::DefaultConstructor(const AstRawString* name,
bool call_super, bool call_super, int pos,
int pos, int end_pos, int end_pos) {
LanguageMode language_mode) {
int materialized_literal_count = -1; int materialized_literal_count = -1;
int expected_property_count = -1; int expected_property_count = -1;
const int parameter_count = 0; const int parameter_count = 0;
...@@ -176,8 +175,7 @@ FunctionLiteral* Parser::DefaultConstructor(const AstRawString* name, ...@@ -176,8 +175,7 @@ FunctionLiteral* Parser::DefaultConstructor(const AstRawString* name,
FunctionKind kind = call_super ? FunctionKind::kDefaultSubclassConstructor FunctionKind kind = call_super ? FunctionKind::kDefaultSubclassConstructor
: FunctionKind::kDefaultBaseConstructor; : FunctionKind::kDefaultBaseConstructor;
DeclarationScope* function_scope = NewFunctionScope(kind); DeclarationScope* function_scope = NewFunctionScope(kind);
SetLanguageMode(function_scope, SetLanguageMode(function_scope, STRICT);
static_cast<LanguageMode>(language_mode | STRICT));
// Set start and end position to the same value // Set start and end position to the same value
function_scope->set_start_position(pos); function_scope->set_start_position(pos);
function_scope->set_end_position(pos); function_scope->set_end_position(pos);
...@@ -939,8 +937,7 @@ FunctionLiteral* Parser::DoParseFunction(ParseInfo* info, ...@@ -939,8 +937,7 @@ FunctionLiteral* Parser::DoParseFunction(ParseInfo* info,
DCHECK_EQ(scope(), outer); DCHECK_EQ(scope(), outer);
bool is_subclass_constructor = IsSubclassConstructor(kind); bool is_subclass_constructor = IsSubclassConstructor(kind);
result = DefaultConstructor(raw_name, is_subclass_constructor, result = DefaultConstructor(raw_name, is_subclass_constructor,
info->start_position(), info->end_position(), info->start_position(), info->end_position());
info->language_mode());
} else { } else {
result = ParseFunctionLiteral( result = ParseFunctionLiteral(
raw_name, Scanner::Location::invalid(), kSkipFunctionNameCheck, kind, raw_name, Scanner::Location::invalid(), kSkipFunctionNameCheck, kind,
...@@ -3334,8 +3331,8 @@ Expression* Parser::RewriteClassLiteral(const AstRawString* name, ...@@ -3334,8 +3331,8 @@ Expression* Parser::RewriteClassLiteral(const AstRawString* name,
bool has_extends = class_info->extends != nullptr; bool has_extends = class_info->extends != nullptr;
bool has_default_constructor = class_info->constructor == nullptr; bool has_default_constructor = class_info->constructor == nullptr;
if (has_default_constructor) { if (has_default_constructor) {
class_info->constructor = DefaultConstructor( class_info->constructor =
name, has_extends, pos, end_pos, scope()->language_mode()); DefaultConstructor(name, has_extends, pos, end_pos);
} }
scope()->set_end_position(end_pos); scope()->set_end_position(end_pos);
......
...@@ -518,8 +518,7 @@ class V8_EXPORT_PRIVATE Parser : public NON_EXPORTED_BASE(ParserBase<Parser>) { ...@@ -518,8 +518,7 @@ class V8_EXPORT_PRIVATE Parser : public NON_EXPORTED_BASE(ParserBase<Parser>) {
// Factory methods. // Factory methods.
FunctionLiteral* DefaultConstructor(const AstRawString* name, bool call_super, FunctionLiteral* DefaultConstructor(const AstRawString* name, bool call_super,
int pos, int end_pos, int pos, int end_pos);
LanguageMode language_mode);
// Skip over a lazy function, either using cached data if we have it, or // Skip over a lazy function, either using cached data if we have it, or
// by parsing the function with PreParser. Consumes the ending }. // by parsing the function with PreParser. Consumes the ending }.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment