You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 25, 2025. It is now read-only.
It seems that the JS projection of GC structs as JS Typed Objects adds a generic getter/setter for each field that accesses that field, but there's no provision for custom getters and setters (for instance to get a synthesized value, or to be alerted when a property is changed so other internal state can change).
These could be provided in JavaScript by modifying the prototype with custom JavaScript getter/setter functions, at the cost of not exposting the property as an "own property".
The getters/setters would need to be JavaScript according to current spec due to #153.
Would this be a problem for code migration of existing JS APIs that use properties with getters/setters or would this sort of workaround be enough to reach the spec's code migration goals?
The text was updated successfully, but these errors were encountered:
The encoding of the table index in binary-leb128.wast is incorrect with the bulk-memory extensions, see WebAssembly/bulk-memory-operations#153. I saw and fixed the issue first in the reference types proposal (see WebAssembly/reference-types#95), but apparently it also exists here.
We've decided that custom getters, setters, field accessors, methods, etc. should be considered in a post-MVP proposal: https://github.com/webassembly/gc-js-customization. For the MVP, code migration will have to depend on manually wrapping idiomatic APIs around exported functions.
It seems that the JS projection of GC structs as JS Typed Objects adds a generic getter/setter for each field that accesses that field, but there's no provision for custom getters and setters (for instance to get a synthesized value, or to be alerted when a property is changed so other internal state can change).
These could be provided in JavaScript by modifying the prototype with custom JavaScript getter/setter functions, at the cost of not exposting the property as an "own property".
The getters/setters would need to be JavaScript according to current spec due to #153.
Would this be a problem for code migration of existing JS APIs that use properties with getters/setters or would this sort of workaround be enough to reach the spec's code migration goals?
The text was updated successfully, but these errors were encountered: