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

Unified Diff: src/parsing/parser-base.h

Issue 2226243002: Indirect Get*Scope over parser/parserbase (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: 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
« no previous file with comments | « src/parsing/parser.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/parsing/parser-base.h
diff --git a/src/parsing/parser-base.h b/src/parsing/parser-base.h
index edd2c518fd0a4bdee29f8a9854c23e77102fb17b..c86b551823b940c652579f3b2d3e7561ab289836 100644
--- a/src/parsing/parser-base.h
+++ b/src/parsing/parser-base.h
@@ -853,6 +853,9 @@ class ParserBase : public Traits {
typename Traits::Type::Factory* factory() { return &ast_node_factory_; }
+ DeclarationScope* GetReceiverScope() const {
+ return scope()->GetReceiverScope();
+ }
LanguageMode language_mode() { return scope()->language_mode(); }
bool is_generator() const { return function_state_->is_generator(); }
bool is_async_function() const {
@@ -3096,7 +3099,7 @@ ParserBase<Traits>::ParseSuperExpression(bool is_new, bool* ok) {
Expect(Token::SUPER, CHECK_OK);
int pos = position();
- DeclarationScope* scope = this->scope()->GetReceiverScope();
+ DeclarationScope* scope = GetReceiverScope();
FunctionKind kind = scope->function_kind();
if (IsConciseMethod(kind) || IsAccessorFunction(kind) ||
IsClassConstructor(kind)) {
@@ -3138,7 +3141,7 @@ ParserBase<Traits>::ParseNewTargetExpression(bool* ok) {
int pos = position();
ExpectMetaProperty(CStrVector("target"), "new.target", pos, CHECK_OK);
- if (!scope()->GetReceiverScope()->is_function_scope()) {
+ if (!GetReceiverScope()->is_function_scope()) {
ReportMessageAt(scanner()->location(),
MessageTemplate::kUnexpectedNewTarget);
*ok = false;
« no previous file with comments | « src/parsing/parser.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698