diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2022-09-02 14:22:29 +0200 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2022-09-05 20:21:00 +0000 |
commit | 7d2c5d177e9813077a621df8d18c0deda73099b3 (patch) | |
tree | 88ad4850908e124d4f5d59f2bca571d63df34bf7 /chromium/third_party/node/node_modules/@babel/types/lib/validators/isBinding.js | |
parent | c5dbcb143405a38088d78b4b760d64aaff5157ab (diff) | |
download | qtwebengine-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.js | 31 |
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 |