fixed class name init in static initializers

This commit is contained in:
Fabrice Bellard
2024-01-08 18:39:58 +01:00
parent c3635861f6
commit 5935a26eae
2 changed files with 19 additions and 17 deletions

View File

@@ -326,6 +326,15 @@ function test_class()
/* test class name scope */
var E1 = class E { static F() { return E; } };
assert(E1 === E1.F());
class S {
static x = 42;
static y = S.x;
static z = this.x;
}
assert(S.x === 42);
assert(S.y === 42);
assert(S.z === 42);
};
function test_template()