summaryrefslogtreecommitdiff
path: root/node_modules/@babel/traverse/lib/path/introspection.js
diff options
context:
space:
mode:
authorlittleblack111 <littleblack11111@gmail.com>2024-08-30 17:21:18 +0800
committerlittleblack111 <littleblack11111@gmail.com>2024-08-30 17:21:18 +0800
commitefbc2ffe6a1ee5ec38a4396305561d6515d0943e (patch)
tree2b4c94f18f2c792dfda813050755d5c0273fae22 /node_modules/@babel/traverse/lib/path/introspection.js
parent43acceb75957c880a5ba5a31aae221394a36d5f6 (diff)
node fixes, updates
Diffstat (limited to 'node_modules/@babel/traverse/lib/path/introspection.js')
-rw-r--r--node_modules/@babel/traverse/lib/path/introspection.js45
1 files changed, 23 insertions, 22 deletions
diff --git a/node_modules/@babel/traverse/lib/path/introspection.js b/node_modules/@babel/traverse/lib/path/introspection.js
index d79e570c..e93187a0 100644
--- a/node_modules/@babel/traverse/lib/path/introspection.js
+++ b/node_modules/@babel/traverse/lib/path/introspection.js
@@ -7,17 +7,13 @@ exports._guessExecutionStatusRelativeTo = _guessExecutionStatusRelativeTo;
exports._resolve = _resolve;
exports.canHaveVariableDeclarationOrExpression = canHaveVariableDeclarationOrExpression;
exports.canSwapBetweenExpressionAndStatement = canSwapBetweenExpressionAndStatement;
-exports.equals = equals;
exports.getSource = getSource;
-exports.has = has;
-exports.is = void 0;
exports.isCompletionRecord = isCompletionRecord;
exports.isConstantExpression = isConstantExpression;
exports.isInStrictMode = isInStrictMode;
exports.isNodeType = isNodeType;
exports.isStatementOrBlock = isStatementOrBlock;
exports.isStatic = isStatic;
-exports.isnt = isnt;
exports.matchesPattern = matchesPattern;
exports.referencesImport = referencesImport;
exports.resolve = resolve;
@@ -37,24 +33,28 @@ const {
function matchesPattern(pattern, allowPartial) {
return _matchesPattern(this.node, pattern, allowPartial);
}
-function has(key) {
- var _this$node;
- const val = (_this$node = this.node) == null ? void 0 : _this$node[key];
- if (val && Array.isArray(val)) {
- return !!val.length;
- } else {
- return !!val;
- }
+{
+ exports.has = function has(key) {
+ var _this$node;
+ const val = (_this$node = this.node) == null ? void 0 : _this$node[key];
+ if (val && Array.isArray(val)) {
+ return !!val.length;
+ } else {
+ return !!val;
+ }
+ };
}
function isStatic() {
return this.scope.isStatic(this.node);
}
-const is = exports.is = has;
-function isnt(key) {
- return !this.has(key);
-}
-function equals(key, value) {
- return this.node[key] === value;
+{
+ exports.is = exports.has;
+ exports.isnt = function isnt(key) {
+ return !this.has(key);
+ };
+ exports.equals = function equals(key, value) {
+ return this.node[key] === value;
+ };
}
function isNodeType(type) {
return isType(this.type, type);
@@ -198,8 +198,8 @@ function _guessExecutionStatusRelativeToCached(base, target, cache) {
target: target.getAncestry(),
this: base.getAncestry()
};
- if (paths.target.indexOf(base) >= 0) return "after";
- if (paths.this.indexOf(target) >= 0) return "before";
+ if (paths.target.includes(base)) return "after";
+ if (paths.this.includes(target)) return "before";
let commonPath;
const commonIndex = {
target: 0,
@@ -279,10 +279,11 @@ function _guessExecutionStatusRelativeToDifferentFunctionsCached(base, target, c
return result;
}
function resolve(dangerous, resolved) {
- return this._resolve(dangerous, resolved) || this;
+ return _resolve.call(this, dangerous, resolved) || this;
}
function _resolve(dangerous, resolved) {
- if (resolved && resolved.indexOf(this) >= 0) return;
+ var _resolved;
+ if ((_resolved = resolved) != null && _resolved.includes(this)) return;
resolved = resolved || [];
resolved.push(this);
if (this.isVariableDeclarator()) {