@babel/traverse
Advanced tools
Comparing version 7.24.1 to 7.24.5
@@ -25,3 +25,2 @@ "use strict"; | ||
getOuterBindingIdentifiers: _getOuterBindingIdentifiers, | ||
isDeclaration, | ||
numericLiteral, | ||
@@ -305,3 +304,3 @@ unaryExpression | ||
const declaration = id.get("declaration"); | ||
if (isDeclaration(declaration)) { | ||
if (declaration.isDeclaration()) { | ||
search.push(declaration); | ||
@@ -308,0 +307,0 @@ } |
@@ -34,3 +34,3 @@ "use strict"; | ||
const SHOULD_SKIP = exports.SHOULD_SKIP = 1 << 2; | ||
class NodePath { | ||
const NodePath_Final = exports.default = class NodePath { | ||
constructor(hub, parent) { | ||
@@ -166,6 +166,6 @@ this.contexts = []; | ||
} | ||
} | ||
Object.assign(NodePath.prototype, NodePath_ancestry, NodePath_inference, NodePath_replacement, NodePath_evaluation, NodePath_conversion, NodePath_introspection, NodePath_context, NodePath_removal, NodePath_modification, NodePath_family, NodePath_comments); | ||
}; | ||
Object.assign(NodePath_Final.prototype, NodePath_ancestry, NodePath_inference, NodePath_replacement, NodePath_evaluation, NodePath_conversion, NodePath_introspection, NodePath_context, NodePath_removal, NodePath_modification, NodePath_family, NodePath_comments); | ||
{ | ||
NodePath.prototype._guessExecutionStatusRelativeToDifferentFunctions = NodePath_introspection._guessExecutionStatusRelativeTo; | ||
NodePath_Final.prototype._guessExecutionStatusRelativeToDifferentFunctions = NodePath_introspection._guessExecutionStatusRelativeTo; | ||
} | ||
@@ -175,6 +175,6 @@ for (const type of t.TYPES) { | ||
const fn = t[typeKey]; | ||
NodePath.prototype[typeKey] = function (opts) { | ||
NodePath_Final.prototype[typeKey] = function (opts) { | ||
return fn(this.node, opts); | ||
}; | ||
NodePath.prototype[`assert${type}`] = function (opts) { | ||
NodePath_Final.prototype[`assert${type}`] = function (opts) { | ||
if (!fn(this.node, opts)) { | ||
@@ -185,3 +185,3 @@ throw new TypeError(`Expected node path of type ${type}`); | ||
} | ||
Object.assign(NodePath.prototype, NodePath_virtual_types_validator); | ||
Object.assign(NodePath_Final.prototype, NodePath_virtual_types_validator); | ||
for (const type of Object.keys(virtualTypes)) { | ||
@@ -191,4 +191,3 @@ if (type[0] === "_") continue; | ||
} | ||
var _default = exports.default = NodePath; | ||
//# sourceMappingURL=index.js.map |
@@ -41,3 +41,4 @@ "use strict"; | ||
function has(key) { | ||
const val = this.node && this.node[key]; | ||
var _this$node; | ||
const val = (_this$node = this.node) == null ? void 0 : _this$node[key]; | ||
if (val && Array.isArray(val)) { | ||
@@ -44,0 +45,0 @@ return !!val.length; |
@@ -142,6 +142,8 @@ "use strict"; | ||
function isRestProperty() { | ||
return nodeIsRestElement(this.node) && this.parentPath && this.parentPath.isObjectPattern(); | ||
var _this$parentPath; | ||
return nodeIsRestElement(this.node) && ((_this$parentPath = this.parentPath) == null ? void 0 : _this$parentPath.isObjectPattern()); | ||
} | ||
function isSpreadProperty() { | ||
return nodeIsRestElement(this.node) && this.parentPath && this.parentPath.isObjectExpression(); | ||
var _this$parentPath2; | ||
return nodeIsRestElement(this.node) && ((_this$parentPath2 = this.parentPath) == null ? void 0 : _this$parentPath2.isObjectExpression()); | ||
} | ||
@@ -148,0 +150,0 @@ function isForAwaitStatement() { |
@@ -115,4 +115,5 @@ "use strict"; | ||
} else if (this.isNodeType("Expression") && !this.isJSXElement() && !parentPath.isJSXElement() || parentPath.isForStatement() && this.key === "init") { | ||
if (this.node) { | ||
const node = this.node; | ||
const self = this; | ||
if (self.node) { | ||
const node = self.node; | ||
let { | ||
@@ -123,7 +124,7 @@ scope | ||
assertExpression(node); | ||
this.replaceWith(callExpression(arrowFunctionExpression([], node), [])); | ||
this.get("callee.body").insertAfter(nodes); | ||
return [this]; | ||
self.replaceWith(callExpression(arrowFunctionExpression([], node), [])); | ||
self.get("callee.body").insertAfter(nodes); | ||
return [self]; | ||
} | ||
if (isHiddenInSequenceExpression(this)) { | ||
if (isHiddenInSequenceExpression(self)) { | ||
nodes.unshift(node); | ||
@@ -130,0 +131,0 @@ } else if (isCallExpression(node) && isSuper(node.callee)) { |
@@ -279,2 +279,5 @@ "use strict"; | ||
} | ||
}, | ||
TSTypeAnnotation(path) { | ||
path.skip(); | ||
} | ||
@@ -281,0 +284,0 @@ }; |
{ | ||
"name": "@babel/traverse", | ||
"version": "7.24.1", | ||
"version": "7.24.5", | ||
"description": "The Babel Traverse module maintains the overall tree state, and is responsible for replacing, removing, and adding nodes", | ||
@@ -19,10 +19,10 @@ "author": "The Babel Team (https://babel.dev/team)", | ||
"dependencies": { | ||
"@babel/code-frame": "^7.24.1", | ||
"@babel/generator": "^7.24.1", | ||
"@babel/code-frame": "^7.24.2", | ||
"@babel/generator": "^7.24.5", | ||
"@babel/helper-environment-visitor": "^7.22.20", | ||
"@babel/helper-function-name": "^7.23.0", | ||
"@babel/helper-hoist-variables": "^7.22.5", | ||
"@babel/helper-split-export-declaration": "^7.22.6", | ||
"@babel/parser": "^7.24.1", | ||
"@babel/types": "^7.24.0", | ||
"@babel/helper-split-export-declaration": "^7.24.5", | ||
"@babel/parser": "^7.24.5", | ||
"@babel/types": "^7.24.5", | ||
"debug": "^4.3.1", | ||
@@ -32,3 +32,3 @@ "globals": "^11.1.0" | ||
"devDependencies": { | ||
"@babel/core": "^7.24.1", | ||
"@babel/core": "^7.24.5", | ||
"@babel/helper-plugin-test-runner": "^7.24.1" | ||
@@ -35,0 +35,0 @@ }, |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
618154
5213
Updated@babel/code-frame@^7.24.2
Updated@babel/generator@^7.24.5
Updated@babel/parser@^7.24.5
Updated@babel/types@^7.24.5