summaryrefslogtreecommitdiff
path: root/node_modules/@babel/plugin-transform-object-super
diff options
context:
space:
mode:
authorlittleblack111 <littleblack11111@gmail.com>2023-10-14 15:31:11 +0800
committerlittleblack111 <littleblack11111@gmail.com>2023-10-14 15:31:11 +0800
commitaa773172311dcada759dfbaac485f4bc6e00bc21 (patch)
treeca6d9a5eff3ab8f689f9acb4f0df791d9486813d /node_modules/@babel/plugin-transform-object-super
parentc5a5384e846f242e901e859fe600d695d8990a9a (diff)
added babel
Diffstat (limited to 'node_modules/@babel/plugin-transform-object-super')
-rw-r--r--node_modules/@babel/plugin-transform-object-super/LICENSE22
-rw-r--r--node_modules/@babel/plugin-transform-object-super/README.md19
-rw-r--r--node_modules/@babel/plugin-transform-object-super/lib/index.js42
-rw-r--r--node_modules/@babel/plugin-transform-object-super/lib/index.js.map1
-rw-r--r--node_modules/@babel/plugin-transform-object-super/package.json35
5 files changed, 119 insertions, 0 deletions
diff --git a/node_modules/@babel/plugin-transform-object-super/LICENSE b/node_modules/@babel/plugin-transform-object-super/LICENSE
new file mode 100644
index 00000000..f31575ec
--- /dev/null
+++ b/node_modules/@babel/plugin-transform-object-super/LICENSE
@@ -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.
diff --git a/node_modules/@babel/plugin-transform-object-super/README.md b/node_modules/@babel/plugin-transform-object-super/README.md
new file mode 100644
index 00000000..a89ae805
--- /dev/null
+++ b/node_modules/@babel/plugin-transform-object-super/README.md
@@ -0,0 +1,19 @@
+# @babel/plugin-transform-object-super
+
+> Compile ES2015 object super to ES5
+
+See our website [@babel/plugin-transform-object-super](https://babeljs.io/docs/en/babel-plugin-transform-object-super) for more information.
+
+## Install
+
+Using npm:
+
+```sh
+npm install --save-dev @babel/plugin-transform-object-super
+```
+
+or using yarn:
+
+```sh
+yarn add @babel/plugin-transform-object-super --dev
+```
diff --git a/node_modules/@babel/plugin-transform-object-super/lib/index.js b/node_modules/@babel/plugin-transform-object-super/lib/index.js
new file mode 100644
index 00000000..59dad106
--- /dev/null
+++ b/node_modules/@babel/plugin-transform-object-super/lib/index.js
@@ -0,0 +1,42 @@
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = void 0;
+var _helperPluginUtils = require("@babel/helper-plugin-utils");
+var _helperReplaceSupers = require("@babel/helper-replace-supers");
+var _core = require("@babel/core");
+function replacePropertySuper(path, getObjectRef, file) {
+ const replaceSupers = new _helperReplaceSupers.default({
+ getObjectRef: getObjectRef,
+ methodPath: path,
+ file: file
+ });
+ replaceSupers.replace();
+}
+var _default = (0, _helperPluginUtils.declare)(api => {
+ api.assertVersion(7);
+ return {
+ name: "transform-object-super",
+ visitor: {
+ ObjectExpression(path, state) {
+ let objectRef;
+ const getObjectRef = () => objectRef = objectRef || path.scope.generateUidIdentifier("obj");
+ path.get("properties").forEach(propPath => {
+ if (!propPath.isMethod()) return;
+ replacePropertySuper(propPath, getObjectRef, state.file);
+ });
+ if (objectRef) {
+ path.scope.push({
+ id: _core.types.cloneNode(objectRef)
+ });
+ path.replaceWith(_core.types.assignmentExpression("=", _core.types.cloneNode(objectRef), path.node));
+ }
+ }
+ }
+ };
+});
+exports.default = _default;
+
+//# sourceMappingURL=index.js.map
diff --git a/node_modules/@babel/plugin-transform-object-super/lib/index.js.map b/node_modules/@babel/plugin-transform-object-super/lib/index.js.map
new file mode 100644
index 00000000..60a70759
--- /dev/null
+++ b/node_modules/@babel/plugin-transform-object-super/lib/index.js.map
@@ -0,0 +1 @@
+{"version":3,"names":["_helperPluginUtils","require","_helperReplaceSupers","_core","replacePropertySuper","path","getObjectRef","file","replaceSupers","ReplaceSupers","methodPath","replace","_default","declare","api","assertVersion","name","visitor","ObjectExpression","state","objectRef","scope","generateUidIdentifier","get","forEach","propPath","isMethod","push","id","t","cloneNode","replaceWith","assignmentExpression","node","exports","default"],"sources":["../src/index.ts"],"sourcesContent":["import { declare } from \"@babel/helper-plugin-utils\";\nimport ReplaceSupers from \"@babel/helper-replace-supers\";\nimport { types as t, type File } from \"@babel/core\";\nimport type { NodePath } from \"@babel/traverse\";\n\nfunction replacePropertySuper(\n path: NodePath<t.ObjectMethod>,\n getObjectRef: () => t.Identifier,\n file: File,\n) {\n // @ts-expect-error todo(flow->ts):\n const replaceSupers = new ReplaceSupers({\n getObjectRef: getObjectRef,\n methodPath: path,\n file: file,\n });\n\n replaceSupers.replace();\n}\n\nexport default declare(api => {\n api.assertVersion(7);\n\n return {\n name: \"transform-object-super\",\n\n visitor: {\n ObjectExpression(path, state) {\n let objectRef: t.Identifier;\n const getObjectRef = () =>\n (objectRef = objectRef || path.scope.generateUidIdentifier(\"obj\"));\n\n path.get(\"properties\").forEach(propPath => {\n if (!propPath.isMethod()) return;\n\n replacePropertySuper(propPath, getObjectRef, state.file);\n });\n\n if (objectRef) {\n path.scope.push({ id: t.cloneNode(objectRef) });\n path.replaceWith(\n t.assignmentExpression(\"=\", t.cloneNode(objectRef), path.node),\n );\n }\n },\n },\n };\n});\n"],"m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;QACH;MACF;IACF;EACF,CAAC;AACH,CAAC,CAAC;AAAAC,OAAA,CAAAC,OAAA,GAAAvB,QAAA"} \ No newline at end of file
diff --git a/node_modules/@babel/plugin-transform-object-super/package.json b/node_modules/@babel/plugin-transform-object-super/package.json
new file mode 100644
index 00000000..caf160ec
--- /dev/null
+++ b/node_modules/@babel/plugin-transform-object-super/package.json
@@ -0,0 +1,35 @@
+{
+ "name": "@babel/plugin-transform-object-super",
+ "version": "7.22.5",
+ "description": "Compile ES2015 object super to ES5",
+ "repository": {
+ "type": "git",
+ "url": "https://github.com/babel/babel.git",
+ "directory": "packages/babel-plugin-transform-object-super"
+ },
+ "homepage": "https://babel.dev/docs/en/next/babel-plugin-transform-object-super",
+ "license": "MIT",
+ "publishConfig": {
+ "access": "public"
+ },
+ "main": "./lib/index.js",
+ "keywords": [
+ "babel-plugin"
+ ],
+ "dependencies": {
+ "@babel/helper-plugin-utils": "^7.22.5",
+ "@babel/helper-replace-supers": "^7.22.5"
+ },
+ "peerDependencies": {
+ "@babel/core": "^7.0.0-0"
+ },
+ "devDependencies": {
+ "@babel/core": "^7.22.5",
+ "@babel/helper-plugin-test-runner": "^7.22.5"
+ },
+ "engines": {
+ "node": ">=6.9.0"
+ },
+ "author": "The Babel Team (https://babel.dev/team)",
+ "type": "commonjs"
+} \ No newline at end of file