diff options
| author | littleblack111 <littleblack11111@gmail.com> | 2024-05-14 14:05:49 +0800 |
|---|---|---|
| committer | littleblack111 <littleblack11111@gmail.com> | 2024-05-14 14:05:49 +0800 |
| commit | 06823fbf1c2e763a5bf76c3990ca98fbbcd98691 (patch) | |
| tree | 4280bece3888d12a022093bf1a9cd1b049393602 /node_modules/@babel/traverse/lib/path/introspection.js | |
| parent | 1368909b3cd552dbb0d12d5863c597f5be46177d (diff) | |
updated node_modules
Diffstat (limited to 'node_modules/@babel/traverse/lib/path/introspection.js')
| -rw-r--r-- | node_modules/@babel/traverse/lib/path/introspection.js | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/node_modules/@babel/traverse/lib/path/introspection.js b/node_modules/@babel/traverse/lib/path/introspection.js index b83b717d..d79e570c 100644 --- a/node_modules/@babel/traverse/lib/path/introspection.js +++ b/node_modules/@babel/traverse/lib/path/introspection.js @@ -38,7 +38,8 @@ function matchesPattern(pattern, allowPartial) { return _matchesPattern(this.node, pattern, allowPartial); } 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)) { return !!val.length; } else { @@ -352,6 +353,18 @@ function isConstantExpression() { } = this.node; return operator !== "in" && operator !== "instanceof" && this.get("left").isConstantExpression() && this.get("right").isConstantExpression(); } + if (this.isMemberExpression()) { + return !this.node.computed && this.get("object").isIdentifier({ + name: "Symbol" + }) && !this.scope.hasBinding("Symbol", { + noGlobals: true + }); + } + if (this.isCallExpression()) { + return this.node.arguments.length === 1 && this.get("callee").matchesPattern("Symbol.for") && !this.scope.hasBinding("Symbol", { + noGlobals: true + }) && this.get("arguments")[0].isStringLiteral(); + } return false; } function isInStrictMode() { |
