| Index: src/parsing/parser.cc
|
| diff --git a/src/parsing/parser.cc b/src/parsing/parser.cc
|
| index 0fcc9ead7287f675cd5d19931fe8dcfddf032d0c..eb2a76f7ef20a974b90138c7c6a170c0f225749b 100644
|
| --- a/src/parsing/parser.cc
|
| +++ b/src/parsing/parser.cc
|
| @@ -940,11 +940,11 @@ FunctionLiteral* Parser::DoParseLazy(ParseInfo* info,
|
| DCHECK(is_sloppy(outer->language_mode()) ||
|
| is_strict(info->language_mode()));
|
| FunctionLiteral::FunctionType function_type = ComputeFunctionType(info);
|
| + FunctionKind kind = info->function_kind();
|
| bool ok = true;
|
|
|
| - if (info->is_arrow()) {
|
| - bool is_async = allow_harmony_async_await() && info->is_async();
|
| - if (is_async) {
|
| + if (IsArrowFunction(kind)) {
|
| + if (allow_harmony_async_await() && IsAsyncFunction(kind)) {
|
| DCHECK(!scanner()->HasAnyLineTerminatorAfterNext());
|
| if (!Check(Token::ASYNC)) {
|
| CHECK(stack_overflow());
|
| @@ -957,8 +957,7 @@ FunctionLiteral* Parser::DoParseLazy(ParseInfo* info,
|
| }
|
|
|
| // TODO(adamk): We should construct this scope from the ScopeInfo.
|
| - FunctionKind arrow_kind = is_async ? kAsyncArrowFunction : kArrowFunction;
|
| - DeclarationScope* scope = NewFunctionScope(arrow_kind);
|
| + DeclarationScope* scope = NewFunctionScope(kind);
|
|
|
| // These two bits only need to be explicitly set because we're
|
| // not passing the ScopeInfo to the Scope constructor.
|
| @@ -1011,10 +1010,9 @@ FunctionLiteral* Parser::DoParseLazy(ParseInfo* info,
|
| }
|
| }
|
| }
|
| - } else if (info->is_default_constructor()) {
|
| + } else if (IsDefaultConstructor(kind)) {
|
| DCHECK_EQ(scope(), outer);
|
| - bool is_subclass_constructor =
|
| - IsSubclassConstructor(info->function_kind());
|
| + bool is_subclass_constructor = IsSubclassConstructor(kind);
|
| result = DefaultConstructor(
|
| raw_name, is_subclass_constructor, info->requires_class_field_init(),
|
| info->start_position(), info->end_position(), info->language_mode());
|
| @@ -1031,10 +1029,9 @@ FunctionLiteral* Parser::DoParseLazy(ParseInfo* info,
|
| result = SynthesizeClassFieldInitializer(shared_info->length());
|
| }
|
| } else {
|
| - result = ParseFunctionLiteral(raw_name, Scanner::Location::invalid(),
|
| - kSkipFunctionNameCheck,
|
| - info->function_kind(), kNoSourcePosition,
|
| - function_type, info->language_mode(), &ok);
|
| + result = ParseFunctionLiteral(
|
| + raw_name, Scanner::Location::invalid(), kSkipFunctionNameCheck, kind,
|
| + kNoSourcePosition, function_type, info->language_mode(), &ok);
|
| if (info->requires_class_field_init()) {
|
| result = InsertClassFieldInitializer(result);
|
| }
|
|
|