feat: initial commit
This commit is contained in:
22
node_modules/@babel/plugin-bugfix-firefox-class-in-computed-class-key/LICENSE
generated
vendored
Normal file
22
node_modules/@babel/plugin-bugfix-firefox-class-in-computed-class-key/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-firefox-class-in-computed-class-key/README.md
generated
vendored
Normal file
19
node_modules/@babel/plugin-bugfix-firefox-class-in-computed-class-key/README.md
generated
vendored
Normal file
@ -0,0 +1,19 @@
|
||||
# @babel/plugin-bugfix-firefox-class-in-computed-class-key
|
||||
|
||||
> Wraps classes defined in computed keys of other classes affected by https://bugzilla.mozilla.org/show_bug.cgi?id=1887677
|
||||
|
||||
See our website [@babel/plugin-bugfix-firefox-class-in-computed-class-key](https://babeljs.io/docs/babel-plugin-bugfix-firefox-class-in-computed-class-key) for more information.
|
||||
|
||||
## Install
|
||||
|
||||
Using npm:
|
||||
|
||||
```sh
|
||||
npm install --save-dev @babel/plugin-bugfix-firefox-class-in-computed-class-key
|
||||
```
|
||||
|
||||
or using yarn:
|
||||
|
||||
```sh
|
||||
yarn add @babel/plugin-bugfix-firefox-class-in-computed-class-key --dev
|
||||
```
|
75
node_modules/@babel/plugin-bugfix-firefox-class-in-computed-class-key/lib/index.js
generated
vendored
Normal file
75
node_modules/@babel/plugin-bugfix-firefox-class-in-computed-class-key/lib/index.js
generated
vendored
Normal file
@ -0,0 +1,75 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = void 0;
|
||||
var _traverse = require("@babel/traverse");
|
||||
var _helperPluginUtils = require("@babel/helper-plugin-utils");
|
||||
var _default = exports.default = (0, _helperPluginUtils.declare)(({
|
||||
types: t,
|
||||
assertVersion
|
||||
}) => {
|
||||
assertVersion(7);
|
||||
const containsClassExpressionVisitor = {
|
||||
ClassExpression(path, state) {
|
||||
state.found = true;
|
||||
path.stop();
|
||||
},
|
||||
Function(path) {
|
||||
path.skip();
|
||||
}
|
||||
};
|
||||
const containsYieldOrAwaitVisitor = _traverse.visitors.environmentVisitor({
|
||||
YieldExpression(path, state) {
|
||||
state.yield = true;
|
||||
if (state.await) path.stop();
|
||||
},
|
||||
AwaitExpression(path, state) {
|
||||
state.await = true;
|
||||
if (state.yield) path.stop();
|
||||
}
|
||||
});
|
||||
function containsClassExpression(path) {
|
||||
if (t.isClassExpression(path.node)) return true;
|
||||
if (t.isFunction(path.node)) return false;
|
||||
const state = {
|
||||
found: false
|
||||
};
|
||||
path.traverse(containsClassExpressionVisitor, state);
|
||||
return state.found;
|
||||
}
|
||||
function wrap(path) {
|
||||
const context = {
|
||||
yield: t.isYieldExpression(path.node),
|
||||
await: t.isAwaitExpression(path.node)
|
||||
};
|
||||
path.traverse(containsYieldOrAwaitVisitor, context);
|
||||
let replacement;
|
||||
if (context.yield) {
|
||||
const fn = t.functionExpression(null, [], t.blockStatement([t.returnStatement(path.node)]), true, context.await);
|
||||
replacement = t.yieldExpression(t.callExpression(t.memberExpression(fn, t.identifier("call")), [t.thisExpression(), t.identifier("arguments")]), true);
|
||||
} else {
|
||||
const fn = t.arrowFunctionExpression([], path.node, context.await);
|
||||
replacement = t.callExpression(fn, []);
|
||||
if (context.await) replacement = t.awaitExpression(replacement);
|
||||
}
|
||||
path.replaceWith(replacement);
|
||||
}
|
||||
return {
|
||||
name: "bugfix-firefox-class-in-computed-class-key",
|
||||
visitor: {
|
||||
Class(path) {
|
||||
const hasPrivateElement = path.node.body.body.some(node => t.isPrivate(node));
|
||||
if (!hasPrivateElement) return;
|
||||
for (const elem of path.get("body.body")) {
|
||||
if ("computed" in elem.node && elem.node.computed && containsClassExpression(elem.get("key"))) {
|
||||
wrap(elem.get("key"));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
});
|
||||
|
||||
//# sourceMappingURL=index.js.map
|
1
node_modules/@babel/plugin-bugfix-firefox-class-in-computed-class-key/lib/index.js.map
generated
vendored
Normal file
1
node_modules/@babel/plugin-bugfix-firefox-class-in-computed-class-key/lib/index.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
43
node_modules/@babel/plugin-bugfix-firefox-class-in-computed-class-key/package.json
generated
vendored
Normal file
43
node_modules/@babel/plugin-bugfix-firefox-class-in-computed-class-key/package.json
generated
vendored
Normal file
@ -0,0 +1,43 @@
|
||||
{
|
||||
"name": "@babel/plugin-bugfix-firefox-class-in-computed-class-key",
|
||||
"version": "7.25.3",
|
||||
"description": "Wraps classes defined in computed keys of other classes affected by https://bugzilla.mozilla.org/show_bug.cgi?id=1887677",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/babel/babel.git",
|
||||
"directory": "packages/babel-plugin-bugfix-firefox-class-in-computed-class-key"
|
||||
},
|
||||
"homepage": "https://babel.dev/docs/en/next/babel-plugin-bugfix-firefox-class-in-computed-class-key",
|
||||
"license": "MIT",
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"main": "./lib/index.js",
|
||||
"exports": {
|
||||
".": {
|
||||
"types": "./lib/index.d.ts",
|
||||
"default": "./lib/index.js"
|
||||
},
|
||||
"./package.json": "./package.json"
|
||||
},
|
||||
"keywords": [
|
||||
"babel-plugin",
|
||||
"bugfix"
|
||||
],
|
||||
"dependencies": {
|
||||
"@babel/helper-plugin-utils": "^7.24.8",
|
||||
"@babel/traverse": "^7.25.3"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@babel/core": "^7.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.25.2",
|
||||
"@babel/helper-plugin-test-runner": "^7.24.7"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=6.9.0"
|
||||
},
|
||||
"author": "The Babel Team (https://babel.dev/team)",
|
||||
"type": "commonjs"
|
||||
}
|
17
node_modules/@babel/plugin-bugfix-firefox-class-in-computed-class-key/tsconfig.json
generated
vendored
Normal file
17
node_modules/@babel/plugin-bugfix-firefox-class-in-computed-class-key/tsconfig.json
generated
vendored
Normal file
@ -0,0 +1,17 @@
|
||||
/* This file is automatically generated by scripts/generators/tsconfig.js */
|
||||
{
|
||||
"extends": [
|
||||
"../../tsconfig.base.json",
|
||||
"../../tsconfig.paths.json"
|
||||
],
|
||||
"include": [
|
||||
"../../packages/babel-plugin-bugfix-firefox-class-in-computed-class-key/src/**/*.ts",
|
||||
"../../lib/globals.d.ts",
|
||||
"../../scripts/repo-utils/*.d.ts"
|
||||
],
|
||||
"references": [
|
||||
{
|
||||
"path": "../../packages/babel-helper-plugin-utils"
|
||||
}
|
||||
]
|
||||
}
|
1
node_modules/@babel/plugin-bugfix-firefox-class-in-computed-class-key/tsconfig.tsbuildinfo
generated
vendored
Normal file
1
node_modules/@babel/plugin-bugfix-firefox-class-in-computed-class-key/tsconfig.tsbuildinfo
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user