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

Unified Diff: src/ast/variables.h

Issue 2233673003: Remove CONST_LEGACY VariableMode (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
Index: src/ast/variables.h
diff --git a/src/ast/variables.h b/src/ast/variables.h
index 950db3c0021263f93209609d24cfd61de8a2d58f..420097484e06b22cf389c889ec0281253df661ea 100644
--- a/src/ast/variables.h
+++ b/src/ast/variables.h
@@ -17,7 +17,7 @@ namespace internal {
// after binding and variable allocation.
class Variable: public ZoneObject {
public:
- enum Kind { NORMAL, FUNCTION, THIS, ARGUMENTS };
+ enum Kind { NORMAL, FUNCTION, THIS, ARGUMENTS, SLOPPY_FUNCTION_NAME };
Variable(Scope* scope, const AstRawString* name, VariableMode mode, Kind kind,
InitializationFlag initialization_flag,
@@ -71,10 +71,12 @@ class Variable: public ZoneObject {
bool IsStaticGlobalObjectProperty() const;
bool is_dynamic() const { return IsDynamicVariableMode(mode_); }
- bool is_const_mode() const { return IsImmutableVariableMode(mode_); }
bool binding_needs_init() const {
return initialization_flag_ == kNeedsInitialization;
}
+ bool throw_on_const_assignment(LanguageMode language_mode) const {
+ return kind_ != SLOPPY_FUNCTION_NAME || is_strict(language_mode);
+ }
bool is_function() const { return kind_ == FUNCTION; }
bool is_this() const { return kind_ == THIS; }
« no previous file with comments | « src/ast/scopes.cc ('k') | src/ast/variables.cc » ('j') | src/compiler/ast-graph-builder.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698