-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
87ec4fc
commit 4d53402
Showing
7 changed files
with
194 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
...ages/babel-plugin-proposal-decorators/test/fixtures/2023-11-misc--to-es2015/super/exec.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
function decorate() { | ||
return function (target, context) {} | ||
} | ||
|
||
class Test { | ||
@decorate() | ||
accessor foo = 42; | ||
|
||
constructor() { | ||
} | ||
} | ||
|
||
new Test() | ||
|
||
class TestChild extends Test { | ||
@decorate() | ||
accessor bar = 1; | ||
|
||
constructor() { | ||
super(); | ||
} | ||
} | ||
|
||
const r = new TestChild(); |
25 changes: 25 additions & 0 deletions
25
...ges/babel-plugin-proposal-decorators/test/fixtures/2023-11-misc--to-es2015/super/input.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
function decorate() { | ||
return function (target, context) {} | ||
} | ||
|
||
class Test { | ||
@decorate() | ||
accessor foo = 42; | ||
|
||
constructor() { | ||
console.log('hello'); | ||
} | ||
} | ||
|
||
new Test() | ||
|
||
class TestChild extends Test { | ||
@decorate() | ||
accessor bar = 1; | ||
|
||
constructor() { | ||
super(); | ||
} | ||
} | ||
|
||
const r = new TestChild(); |
37 changes: 37 additions & 0 deletions
37
...es/babel-plugin-proposal-decorators/test/fixtures/2023-11-misc--to-es2015/super/output.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
let _init_foo, _init_extra_foo, _init_bar, _init_extra_bar; | ||
function decorate() { | ||
return function (target, context) {}; | ||
} | ||
class Test { | ||
static { | ||
[_init_foo, _init_extra_foo] = babelHelpers.applyDecs2311(this, [], [[decorate(), 1, "foo"]]).e; | ||
} | ||
#A = _init_foo(this, 42); | ||
get foo() { | ||
return this.#A; | ||
} | ||
set foo(v) { | ||
this.#A = v; | ||
} | ||
constructor() { | ||
_init_extra_foo(this); | ||
console.log('hello'); | ||
} | ||
} | ||
new Test(); | ||
class TestChild extends Test { | ||
static { | ||
[_init_bar, _init_extra_bar] = babelHelpers.applyDecs2311(this, [], [[decorate(), 1, "bar"]], 0, void 0, Test).e; | ||
} | ||
#A = _init_bar(this, 1); | ||
get bar() { | ||
return this.#A; | ||
} | ||
set bar(v) { | ||
this.#A = v; | ||
} | ||
constructor() { | ||
super(), _init_extra_bar(this); | ||
} | ||
} | ||
const r = new TestChild(); |
24 changes: 24 additions & 0 deletions
24
packages/babel-plugin-proposal-decorators/test/fixtures/2023-11-misc/super/exec.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
function decorate() { | ||
return function (target, context) {} | ||
} | ||
|
||
class Test { | ||
@decorate() | ||
accessor foo = 42; | ||
|
||
constructor() { | ||
} | ||
} | ||
|
||
new Test() | ||
|
||
class TestChild extends Test { | ||
@decorate() | ||
accessor bar = 1; | ||
|
||
constructor() { | ||
super(); | ||
} | ||
} | ||
|
||
const r = new TestChild(); |
25 changes: 25 additions & 0 deletions
25
packages/babel-plugin-proposal-decorators/test/fixtures/2023-11-misc/super/input.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
function decorate() { | ||
return function (target, context) {} | ||
} | ||
|
||
class Test { | ||
@decorate() | ||
accessor foo = 42; | ||
|
||
constructor() { | ||
console.log('hello'); | ||
} | ||
} | ||
|
||
new Test() | ||
|
||
class TestChild extends Test { | ||
@decorate() | ||
accessor bar = 1; | ||
|
||
constructor() { | ||
super(); | ||
} | ||
} | ||
|
||
const r = new TestChild(); |
37 changes: 37 additions & 0 deletions
37
packages/babel-plugin-proposal-decorators/test/fixtures/2023-11-misc/super/output.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
let _init_foo, _init_extra_foo, _init_bar, _init_extra_bar; | ||
function decorate() { | ||
return function (target, context) {}; | ||
} | ||
class Test { | ||
static { | ||
[_init_foo, _init_extra_foo] = babelHelpers.applyDecs2311(this, [], [[decorate(), 1, "foo"]]).e; | ||
} | ||
#A = _init_foo(this, 42); | ||
get foo() { | ||
return this.#A; | ||
} | ||
set foo(v) { | ||
this.#A = v; | ||
} | ||
constructor() { | ||
_init_extra_foo(this); | ||
console.log('hello'); | ||
} | ||
} | ||
new Test(); | ||
class TestChild extends Test { | ||
static { | ||
[_init_bar, _init_extra_bar] = babelHelpers.applyDecs2311(this, [], [[decorate(), 1, "bar"]], 0, void 0, Test).e; | ||
} | ||
#A = _init_bar(this, 1); | ||
get bar() { | ||
return this.#A; | ||
} | ||
set bar(v) { | ||
this.#A = v; | ||
} | ||
constructor() { | ||
super(), _init_extra_bar(this); | ||
} | ||
} | ||
const r = new TestChild(); |