Cleanup traverse cache APIs (#5494)
This commit is contained in:
parent
299e51298c
commit
c9a851a218
@ -104,15 +104,4 @@ traverse.hasType = function (
|
|||||||
return state.has;
|
return state.has;
|
||||||
};
|
};
|
||||||
|
|
||||||
traverse.clearCache = function() {
|
traverse.cache = cache;
|
||||||
cache.clear();
|
|
||||||
};
|
|
||||||
|
|
||||||
traverse.clearCache.clearPath = cache.clearPath;
|
|
||||||
traverse.clearCache.clearScope = cache.clearScope;
|
|
||||||
|
|
||||||
traverse.copyCache = function(source, destination) {
|
|
||||||
if (cache.path.has(source)) {
|
|
||||||
cache.path.set(destination, cache.path.get(source));
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|||||||
@ -96,7 +96,7 @@ describe("traverse", function () {
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
traverse.clearCache();
|
traverse.cache.clear();
|
||||||
|
|
||||||
const paths2 = [];
|
const paths2 = [];
|
||||||
const scopes2 = [];
|
const scopes2 = [];
|
||||||
@ -122,7 +122,7 @@ describe("traverse", function () {
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
traverse.clearCache.clearPath();
|
traverse.cache.clearPath();
|
||||||
|
|
||||||
const paths2 = [];
|
const paths2 = [];
|
||||||
traverse(ast, {
|
traverse(ast, {
|
||||||
@ -145,7 +145,7 @@ describe("traverse", function () {
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
traverse.clearCache.clearScope();
|
traverse.cache.clearScope();
|
||||||
|
|
||||||
const scopes2 = [];
|
const scopes2 = [];
|
||||||
traverse(ast, {
|
traverse(ast, {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user