Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add input/output tests on multiple static blocks
- Loading branch information
Showing
6 changed files
with
90 additions
and
0 deletions.
There are no files selected for viewing
11 changes: 11 additions & 0 deletions
11
...class-static-block/test/fixtures/class-static-block/multiple-static-initializers/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,11 @@ | ||
class Foo { | ||
static #bar = 21; | ||
static { | ||
this.foo = this.#bar; | ||
this.qux1 = this.qux; | ||
} | ||
static qux = 21; | ||
static { | ||
this.qux2 = this.qux; | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
...lass-static-block/test/fixtures/class-static-block/multiple-static-initializers/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,11 @@ | ||
class Foo { | ||
static #bar = 21; | ||
static #_ = (() => { | ||
this.foo = this.#bar; | ||
this.qux1 = this.qux; | ||
})(); | ||
static qux = 21; | ||
static #_2 = (() => { | ||
this.qux2 = this.qux; | ||
})(); | ||
} |
11 changes: 11 additions & 0 deletions
11
...-class-static-block/test/fixtures/integration-loose/multiple-static-initializers/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,11 @@ | ||
class Foo { | ||
static #bar = 21; | ||
static { | ||
this.foo = this.#bar; | ||
this.qux1 = this.qux; | ||
} | ||
static qux = 21; | ||
static { | ||
this.qux2 = this.qux; | ||
} | ||
} |
26 changes: 26 additions & 0 deletions
26
...class-static-block/test/fixtures/integration-loose/multiple-static-initializers/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,26 @@ | ||
var _bar = babelHelpers.classPrivateFieldLooseKey("bar"); | ||
|
||
var _ = babelHelpers.classPrivateFieldLooseKey("_"); | ||
|
||
var _2 = babelHelpers.classPrivateFieldLooseKey("_2"); | ||
|
||
class Foo {} | ||
|
||
Object.defineProperty(Foo, _bar, { | ||
writable: true, | ||
value: 21 | ||
}); | ||
Object.defineProperty(Foo, _, { | ||
writable: true, | ||
value: (() => { | ||
Foo.foo = babelHelpers.classPrivateFieldLooseBase(Foo, _bar)[_bar]; | ||
Foo.qux1 = Foo.qux; | ||
})() | ||
}); | ||
Foo.qux = 21; | ||
Object.defineProperty(Foo, _2, { | ||
writable: true, | ||
value: (() => { | ||
Foo.qux2 = Foo.qux; | ||
})() | ||
}); |
11 changes: 11 additions & 0 deletions
11
...oposal-class-static-block/test/fixtures/integration/multiple-static-initializers/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,11 @@ | ||
class Foo { | ||
static #bar = 21; | ||
static { | ||
this.foo = this.#bar; | ||
this.qux1 = this.qux; | ||
} | ||
static qux = 21; | ||
static { | ||
this.qux2 = this.qux; | ||
} | ||
} |
20 changes: 20 additions & 0 deletions
20
...posal-class-static-block/test/fixtures/integration/multiple-static-initializers/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,20 @@ | ||
class Foo {} | ||
|
||
var _bar = { | ||
writable: true, | ||
value: 21 | ||
}; | ||
var _ = { | ||
writable: true, | ||
value: (() => { | ||
Foo.foo = babelHelpers.classStaticPrivateFieldSpecGet(Foo, Foo, _bar); | ||
Foo.qux1 = Foo.qux; | ||
})() | ||
}; | ||
babelHelpers.defineProperty(Foo, "qux", 21); | ||
var _2 = { | ||
writable: true, | ||
value: (() => { | ||
Foo.qux2 = Foo.qux; | ||
})() | ||
}; |