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

Unified Diff: src/parsing/preparser.h

Issue 2209573002: Separate Scope into DeclarationScope and Scope (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Move has_simple_parameters_ to DeclarationScope Created 4 years, 4 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/parsing/preparser.h
diff --git a/src/parsing/preparser.h b/src/parsing/preparser.h
index f3dbec0fa4a7669b6af3a3f34f311bdb759ecd71..cea907fbe8062645ba8ea7b92e686d84bf27d535 100644
--- a/src/parsing/preparser.h
+++ b/src/parsing/preparser.h
@@ -574,7 +574,7 @@ class PreParserFactory {
struct PreParserFormalParameters : FormalParametersBase {
- explicit PreParserFormalParameters(Scope* scope)
+ explicit PreParserFormalParameters(DeclarationScope* scope)
: FormalParametersBase(scope) {}
int arity = 0;
@@ -920,7 +920,8 @@ class PreParserTraits {
int initializer_end_position, bool is_rest) {
++parameters->arity;
}
- void DeclareFormalParameter(Scope* scope, PreParserIdentifier parameter,
+ void DeclareFormalParameter(DeclarationScope* scope,
+ PreParserIdentifier parameter,
Type::ExpressionClassifier* classifier) {
if (!classifier->is_simple_parameter_list()) {
scope->SetHasNonSimpleParameters();
@@ -1045,9 +1046,7 @@ class PreParser : public ParserBase<PreParserTraits> {
// ModuleDeclarationInstantiation for Source Text Module Records creates a
// new Module Environment Record whose outer lexical environment record is
// the global scope.
- if (is_module) {
- scope = NewScopeWithParent(scope, MODULE_SCOPE);
- }
+ if (is_module) scope = NewModuleScope(scope);
FunctionState top_scope(&function_state_, &scope_state_, scope,
kNormalFunction);

Powered by Google App Engine
This is Rietveld 408576698