"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "packages/babel-traverse/src/path/index.js" between
babel-7.12.6.tar.gz and babel-7.12.7.tar.gz

About: Babel is a JavaScript compiler that is mainly used to convert ECMAScript 2015+ code into a backwards compatible version of JavaScript. Hint: There exists a high-performance language interoperability tool also named "Babel".

index.js  (babel-7.12.6):index.js  (babel-7.12.7)
skipping to change at line 70 skipping to change at line 70
if (!hub && parentPath) { if (!hub && parentPath) {
hub = parentPath.hub; hub = parentPath.hub;
} }
if (!parent) { if (!parent) {
throw new Error("To get a node path the parent needs to exist"); throw new Error("To get a node path the parent needs to exist");
} }
const targetNode = container[key]; const targetNode = container[key];
const paths = pathCache.get(parent) || []; let paths = pathCache.get(parent);
if (!pathCache.has(parent)) { if (!paths) {
paths = new Map();
pathCache.set(parent, paths); pathCache.set(parent, paths);
} }
let path; let path = paths.get(targetNode);
for (let i = 0; i < paths.length; i++) {
const pathCheck = paths[i];
if (pathCheck.node === targetNode) {
path = pathCheck;
break;
}
}
if (!path) { if (!path) {
path = new NodePath(hub, parent); path = new NodePath(hub, parent);
paths.push(path); if (targetNode) paths.set(targetNode, path);
} }
path.setup(parentPath, container, listKey, key); path.setup(parentPath, container, listKey, key);
return path; return path;
} }
getScope(scope: Scope) { getScope(scope: Scope) {
return this.isScope() ? new Scope(this) : scope; return this.isScope() ? new Scope(this) : scope;
} }
 End of changes. 3 change blocks. 
13 lines changed or deleted 5 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)