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

Unified Diff: src/preparser.h

Issue 1386253002: Use Scope::function_kind_ to distinguish arrow function scopes (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 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
Index: src/preparser.h
diff --git a/src/preparser.h b/src/preparser.h
index b86dc9bb3688a0df9e3ab84dcba99306e867c1e6..d890ae5c216d7b497d0f3801288bd2fe7c4123fb 100644
--- a/src/preparser.h
+++ b/src/preparser.h
@@ -307,16 +307,14 @@ class ParserBase : public Traits {
};
Scope* NewScope(Scope* parent, ScopeType scope_type) {
- // Must always pass the function kind for FUNCTION_SCOPE and ARROW_SCOPE.
+ // Must always pass the function kind for FUNCTION_SCOPE.
DCHECK(scope_type != FUNCTION_SCOPE);
- DCHECK(scope_type != ARROW_SCOPE);
return NewScope(parent, scope_type, kNormalFunction);
}
Scope* NewScope(Scope* parent, ScopeType scope_type, FunctionKind kind) {
DCHECK(ast_value_factory());
DCHECK(scope_type != MODULE_SCOPE || FLAG_harmony_modules);
- DCHECK(!IsArrowFunction(kind) || scope_type == ARROW_SCOPE);
Scope* result = new (zone())
Scope(zone(), parent, scope_type, ast_value_factory(), kind);
result->Initialize();
@@ -2929,7 +2927,7 @@ ParserBase<Traits>::ParseAssignmentExpression(bool accept_IN,
parenthesized_formals, CHECK_OK);
Scanner::Location loc(lhs_beg_pos, scanner()->location().end_pos);
Scope* scope =
- this->NewScope(scope_, ARROW_SCOPE, FunctionKind::kArrowFunction);
+ this->NewScope(scope_, FUNCTION_SCOPE, FunctionKind::kArrowFunction);
FormalParametersT parameters(scope);
if (!arrow_formals_classifier.is_simple_parameter_list()) {
scope->SetHasNonSimpleParameters();
« no previous file with comments | « src/parser.cc ('k') | src/preparser.cc » ('j') | test/mjsunit/es6/regress/regress-4466.js » ('J')

Powered by Google App Engine
This is Rietveld 408576698