Area restrita - Questionario
This commit is contained in:
+11
-9
@@ -877,6 +877,17 @@ function transformClass(path, state, constantSuper, ignoreFunctionLength, classN
|
||||
classLocals.push(classIdLocal, classInitLocal);
|
||||
const statics = [];
|
||||
path.get("body.body").forEach(element => {
|
||||
if (element.isStaticBlock() || !element.isClassMethod() && element.node.static) {
|
||||
const replaceSupers = new _helperReplaceSupers.default({
|
||||
constantSuper,
|
||||
methodPath: element,
|
||||
objectRef: classIdLocal,
|
||||
superRef: path.node.superClass,
|
||||
file: state.file,
|
||||
refToPreserve: classIdLocal
|
||||
});
|
||||
replaceSupers.replace();
|
||||
}
|
||||
if (element.isStaticBlock()) {
|
||||
if (hasInstancePrivateAccess(element, instancePrivateNames)) {
|
||||
const staticBlockClosureId = memoiseExpression(staticBlockToFunctionClosure(element.node), "staticBlock", staticClosures);
|
||||
@@ -904,15 +915,6 @@ function transformClass(path, state, constantSuper, ignoreFunctionLength, classN
|
||||
static: true
|
||||
})) {
|
||||
if (hasInstancePrivateAccess(element, instancePrivateNames)) {
|
||||
const replaceSupers = new _helperReplaceSupers.default({
|
||||
constantSuper,
|
||||
methodPath: element,
|
||||
objectRef: classIdLocal,
|
||||
superRef: path.node.superClass,
|
||||
file: state.file,
|
||||
refToPreserve: classIdLocal
|
||||
});
|
||||
replaceSupers.replace();
|
||||
const privateMethodDelegateId = memoiseExpression(createFunctionExpressionFromPrivateMethod(element.node), element.get("key.id").node.name, staticClosures);
|
||||
if (ignoreFunctionLength) {
|
||||
element.node.params = [_core.types.restElement(_core.types.identifier("arg"))];
|
||||
|
||||
+1
-1
File diff suppressed because one or more lines are too long
+5
-5
@@ -95,18 +95,18 @@ function createClassFeaturePlugin({
|
||||
pre(file) {
|
||||
(0, _features.enableFeature)(file, feature, loose);
|
||||
if (typeof file.get(versionKey) === "number") {
|
||||
file.set(versionKey, "7.28.6");
|
||||
file.set(versionKey, "7.29.7");
|
||||
return;
|
||||
}
|
||||
if (!file.get(versionKey) || _semver.lt(file.get(versionKey), "7.28.6")) {
|
||||
file.set(versionKey, "7.28.6");
|
||||
if (!file.get(versionKey) || _semver.lt(file.get(versionKey), "7.29.7")) {
|
||||
file.set(versionKey, "7.29.7");
|
||||
}
|
||||
},
|
||||
visitor: {
|
||||
Class(path, {
|
||||
file
|
||||
}) {
|
||||
if (file.get(versionKey) !== "7.28.6") return;
|
||||
if (file.get(versionKey) !== "7.29.7") return;
|
||||
if (!(0, _features.shouldTransform)(path, file)) return;
|
||||
const pathIsClassDeclaration = path.isClassDeclaration();
|
||||
if (pathIsClassDeclaration) (0, _typescript.assertFieldTransformed)(path);
|
||||
@@ -218,7 +218,7 @@ function createClassFeaturePlugin({
|
||||
ExportDefaultDeclaration(path, {
|
||||
file
|
||||
}) {
|
||||
if (file.get(versionKey) !== "7.28.6") return;
|
||||
if (file.get(versionKey) !== "7.29.7") return;
|
||||
const decl = path.get("declaration");
|
||||
if (decl.isClassDeclaration() && (0, _decorators.hasDecorators)(decl.node)) {
|
||||
if (decl.node.id) {
|
||||
|
||||
+10
-10
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@babel/helper-create-class-features-plugin",
|
||||
"version": "7.28.6",
|
||||
"version": "7.29.7",
|
||||
"author": "The Babel Team (https://babel.dev/team)",
|
||||
"license": "MIT",
|
||||
"description": "Compile class public and private fields, private methods and decorators to ES6",
|
||||
@@ -18,21 +18,21 @@
|
||||
"babel-plugin"
|
||||
],
|
||||
"dependencies": {
|
||||
"@babel/helper-annotate-as-pure": "^7.27.3",
|
||||
"@babel/helper-member-expression-to-functions": "^7.28.5",
|
||||
"@babel/helper-optimise-call-expression": "^7.27.1",
|
||||
"@babel/helper-replace-supers": "^7.28.6",
|
||||
"@babel/helper-skip-transparent-expression-wrappers": "^7.27.1",
|
||||
"@babel/traverse": "^7.28.6",
|
||||
"@babel/helper-annotate-as-pure": "^7.29.7",
|
||||
"@babel/helper-member-expression-to-functions": "^7.29.7",
|
||||
"@babel/helper-optimise-call-expression": "^7.29.7",
|
||||
"@babel/helper-replace-supers": "^7.29.7",
|
||||
"@babel/helper-skip-transparent-expression-wrappers": "^7.29.7",
|
||||
"@babel/traverse": "^7.29.7",
|
||||
"semver": "^6.3.1"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@babel/core": "^7.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.28.6",
|
||||
"@babel/helper-plugin-test-runner": "^7.27.1",
|
||||
"@babel/preset-env": "^7.28.6",
|
||||
"@babel/core": "^7.29.7",
|
||||
"@babel/helper-plugin-test-runner": "^7.29.7",
|
||||
"@babel/preset-env": "^7.29.7",
|
||||
"@types/charcodes": "^0.2.0",
|
||||
"charcodes": "^0.2.0"
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user