summaryrefslogtreecommitdiff
path: root/chromium/third_party/node/node_modules/@babel/types/lib/validators/isBinding.js
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2022-09-02 14:22:29 +0200
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2022-09-05 20:21:00 +0000
commit7d2c5d177e9813077a621df8d18c0deda73099b3 (patch)
tree88ad4850908e124d4f5d59f2bca571d63df34bf7 /chromium/third_party/node/node_modules/@babel/types/lib/validators/isBinding.js
parentc5dbcb143405a38088d78b4b760d64aaff5157ab (diff)
downloadqtwebengine-chromium-7d2c5d177e9813077a621df8d18c0deda73099b3.tar.gz
BASELINE: Update Chromium to 102.0.5005.177
Change-Id: I0229f2402b8321f58c0092ec81d63372bec7e789 Reviewed-by: Michael BrĂ¼ning <michael.bruning@qt.io>
Diffstat (limited to 'chromium/third_party/node/node_modules/@babel/types/lib/validators/isBinding.js')
-rw-r--r--chromium/third_party/node/node_modules/@babel/types/lib/validators/isBinding.js31
1 files changed, 31 insertions, 0 deletions
diff --git a/chromium/third_party/node/node_modules/@babel/types/lib/validators/isBinding.js b/chromium/third_party/node/node_modules/@babel/types/lib/validators/isBinding.js
new file mode 100644
index 00000000000..74c86dd0e98
--- /dev/null
+++ b/chromium/third_party/node/node_modules/@babel/types/lib/validators/isBinding.js
@@ -0,0 +1,31 @@
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = isBinding;
+
+var _getBindingIdentifiers = require("../retrievers/getBindingIdentifiers");
+
+function isBinding(node, parent, grandparent) {
+ if (grandparent && node.type === "Identifier" && parent.type === "ObjectProperty" && grandparent.type === "ObjectExpression") {
+ return false;
+ }
+
+ const keys = _getBindingIdentifiers.default.keys[parent.type];
+
+ if (keys) {
+ for (let i = 0; i < keys.length; i++) {
+ const key = keys[i];
+ const val = parent[key];
+
+ if (Array.isArray(val)) {
+ if (val.indexOf(node) >= 0) return true;
+ } else {
+ if (val === node) return true;
+ }
+ }
+ }
+
+ return false;
+} \ No newline at end of file