remove path.refreshScope until i'm more confident on it's functionality so it doesn't break peopls stuff
This commit is contained in:
parent
17b34a2959
commit
56b6a795a4
@ -89,22 +89,7 @@ export default class TraversalPath {
|
||||
}
|
||||
|
||||
refreshScope(oldNode, newNodes) {
|
||||
var scope = this.scope;
|
||||
if (!scope) return;
|
||||
|
||||
if (!t.isAssignmentExpression(oldNode)) {
|
||||
var bindings = t.getBindingIdentifiers(oldNode);
|
||||
for (var key in bindings) {
|
||||
if (scope.bindingIdentifierEquals(key, bindings[key])) {
|
||||
scope.removeBinding(key);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (let i = 0; i < newNodes.length; i++) {
|
||||
var newNode = newNodes[i];
|
||||
scope.refreshDeclaration(newNode);
|
||||
}
|
||||
// todo
|
||||
}
|
||||
|
||||
refresh() {
|
||||
@ -151,7 +136,7 @@ export default class TraversalPath {
|
||||
}
|
||||
|
||||
this.flatten();
|
||||
// TODO: duplicate internal metadata
|
||||
// TODO: duplicate internal path metadata across the new node paths
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -864,7 +864,7 @@ export default class Scope {
|
||||
*/
|
||||
|
||||
removeOwnBinding(name) {
|
||||
delete this.bindings[name];
|
||||
this.bindings[name] = null;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -875,7 +875,6 @@ export default class Scope {
|
||||
|
||||
removeBinding(name) {
|
||||
var info = this.getBindingInfo(name);
|
||||
if (!info) return;
|
||||
info.scope.removeOwnBinding(name);
|
||||
if (info) info.scope.removeOwnBinding(name);
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user