Skip to content

class static setter receives the class object as its value since #11651 (gap 11499 / 10480 regress on main) #11669

Description

@proggeramlug

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.

commit 11499 10480
989c551 (parent of #11651) match match
880e9a4 (#11651) DIFF DIFF
41de9c5 (main as of 2026-09-29) DIFF DIFF

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions