Skip to content

Commit 611f5c8

Browse files
Add missing semicolons in 2021-12 decorators output (#14398)
1 parent 29dff68 commit 611f5c8

38 files changed

Lines changed: 62 additions & 62 deletions

File tree

packages/babel-plugin-proposal-decorators/src/transformer-2021-12.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -991,7 +991,7 @@ function transformClass(
991991

992992
// When path is a ClassExpression, path.insertBefore will convert `path`
993993
// into a SequenceExpression
994-
path.insertBefore(assignments);
994+
path.insertBefore(assignments.map(expr => t.expressionStatement(expr)));
995995

996996
// Recrawl the scope to make sure new identifiers are properly synced
997997
path.scope.crawl();

packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-accessors--to-es2015/public/output.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ var _init_a, _init_b, _computedKey, _init_computedKey, _initProto;
22

33
const dec = () => {};
44

5-
_computedKey = 'c'
5+
_computedKey = 'c';
66

77
var _A = /*#__PURE__*/new WeakMap();
88

packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-accessors--to-es2015/static-public/output.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ var _init_a, _init_b, _computedKey, _init_computedKey, _initStatic;
22

33
const dec = () => {};
44

5-
_computedKey = 'c'
5+
_computedKey = 'c';
66

77
class Foo {
88
static get a() {

packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-accessors/public/output.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ var _init_a, _init_b, _computedKey, _init_computedKey, _initProto;
22

33
const dec = () => {};
44

5-
_computedKey = 'c'
5+
_computedKey = 'c';
66

77
class Foo {
88
static {

packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-accessors/static-public/output.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ var _init_a, _init_b, _computedKey, _init_computedKey, _initStatic;
22

33
const dec = () => {};
44

5-
_computedKey = 'c'
5+
_computedKey = 'c';
66

77
class Foo {
88
static {

packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-classes/inheritance/output.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ const dec = () => {};
44

55
let _Bar;
66

7-
_dec = dec1
7+
_dec = dec1;
88

99
class Bar {
1010
static {
@@ -18,7 +18,7 @@ class Bar {
1818

1919
let _Foo;
2020

21-
_dec2 = dec2
21+
_dec2 = dec2;
2222

2323
class Foo extends _Bar {
2424
static {

packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-duplicated-keys--to-es2015/computed-keys-same-ast/output.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ var _computedKey, _computedKey2, _initProto;
22

33
const dec = () => {};
44

5-
_computedKey = getKey()
6-
_computedKey2 = getKey()
5+
_computedKey = getKey();
6+
_computedKey2 = getKey();
77

88
class Foo {
99
constructor(...args) {

packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-duplicated-keys--to-es2015/computed-keys-same-value/output.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ var _computedKey, _computedKey2, _initProto;
22

33
const dec = () => {};
44

5-
_computedKey = getKeyI()
6-
_computedKey2 = getKeyJ()
5+
_computedKey = getKeyI();
6+
_computedKey2 = getKeyJ();
77

88
class Foo {
99
constructor(...args) {

packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-duplicated-keys/computed-keys-same-ast/output.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ var _computedKey, _computedKey2, _initProto;
22

33
const dec = () => {};
44

5-
_computedKey = getKey()
6-
_computedKey2 = getKey()
5+
_computedKey = getKey();
6+
_computedKey2 = getKey();
77

88
class Foo {
99
static {

packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-duplicated-keys/computed-keys-same-value/output.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ var _computedKey, _computedKey2, _initProto;
22

33
const dec = () => {};
44

5-
_computedKey = getKeyI()
6-
_computedKey2 = getKeyJ()
5+
_computedKey = getKeyI();
6+
_computedKey2 = getKeyJ();
77

88
class Foo {
99
static {

0 commit comments

Comments
 (0)