Skip to content

Commit

Permalink
add test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
JLHwung committed May 9, 2024
1 parent 8dfe6c1 commit dd0139f
Show file tree
Hide file tree
Showing 5 changed files with 54 additions and 1 deletion.
Expand Up @@ -4,3 +4,9 @@ class Foo {

static accessor #b = 123;
}

Foo = class {
static accessor #a;

static accessor #b = 123;
}
Expand Up @@ -15,3 +15,19 @@ class Foo {
Foo.#B = v;
}
}
Foo = class _Class {
static #A;
static get #a() {
return _Class.#A;
}
static set #a(v) {
_Class.#A = v;
}
static #B = 123;
static get #b() {
return _Class.#B;
}
static set #b(v) {
_Class.#B = v;
}
};
Expand Up @@ -6,3 +6,11 @@ class Foo {

static accessor ['c'] = 456;
}

Foo = class {
static accessor a;

static accessor b = 123;

static accessor ['c'] = 456;
}
Expand Up @@ -22,3 +22,26 @@ class Foo {
Foo.#C = v;
}
}
Foo = class _Class {
static #A;
static get a() {
return _Class.#A;
}
static set a(v) {
_Class.#A = v;
}
static #B = 123;
static get b() {
return _Class.#B;
}
static set b(v) {
_Class.#B = v;
}
static #C = 456;
static get ['c']() {
return _Class.#C;
}
static set ['c'](v) {
_Class.#C = v;
}
};
Expand Up @@ -126,7 +126,7 @@ expect(logs).toEqual(["default", "atypical"]);
static accessor [6n] = @dec class { p; };
static accessor [f()] = @dec class { @dec static 7() {} };
static accessor [{ [Symbol.toPrimitive]: () => (logs.push("computing symbol"), Symbol(9)) }] = @dec class { p; };
static accessor #_10 = @dec class {};
static accessor #_10 = @dec class { static accessor a; };
}

expect(logs).toEqual(["computing f", "computing symbol", "A0", "1", "2", "3", "4", "5", "6", "7", "8", "[9]", "#_10"]);
Expand Down

0 comments on commit dd0139f

Please sign in to comment.