-
-
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
4b05c2c
commit f182cbd
Showing
12 changed files
with
188 additions
and
172 deletions.
There are no files selected for viewing
30 changes: 30 additions & 0 deletions
30
...tors/test/fixtures/2023-11-misc--to-es2015/initField-existing-derived-constructor/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,30 @@ | ||
{ | ||
let self, a, initCalled; | ||
|
||
function deco(_, context) { | ||
context.addInitializer(() => { | ||
initCalled = true; | ||
}); | ||
} | ||
|
||
class B { | ||
constructor(s) { | ||
a = s; | ||
} | ||
} | ||
|
||
class A extends B { | ||
constructor() { | ||
let a = 2; | ||
self = super(a); | ||
} | ||
|
||
@deco | ||
accessor foo = 42; | ||
} | ||
|
||
let instance = new A(); | ||
expect(self).toBe(instance); | ||
expect(a).toBe(2); | ||
expect(initCalled).toBe(true); | ||
} |
30 changes: 30 additions & 0 deletions
30
...ors/test/fixtures/2023-11-misc--to-es2015/initField-existing-derived-constructor/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,30 @@ | ||
{ | ||
let self, a, initCalled; | ||
|
||
function deco(_, context) { | ||
context.addInitializer(() => { | ||
initCalled = true; | ||
}); | ||
} | ||
|
||
class B { | ||
constructor(s) { | ||
a = s; | ||
} | ||
} | ||
|
||
class A extends B { | ||
constructor() { | ||
let a = 2; | ||
self = super(a); | ||
} | ||
|
||
@deco | ||
accessor foo = 42; | ||
} | ||
|
||
let instance = new A(); | ||
expect(self).toBe(instance); | ||
expect(a).toBe(2); | ||
expect(initCalled).toBe(true); | ||
} |
34 changes: 34 additions & 0 deletions
34
...rs/test/fixtures/2023-11-misc--to-es2015/initField-existing-derived-constructor/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,34 @@ | ||
{ | ||
var _A2; | ||
let _init_foo, _init_extra_foo; | ||
let self, a, initCalled; | ||
function deco(_, context) { | ||
context.addInitializer(() => { | ||
initCalled = true; | ||
}); | ||
} | ||
class B { | ||
constructor(s) { | ||
a = s; | ||
} | ||
} | ||
var _A = /*#__PURE__*/new WeakMap(); | ||
class A extends B { | ||
constructor() { | ||
let a = 2; | ||
self = ((super(a), babelHelpers.classPrivateFieldInitSpec(this, _A, _init_foo(this, 42)), this), _init_extra_foo(this)); | ||
} | ||
get foo() { | ||
return babelHelpers.classPrivateFieldGet2(_A, this); | ||
} | ||
set foo(v) { | ||
babelHelpers.classPrivateFieldSet2(_A, this, v); | ||
} | ||
} | ||
_A2 = A; | ||
[_init_foo, _init_extra_foo] = babelHelpers.applyDecs2311(_A2, [], [[deco, 1, "foo"]], 0, void 0, B).e; | ||
let instance = new A(); | ||
expect(self).toBe(instance); | ||
expect(a).toBe(2); | ||
expect(initCalled).toBe(true); | ||
} |
24 changes: 0 additions & 24 deletions
24
...ages/babel-plugin-proposal-decorators/test/fixtures/2023-11-misc--to-es2015/super/exec.js
This file was deleted.
Oops, something went wrong.
25 changes: 0 additions & 25 deletions
25
...ges/babel-plugin-proposal-decorators/test/fixtures/2023-11-misc--to-es2015/super/input.js
This file was deleted.
Oops, something went wrong.
37 changes: 0 additions & 37 deletions
37
...es/babel-plugin-proposal-decorators/test/fixtures/2023-11-misc--to-es2015/super/output.js
This file was deleted.
Oops, something went wrong.
30 changes: 30 additions & 0 deletions
30
...osal-decorators/test/fixtures/2023-11-misc/initField-existing-derived-constructor/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,30 @@ | ||
{ | ||
let self, a, initCalled; | ||
|
||
function deco(_, context) { | ||
context.addInitializer(() => { | ||
initCalled = true; | ||
}); | ||
} | ||
|
||
class B { | ||
constructor(s) { | ||
a = s; | ||
} | ||
} | ||
|
||
class A extends B { | ||
constructor() { | ||
let a = 2; | ||
self = super(a); | ||
} | ||
|
||
@deco | ||
accessor foo = 42; | ||
} | ||
|
||
let instance = new A(); | ||
expect(self).toBe(instance); | ||
expect(a).toBe(2); | ||
expect(initCalled).toBe(true); | ||
} |
30 changes: 30 additions & 0 deletions
30
...sal-decorators/test/fixtures/2023-11-misc/initField-existing-derived-constructor/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,30 @@ | ||
{ | ||
let self, a, initCalled; | ||
|
||
function deco(_, context) { | ||
context.addInitializer(() => { | ||
initCalled = true; | ||
}); | ||
} | ||
|
||
class B { | ||
constructor(s) { | ||
a = s; | ||
} | ||
} | ||
|
||
class A extends B { | ||
constructor() { | ||
let a = 2; | ||
self = super(a); | ||
} | ||
|
||
@deco | ||
accessor foo = 42; | ||
} | ||
|
||
let instance = new A(); | ||
expect(self).toBe(instance); | ||
expect(a).toBe(2); | ||
expect(initCalled).toBe(true); | ||
} |
34 changes: 34 additions & 0 deletions
34
...al-decorators/test/fixtures/2023-11-misc/initField-existing-derived-constructor/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,34 @@ | ||
{ | ||
let _init_foo, _init_extra_foo; | ||
let self, a, initCalled; | ||
function deco(_, context) { | ||
context.addInitializer(() => { | ||
initCalled = true; | ||
}); | ||
} | ||
class B { | ||
constructor(s) { | ||
a = s; | ||
} | ||
} | ||
class A extends B { | ||
static { | ||
[_init_foo, _init_extra_foo] = babelHelpers.applyDecs2311(this, [], [[deco, 1, "foo"]], 0, void 0, B).e; | ||
} | ||
constructor() { | ||
let a = 2; | ||
self = (super(a), _init_extra_foo(this)); | ||
} | ||
#A = _init_foo(this, 42); | ||
get foo() { | ||
return this.#A; | ||
} | ||
set foo(v) { | ||
this.#A = v; | ||
} | ||
} | ||
let instance = new A(); | ||
expect(self).toBe(instance); | ||
expect(a).toBe(2); | ||
expect(initCalled).toBe(true); | ||
} |
24 changes: 0 additions & 24 deletions
24
packages/babel-plugin-proposal-decorators/test/fixtures/2023-11-misc/super/exec.js
This file was deleted.
Oops, something went wrong.
25 changes: 0 additions & 25 deletions
25
packages/babel-plugin-proposal-decorators/test/fixtures/2023-11-misc/super/input.js
This file was deleted.
Oops, something went wrong.
37 changes: 0 additions & 37 deletions
37
packages/babel-plugin-proposal-decorators/test/fixtures/2023-11-misc/super/output.js
This file was deleted.
Oops, something went wrong.