Chromium Code Reviews| Index: src/ast/variables.h |
| diff --git a/src/ast/variables.h b/src/ast/variables.h |
| index 44cfd412cfbac0d5c9fc0e7b95b44ac0ce20ce0b..8cbdbe323f3d81a827dc4d182a489172e46e2a78 100644 |
| --- a/src/ast/variables.h |
| +++ b/src/ast/variables.h |
| @@ -100,19 +100,16 @@ class Variable final : public ZoneObject { |
| int index() const { return index_; } |
| - // Sentinel index values for module exports and imports. |
| - enum { kModuleExportIndex, kModuleImportIndex }; |
| - |
| bool IsExport() const { |
| - DCHECK(location() == VariableLocation::MODULE); |
| - return index() == kModuleExportIndex; |
| + DCHECK_EQ(location(), VariableLocation::MODULE); |
| + DCHECK_NE(index(), 0); |
|
adamk
2016/10/31 18:25:04
So this 0 appears in lots of places, but as I thin
neis
2016/11/03 10:43:48
There's a comment now in modules.h.
|
| + return index() > 0; |
| } |
| void AllocateTo(VariableLocation location, int index) { |
| DCHECK(IsUnallocated() || |
| (this->location() == location && this->index() == index)); |
| - DCHECK_IMPLIES(location == VariableLocation::MODULE, |
| - index == kModuleExportIndex || index == kModuleImportIndex); |
| + DCHECK_IMPLIES(location == VariableLocation::MODULE, index != 0); |
| bit_field_ = LocationField::update(bit_field_, location); |
| DCHECK_EQ(location, this->location()); |
| index_ = index; |