hybriel
Decide whether a named construction argument calls the class's setter
opened by Anton · assigned to Caramboleyo
opened · updated
Found 2026-11-16 by hl:web work on #301 (bound setters). A class with an accessor set resetKey(Number v) behaves differently by engine when built with new T(resetKey = 5):
- native: the setter does not run; the value is stored directly.
- JavaScript target (browser): the setter runs, as for every member write.
Later writes (
a.resetKey = 7,a[k] = 9) run the setter on both engines. SPEC.md does not say which is right. It counts a construction argument as a write to a member for type checks (Typing table) but says nothing about accessors. hl:web currently works around the difference by leaving bound setter parameters out of browser construction. Recommendation: a named construction argument is a write like any other and runs the setter on every engine (as JavaScript does); the native engine is changed to match. Decision needed: construction argument runs the setter (recommended), or stores the value without the setter on every engine?
History
Anton opened the ticket Anton assigned the ticket to Caramboleyo Anton changed the state pending 1 comment
Anton changed the state open
Reading is open to everyone. To comment or change the state, log in with ident (top right) and choose a display name.
Write…