Bug 1332445 - Get rid of SymbolTable::globalScope. r=kanru

MozReview-Commit-ID: Ar69yiCqJnT

--HG--
extra : rebase_source : 33a19aaf6f1586bd1c023cfe7637201ea6774301
This commit is contained in:
Andrew McCreight 2017-01-23 10:52:22 -08:00
Родитель d6a0e6b709
Коммит a619072cc3
1 изменённых файлов: 4 добавлений и 7 удалений

Просмотреть файл

@ -490,13 +490,11 @@ class SymbolTable:
def __init__(self, errors):
self.errors = errors
self.scopes = [ { } ] # stack({})
self.globalScope = self.scopes[0]
self.currentScope = self.globalScope
self.currentScope = self.scopes[0]
def enterScope(self, node):
assert (isinstance(self.scopes[0], dict)
and self.globalScope is self.scopes[0])
assert (isinstance(self.currentScope, dict))
assert isinstance(self.scopes[0], dict)
assert isinstance(self.currentScope, dict)
if not hasattr(node, 'symtab'):
node.symtab = { }
@ -510,8 +508,7 @@ class SymbolTable:
self.currentScope = self.scopes[-1]
assert (isinstance(self.scopes[0], dict)
and self.globalScope is self.scopes[0])
assert isinstance(self.scopes[0], dict)
assert isinstance(self.currentScope, dict)
def lookup(self, sym):