Add <%br= %> jqhtml syntax docs, class override detection, npm update
Document event handler placement and model fetch clarification 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
7
node_modules/@babel/helper-create-class-features-plugin/lib/decorators-2018-09.js
generated
vendored
7
node_modules/@babel/helper-create-class-features-plugin/lib/decorators-2018-09.js
generated
vendored
@@ -6,7 +6,6 @@ Object.defineProperty(exports, "__esModule", {
|
||||
exports.buildDecoratedClass = buildDecoratedClass;
|
||||
var _core = require("@babel/core");
|
||||
var _helperReplaceSupers = require("@babel/helper-replace-supers");
|
||||
;
|
||||
function prop(key, value) {
|
||||
if (!value) return null;
|
||||
return _core.types.objectProperty(_core.types.identifier(key), value);
|
||||
@@ -57,10 +56,8 @@ function extractElementDescriptor(file, classRef, superRef, path) {
|
||||
}
|
||||
const properties = [prop("kind", _core.types.stringLiteral(_core.types.isClassMethod(node) ? node.kind : "field")), prop("decorators", takeDecorators(node)), prop("static", node.static && _core.types.booleanLiteral(true)), prop("key", getKey(node))].filter(Boolean);
|
||||
if (isMethod) {
|
||||
{
|
||||
var _path$ensureFunctionN;
|
||||
(_path$ensureFunctionN = path.ensureFunctionName) != null ? _path$ensureFunctionN : path.ensureFunctionName = require("@babel/traverse").NodePath.prototype.ensureFunctionName;
|
||||
}
|
||||
var _path$ensureFunctionN;
|
||||
(_path$ensureFunctionN = path.ensureFunctionName) != null ? _path$ensureFunctionN : path.ensureFunctionName = require("@babel/traverse").NodePath.prototype.ensureFunctionName;
|
||||
path.ensureFunctionName(false);
|
||||
properties.push(prop("value", _core.types.toExpression(path.node)));
|
||||
} else if (_core.types.isClassProperty(node) && node.value) {
|
||||
|
||||
File diff suppressed because one or more lines are too long
122
node_modules/@babel/helper-create-class-features-plugin/lib/decorators.js
generated
vendored
122
node_modules/@babel/helper-create-class-features-plugin/lib/decorators.js
generated
vendored
@@ -370,17 +370,15 @@ function createPrivateBrandCheckClosure(brandName) {
|
||||
return _core.types.arrowFunctionExpression([_core.types.identifier("_")], _core.types.binaryExpression("in", _core.types.cloneNode(brandName), _core.types.identifier("_")));
|
||||
}
|
||||
function usesPrivateField(expression) {
|
||||
{
|
||||
try {
|
||||
_core.types.traverseFast(expression, node => {
|
||||
if (_core.types.isPrivateName(node)) {
|
||||
throw null;
|
||||
}
|
||||
});
|
||||
return false;
|
||||
} catch (_unused) {
|
||||
return true;
|
||||
}
|
||||
try {
|
||||
_core.types.traverseFast(expression, node => {
|
||||
if (_core.types.isPrivateName(node)) {
|
||||
throw null;
|
||||
}
|
||||
});
|
||||
return false;
|
||||
} catch (_unused) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
function convertToComputedKey(path) {
|
||||
@@ -452,21 +450,19 @@ function transformClass(path, state, constantSuper, ignoreFunctionLength, classN
|
||||
const classIdName = (_path$node$id = path.node.id) == null ? void 0 : _path$node$id.name;
|
||||
const setClassName = typeof className === "object" ? className : undefined;
|
||||
const usesFunctionContextOrYieldAwait = decorator => {
|
||||
{
|
||||
try {
|
||||
_core.types.traverseFast(decorator, node => {
|
||||
if (_core.types.isThisExpression(node) || _core.types.isSuper(node) || _core.types.isYieldExpression(node) || _core.types.isAwaitExpression(node) || _core.types.isIdentifier(node, {
|
||||
name: "arguments"
|
||||
}) || classIdName && _core.types.isIdentifier(node, {
|
||||
name: classIdName
|
||||
}) || _core.types.isMetaProperty(node) && node.meta.name !== "import") {
|
||||
throw null;
|
||||
}
|
||||
});
|
||||
return false;
|
||||
} catch (_unused2) {
|
||||
return true;
|
||||
}
|
||||
try {
|
||||
_core.types.traverseFast(decorator, node => {
|
||||
if (_core.types.isThisExpression(node) || _core.types.isSuper(node) || _core.types.isYieldExpression(node) || _core.types.isAwaitExpression(node) || _core.types.isIdentifier(node, {
|
||||
name: "arguments"
|
||||
}) || classIdName && _core.types.isIdentifier(node, {
|
||||
name: classIdName
|
||||
}) || _core.types.isMetaProperty(node) && node.meta.name !== "import") {
|
||||
throw null;
|
||||
}
|
||||
});
|
||||
return false;
|
||||
} catch (_unused2) {
|
||||
return true;
|
||||
}
|
||||
};
|
||||
const instancePrivateNames = [];
|
||||
@@ -1022,33 +1018,31 @@ function transformClass(path, state, constantSuper, ignoreFunctionLength, classN
|
||||
function createLocalsAssignment(elementLocals, classLocals, elementDecorations, classDecorations, classDecorationsFlag, maybePrivateBrandName, setClassName, superClass, state, version) {
|
||||
let lhs, rhs;
|
||||
const args = [setClassName ? createSetFunctionNameCall(state, setClassName) : _core.types.thisExpression(), classDecorations, elementDecorations];
|
||||
{
|
||||
if (version !== "2023-11") {
|
||||
args.splice(1, 2, elementDecorations, classDecorations);
|
||||
if (version !== "2023-11") {
|
||||
args.splice(1, 2, elementDecorations, classDecorations);
|
||||
}
|
||||
if (version === "2021-12" || version === "2022-03" && !state.availableHelper("applyDecs2203R")) {
|
||||
lhs = _core.types.arrayPattern([...elementLocals, ...classLocals]);
|
||||
rhs = _core.types.callExpression(state.addHelper(version === "2021-12" ? "applyDecs" : "applyDecs2203"), args);
|
||||
return _core.types.assignmentExpression("=", lhs, rhs);
|
||||
} else if (version === "2022-03") {
|
||||
rhs = _core.types.callExpression(state.addHelper("applyDecs2203R"), args);
|
||||
} else if (version === "2023-01") {
|
||||
if (maybePrivateBrandName) {
|
||||
args.push(createPrivateBrandCheckClosure(maybePrivateBrandName));
|
||||
}
|
||||
if (version === "2021-12" || version === "2022-03" && !state.availableHelper("applyDecs2203R")) {
|
||||
lhs = _core.types.arrayPattern([...elementLocals, ...classLocals]);
|
||||
rhs = _core.types.callExpression(state.addHelper(version === "2021-12" ? "applyDecs" : "applyDecs2203"), args);
|
||||
return _core.types.assignmentExpression("=", lhs, rhs);
|
||||
} else if (version === "2022-03") {
|
||||
rhs = _core.types.callExpression(state.addHelper("applyDecs2203R"), args);
|
||||
} else if (version === "2023-01") {
|
||||
if (maybePrivateBrandName) {
|
||||
args.push(createPrivateBrandCheckClosure(maybePrivateBrandName));
|
||||
}
|
||||
rhs = _core.types.callExpression(state.addHelper("applyDecs2301"), args);
|
||||
} else if (version === "2023-05") {
|
||||
if (maybePrivateBrandName || superClass || classDecorationsFlag.value !== 0) {
|
||||
args.push(classDecorationsFlag);
|
||||
}
|
||||
if (maybePrivateBrandName) {
|
||||
args.push(createPrivateBrandCheckClosure(maybePrivateBrandName));
|
||||
} else if (superClass) {
|
||||
args.push(_core.types.unaryExpression("void", _core.types.numericLiteral(0)));
|
||||
}
|
||||
if (superClass) args.push(superClass);
|
||||
rhs = _core.types.callExpression(state.addHelper("applyDecs2305"), args);
|
||||
rhs = _core.types.callExpression(state.addHelper("applyDecs2301"), args);
|
||||
} else if (version === "2023-05") {
|
||||
if (maybePrivateBrandName || superClass || classDecorationsFlag.value !== 0) {
|
||||
args.push(classDecorationsFlag);
|
||||
}
|
||||
if (maybePrivateBrandName) {
|
||||
args.push(createPrivateBrandCheckClosure(maybePrivateBrandName));
|
||||
} else if (superClass) {
|
||||
args.push(_core.types.unaryExpression("void", _core.types.numericLiteral(0)));
|
||||
}
|
||||
if (superClass) args.push(superClass);
|
||||
rhs = _core.types.callExpression(state.addHelper("applyDecs2305"), args);
|
||||
}
|
||||
if (version === "2023-11") {
|
||||
if (maybePrivateBrandName || superClass || classDecorationsFlag.value !== 0) {
|
||||
@@ -1253,14 +1247,12 @@ function _default({
|
||||
loose
|
||||
}, version, inherits) {
|
||||
var _assumption, _assumption2;
|
||||
{
|
||||
if (version === "2023-11" || version === "2023-05" || version === "2023-01") {
|
||||
assertVersion("^7.21.0");
|
||||
} else if (version === "2021-12") {
|
||||
assertVersion("^7.16.0");
|
||||
} else {
|
||||
assertVersion("^7.19.0");
|
||||
}
|
||||
if (version === "2023-11" || version === "2023-05" || version === "2023-01") {
|
||||
assertVersion("^7.21.0");
|
||||
} else if (version === "2021-12") {
|
||||
assertVersion("^7.16.0");
|
||||
} else {
|
||||
assertVersion("^7.19.0");
|
||||
}
|
||||
const VISITED = new WeakSet();
|
||||
const constantSuper = (_assumption = assumption("constantSuper")) != null ? _assumption : loose;
|
||||
@@ -1289,11 +1281,9 @@ function _default({
|
||||
declaration
|
||||
} = path.node;
|
||||
if ((declaration == null ? void 0 : declaration.type) === "ClassDeclaration" && isDecorated(declaration)) {
|
||||
var _path$splitExportDecl;
|
||||
const isAnonymous = !declaration.id;
|
||||
{
|
||||
var _path$splitExportDecl;
|
||||
(_path$splitExportDecl = path.splitExportDeclaration) != null ? _path$splitExportDecl : path.splitExportDeclaration = require("@babel/traverse").NodePath.prototype.splitExportDeclaration;
|
||||
}
|
||||
(_path$splitExportDecl = path.splitExportDeclaration) != null ? _path$splitExportDecl : path.splitExportDeclaration = require("@babel/traverse").NodePath.prototype.splitExportDeclaration;
|
||||
const updatedVarDeclarationPath = path.splitExportDeclaration();
|
||||
if (isAnonymous) {
|
||||
visitClass(updatedVarDeclarationPath, state, _core.types.stringLiteral("default"));
|
||||
@@ -1305,10 +1295,8 @@ function _default({
|
||||
declaration
|
||||
} = path.node;
|
||||
if ((declaration == null ? void 0 : declaration.type) === "ClassDeclaration" && isDecorated(declaration)) {
|
||||
{
|
||||
var _path$splitExportDecl2;
|
||||
(_path$splitExportDecl2 = path.splitExportDeclaration) != null ? _path$splitExportDecl2 : path.splitExportDeclaration = require("@babel/traverse").NodePath.prototype.splitExportDeclaration;
|
||||
}
|
||||
var _path$splitExportDecl2;
|
||||
(_path$splitExportDecl2 = path.splitExportDeclaration) != null ? _path$splitExportDecl2 : path.splitExportDeclaration = require("@babel/traverse").NodePath.prototype.splitExportDeclaration;
|
||||
path.splitExportDeclaration();
|
||||
}
|
||||
},
|
||||
|
||||
2
node_modules/@babel/helper-create-class-features-plugin/lib/decorators.js.map
generated
vendored
2
node_modules/@babel/helper-create-class-features-plugin/lib/decorators.js.map
generated
vendored
File diff suppressed because one or more lines are too long
24
node_modules/@babel/helper-create-class-features-plugin/lib/features.js
generated
vendored
24
node_modules/@babel/helper-create-class-features-plugin/lib/features.js
generated
vendored
@@ -18,14 +18,10 @@ const FEATURES = exports.FEATURES = Object.freeze({
|
||||
const featuresSameLoose = new Map([[FEATURES.fields, "@babel/plugin-transform-class-properties"], [FEATURES.privateMethods, "@babel/plugin-transform-private-methods"], [FEATURES.privateIn, "@babel/plugin-transform-private-property-in-object"]]);
|
||||
const featuresKey = "@babel/plugin-class-features/featuresKey";
|
||||
const looseKey = "@babel/plugin-class-features/looseKey";
|
||||
{
|
||||
var looseLowPriorityKey = "@babel/plugin-class-features/looseLowPriorityKey/#__internal__@babel/preset-env__please-overwrite-loose-instead-of-throwing";
|
||||
}
|
||||
{
|
||||
var canIgnoreLoose = function (file, feature) {
|
||||
return !!(file.get(looseLowPriorityKey) & feature);
|
||||
};
|
||||
}
|
||||
var looseLowPriorityKey = "@babel/plugin-class-features/looseLowPriorityKey/#__internal__@babel/preset-env__please-overwrite-loose-instead-of-throwing";
|
||||
var canIgnoreLoose = function (file, feature) {
|
||||
return !!(file.get(looseLowPriorityKey) & feature);
|
||||
};
|
||||
function enableFeature(file, feature, loose) {
|
||||
if (!hasFeature(file, feature) || canIgnoreLoose(file, feature)) {
|
||||
file.set(featuresKey, file.get(featuresKey) | feature);
|
||||
@@ -42,17 +38,13 @@ function enableFeature(file, feature, loose) {
|
||||
let resolvedLoose;
|
||||
for (const [mask, name] of featuresSameLoose) {
|
||||
if (!hasFeature(file, mask)) continue;
|
||||
{
|
||||
if (canIgnoreLoose(file, mask)) continue;
|
||||
}
|
||||
if (canIgnoreLoose(file, mask)) continue;
|
||||
const loose = isLoose(file, mask);
|
||||
if (resolvedLoose === !loose) {
|
||||
throw new Error("'loose' mode configuration must be the same for @babel/plugin-transform-class-properties, " + "@babel/plugin-transform-private-methods and " + "@babel/plugin-transform-private-property-in-object (when they are enabled)." + "\n\n" + getBabelShowConfigForHint(file));
|
||||
} else {
|
||||
resolvedLoose = loose;
|
||||
{
|
||||
var higherPriorityPluginName = name;
|
||||
}
|
||||
var higherPriorityPluginName = name;
|
||||
}
|
||||
}
|
||||
if (resolvedLoose !== undefined) {
|
||||
@@ -87,9 +79,7 @@ function isLoose(file, feature) {
|
||||
}
|
||||
function setLoose(file, feature, loose) {
|
||||
if (loose) file.set(looseKey, file.get(looseKey) | feature);else file.set(looseKey, file.get(looseKey) & ~feature);
|
||||
{
|
||||
file.set(looseLowPriorityKey, file.get(looseLowPriorityKey) & ~feature);
|
||||
}
|
||||
file.set(looseLowPriorityKey, file.get(looseLowPriorityKey) & ~feature);
|
||||
}
|
||||
function shouldTransform(path, file) {
|
||||
let decoratorPath = null;
|
||||
|
||||
2
node_modules/@babel/helper-create-class-features-plugin/lib/features.js.map
generated
vendored
2
node_modules/@babel/helper-create-class-features-plugin/lib/features.js.map
generated
vendored
File diff suppressed because one or more lines are too long
67
node_modules/@babel/helper-create-class-features-plugin/lib/fields.js
generated
vendored
67
node_modules/@babel/helper-create-class-features-plugin/lib/fields.js
generated
vendored
@@ -17,12 +17,9 @@ var _helperOptimiseCallExpression = require("@babel/helper-optimise-call-express
|
||||
var _helperAnnotateAsPure = require("@babel/helper-annotate-as-pure");
|
||||
var _helperSkipTransparentExpressionWrappers = require("@babel/helper-skip-transparent-expression-wrappers");
|
||||
var ts = require("./typescript.js");
|
||||
{
|
||||
var newHelpers = file => {
|
||||
;
|
||||
return file.availableHelper("classPrivateFieldGet2");
|
||||
};
|
||||
}
|
||||
var newHelpers = file => {
|
||||
return file.availableHelper("classPrivateFieldGet2");
|
||||
};
|
||||
function buildPrivateNamesMap(className, privateFieldsAsSymbolsOrProperties, props, file) {
|
||||
const privateNamesMap = new Map();
|
||||
let classBrandId;
|
||||
@@ -556,15 +553,13 @@ function buildPrivateInstanceFieldInitSpec(ref, prop, privateNamesMap, state) {
|
||||
id
|
||||
} = privateNamesMap.get(prop.node.key.id.name);
|
||||
const value = prop.node.value || prop.scope.buildUndefinedNode();
|
||||
{
|
||||
if (!state.availableHelper("classPrivateFieldInitSpec")) {
|
||||
return inheritPropComments(_core.template.statement.ast`${_core.types.cloneNode(id)}.set(${ref}, {
|
||||
if (!state.availableHelper("classPrivateFieldInitSpec")) {
|
||||
return inheritPropComments(_core.template.statement.ast`${_core.types.cloneNode(id)}.set(${ref}, {
|
||||
// configurable is always false for private elements
|
||||
// enumerable is always false for private elements
|
||||
writable: true,
|
||||
value: ${value},
|
||||
})`, prop);
|
||||
}
|
||||
}
|
||||
const helper = state.addHelper("classPrivateFieldInitSpec");
|
||||
return inheritLoc(inheritPropComments(_core.types.expressionStatement(_core.types.callExpression(helper, [_core.types.thisExpression(), inheritLoc(_core.types.cloneNode(id), prop.node.key), newHelpers(state) ? value : _core.template.expression.ast`{ writable: true, value: ${value} }`])), prop), prop.node);
|
||||
@@ -576,22 +571,21 @@ function buildPrivateStaticFieldInitSpec(prop, privateNamesMap, noUninitializedP
|
||||
}`;
|
||||
return inheritPropComments(_core.types.variableDeclaration("var", [_core.types.variableDeclarator(_core.types.cloneNode(privateName.id), value)]), prop);
|
||||
}
|
||||
{
|
||||
var buildPrivateStaticFieldInitSpecOld = function (prop, privateNamesMap) {
|
||||
const privateName = privateNamesMap.get(prop.node.key.id.name);
|
||||
const {
|
||||
id,
|
||||
getId,
|
||||
setId,
|
||||
initAdded
|
||||
} = privateName;
|
||||
const isGetterOrSetter = getId || setId;
|
||||
if (!prop.isProperty() && (initAdded || !isGetterOrSetter)) return;
|
||||
if (isGetterOrSetter) {
|
||||
privateNamesMap.set(prop.node.key.id.name, Object.assign({}, privateName, {
|
||||
initAdded: true
|
||||
}));
|
||||
return inheritPropComments(_core.template.statement.ast`
|
||||
var buildPrivateStaticFieldInitSpecOld = function (prop, privateNamesMap) {
|
||||
const privateName = privateNamesMap.get(prop.node.key.id.name);
|
||||
const {
|
||||
id,
|
||||
getId,
|
||||
setId,
|
||||
initAdded
|
||||
} = privateName;
|
||||
const isGetterOrSetter = getId || setId;
|
||||
if (!prop.isProperty() && (initAdded || !isGetterOrSetter)) return;
|
||||
if (isGetterOrSetter) {
|
||||
privateNamesMap.set(prop.node.key.id.name, Object.assign({}, privateName, {
|
||||
initAdded: true
|
||||
}));
|
||||
return inheritPropComments(_core.template.statement.ast`
|
||||
var ${_core.types.cloneNode(id)} = {
|
||||
// configurable is false by default
|
||||
// enumerable is false by default
|
||||
@@ -600,9 +594,9 @@ function buildPrivateStaticFieldInitSpec(prop, privateNamesMap, noUninitializedP
|
||||
set: ${setId ? setId.name : prop.scope.buildUndefinedNode()}
|
||||
}
|
||||
`, prop);
|
||||
}
|
||||
const value = prop.node.value || prop.scope.buildUndefinedNode();
|
||||
return inheritPropComments(_core.template.statement.ast`
|
||||
}
|
||||
const value = prop.node.value || prop.scope.buildUndefinedNode();
|
||||
return inheritPropComments(_core.template.statement.ast`
|
||||
var ${_core.types.cloneNode(id)} = {
|
||||
// configurable is false by default
|
||||
// enumerable is false by default
|
||||
@@ -610,8 +604,7 @@ function buildPrivateStaticFieldInitSpec(prop, privateNamesMap, noUninitializedP
|
||||
value: ${value}
|
||||
};
|
||||
`, prop);
|
||||
};
|
||||
}
|
||||
};
|
||||
function buildPrivateMethodInitLoose(ref, prop, privateNamesMap) {
|
||||
const privateName = privateNamesMap.get(prop.node.key.id.name);
|
||||
const {
|
||||
@@ -669,15 +662,13 @@ function buildPrivateAccessorInitialization(ref, prop, privateNamesMap, state) {
|
||||
privateNamesMap.set(prop.node.key.id.name, Object.assign({}, privateName, {
|
||||
initAdded: true
|
||||
}));
|
||||
{
|
||||
if (!state.availableHelper("classPrivateFieldInitSpec")) {
|
||||
return inheritPropComments(_core.template.statement.ast`
|
||||
if (!state.availableHelper("classPrivateFieldInitSpec")) {
|
||||
return inheritPropComments(_core.template.statement.ast`
|
||||
${id}.set(${ref}, {
|
||||
get: ${getId ? getId.name : prop.scope.buildUndefinedNode()},
|
||||
set: ${setId ? setId.name : prop.scope.buildUndefinedNode()}
|
||||
});
|
||||
`, prop);
|
||||
}
|
||||
}
|
||||
const helper = state.addHelper("classPrivateFieldInitSpec");
|
||||
return inheritLoc(inheritPropComments(_core.template.statement.ast`${helper}(
|
||||
@@ -694,10 +685,8 @@ function buildPrivateInstanceMethodInitialization(ref, prop, privateNamesMap, st
|
||||
const {
|
||||
id
|
||||
} = privateName;
|
||||
{
|
||||
if (!state.availableHelper("classPrivateMethodInitSpec")) {
|
||||
return inheritPropComments(_core.template.statement.ast`${id}.add(${ref})`, prop);
|
||||
}
|
||||
if (!state.availableHelper("classPrivateMethodInitSpec")) {
|
||||
return inheritPropComments(_core.template.statement.ast`${id}.add(${ref})`, prop);
|
||||
}
|
||||
const helper = state.addHelper("classPrivateMethodInitSpec");
|
||||
return inheritPropComments(_core.template.statement.ast`${helper}(
|
||||
|
||||
2
node_modules/@babel/helper-create-class-features-plugin/lib/fields.js.map
generated
vendored
2
node_modules/@babel/helper-create-class-features-plugin/lib/fields.js.map
generated
vendored
File diff suppressed because one or more lines are too long
102
node_modules/@babel/helper-create-class-features-plugin/lib/index.js
generated
vendored
102
node_modules/@babel/helper-create-class-features-plugin/lib/index.js
generated
vendored
@@ -54,19 +54,15 @@ function createClassFeaturePlugin({
|
||||
}) {
|
||||
var _api$assumption;
|
||||
if (feature & _features.FEATURES.decorators) {
|
||||
{
|
||||
if (decoratorVersion === "2023-11" || decoratorVersion === "2023-05" || decoratorVersion === "2023-01" || decoratorVersion === "2022-03" || decoratorVersion === "2021-12") {
|
||||
return (0, _decorators.default)(api, {
|
||||
loose
|
||||
}, decoratorVersion, inherits);
|
||||
}
|
||||
if (decoratorVersion === "2023-11" || decoratorVersion === "2023-05" || decoratorVersion === "2023-01" || decoratorVersion === "2022-03" || decoratorVersion === "2021-12") {
|
||||
return (0, _decorators.default)(api, {
|
||||
loose
|
||||
}, decoratorVersion, inherits);
|
||||
}
|
||||
}
|
||||
{
|
||||
api != null ? api : api = {
|
||||
assumption: () => void 0
|
||||
};
|
||||
}
|
||||
api != null ? api : api = {
|
||||
assumption: () => void 0
|
||||
};
|
||||
const setPublicClassFields = api.assumption("setPublicClassFields");
|
||||
const privateFieldsAsSymbols = api.assumption("privateFieldsAsSymbols");
|
||||
const privateFieldsAsProperties = api.assumption("privateFieldsAsProperties");
|
||||
@@ -98,21 +94,19 @@ function createClassFeaturePlugin({
|
||||
inherits,
|
||||
pre(file) {
|
||||
(0, _features.enableFeature)(file, feature, loose);
|
||||
{
|
||||
if (typeof file.get(versionKey) === "number") {
|
||||
file.set(versionKey, "7.28.5");
|
||||
return;
|
||||
}
|
||||
if (typeof file.get(versionKey) === "number") {
|
||||
file.set(versionKey, "7.28.6");
|
||||
return;
|
||||
}
|
||||
if (!file.get(versionKey) || _semver.lt(file.get(versionKey), "7.28.5")) {
|
||||
file.set(versionKey, "7.28.5");
|
||||
if (!file.get(versionKey) || _semver.lt(file.get(versionKey), "7.28.6")) {
|
||||
file.set(versionKey, "7.28.6");
|
||||
}
|
||||
},
|
||||
visitor: {
|
||||
Class(path, {
|
||||
file
|
||||
}) {
|
||||
if (file.get(versionKey) !== "7.28.5") return;
|
||||
if (file.get(versionKey) !== "7.28.6") return;
|
||||
if (!(0, _features.shouldTransform)(path, file)) return;
|
||||
const pathIsClassDeclaration = path.isClassDeclaration();
|
||||
if (pathIsClassDeclaration) (0, _typescript.assertFieldTransformed)(path);
|
||||
@@ -164,16 +158,12 @@ function createClassFeaturePlugin({
|
||||
}
|
||||
}
|
||||
}
|
||||
{
|
||||
if (!props.length && !isDecorated) return;
|
||||
}
|
||||
if (!props.length && !isDecorated) return;
|
||||
const innerBinding = path.node.id;
|
||||
let ref;
|
||||
if (!innerBinding || !pathIsClassDeclaration) {
|
||||
{
|
||||
var _path$ensureFunctionN;
|
||||
(_path$ensureFunctionN = path.ensureFunctionName) != null ? _path$ensureFunctionN : path.ensureFunctionName = require("@babel/traverse").NodePath.prototype.ensureFunctionName;
|
||||
}
|
||||
var _path$ensureFunctionN;
|
||||
(_path$ensureFunctionN = path.ensureFunctionName) != null ? _path$ensureFunctionN : path.ensureFunctionName = require("@babel/traverse").NodePath.prototype.ensureFunctionName;
|
||||
path.ensureFunctionName(false);
|
||||
ref = path.scope.generateUidIdentifier((innerBinding == null ? void 0 : innerBinding.name) || "Class");
|
||||
}
|
||||
@@ -187,30 +177,26 @@ function createClassFeaturePlugin({
|
||||
innerBinding
|
||||
}, file);
|
||||
let keysNodes, staticNodes, instanceNodes, lastInstanceNodeReturnsThis, pureStaticNodes, classBindingNode, wrapClass;
|
||||
{
|
||||
if (isDecorated) {
|
||||
staticNodes = pureStaticNodes = keysNodes = [];
|
||||
({
|
||||
instanceNodes,
|
||||
wrapClass
|
||||
} = (0, _decorators2.buildDecoratedClass)(classRefForDefine, path, elements, file));
|
||||
} else {
|
||||
keysNodes = (0, _misc.extractComputedKeys)(path, computedPaths, file);
|
||||
({
|
||||
staticNodes,
|
||||
pureStaticNodes,
|
||||
instanceNodes,
|
||||
lastInstanceNodeReturnsThis,
|
||||
classBindingNode,
|
||||
wrapClass
|
||||
} = (0, _fields.buildFieldsInitNodes)(ref, path.node.superClass, props, privateNamesMap, file, setPublicClassFields != null ? setPublicClassFields : loose, privateFieldsAsSymbolsOrProperties != null ? privateFieldsAsSymbolsOrProperties : loose, noUninitializedPrivateFieldAccess, constantSuper != null ? constantSuper : loose, innerBinding));
|
||||
}
|
||||
if (isDecorated) {
|
||||
staticNodes = pureStaticNodes = keysNodes = [];
|
||||
({
|
||||
instanceNodes,
|
||||
wrapClass
|
||||
} = (0, _decorators2.buildDecoratedClass)(classRefForDefine, path, elements, file));
|
||||
} else {
|
||||
keysNodes = (0, _misc.extractComputedKeys)(path, computedPaths, file);
|
||||
({
|
||||
staticNodes,
|
||||
pureStaticNodes,
|
||||
instanceNodes,
|
||||
lastInstanceNodeReturnsThis,
|
||||
classBindingNode,
|
||||
wrapClass
|
||||
} = (0, _fields.buildFieldsInitNodes)(ref, path.node.superClass, props, privateNamesMap, file, setPublicClassFields != null ? setPublicClassFields : loose, privateFieldsAsSymbolsOrProperties != null ? privateFieldsAsSymbolsOrProperties : loose, noUninitializedPrivateFieldAccess, constantSuper != null ? constantSuper : loose, innerBinding));
|
||||
}
|
||||
if (instanceNodes.length > 0) {
|
||||
(0, _misc.injectInitialization)(path, constructor, instanceNodes, (referenceVisitor, state) => {
|
||||
{
|
||||
if (isDecorated) return;
|
||||
}
|
||||
if (isDecorated) return;
|
||||
for (const prop of props) {
|
||||
if (_core.types.isStaticBlock != null && _core.types.isStaticBlock(prop.node) || prop.node.static) continue;
|
||||
prop.traverse(referenceVisitor, state);
|
||||
@@ -232,19 +218,15 @@ function createClassFeaturePlugin({
|
||||
ExportDefaultDeclaration(path, {
|
||||
file
|
||||
}) {
|
||||
{
|
||||
if (file.get(versionKey) !== "7.28.5") return;
|
||||
const decl = path.get("declaration");
|
||||
if (decl.isClassDeclaration() && (0, _decorators.hasDecorators)(decl.node)) {
|
||||
if (decl.node.id) {
|
||||
{
|
||||
var _path$splitExportDecl;
|
||||
(_path$splitExportDecl = path.splitExportDeclaration) != null ? _path$splitExportDecl : path.splitExportDeclaration = require("@babel/traverse").NodePath.prototype.splitExportDeclaration;
|
||||
}
|
||||
path.splitExportDeclaration();
|
||||
} else {
|
||||
decl.node.type = "ClassExpression";
|
||||
}
|
||||
if (file.get(versionKey) !== "7.28.6") return;
|
||||
const decl = path.get("declaration");
|
||||
if (decl.isClassDeclaration() && (0, _decorators.hasDecorators)(decl.node)) {
|
||||
if (decl.node.id) {
|
||||
var _path$splitExportDecl;
|
||||
(_path$splitExportDecl = path.splitExportDeclaration) != null ? _path$splitExportDecl : path.splitExportDeclaration = require("@babel/traverse").NodePath.prototype.splitExportDeclaration;
|
||||
path.splitExportDeclaration();
|
||||
} else {
|
||||
decl.node.type = "ClassExpression";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
2
node_modules/@babel/helper-create-class-features-plugin/lib/index.js.map
generated
vendored
2
node_modules/@babel/helper-create-class-features-plugin/lib/index.js.map
generated
vendored
File diff suppressed because one or more lines are too long
10
node_modules/@babel/helper-create-class-features-plugin/package.json
generated
vendored
10
node_modules/@babel/helper-create-class-features-plugin/package.json
generated
vendored
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@babel/helper-create-class-features-plugin",
|
||||
"version": "7.28.5",
|
||||
"version": "7.28.6",
|
||||
"author": "The Babel Team (https://babel.dev/team)",
|
||||
"license": "MIT",
|
||||
"description": "Compile class public and private fields, private methods and decorators to ES6",
|
||||
@@ -21,18 +21,18 @@
|
||||
"@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.27.1",
|
||||
"@babel/helper-replace-supers": "^7.28.6",
|
||||
"@babel/helper-skip-transparent-expression-wrappers": "^7.27.1",
|
||||
"@babel/traverse": "^7.28.5",
|
||||
"@babel/traverse": "^7.28.6",
|
||||
"semver": "^6.3.1"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@babel/core": "^7.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.28.5",
|
||||
"@babel/core": "^7.28.6",
|
||||
"@babel/helper-plugin-test-runner": "^7.27.1",
|
||||
"@babel/preset-env": "^7.28.5",
|
||||
"@babel/preset-env": "^7.28.6",
|
||||
"@types/charcodes": "^0.2.0",
|
||||
"charcodes": "^0.2.0"
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user