|
@@ -83,6 +83,19 @@ test("static fields", () => {
|
|
|
expect("A.#simple").not.toEval();
|
|
|
});
|
|
|
|
|
|
+test("slash after private identifier is treated as division", () => {
|
|
|
+ class A {
|
|
|
+ static #field = 4;
|
|
|
+ static #divided = this.#field / 2;
|
|
|
+
|
|
|
+ static getDivided() {
|
|
|
+ return this.#divided;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ expect(A.getDivided()).toBe(2);
|
|
|
+});
|
|
|
+
|
|
|
test("cannot have static and non static field with the same description", () => {
|
|
|
expect("class A { static #simple; #simple; }").not.toEval();
|
|
|
});
|