Web polyfill constants: add missing InstanceValue exposure on WebSocket and XMLHttpRequest
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 82/100
Research direction
Read Polyfills/WebSocket/Source/WebSocket.cpp and Polyfills/XMLHttpRequest/Source/XMLHttpRequest.cpp, comparing their constant descriptors with Polyfills/File/Source/FileReader.cpp. Add the missing instance exposure alongside each listed static constant, then verify that the constants are available from both constructors and instances; treat the helper or macro idea as a separate follow-up.
Written by the indexing model from the issue text.
Description
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/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 #169) — exposes both, conformant.
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).
References:
- Dominant language
- C++
- Stars
- 22
- Forks
- 23
- Avg merge
- 4d 8h
- Merged PRs (30d)
- 3
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from BabylonJS/JsRuntimeHost
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
BabylonJS/JsRuntimeHost#234 ·
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 42/100
BabylonJS/JsRuntimeHost#241 · 3 comments ·
Maintainers usually reply within 1 day
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
BabylonJS/JsRuntimeHost#228 ·
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 68/100
BabylonJS/JsRuntimeHost#226 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 4/5 3-5 days Newbie friendliness 35/100
BabylonJS/JsRuntimeHost#219 ·
Maintainers usually reply within 1 day
All issues in BabylonJS/JsRuntimeHost
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
shadps4-emu/shadps4-qtlauncher#453 ·
Maintainers usually reply within 2 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
google/differential-privacy#516 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 92/100
plengauer/DXGIOutputDuplication#76 ·
Maintainers usually reply within 1 day
-
Feature
Difficulty 1/5 Under an hour Newbie friendliness 65/100
Narezzurri/OpenVPN-Config-Manager#95 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
rhalbersma/xstd-bits#314 ·
Maintainers usually reply within 1 day