-
-
Notifications
You must be signed in to change notification settings - Fork 8.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
assign class property keys to the correct top level symbol
- Loading branch information
Showing
8 changed files
with
158 additions
and
8 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
it("should not throw when using dynamic properties in unused classes", () => { | ||
require("./unused1"); | ||
}); | ||
|
||
it("should not throw when using dynamic properties in used classes", () => { | ||
const exports = require("./used1"); | ||
const x = new exports.Used(); | ||
expect(x.a()).toBe("A"); | ||
expect(x.b).toBe("B"); | ||
expect(x.c).toBe("C"); | ||
expect(exports.Used.d()).toBe("D"); | ||
expect(exports.Used.e).toBe("E"); | ||
expect(exports.Used.f).toBe("F"); | ||
const x2 = new exports.Used2(); | ||
expect(x2.a()).toBe("A"); | ||
expect(x2.b).toBe("B"); | ||
expect(x2.c).toBe("C"); | ||
expect(exports.Used2.d()).toBe("D"); | ||
expect(exports.Used2.e).toBe("E"); | ||
expect(exports.Used2.f).toBe("F"); | ||
expect(x2.x).toBe("X"); | ||
}); |
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,16 @@ | ||
export const a = () => "a"; | ||
export const A = "A"; | ||
export const b = "b"; | ||
export const B = "B"; | ||
export const c = "c"; | ||
export const C = "C"; | ||
export const d = () => "d"; | ||
export const D = "D"; | ||
export const e = "e"; | ||
export const E = "E"; | ||
export const f = "f"; | ||
export const F = "F"; | ||
export class X { | ||
x = "X"; | ||
} | ||
export const y = "y"; |
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 @@ | ||
import { a, b, c, d, e, f, A, B, C, D, E, F, X } from "./module"; | ||
|
||
class Unused { | ||
[a()]() { | ||
return A; | ||
} | ||
[b] = B; | ||
get [c]() { | ||
return C; | ||
} | ||
static [d()]() { | ||
return D; | ||
} | ||
static [e] = E; | ||
static get [f]() { | ||
return F; | ||
} | ||
} | ||
|
||
class Unused2 extends X { | ||
[a()]() { | ||
return A; | ||
} | ||
[b] = B; | ||
get [c]() { | ||
return C; | ||
} | ||
static [d()]() { | ||
return D; | ||
} | ||
static [e] = E; | ||
static get [f]() { | ||
return F; | ||
} | ||
} | ||
|
||
export {}; |
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 @@ | ||
import { a, b, c, d, e, f, A, B, C, D, E, F, X } from "./module?1"; | ||
|
||
class Used { | ||
[a()]() { | ||
return A; | ||
} | ||
[b] = B; | ||
get [c]() { | ||
return C; | ||
} | ||
static [d()]() { | ||
return D; | ||
} | ||
static [e] = E; | ||
static get [f]() { | ||
return F; | ||
} | ||
} | ||
|
||
class Used2 extends X { | ||
[a()]() { | ||
return A; | ||
} | ||
[b] = B; | ||
get [c]() { | ||
return C; | ||
} | ||
static [d()]() { | ||
return D; | ||
} | ||
static [e] = E; | ||
static get [f]() { | ||
return F; | ||
} | ||
} | ||
|
||
export { Used, Used2 }; |
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