-
-
Notifications
You must be signed in to change notification settings - Fork 484
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test(transformer/class-properties): add static super tagged expressio…
…n test
- Loading branch information
Showing
7 changed files
with
57 additions
and
3 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
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
13 changes: 13 additions & 0 deletions
13
...abel-plugin-transform-class-properties/test/fixtures/static-super-tagged-template/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,13 @@ | ||
import { expect } from "vitest"; | ||
|
||
class S { | ||
static method() { | ||
return this; | ||
} | ||
} | ||
|
||
class C extends S { | ||
static prop = super.method`xyz`; | ||
} | ||
|
||
expect(C.prop).toBe(C); |
6 changes: 6 additions & 0 deletions
6
...bel-plugin-transform-class-properties/test/fixtures/static-super-tagged-template/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,6 @@ | ||
class Outer { | ||
A = () => {}; | ||
static B = () => { | ||
super.A`oxc`; | ||
}; | ||
} |
10 changes: 10 additions & 0 deletions
10
...el-plugin-transform-class-properties/test/fixtures/static-super-tagged-template/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,10 @@ | ||
var _Outer; | ||
class Outer { | ||
constructor() { | ||
babelHelpers.defineProperty(this, "A", () => {}); | ||
} | ||
} | ||
_Outer = Outer; | ||
babelHelpers.defineProperty(Outer, "B", () => { | ||
babelHelpers.superPropGet(_Outer, "A", _Outer).bind(_Outer)`oxc`; | ||
}); |
6 changes: 6 additions & 0 deletions
6
.../tests/babel-plugin-transform-class-properties/test/fixtures/static-super-tagged/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,6 @@ | ||
class Outer { | ||
A = () => {}; | ||
static B = () => { | ||
super.A``; | ||
}; | ||
} |
10 changes: 10 additions & 0 deletions
10
...tests/babel-plugin-transform-class-properties/test/fixtures/static-super-tagged/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,10 @@ | ||
var _Outer; | ||
class Outer { | ||
constructor() { | ||
babelHelpers.defineProperty(this, "A", () => {}); | ||
} | ||
} | ||
_Outer = Outer; | ||
babelHelpers.defineProperty(Outer, "B", () => { | ||
babelHelpers.superPropGet(_Outer, "A", _Outer)``; | ||
}); |