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

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: Rebased 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/ast/scopes.cc ('k') | src/ast/variables.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ast/variables.h
diff --git a/src/ast/variables.h b/src/ast/variables.h
index 1d6b33657069efd1b23960fed615fe533c90b08d..01e4d528ddec472d06621d5a101658ebfa59b571 100644
--- a/src/ast/variables.h
+++ b/src/ast/variables.h
@@ -22,7 +22,8 @@ class Variable final : public ZoneObject {
FUNCTION,
THIS,
ARGUMENTS,
- kLastKind = ARGUMENTS
+ SLOPPY_FUNCTION_NAME,
+ kLastKind = SLOPPY_FUNCTION_NAME
};
Variable(Scope* scope, const AstRawString* name, VariableMode mode, Kind kind,
@@ -76,16 +77,21 @@ class Variable final : 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 {
DCHECK(initialization_flag() != kNeedsInitialization ||
IsLexicalVariableMode(mode()));
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; }
bool is_arguments() const { return kind() == ARGUMENTS; }
+ bool is_sloppy_function_name() const {
+ return kind() == SLOPPY_FUNCTION_NAME;
+ }
Variable* local_if_not_shadowed() const {
DCHECK(mode() == DYNAMIC_LOCAL && local_if_not_shadowed_ != NULL);
@@ -128,7 +134,7 @@ class Variable final : public ZoneObject {
uint16_t bit_field_;
class VariableModeField : public BitField16<VariableMode, 0, 3> {};
- class KindField : public BitField16<Kind, VariableModeField::kNext, 2> {};
+ class KindField : public BitField16<Kind, VariableModeField::kNext, 3> {};
class LocationField
: public BitField16<VariableLocation, KindField::kNext, 3> {};
class ForceContextAllocationField
« no previous file with comments | « src/ast/scopes.cc ('k') | src/ast/variables.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698