@babel/plugin-transform-private-property-in-object
Advanced tools
Comparing version 7.22.5 to 8.0.0-alpha.0
@@ -1,12 +0,7 @@ | ||
"use strict"; | ||
import { declare } from '@babel/helper-plugin-utils'; | ||
import syntaxPlugin from '@babel/plugin-syntax-private-property-in-object'; | ||
import { enableFeature, FEATURES, buildCheckInRHS, injectInitialization } from '@babel/helper-create-class-features-plugin'; | ||
import annotateAsPure from '@babel/helper-annotate-as-pure'; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
exports.default = void 0; | ||
var _helperPluginUtils = require("@babel/helper-plugin-utils"); | ||
var _pluginSyntaxPrivatePropertyInObject = require("@babel/plugin-syntax-private-property-in-object"); | ||
var _helperCreateClassFeaturesPlugin = require("@babel/helper-create-class-features-plugin"); | ||
var _helperAnnotateAsPure = require("@babel/helper-annotate-as-pure"); | ||
var _default = (0, _helperPluginUtils.declare)((api, opt) => { | ||
var index = declare((api, opt) => { | ||
api.assertVersion(7); | ||
@@ -40,3 +35,3 @@ const { | ||
} | ||
function injectInitialization(classPath, init) { | ||
function injectInitialization$1(classPath, init) { | ||
let firstFieldPath; | ||
@@ -58,3 +53,3 @@ let constructorPath; | ||
} else { | ||
(0, _helperCreateClassFeaturesPlugin.injectInitialization)(classPath, constructorPath, [t.expressionStatement(init)]); | ||
injectInitialization(classPath, constructorPath, [t.expressionStatement(init)]); | ||
} | ||
@@ -69,3 +64,3 @@ } | ||
const newExpr = t.newExpression(t.identifier("WeakSet"), []); | ||
(0, _helperAnnotateAsPure.default)(newExpr); | ||
annotateAsPure(newExpr); | ||
outerClass.insertBefore(template.ast`var ${id} = ${newExpr}`); | ||
@@ -77,5 +72,5 @@ } | ||
name: "transform-private-property-in-object", | ||
inherits: _pluginSyntaxPrivatePropertyInObject.default, | ||
inherits: syntaxPlugin.default, | ||
pre() { | ||
(0, _helperCreateClassFeaturesPlugin.enableFeature)(this.file, _helperCreateClassFeaturesPlugin.FEATURES.privateIn, loose); | ||
enableFeature(this.file, FEATURES.privateIn, loose); | ||
}, | ||
@@ -115,12 +110,11 @@ visitor: { | ||
path.replaceWith(template.expression.ast` | ||
${t.cloneNode(outerClass.node.id)} === ${(0, _helperCreateClassFeaturesPlugin.buildCheckInRHS)(node.right, file)} | ||
${t.cloneNode(outerClass.node.id)} === ${buildCheckInRHS(node.right, file)} | ||
`); | ||
} else { | ||
var _outerClass$node$id; | ||
const id = getWeakSetId(classWeakSets, outerClass, outerClass, (_outerClass$node$id = outerClass.node.id) == null ? void 0 : _outerClass$node$id.name, injectInitialization); | ||
path.replaceWith(template.expression.ast`${id}.has(${(0, _helperCreateClassFeaturesPlugin.buildCheckInRHS)(node.right, file)})`); | ||
const id = getWeakSetId(classWeakSets, outerClass, outerClass, outerClass.node.id?.name, injectInitialization$1); | ||
path.replaceWith(template.expression.ast`${id}.has(${buildCheckInRHS(node.right, file)})`); | ||
} | ||
} else { | ||
const id = getWeakSetId(fieldsWeakSets, outerClass, privateElement, privateElement.node.key.id.name, injectToFieldInit); | ||
path.replaceWith(template.expression.ast`${id}.has(${(0, _helperCreateClassFeaturesPlugin.buildCheckInRHS)(node.right, file)})`); | ||
path.replaceWith(template.expression.ast`${id}.has(${buildCheckInRHS(node.right, file)})`); | ||
} | ||
@@ -131,4 +125,4 @@ } | ||
}); | ||
exports.default = _default; | ||
export { index as default }; | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "@babel/plugin-transform-private-property-in-object", | ||
"version": "7.22.5", | ||
"version": "8.0.0-alpha.0", | ||
"description": "This plugin transforms checks for a private property in an object", | ||
@@ -20,19 +20,23 @@ "repository": { | ||
"dependencies": { | ||
"@babel/helper-annotate-as-pure": "^7.22.5", | ||
"@babel/helper-create-class-features-plugin": "^7.22.5", | ||
"@babel/helper-plugin-utils": "^7.22.5", | ||
"@babel/helper-annotate-as-pure": "^8.0.0-alpha.0", | ||
"@babel/helper-create-class-features-plugin": "^8.0.0-alpha.0", | ||
"@babel/helper-plugin-utils": "^8.0.0-alpha.0", | ||
"@babel/plugin-syntax-private-property-in-object": "^7.14.5" | ||
}, | ||
"peerDependencies": { | ||
"@babel/core": "^7.0.0-0" | ||
"@babel/core": "^8.0.0-alpha.0" | ||
}, | ||
"devDependencies": { | ||
"@babel/core": "^7.22.5", | ||
"@babel/helper-plugin-test-runner": "^7.22.5" | ||
"@babel/core": "^8.0.0-alpha.0", | ||
"@babel/helper-plugin-test-runner": "^8.0.0-alpha.0" | ||
}, | ||
"engines": { | ||
"node": ">=6.9.0" | ||
"node": "^16.20.0 || ^18.16.0 || >=20.0.0" | ||
}, | ||
"author": "The Babel Team (https://babel.dev/team)", | ||
"type": "commonjs" | ||
"exports": { | ||
".": "./lib/index.js", | ||
"./package.json": "./package.json" | ||
}, | ||
"type": "module" | ||
} |
@@ -5,3 +5,3 @@ # @babel/plugin-transform-private-property-in-object | ||
See our website [@babel/plugin-transform-private-property-in-object](https://babeljs.io/docs/en/babel-plugin-transform-private-property-in-object) for more information. | ||
See our website [@babel/plugin-transform-private-property-in-object](https://babeljs.io/docs/babel-plugin-transform-private-property-in-object) for more information. | ||
@@ -8,0 +8,0 @@ ## Install |
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
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
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
Yes
19876
120
1
+ Added@babel/code-frame@8.0.0-alpha.12(transitive)
+ Added@babel/compat-data@8.0.0-alpha.12(transitive)
+ Added@babel/core@8.0.0-alpha.12(transitive)
+ Added@babel/generator@8.0.0-alpha.12(transitive)
+ Added@babel/helper-annotate-as-pure@8.0.0-alpha.12(transitive)
+ Added@babel/helper-compilation-targets@8.0.0-alpha.12(transitive)
+ Added@babel/helper-create-class-features-plugin@8.0.0-alpha.12(transitive)
+ Added@babel/helper-member-expression-to-functions@8.0.0-alpha.12(transitive)
+ Added@babel/helper-optimise-call-expression@8.0.0-alpha.12(transitive)
+ Added@babel/helper-plugin-utils@8.0.0-alpha.12(transitive)
+ Added@babel/helper-replace-supers@8.0.0-alpha.12(transitive)
+ Added@babel/helper-skip-transparent-expression-wrappers@8.0.0-alpha.12(transitive)
+ Added@babel/helper-string-parser@8.0.0-alpha.12(transitive)
+ Added@babel/helper-validator-identifier@8.0.0-alpha.12(transitive)
+ Added@babel/helper-validator-option@8.0.0-alpha.12(transitive)
+ Added@babel/helpers@8.0.0-alpha.12(transitive)
+ Added@babel/highlight@8.0.0-alpha.12(transitive)
+ Added@babel/parser@8.0.0-alpha.12(transitive)
+ Added@babel/template@8.0.0-alpha.12(transitive)
+ Added@babel/traverse@8.0.0-alpha.12(transitive)
+ Added@babel/types@8.0.0-alpha.12(transitive)
+ Addedglobals@15.11.0(transitive)
+ Addedjs-tokens@8.0.3(transitive)
+ Addedlru-cache@7.18.3(transitive)
+ Addedsemver@7.6.3(transitive)
+ Addedto-fast-properties@3.0.1(transitive)
- Removed@babel/helper-annotate-as-pure@7.25.7(transitive)
- Removed@babel/helper-create-class-features-plugin@7.25.7(transitive)
- Removed@babel/helper-member-expression-to-functions@7.25.7(transitive)
- Removed@babel/helper-optimise-call-expression@7.25.7(transitive)
- Removed@babel/helper-replace-supers@7.25.7(transitive)
- Removed@babel/helper-skip-transparent-expression-wrappers@7.25.7(transitive)
Updated@babel/helper-create-class-features-plugin@^8.0.0-alpha.0