@babel/traverse 7.1.5 → 7.3.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of @babel/traverse might be problematic. Click here for more details.
- package/LICENSE +1 -1
- package/lib/path/conversion.js +1 -4
- package/lib/path/modification.js +3 -1
- package/lib/scope/index.js +0 -1
- package/package.json +8 -7
package/LICENSE
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
MIT License
|
2
2
|
|
3
|
-
Copyright (c) 2014-
|
3
|
+
Copyright (c) 2014-present Sebastian McKenzie and other contributors
|
4
4
|
|
5
5
|
Permission is hereby granted, free of charge, to any person obtaining
|
6
6
|
a copy of this software and associated documentation files (the
|
package/lib/path/conversion.js
CHANGED
@@ -168,7 +168,6 @@ function hoistFunctionEnvironment(fnPath, specCompliant = false, allowInsertArro
|
|
168
168
|
},
|
169
169
|
|
170
170
|
ClassProperty(child) {
|
171
|
-
if (child.node.static) return;
|
172
171
|
child.skip();
|
173
172
|
},
|
174
173
|
|
@@ -316,7 +315,6 @@ function getThisBinding(thisEnvFn, inConstructor) {
|
|
316
315
|
},
|
317
316
|
|
318
317
|
ClassProperty(child) {
|
319
|
-
if (child.node.static) return;
|
320
318
|
child.skip();
|
321
319
|
},
|
322
320
|
|
@@ -324,7 +322,7 @@ function getThisBinding(thisEnvFn, inConstructor) {
|
|
324
322
|
if (!child.get("callee").isSuper()) return;
|
325
323
|
if (supers.has(child.node)) return;
|
326
324
|
supers.add(child.node);
|
327
|
-
child.
|
325
|
+
child.replaceWithMultiple([child.node, t().assignmentExpression("=", t().identifier(thisBinding), t().identifier("this"))]);
|
328
326
|
}
|
329
327
|
|
330
328
|
});
|
@@ -405,7 +403,6 @@ function getScopeInformation(fnPath) {
|
|
405
403
|
const superCalls = [];
|
406
404
|
fnPath.traverse({
|
407
405
|
ClassProperty(child) {
|
408
|
-
if (child.node.static) return;
|
409
406
|
child.skip();
|
410
407
|
},
|
411
408
|
|
package/lib/path/modification.js
CHANGED
@@ -104,7 +104,9 @@ function insertAfter(nodes) {
|
|
104
104
|
} = this;
|
105
105
|
|
106
106
|
if (parentPath.isExpressionStatement() || parentPath.isLabeledStatement() || parentPath.isExportNamedDeclaration() || parentPath.isExportDefaultDeclaration() && this.isDeclaration()) {
|
107
|
-
return parentPath.insertAfter(nodes
|
107
|
+
return parentPath.insertAfter(nodes.map(node => {
|
108
|
+
return t().isExpression(node) ? t().expressionStatement(node) : node;
|
109
|
+
}));
|
108
110
|
} else if (this.isNodeType("Expression") && !this.isJSXElement() || parentPath.isForStatement() && this.key === "init") {
|
109
111
|
if (this.node) {
|
110
112
|
let {
|
package/lib/scope/index.js
CHANGED
@@ -340,7 +340,6 @@ class Scope {
|
|
340
340
|
checkBlockScopedCollisions(local, kind, name, id) {
|
341
341
|
if (kind === "param") return;
|
342
342
|
if (local.kind === "local") return;
|
343
|
-
if (kind === "hoisted" && local.kind === "let") return;
|
344
343
|
const duplicate = kind === "let" || local.kind === "let" || local.kind === "const" || local.kind === "module" || local.kind === "param" && (kind === "let" || kind === "const");
|
345
344
|
|
346
345
|
if (duplicate) {
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@babel/traverse",
|
3
|
-
"version": "7.
|
3
|
+
"version": "7.3.4",
|
4
4
|
"description": "The Babel Traverse module maintains the overall tree state, and is responsible for replacing, removing, and adding nodes",
|
5
5
|
"author": "Sebastian McKenzie <sebmck@gmail.com>",
|
6
6
|
"homepage": "https://babeljs.io/",
|
@@ -12,16 +12,17 @@
|
|
12
12
|
"main": "lib/index.js",
|
13
13
|
"dependencies": {
|
14
14
|
"@babel/code-frame": "^7.0.0",
|
15
|
-
"@babel/generator": "^7.
|
15
|
+
"@babel/generator": "^7.3.4",
|
16
16
|
"@babel/helper-function-name": "^7.1.0",
|
17
17
|
"@babel/helper-split-export-declaration": "^7.0.0",
|
18
|
-
"@babel/parser": "^7.
|
19
|
-
"@babel/types": "^7.
|
20
|
-
"debug": "^
|
18
|
+
"@babel/parser": "^7.3.4",
|
19
|
+
"@babel/types": "^7.3.4",
|
20
|
+
"debug": "^4.1.0",
|
21
21
|
"globals": "^11.1.0",
|
22
|
-
"lodash": "^4.17.
|
22
|
+
"lodash": "^4.17.11"
|
23
23
|
},
|
24
24
|
"devDependencies": {
|
25
25
|
"@babel/helper-plugin-test-runner": "^7.0.0"
|
26
|
-
}
|
26
|
+
},
|
27
|
+
"gitHead": "1f6454cc90fe33e0a32260871212e2f719f35741"
|
27
28
|
}
|