@babel/helper-create-class-features-plugin
Advanced tools
Comparing version 7.20.2 to 7.20.5
@@ -86,10 +86,3 @@ "use strict"; | ||
function addDecorateHelper(file) { | ||
try { | ||
return file.addHelper("decorate"); | ||
} catch (err) { | ||
if (err.code === "BABEL_HELPER_UNKNOWN") { | ||
err.message += "\n '@babel/plugin-transform-decorators' in non-legacy mode" + " requires '@babel/core' version ^7.0.2 and you appear to be using" + " an older version."; | ||
} | ||
throw err; | ||
} | ||
return file.addHelper("decorate"); | ||
} | ||
@@ -96,0 +89,0 @@ function buildDecoratedClass(ref, path, elements, file) { |
@@ -6,2 +6,3 @@ "use strict"; | ||
}); | ||
exports.buildCheckInRHS = buildCheckInRHS; | ||
exports.buildFieldsInitNodes = buildFieldsInitNodes; | ||
@@ -138,4 +139,10 @@ exports.buildPrivateNamesMap = buildPrivateNamesMap; | ||
} | ||
function buildCheckInRHS(rhs, file, inRHSIsObject) { | ||
if (inRHSIsObject || !(file.availableHelper != null && file.availableHelper("checkInRHS"))) return rhs; | ||
return _core.types.callExpression(file.addHelper("checkInRHS"), [rhs]); | ||
} | ||
const privateInVisitor = privateNameVisitorFactory({ | ||
BinaryExpression(path) { | ||
BinaryExpression(path, { | ||
file | ||
}) { | ||
const { | ||
@@ -165,3 +172,3 @@ operator, | ||
path.replaceWith(_core.template.expression.ast` | ||
Object.prototype.hasOwnProperty.call(${right}, ${_core.types.cloneNode(id)}) | ||
Object.prototype.hasOwnProperty.call(${buildCheckInRHS(right, file)}, ${_core.types.cloneNode(id)}) | ||
`); | ||
@@ -175,6 +182,6 @@ return; | ||
if (isStatic) { | ||
path.replaceWith(_core.template.expression.ast`${right} === ${this.classRef}`); | ||
path.replaceWith(_core.template.expression.ast`${buildCheckInRHS(right, file)} === ${_core.types.cloneNode(this.classRef)}`); | ||
return; | ||
} | ||
path.replaceWith(_core.template.expression.ast`${_core.types.cloneNode(id)}.has(${right})`); | ||
path.replaceWith(_core.template.expression.ast`${_core.types.cloneNode(id)}.has(${buildCheckInRHS(right, file)})`); | ||
} | ||
@@ -181,0 +188,0 @@ }); |
@@ -12,2 +12,8 @@ "use strict"; | ||
}); | ||
Object.defineProperty(exports, "buildCheckInRHS", { | ||
enumerable: true, | ||
get: function () { | ||
return _fields.buildCheckInRHS; | ||
} | ||
}); | ||
exports.createClassFeaturePlugin = createClassFeaturePlugin; | ||
@@ -34,3 +40,3 @@ Object.defineProperty(exports, "enableFeature", { | ||
var _typescript = require("./typescript"); | ||
const version = "7.20.2".split(".").reduce((v, x) => v * 1e5 + +x, 0); | ||
const version = "7.20.5".split(".").reduce((v, x) => v * 1e5 + +x, 0); | ||
const versionKey = "@babel/plugin-class-features/version"; | ||
@@ -37,0 +43,0 @@ function createClassFeaturePlugin({ |
{ | ||
"name": "@babel/helper-create-class-features-plugin", | ||
"version": "7.20.2", | ||
"version": "7.20.5", | ||
"author": "The Babel Team (https://babel.dev/team)", | ||
@@ -33,3 +33,3 @@ "license": "MIT", | ||
"devDependencies": { | ||
"@babel/core": "^7.20.2", | ||
"@babel/core": "^7.20.5", | ||
"@babel/helper-plugin-test-runner": "^7.18.6", | ||
@@ -36,0 +36,0 @@ "@babel/plugin-syntax-class-static-block": "^7.14.5", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
178650
1404