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
Per WHATWG IDL, class const members are exposed on both the constructor (static) and instances (via the prototype). JRH polyfills currently do this inconsistently:
Polyfills/WebSocket/Source/WebSocket.cpp (L16–19) — CONNECTING / OPEN / CLOSING / CLOSED are StaticValue only. new WebSocket(...).OPEN returns undefined.
Polyfills/XMLHttpRequest/Source/XMLHttpRequest.cpp (L72–76) — UNSENT / OPENED / HEADERS_RECEIVED / LOADING / DONE are StaticValue only. Same gap.
Fix: add an InstanceValue entry alongside each StaticValue for both polyfills. Going forward, web polyfill classes with IDL const members should define one of each.
Follow-up: investigate whether a helper function/macro can emit both descriptors from a single declaration so authors don't have to remember the dual exposure (and constants can't silently drift between static and instance values).
Per WHATWG IDL, class
constmembers are exposed on both the constructor (static) and instances (via the prototype). JRH polyfills currently do this inconsistently:Polyfills/WebSocket/Source/WebSocket.cpp(L16–19) —CONNECTING/OPEN/CLOSING/CLOSEDareStaticValueonly.new WebSocket(...).OPENreturnsundefined.Polyfills/XMLHttpRequest/Source/XMLHttpRequest.cpp(L72–76) —UNSENT/OPENED/HEADERS_RECEIVED/LOADING/DONEareStaticValueonly. Same gap.Polyfills/File/Source/FileReader.cpp(new in Add File / FileReader polyfill #169) — exposes both, conformant.Fix: add an
InstanceValueentry alongside eachStaticValuefor both polyfills. Going forward, web polyfill classes with IDLconstmembers should define one of each.Follow-up: investigate whether a helper function/macro can emit both descriptors from a single declaration so authors don't have to remember the dual exposure (and constants can't silently drift between static and instance values).
References: