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

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

Issue 2263973003: [parser] Modify some const qualifications (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebase 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') | src/parsing/preparser.h » ('j') | 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 5e69125a97b4fe9975e70a468ec8b7731df076c9..f38af71614f9e9946dd54d4e3c6e343248a0b636 100644
--- a/src/parsing/parser-base.h
+++ b/src/parsing/parser-base.h
@@ -606,30 +606,30 @@ class ParserBase : public Traits {
Mode old_mode_;
};
- DeclarationScope* NewScriptScope() {
+ DeclarationScope* NewScriptScope() const {
return new (zone()) DeclarationScope(zone());
}
- DeclarationScope* NewVarblockScope() {
+ DeclarationScope* NewVarblockScope() const {
return new (zone()) DeclarationScope(zone(), scope(), BLOCK_SCOPE);
}
- ModuleScope* NewModuleScope(DeclarationScope* parent) {
+ ModuleScope* NewModuleScope(DeclarationScope* parent) const {
return new (zone()) ModuleScope(zone(), parent, ast_value_factory());
}
- DeclarationScope* NewEvalScope(Scope* parent) {
+ DeclarationScope* NewEvalScope(Scope* parent) const {
return new (zone()) DeclarationScope(zone(), parent, EVAL_SCOPE);
}
- Scope* NewScope(ScopeType scope_type) {
+ Scope* NewScope(ScopeType scope_type) const {
return NewScopeWithParent(scope(), scope_type);
}
// This constructor should only be used when absolutely necessary. Most scopes
// should automatically use scope() as parent, and be fine with
// NewScope(ScopeType) above.
- Scope* NewScopeWithParent(Scope* parent, ScopeType scope_type) {
+ Scope* NewScopeWithParent(Scope* parent, ScopeType scope_type) const {
// Must always use the specific constructors for the blacklisted scope
// types.
DCHECK_NE(FUNCTION_SCOPE, scope_type);
@@ -639,7 +639,7 @@ class ParserBase : public Traits {
return new (zone()) Scope(zone(), parent, scope_type);
}
- DeclarationScope* NewFunctionScope(FunctionKind kind) {
+ DeclarationScope* NewFunctionScope(FunctionKind kind) const {
DCHECK(ast_value_factory());
DeclarationScope* result =
new (zone()) DeclarationScope(zone(), scope(), FUNCTION_SCOPE, kind);
@@ -653,8 +653,8 @@ class ParserBase : public Traits {
Scanner* scanner() const { return scanner_; }
AstValueFactory* ast_value_factory() const { return ast_value_factory_; }
- int position() { return scanner_->location().beg_pos; }
- int peek_position() { return scanner_->peek_location().beg_pos; }
+ int position() const { return scanner_->location().beg_pos; }
+ int peek_position() const { return scanner_->peek_location().beg_pos; }
bool stack_overflow() const { return stack_overflow_; }
void set_stack_overflow() { stack_overflow_ = true; }
Mode mode() const { return mode_; }
« no previous file with comments | « src/parsing/parser.cc ('k') | src/parsing/preparser.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698