first
This commit is contained in:
22
node_modules/@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining/LICENSE
generated
vendored
Normal file
22
node_modules/@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining/LICENSE
generated
vendored
Normal file
@ -0,0 +1,22 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2014-present Sebastian McKenzie and other contributors
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
"Software"), to deal in the Software without restriction, including
|
||||
without limitation the rights to use, copy, modify, merge, publish,
|
||||
distribute, sublicense, and/or sell copies of the Software, and to
|
||||
permit persons to whom the Software is furnished to do so, subject to
|
||||
the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be
|
||||
included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
19
node_modules/@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining/README.md
generated
vendored
Normal file
19
node_modules/@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining/README.md
generated
vendored
Normal file
@ -0,0 +1,19 @@
|
||||
# @babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining
|
||||
|
||||
> Transform optional chaining operators to workaround https://crbug.com/v8/11558
|
||||
|
||||
See our website [@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining](https://babeljs.io/docs/en/babel-plugin-bugfix-v8-spread-parameters-in-optional-chaining) for more information.
|
||||
|
||||
## Install
|
||||
|
||||
Using npm:
|
||||
|
||||
```sh
|
||||
npm install --save-dev @babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining
|
||||
```
|
||||
|
||||
or using yarn:
|
||||
|
||||
```sh
|
||||
yarn add @babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining --dev
|
||||
```
|
66
node_modules/@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining/lib/index.js
generated
vendored
Normal file
66
node_modules/@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining/lib/index.js
generated
vendored
Normal file
@ -0,0 +1,66 @@
|
||||
'use strict';
|
||||
|
||||
Object.defineProperty(exports, '__esModule', { value: true });
|
||||
|
||||
var helperPluginUtils = require('@babel/helper-plugin-utils');
|
||||
var pluginTransformOptionalChaining = require('@babel/plugin-transform-optional-chaining');
|
||||
var helperSkipTransparentExpressionWrappers = require('@babel/helper-skip-transparent-expression-wrappers');
|
||||
var core = require('@babel/core');
|
||||
|
||||
function matchAffectedArguments(argumentNodes) {
|
||||
const spreadIndex = argumentNodes.findIndex(node => core.types.isSpreadElement(node));
|
||||
return spreadIndex >= 0 && spreadIndex !== argumentNodes.length - 1;
|
||||
}
|
||||
function shouldTransform(path) {
|
||||
let optionalPath = path;
|
||||
const chains = [];
|
||||
for (;;) {
|
||||
if (optionalPath.isOptionalMemberExpression()) {
|
||||
chains.push(optionalPath.node);
|
||||
optionalPath = helperSkipTransparentExpressionWrappers.skipTransparentExprWrappers(optionalPath.get("object"));
|
||||
} else if (optionalPath.isOptionalCallExpression()) {
|
||||
chains.push(optionalPath.node);
|
||||
optionalPath = helperSkipTransparentExpressionWrappers.skipTransparentExprWrappers(optionalPath.get("callee"));
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
for (let i = 0; i < chains.length; i++) {
|
||||
const node = chains[i];
|
||||
if (core.types.isOptionalCallExpression(node) && matchAffectedArguments(node.arguments)) {
|
||||
if (node.optional) {
|
||||
return true;
|
||||
}
|
||||
const callee = chains[i + 1];
|
||||
if (core.types.isOptionalMemberExpression(callee, {
|
||||
optional: true
|
||||
})) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
var index = helperPluginUtils.declare(api => {
|
||||
var _api$assumption, _api$assumption2;
|
||||
api.assertVersion(7);
|
||||
const noDocumentAll = (_api$assumption = api.assumption("noDocumentAll")) != null ? _api$assumption : false;
|
||||
const pureGetters = (_api$assumption2 = api.assumption("pureGetters")) != null ? _api$assumption2 : false;
|
||||
return {
|
||||
name: "bugfix-v8-spread-parameters-in-optional-chaining",
|
||||
visitor: {
|
||||
"OptionalCallExpression|OptionalMemberExpression"(path) {
|
||||
if (shouldTransform(path)) {
|
||||
pluginTransformOptionalChaining.transform(path, {
|
||||
noDocumentAll,
|
||||
pureGetters
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
});
|
||||
|
||||
exports["default"] = index;
|
||||
//# sourceMappingURL=index.js.map
|
1
node_modules/@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining/lib/index.js.map
generated
vendored
Normal file
1
node_modules/@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining/lib/index.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
44
node_modules/@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining/lib/util.js
generated
vendored
Normal file
44
node_modules/@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining/lib/util.js
generated
vendored
Normal file
@ -0,0 +1,44 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.shouldTransform = shouldTransform;
|
||||
var _helperSkipTransparentExpressionWrappers = require("@babel/helper-skip-transparent-expression-wrappers");
|
||||
var _core = require("@babel/core");
|
||||
function matchAffectedArguments(argumentNodes) {
|
||||
const spreadIndex = argumentNodes.findIndex(node => _core.types.isSpreadElement(node));
|
||||
return spreadIndex >= 0 && spreadIndex !== argumentNodes.length - 1;
|
||||
}
|
||||
function shouldTransform(path) {
|
||||
let optionalPath = path;
|
||||
const chains = [];
|
||||
for (;;) {
|
||||
if (optionalPath.isOptionalMemberExpression()) {
|
||||
chains.push(optionalPath.node);
|
||||
optionalPath = (0, _helperSkipTransparentExpressionWrappers.skipTransparentExprWrappers)(optionalPath.get("object"));
|
||||
} else if (optionalPath.isOptionalCallExpression()) {
|
||||
chains.push(optionalPath.node);
|
||||
optionalPath = (0, _helperSkipTransparentExpressionWrappers.skipTransparentExprWrappers)(optionalPath.get("callee"));
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
for (let i = 0; i < chains.length; i++) {
|
||||
const node = chains[i];
|
||||
if (_core.types.isOptionalCallExpression(node) && matchAffectedArguments(node.arguments)) {
|
||||
if (node.optional) {
|
||||
return true;
|
||||
}
|
||||
const callee = chains[i + 1];
|
||||
if (_core.types.isOptionalMemberExpression(callee, {
|
||||
optional: true
|
||||
})) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
//# sourceMappingURL=util.js.map
|
1
node_modules/@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining/lib/util.js.map
generated
vendored
Normal file
1
node_modules/@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining/lib/util.js.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"names":["_helperSkipTransparentExpressionWrappers","require","_core","matchAffectedArguments","argumentNodes","spreadIndex","findIndex","node","t","isSpreadElement","length","shouldTransform","path","optionalPath","chains","isOptionalMemberExpression","push","skipTransparentExprWrappers","get","isOptionalCallExpression","i","arguments","optional","callee"],"sources":["../src/util.ts"],"sourcesContent":["import { skipTransparentExprWrappers } from \"@babel/helper-skip-transparent-expression-wrappers\";\nimport type { NodePath } from \"@babel/traverse\";\nimport { types as t } from \"@babel/core\";\n// https://crbug.com/v8/11558\n\n// check if there is a spread element followed by another argument.\n// (...[], 0) or (...[], ...[])\n\nfunction matchAffectedArguments(argumentNodes: t.CallExpression[\"arguments\"]) {\n const spreadIndex = argumentNodes.findIndex(node => t.isSpreadElement(node));\n return spreadIndex >= 0 && spreadIndex !== argumentNodes.length - 1;\n}\n\n/**\n * Check whether the optional chain is affected by https://crbug.com/v8/11558.\n * This routine MUST not manipulate NodePath\n *\n * @export\n * @param {(NodePath<t.OptionalMemberExpression | t.OptionalCallExpression>)} path\n * @returns {boolean}\n */\nexport function shouldTransform(\n path: NodePath<t.OptionalMemberExpression | t.OptionalCallExpression>,\n): boolean {\n let optionalPath: NodePath<t.Expression> = path;\n const chains: (t.OptionalCallExpression | t.OptionalMemberExpression)[] = [];\n for (;;) {\n if (optionalPath.isOptionalMemberExpression()) {\n chains.push(optionalPath.node);\n optionalPath = skipTransparentExprWrappers(optionalPath.get(\"object\"));\n } else if (optionalPath.isOptionalCallExpression()) {\n chains.push(optionalPath.node);\n optionalPath = skipTransparentExprWrappers(optionalPath.get(\"callee\"));\n } else {\n break;\n }\n }\n for (let i = 0; i < chains.length; i++) {\n const node = chains[i];\n if (\n t.isOptionalCallExpression(node) &&\n matchAffectedArguments(node.arguments)\n ) {\n // f?.(...[], 0)\n if (node.optional) {\n return true;\n }\n // o?.m(...[], 0)\n // when node.optional is false, chains[i + 1] is always well defined\n const callee = chains[i + 1];\n if (t.isOptionalMemberExpression(callee, { optional: true })) {\n return true;\n }\n }\n }\n return false;\n}\n"],"mappings":";;;;;;AAAA,IAAAA,wCAAA,GAAAC,OAAA;AAEA,IAAAC,KAAA,GAAAD,OAAA;AAMA,SAASE,sBAAsBA,CAACC,aAA4C,EAAE;EAC5E,MAAMC,WAAW,GAAGD,aAAa,CAACE,SAAS,CAACC,IAAI,IAAIC,WAAC,CAACC,eAAe,CAACF,IAAI,CAAC,CAAC;EAC5E,OAAOF,WAAW,IAAI,CAAC,IAAIA,WAAW,KAAKD,aAAa,CAACM,MAAM,GAAG,CAAC;AACrE;AAUO,SAASC,eAAeA,CAC7BC,IAAqE,EAC5D;EACT,IAAIC,YAAoC,GAAGD,IAAI;EAC/C,MAAME,MAAiE,GAAG,EAAE;EAC5E,SAAS;IACP,IAAID,YAAY,CAACE,0BAA0B,CAAC,CAAC,EAAE;MAC7CD,MAAM,CAACE,IAAI,CAACH,YAAY,CAACN,IAAI,CAAC;MAC9BM,YAAY,GAAG,IAAAI,oEAA2B,EAACJ,YAAY,CAACK,GAAG,CAAC,QAAQ,CAAC,CAAC;IACxE,CAAC,MAAM,IAAIL,YAAY,CAACM,wBAAwB,CAAC,CAAC,EAAE;MAClDL,MAAM,CAACE,IAAI,CAACH,YAAY,CAACN,IAAI,CAAC;MAC9BM,YAAY,GAAG,IAAAI,oEAA2B,EAACJ,YAAY,CAACK,GAAG,CAAC,QAAQ,CAAC,CAAC;IACxE,CAAC,MAAM;MACL;IACF;EACF;EACA,KAAK,IAAIE,CAAC,GAAG,CAAC,EAAEA,CAAC,GAAGN,MAAM,CAACJ,MAAM,EAAEU,CAAC,EAAE,EAAE;IACtC,MAAMb,IAAI,GAAGO,MAAM,CAACM,CAAC,CAAC;IACtB,IACEZ,WAAC,CAACW,wBAAwB,CAACZ,IAAI,CAAC,IAChCJ,sBAAsB,CAACI,IAAI,CAACc,SAAS,CAAC,EACtC;MAEA,IAAId,IAAI,CAACe,QAAQ,EAAE;QACjB,OAAO,IAAI;MACb;MAGA,MAAMC,MAAM,GAAGT,MAAM,CAACM,CAAC,GAAG,CAAC,CAAC;MAC5B,IAAIZ,WAAC,CAACO,0BAA0B,CAACQ,MAAM,EAAE;QAAED,QAAQ,EAAE;MAAK,CAAC,CAAC,EAAE;QAC5D,OAAO,IAAI;MACb;IACF;EACF;EACA,OAAO,KAAK;AACd"}
|
74
node_modules/@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining/package.json
generated
vendored
Normal file
74
node_modules/@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining/package.json
generated
vendored
Normal file
@ -0,0 +1,74 @@
|
||||
{
|
||||
"_from": "@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining@^7.22.5",
|
||||
"_id": "@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining@7.22.5",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha512-31Bb65aZaUwqCbWMnZPduIZxCBngHFlzyN6Dq6KAJjtx+lx6ohKHubc61OomYi7XwVD4Ol0XCVz4h+pYFR048g==",
|
||||
"_location": "/@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "range",
|
||||
"registry": true,
|
||||
"raw": "@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining@^7.22.5",
|
||||
"name": "@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining",
|
||||
"escapedName": "@babel%2fplugin-bugfix-v8-spread-parameters-in-optional-chaining",
|
||||
"scope": "@babel",
|
||||
"rawSpec": "^7.22.5",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "^7.22.5"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/@babel/preset-env"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining/-/plugin-bugfix-v8-spread-parameters-in-optional-chaining-7.22.5.tgz",
|
||||
"_shasum": "fef09f9499b1f1c930da8a0c419db42167d792ca",
|
||||
"_spec": "@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining@^7.22.5",
|
||||
"_where": "C:\\Users\\zhouxueli\\Desktop\\scheduling-app\\node_modules\\@babel\\preset-env",
|
||||
"author": {
|
||||
"name": "The Babel Team",
|
||||
"url": "https://babel.dev/team"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/babel/babel/issues"
|
||||
},
|
||||
"bundleDependencies": false,
|
||||
"dependencies": {
|
||||
"@babel/helper-plugin-utils": "^7.22.5",
|
||||
"@babel/helper-skip-transparent-expression-wrappers": "^7.22.5",
|
||||
"@babel/plugin-transform-optional-chaining": "^7.22.5"
|
||||
},
|
||||
"deprecated": false,
|
||||
"description": "Transform optional chaining operators to workaround https://crbug.com/v8/11558",
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.22.5",
|
||||
"@babel/helper-plugin-test-runner": "^7.22.5",
|
||||
"@babel/traverse": "^7.22.5"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=6.9.0"
|
||||
},
|
||||
"exports": {
|
||||
".": "./lib/index.js",
|
||||
"./package.json": "./package.json"
|
||||
},
|
||||
"homepage": "https://babel.dev/docs/en/next/babel-plugin-bugfix-v8-spread-parameters-in-optional-chaining",
|
||||
"keywords": [
|
||||
"babel-plugin",
|
||||
"bugfix"
|
||||
],
|
||||
"license": "MIT",
|
||||
"main": "./lib/index.js",
|
||||
"name": "@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining",
|
||||
"peerDependencies": {
|
||||
"@babel/core": "^7.13.0"
|
||||
},
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/babel/babel.git",
|
||||
"directory": "packages/babel-plugin-bugfix-v8-spread-parameters-in-optional-chaining"
|
||||
},
|
||||
"type": "commonjs",
|
||||
"version": "7.22.5"
|
||||
}
|
Reference in New Issue
Block a user