first commit
This commit is contained in:
45
app_vue/node_modules/@babel/plugin-transform-block-scoped-functions/lib/index.js
generated
vendored
Normal file
45
app_vue/node_modules/@babel/plugin-transform-block-scoped-functions/lib/index.js
generated
vendored
Normal file
@ -0,0 +1,45 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = void 0;
|
||||
var _helperPluginUtils = require("@babel/helper-plugin-utils");
|
||||
var _core = require("@babel/core");
|
||||
var _default = exports.default = (0, _helperPluginUtils.declare)(api => {
|
||||
api.assertVersion(7);
|
||||
function transformStatementList(parentPath, paths) {
|
||||
;
|
||||
for (const path of paths) {
|
||||
if (!path.isFunctionDeclaration()) continue;
|
||||
;
|
||||
const func = path.node;
|
||||
const declar = _core.types.variableDeclaration("let", [_core.types.variableDeclarator(func.id, _core.types.toExpression(func))]);
|
||||
declar._blockHoist = 2;
|
||||
func.id = null;
|
||||
path.replaceWith(declar);
|
||||
}
|
||||
}
|
||||
return {
|
||||
name: "transform-block-scoped-functions",
|
||||
visitor: {
|
||||
BlockStatement(path) {
|
||||
const {
|
||||
node,
|
||||
parent
|
||||
} = path;
|
||||
if (_core.types.isFunction(parent, {
|
||||
body: node
|
||||
}) || _core.types.isExportDeclaration(parent)) {
|
||||
return;
|
||||
}
|
||||
transformStatementList(path, path.get("body"));
|
||||
},
|
||||
SwitchCase(path) {
|
||||
transformStatementList(path, path.get("consequent"));
|
||||
}
|
||||
}
|
||||
};
|
||||
});
|
||||
|
||||
//# sourceMappingURL=index.js.map
|
1
app_vue/node_modules/@babel/plugin-transform-block-scoped-functions/lib/index.js.map
generated
vendored
Normal file
1
app_vue/node_modules/@babel/plugin-transform-block-scoped-functions/lib/index.js.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"names":["_helperPluginUtils","require","_core","_default","exports","default","declare","api","assertVersion","transformStatementList","parentPath","paths","path","isFunctionDeclaration","func","node","declar","t","variableDeclaration","variableDeclarator","id","toExpression","_blockHoist","replaceWith","name","visitor","BlockStatement","parent","isFunction","body","isExportDeclaration","get","SwitchCase"],"sources":["../src/index.ts"],"sourcesContent":["import { declare } from \"@babel/helper-plugin-utils\";\nimport { types as t, type NodePath } from \"@babel/core\";\n\nexport default declare(api => {\n api.assertVersion(REQUIRED_VERSION(7));\n\n function transformStatementList(\n parentPath: NodePath,\n paths: NodePath<t.Statement>[],\n ) {\n if (process.env.BABEL_8_BREAKING) {\n // eslint-disable-next-line no-var\n var isInStrictMode = parentPath.isInStrictMode();\n }\n\n for (const path of paths) {\n if (!path.isFunctionDeclaration()) continue;\n\n if (\n process.env.BABEL_8_BREAKING &&\n !isInStrictMode &&\n !(\n path.node.async ||\n path.node.generator ||\n path.getData(\n \"@babel/plugin-transform-async-generator-functions/async_generator_function\",\n )\n )\n ) {\n continue;\n }\n\n const func = path.node;\n const declar = t.variableDeclaration(\"let\", [\n t.variableDeclarator(func.id, t.toExpression(func)),\n ]);\n\n // hoist it up above everything else\n // @ts-expect-error todo(flow->ts): avoid mutations\n declar._blockHoist = 2;\n\n // todo: name this\n func.id = null;\n\n path.replaceWith(declar);\n }\n }\n\n return {\n name: \"transform-block-scoped-functions\",\n\n visitor: {\n BlockStatement(path) {\n const { node, parent } = path;\n if (\n t.isFunction(parent, { body: node }) ||\n t.isExportDeclaration(parent)\n ) {\n return;\n }\n\n transformStatementList(path, path.get(\"body\"));\n },\n\n SwitchCase(path) {\n transformStatementList(path, path.get(\"consequent\"));\n },\n },\n };\n});\n"],"mappings":";;;;;;AAAA,IAAAA,kBAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AAAwD,IAAAE,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEzC,IAAAC,0BAAO,EAACC,GAAG,IAAI;EAC5BA,GAAG,CAACC,aAAa,CAAkB,CAAE,CAAC;EAEtC,SAASC,sBAAsBA,CAC7BC,UAAoB,EACpBC,KAA8B,EAC9B;IAAA;IAMA,KAAK,MAA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