@babel/plugin-proposal-decorators
Advanced tools
Comparing version 8.0.0-alpha.2 to 8.0.0-alpha.3
@@ -712,3 +712,13 @@ import { declare } from '@babel/helper-plugin-utils'; | ||
} | ||
originalClass.body.body.unshift(types.staticBlock([types.expressionStatement(createLocalsAssignment(elementLocals, classLocals, elementDecorations, types.arrayExpression(classDecorations), types.numericLiteral(classDecorationsFlag), needsInstancePrivateBrandCheck ? lastInstancePrivateName : null, state)), requiresStaticInit && types.expressionStatement(types.callExpression(types.cloneNode(staticInitLocal), [types.thisExpression()]))].filter(Boolean))); | ||
let { | ||
superClass | ||
} = originalClass; | ||
if (superClass) { | ||
const id = path.scope.maybeGenerateMemoised(superClass); | ||
if (id) { | ||
originalClass.superClass = types.assignmentExpression("=", id, superClass); | ||
superClass = id; | ||
} | ||
} | ||
originalClass.body.body.unshift(types.staticBlock([types.expressionStatement(createLocalsAssignment(elementLocals, classLocals, elementDecorations, types.arrayExpression(classDecorations), types.numericLiteral(classDecorationsFlag), needsInstancePrivateBrandCheck ? lastInstancePrivateName : null, types.cloneNode(superClass), state)), requiresStaticInit && types.expressionStatement(types.callExpression(types.cloneNode(staticInitLocal), [types.thisExpression()]))].filter(Boolean))); | ||
path.insertBefore(assignments.map(expr => types.expressionStatement(expr))); | ||
@@ -718,7 +728,7 @@ path.scope.crawl(); | ||
} | ||
function createLocalsAssignment(elementLocals, classLocals, elementDecorations, classDecorations, classDecorationsFlag, maybePrivateBranName, state, version) { | ||
function createLocalsAssignment(elementLocals, classLocals, elementDecorations, classDecorations, classDecorationsFlag, maybePrivateBranName, superClass, state, version) { | ||
let lhs, rhs; | ||
const args = [types.thisExpression(), elementDecorations, classDecorations]; | ||
{ | ||
if (maybePrivateBranName || classDecorationsFlag.value !== 0) { | ||
if (maybePrivateBranName || superClass || classDecorationsFlag.value !== 0) { | ||
args.push(classDecorationsFlag); | ||
@@ -730,3 +740,6 @@ } | ||
`); | ||
} else if (superClass) { | ||
args.push(types.unaryExpression("void", types.numericLiteral(0))); | ||
} | ||
if (superClass) args.push(superClass); | ||
rhs = types.callExpression(state.addHelper("applyDecs2305"), args); | ||
@@ -733,0 +746,0 @@ } |
{ | ||
"name": "@babel/plugin-proposal-decorators", | ||
"version": "8.0.0-alpha.2", | ||
"version": "8.0.0-alpha.3", | ||
"author": "The Babel Team (https://babel.dev/team)", | ||
@@ -23,15 +23,15 @@ "license": "MIT", | ||
"dependencies": { | ||
"@babel/helper-create-class-features-plugin": "^8.0.0-alpha.2", | ||
"@babel/helper-plugin-utils": "^8.0.0-alpha.2", | ||
"@babel/helper-replace-supers": "^8.0.0-alpha.2", | ||
"@babel/helper-split-export-declaration": "^8.0.0-alpha.2", | ||
"@babel/plugin-syntax-decorators": "^8.0.0-alpha.2" | ||
"@babel/helper-create-class-features-plugin": "^8.0.0-alpha.3", | ||
"@babel/helper-plugin-utils": "^8.0.0-alpha.3", | ||
"@babel/helper-replace-supers": "^8.0.0-alpha.3", | ||
"@babel/helper-split-export-declaration": "^8.0.0-alpha.3", | ||
"@babel/plugin-syntax-decorators": "^8.0.0-alpha.3" | ||
}, | ||
"peerDependencies": { | ||
"@babel/core": "^8.0.0-alpha.2" | ||
"@babel/core": "^8.0.0-alpha.3" | ||
}, | ||
"devDependencies": { | ||
"@babel/core": "^8.0.0-alpha.2", | ||
"@babel/helper-plugin-test-runner": "^8.0.0-alpha.2", | ||
"@babel/traverse": "^8.0.0-alpha.2", | ||
"@babel/core": "^8.0.0-alpha.3", | ||
"@babel/helper-plugin-test-runner": "^8.0.0-alpha.3", | ||
"@babel/traverse": "^8.0.0-alpha.3", | ||
"@types/charcodes": "^0.2.0", | ||
@@ -38,0 +38,0 @@ "array.prototype.concat": "^1.0.2", |
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
136380
5
812