Index: src/ast/variables.h |
diff --git a/src/ast/variables.h b/src/ast/variables.h |
index 47ff313286ef044536299a013a7b75858379aecf..44cfd412cfbac0d5c9fc0e7b95b44ac0ce20ce0b 100644 |
--- a/src/ast/variables.h |
+++ b/src/ast/variables.h |
@@ -100,14 +100,19 @@ 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() == 0; |
+ return index() == kModuleExportIndex; |
} |
void AllocateTo(VariableLocation location, int index) { |
DCHECK(IsUnallocated() || |
(this->location() == location && this->index() == index)); |
+ DCHECK_IMPLIES(location == VariableLocation::MODULE, |
+ index == kModuleExportIndex || index == kModuleImportIndex); |
bit_field_ = LocationField::update(bit_field_, location); |
DCHECK_EQ(location, this->location()); |
index_ = index; |