Since #11651 (880e9a4, "class static accessors are accessor properties of the class function object"), a store through a class's static setter calls the setter with the class itself as the value instead of the assigned value. The setter's this is correct.
Two gap tests that passed before #11651 now fail on main. Both show the same symptom:
test_gap_10480_define_property_generic_descriptor_accessors
class Statics { static _v = 0; static get sv() { return Statics._v; } static set sv(value: number) { Statics._v = value * 10; } }
Object.defineProperty(Statics, "sv", { enumerable: true });
Statics.sv = 2;
console.log("static-read", Statics.sv, ...);
- static-read 20 sv,_v sv,_v (node 26.5.1)
+ static-read NaN sv,_v sv,_v (perry)
test_gap_11499_class_object_static_write. Here setCode2(HasStatic, 1) does o.tag = v, and the setter stores "set:" + String(v):
- G.own-static-setter: set:1
- H.inherited-static-setter: set:2
+ G.own-static-setter: set:class HasStatic { ...source text... }
+ H.inherited-static-setter: set:class SubStatic extends HasStatic {}
It fails through both the class's own setter and one inherited by a subclass (SubStatic).
Bisect
All builds are Linux x86_64 release with CODEGEN_UNITS=16 and PERRY_NO_AUTO_OPTIMIZE=1. Output was diffed against Node 26.5.1.
Found while triaging #11639, which was rebased onto 41de9c5 and hit both tests as pass -> parity_fail in its gap-suite shards 2 and 6 (run 36571885695). That PR's output is byte-identical to main's for both tests, so it is not involved.
Since #11651 (880e9a4, "class static accessors are accessor properties of the class function object"), a store through a class's static setter calls the setter with the class itself as the value instead of the assigned value. The setter's
thisis correct.Two gap tests that passed before #11651 now fail on main. Both show the same symptom:
test_gap_10480_define_property_generic_descriptor_accessors
test_gap_11499_class_object_static_write. Here
setCode2(HasStatic, 1)doeso.tag = v, and the setter stores"set:" + String(v):It fails through both the class's own setter and one inherited by a subclass (
SubStatic).Bisect
All builds are Linux x86_64 release with
CODEGEN_UNITS=16andPERRY_NO_AUTO_OPTIMIZE=1. Output was diffed against Node 26.5.1.Found while triaging #11639, which was rebased onto 41de9c5 and hit both tests as
pass -> parity_failin its gap-suite shards 2 and 6 (run 36571885695). That PR's output is byte-identical to main's for both tests, so it is not involved.