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

Side by Side Diff: src/ast/scopes.h

Issue 1723313002: [parser] Enforce module-specific identifier restriction (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Relax assertion criteria Created 4 years, 7 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 unified diff | Download patch
« no previous file with comments | « no previous file | src/parsing/parser.cc » ('j') | test/cctest/test-parsing.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef V8_AST_SCOPES_H_ 5 #ifndef V8_AST_SCOPES_H_
6 #define V8_AST_SCOPES_H_ 6 #define V8_AST_SCOPES_H_
7 7
8 #include "src/ast/ast.h" 8 #include "src/ast/ast.h"
9 #include "src/hashmap.h" 9 #include "src/hashmap.h"
10 #include "src/pending-compilation-error-handler.h" 10 #include "src/pending-compilation-error-handler.h"
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after
236 void RecordEvalCall() { scope_calls_eval_ = true; } 236 void RecordEvalCall() { scope_calls_eval_ = true; }
237 237
238 // Inform the scope that the corresponding code uses "arguments". 238 // Inform the scope that the corresponding code uses "arguments".
239 void RecordArgumentsUsage() { scope_uses_arguments_ = true; } 239 void RecordArgumentsUsage() { scope_uses_arguments_ = true; }
240 240
241 // Inform the scope that the corresponding code uses "super". 241 // Inform the scope that the corresponding code uses "super".
242 void RecordSuperPropertyUsage() { scope_uses_super_property_ = true; } 242 void RecordSuperPropertyUsage() { scope_uses_super_property_ = true; }
243 243
244 // Set the language mode flag (unless disabled by a global flag). 244 // Set the language mode flag (unless disabled by a global flag).
245 void SetLanguageMode(LanguageMode language_mode) { 245 void SetLanguageMode(LanguageMode language_mode) {
246 DCHECK(!is_module_scope()); 246 DCHECK(!is_module_scope() || is_strict(language_mode));
247 language_mode_ = language_mode; 247 language_mode_ = language_mode;
248 } 248 }
249 249
250 // Set the ASM module flag. 250 // Set the ASM module flag.
251 void SetAsmModule() { asm_module_ = true; } 251 void SetAsmModule() { asm_module_ = true; }
252 252
253 // Inform the scope that the scope may execute declarations nonlinearly. 253 // Inform the scope that the scope may execute declarations nonlinearly.
254 // Currently, the only nonlinear scope is a switch statement. The name is 254 // Currently, the only nonlinear scope is a switch statement. The name is
255 // more general in case something else comes up with similar control flow, 255 // more general in case something else comes up with similar control flow,
256 // for example the ability to break out of something which does not have 256 // for example the ability to break out of something which does not have
(...skipping 553 matching lines...) Expand 10 before | Expand all | Expand 10 after
810 AstValueFactory* ast_value_factory_; 810 AstValueFactory* ast_value_factory_;
811 Zone* zone_; 811 Zone* zone_;
812 812
813 PendingCompilationErrorHandler pending_error_handler_; 813 PendingCompilationErrorHandler pending_error_handler_;
814 }; 814 };
815 815
816 } // namespace internal 816 } // namespace internal
817 } // namespace v8 817 } // namespace v8
818 818
819 #endif // V8_AST_SCOPES_H_ 819 #endif // V8_AST_SCOPES_H_
OLDNEW
« no previous file with comments | « no previous file | src/parsing/parser.cc » ('j') | test/cctest/test-parsing.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698