Commit 293d84c7 authored by Adam Klein's avatar Adam Klein Committed by Commit Bot

Reorder VariableMode enums to slightly simplify IsLexicalVariableMode()

Change-Id: I0f4756efdaa9468bcbd88949ddb2e2d7cae3ce06
Reviewed-on: https://chromium-review.googlesource.com/568917Reviewed-by: 's avatarSathya Gunasekaran <gsathya@chromium.org>
Commit-Queue: Adam Klein <adamk@chromium.org>
Cr-Commit-Position: refs/heads/master@{#46610}
parent 935b4e83
......@@ -955,12 +955,12 @@ const double kMaxSafeInteger = 9007199254740991.0; // 2^53-1
// The order of this enum has to be kept in sync with the predicates below.
enum VariableMode : uint8_t {
// User declared variables:
VAR, // declared via 'var', and 'function' declarations
LET, // declared via 'let' declarations (first lexical)
CONST, // declared via 'const' declarations (last lexical)
VAR, // declared via 'var', and 'function' declarations
// Variables introduced by the compiler:
TEMPORARY, // temporary variables (not user-visible), stack-allocated
// unless the scope as a whole has forced context allocation
......@@ -1014,13 +1014,14 @@ inline bool IsDynamicVariableMode(VariableMode mode) {
inline bool IsDeclaredVariableMode(VariableMode mode) {
STATIC_ASSERT(VAR == 0); // Implies that mode >= VAR.
return mode <= CONST;
STATIC_ASSERT(LET == 0); // Implies that mode >= LET.
return mode <= VAR;
}
inline bool IsLexicalVariableMode(VariableMode mode) {
return mode >= LET && mode <= CONST;
STATIC_ASSERT(LET == 0); // Implies that mode >= LET.
return mode <= CONST;
}
enum VariableLocation : uint8_t {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment