clear scope uids when removing a binding - fixes #2101
This commit is contained in:
parent
f9a657dd36
commit
fc8c38ac0d
@ -1038,7 +1038,18 @@ export default class Scope {
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
removeBinding(name: string) {
|
removeBinding(name: string) {
|
||||||
|
// clear literal binding
|
||||||
var info = this.getBinding(name);
|
var info = this.getBinding(name);
|
||||||
if (info) info.scope.removeOwnBinding(name);
|
if (info) {
|
||||||
|
info.scope.removeOwnBinding(name);
|
||||||
|
}
|
||||||
|
|
||||||
|
// clear uids with this name - https://github.com/babel/babel/issues/2101
|
||||||
|
var scope = this;
|
||||||
|
do {
|
||||||
|
if (scope.uids[name]) {
|
||||||
|
scope.uids[name] = false;
|
||||||
|
}
|
||||||
|
} while(scope = scope.parent);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user