-
Notifications
You must be signed in to change notification settings - Fork 195
runtime(js): better caml_xmlhttprequest_create error handling and remove Map polyfill #1846
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Signed-off-by: Sora Morimoto <sora@morimoto.io>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR Overview
This PR simplifies runtime checks in JavaScript runtime code by removing redundant existence validations and the polyfill for legacy environments.
- Simplifies XMLHttpRequest creation in jslib_js_of_ocaml.js by removing an unnecessary type check and catch parameter
- Eliminates the legacy polyfill for MlObjectTable in marshal.js in favor of using globalThis.Map exclusively
Reviewed Changes
File | Description |
---|---|
runtime/js/jslib_js_of_ocaml.js | Simplifies XMLHttpRequest creation by removing extra checks and a catch parameter |
runtime/js/marshal.js | Removes the legacy polyfill for MlObjectTable, relying solely on globalThis.Map |
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
Comments suppressed due to low confidence (1)
runtime/js/marshal.js:633
- Removing the polyfill for environments where globalThis.Map is undefined may cause failures in older runtimes. Ensure that your target environments fully support globalThis.Map.
function MlObjectTable() {
} catch (e) {} | ||
try { | ||
return new globalThis.XMLHttpRequest(); | ||
} catch { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using a catch block without an error binding may obscure useful error details, which could hinder debugging. Consider capturing the error (e.g., using 'catch (e)') to log or examine further.
} catch { | |
} catch (e) { | |
console.error("Error creating XMLHttpRequest:", e); |
Copilot uses AI. Check for mistakes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can be added if you prefer @hhugo
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I prefer the version before this PR. XMLHttpRequest might not be defined (e.g. node) and the code reflected that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So instead of an error message that it could not be created, should it be an error message saying it is not available?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or
function caml_xmlhttprequest_create(unit) {
if (typeof globalThis.XMLHttpRequest === "undefined") {
caml_failwith("XMLHttpRequest is not available");
}
try {
return new globalThis.XMLHttpRequest();
} catch {
caml_failwith("Failed to create XMLHttpRequest");
}
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe but this non longer fit in the PR title and description as it's no longer a simplification and no longer remove checks
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@hhugo Well, I just updated the title and description of the PR, but if it's better to drop the commit itself, I will drop it.
1b7dd19
to
6b270c4
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR Overview
This pull request removes outdated runtime polyfills, requiring native support for JavaScript's Map and XMLHttpRequest to simplify the code and reduce bundle size.
- Removed the Map polyfill from the MlObjectTable implementation and now relies on native Map support.
- Simplified the XMLHttpRequest creation function by directly using the global implementation and throwing clear error messages.
- Updated documentation in ECMASCRIPT.md and release notes in CHANGES.md to reflect these changes.
Reviewed Changes
File | Description |
---|---|
ECMASCRIPT.md | Added new sections for Map and XMLHttpRequest compatibility |
runtime/js/jslib_js_of_ocaml.js | Refined XMLHttpRequest creation logic with improved error handling |
CHANGES.md | Updated release notes with polyfill removal and XMLHttpRequest changes |
runtime/js/marshal.js | Removed the Map polyfill from MlObjectTable implementation |
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
Comments suppressed due to low confidence (1)
runtime/js/jslib_js_of_ocaml.js:81
- [nitpick] Consider capturing the error object in the catch block (e.g., 'catch (e)') and including its message in the call to caml_failwith to provide additional debugging context.
} catch {
Signed-off-by: Sora Morimoto <sora@morimoto.io>
Signed-off-by: Sora Morimoto <sora@morimoto.io>
6b270c4
to
74ca496
Compare
CHANGES: ## Features/Changes * Misc: drop support for OCaml 4.12 and bellow * Misc: switch to dune.3.19 * Misc: initial support for ocaml 5.4 (ocsigen/js_of_ocaml#2030, ocsigen/js_of_ocaml#2058) * Compiler: support for OCaml 4.14.3+trunk (ocsigen/js_of_ocaml#1844) * Compiler: add the `--empty-sourcemap` flag * Compiler: improve debug/sourcemap location of closures (ocsigen/js_of_ocaml#1947) * Compiler: optimize compilation of switches (ocsigen/js_of_ocaml#1921, ocsigen/js_of_ocaml#2057) * Compiler: evaluate statically more primitives (ocsigen/js_of_ocaml#1912, ocsigen/js_of_ocaml#1915, ocsigen/js_of_ocaml#1965, ocsigen/js_of_ocaml#1969) * Compiler: rewrote inlining pass (ocsigen/js_of_ocaml#1935, ocsigen/js_of_ocaml#2018, ocsigen/js_of_ocaml#2027) * Compiler: improve tailcall optimization (ocsigen/js_of_ocaml#1943) * Compiler: improve deadcode optimization (ocsigen/js_of_ocaml#1963, ocsigen/js_of_ocaml#1962, ocsigen/js_of_ocaml#1967) * Compiler: deadcode elimination of cyclic values (ocsigen/js_of_ocaml#1978) * Compiler: remove empty blocks (ocsigen/js_of_ocaml#1934) * Compiler: improve coloring optimization (ocsigen/js_of_ocaml#1971, ocsigen/js_of_ocaml#1984, ocsigen/js_of_ocaml#1986, ocsigen/js_of_ocaml#1989) * Compiler: faster constant sharing (ocsigen/js_of_ocaml#1988) * Compiler: faster js code generation (ocsigen/js_of_ocaml#1985) * Compiler: improve performance of Javascript linking * Compiler: more efficient code generation from bytecode (ocsigen/js_of_ocaml#1972) * Compiler: faster compilation by improving the scheduling of optimization passes (ocsigen/js_of_ocaml#1962, ocsigen/js_of_ocaml#2001, ocsigen/js_of_ocaml#2012, ocsigen/js_of_ocaml#2027) * Compiler: faster compilation by stopping sooner when optimizations become unproductive (ocsigen/js_of_ocaml#1939) * Compiler: Propagate arity between compilation units (ocsigen/js_of_ocaml#1594) * Compiler: Add flags to enable/disable warnings (ocsigen/js_of_ocaml#2052) * Compiler/wasm: directly write Wasm binary modules (ocsigen/js_of_ocaml#2000, ocsigen/js_of_ocaml#2003) * Compiler/wasm: faster wat output (ocsigen/js_of_ocaml#1992) * Compiler/wasm: use a Wasm text files preprocessor (ocsigen/js_of_ocaml#1822) * Compiler/wasm: optimize integer operations (ocsigen/js_of_ocaml#2032) * Compiler/wasm: use type analysis to remove some unnecessary uses of JavasScript strict equality (ocsigen/js_of_ocaml#2040) * Compiler/wasm: use more precise environment types (ocsigen/js_of_ocaml#2041) * Compiler/wasm: optimize calls to statically known function (ocsigen/js_of_ocaml#2044) * Runtime: use es6 class (ocsigen/js_of_ocaml#1840) * Runtime: support more Unix functions (ocsigen/js_of_ocaml#1829) * Runtime: remove polyfill for Map to simplify MlObjectTable implementation (ocsigen/js_of_ocaml#1846) * Runtime: refactor caml_xmlhttprequest_create implementation (ocsigen/js_of_ocaml#1846) * Runtime: update constant imports to use `node:fs` module (ocsigen/js_of_ocaml#1850) * Runtime: make Obj.dup work with floats and boxed numbers (ocsigen/js_of_ocaml#1871) * Runtime: delete BigStringReader, one should use UInt8ArrayReader instead * Runtime: less conversion during un-marshalling (ocsigen/js_of_ocaml#1889) * Runtime: use TextEncoder/TextDecoder for utf8-utf16 conversions * Runtime: use Dataview to convert between floats and bit representation * Runtime: optimize Str.search_forward/search_backward (ocsigen/js_of_ocaml#2056) * Runtime: deprecate caml_ba_create_from (ocsigen/js_of_ocaml#2056) * Runtime: check for unused variable in the runtime (ocsigen/js_of_ocaml#2056) * Runtime/wasm: implement BLAKE2b primitives for Wasm (ocsigen/js_of_ocaml#1873) * Runtime/wasm: support jsoo_env and keep track of backtrace status (ocsigen/js_of_ocaml#1881) * Runtime/wasm: support unmarshaling compressed data (ocsigen/js_of_ocaml#1898) * Runtime/wasm: make resuming a continuation more efficient in Wasm (ocsigen/js_of_ocaml#1892) * Runtime/wasm: use imported string constants for JavaScript strings (ocsigen/js_of_ocaml#2022) * Runtime/wasm: use DataView primitives to implement bigarrays (ocsigen/js_of_ocaml#1979) * Ppx: explicitly disallow polymorphic method (ocsigen/js_of_ocaml#1897) * Ppx: allow "function" in object literals (ocsigen/js_of_ocaml#1897) * Lib: add Dom_html.window.matchMedia & Dom_html.mediaQueryList (ocsigen/js_of_ocaml#2017) * Lib: make the Wasm version of Json.output work with native ints and JavaScript objects (ocsigen/js_of_ocaml#1872) ## Bug fixes * Compiler: fix stack overflow issues with double translation (ocsigen/js_of_ocaml#1869) * Compiler: minifier fix (ocsigen/js_of_ocaml#1867) * Compiler: fix shortvar with --enable es6 (AssignTarget was not properly handled) * Compiler: fix assert failure with double translation (ocsigen/js_of_ocaml#1870) * Compiler: fix path rewriting of Wasm source maps (ocsigen/js_of_ocaml#1882) * Compiler: fix global dead code in presence of dead tailcall (ocsigen/js_of_ocaml#2010) * Compiler/wasm: fix bound check for empty float array (ocsigen/js_of_ocaml#1904) * Runtime: fix path normalization (ocsigen/js_of_ocaml#1848) * Runtime: fix reading from the pseudo-filesystem (ocsigen/js_of_ocaml#1859) * Runtime: fix initialization of standard streams under Windows (ocsigen/js_of_ocaml#1849) * Runtime: fix Int64.of_string overflow check (ocsigen/js_of_ocaml#1874) * Runtime: fix caml_string_concat when not using JS strings (ocsigen/js_of_ocaml#1874) * Runtime: consistent bigarray hashing across all architectures (ocsigen/js_of_ocaml#1977) * Runtime: fix caml_utf8_of_utf16 bug in high surrogate case (ocsigen/js_of_ocaml#2008) * Runtime: fix method lookup (ocsigen/js_of_ocaml#2034, ocsigen/js_of_ocaml#2038, ocsigen/js_of_ocaml#2039) * Lib: fix Dom_html.Keyboard_code.of_event (ocsigen/js_of_ocaml#1878) * Tools: fix jsoo_mktop and jsoo_mkcmis (ocsigen/js_of_ocaml#1877) * Toplevel: fix for when use-js-strings is disabled (ocsigen/js_of_ocaml#1997)
CHANGES: ## Features/Changes * Misc: drop support for OCaml 4.12 and bellow * Misc: switch to dune.3.19 * Misc: initial support for ocaml 5.4 (ocsigen/js_of_ocaml#2030, ocsigen/js_of_ocaml#2058) * Compiler: support for OCaml 4.14.3+trunk (ocsigen/js_of_ocaml#1844) * Compiler: add the `--empty-sourcemap` flag * Compiler: improve debug/sourcemap location of closures (ocsigen/js_of_ocaml#1947) * Compiler: optimize compilation of switches (ocsigen/js_of_ocaml#1921, ocsigen/js_of_ocaml#2057) * Compiler: evaluate statically more primitives (ocsigen/js_of_ocaml#1912, ocsigen/js_of_ocaml#1915, ocsigen/js_of_ocaml#1965, ocsigen/js_of_ocaml#1969) * Compiler: rewrote inlining pass (ocsigen/js_of_ocaml#1935, ocsigen/js_of_ocaml#2018, ocsigen/js_of_ocaml#2027) * Compiler: improve tailcall optimization (ocsigen/js_of_ocaml#1943) * Compiler: improve deadcode optimization (ocsigen/js_of_ocaml#1963, ocsigen/js_of_ocaml#1962, ocsigen/js_of_ocaml#1967) * Compiler: deadcode elimination of cyclic values (ocsigen/js_of_ocaml#1978) * Compiler: remove empty blocks (ocsigen/js_of_ocaml#1934) * Compiler: improve coloring optimization (ocsigen/js_of_ocaml#1971, ocsigen/js_of_ocaml#1984, ocsigen/js_of_ocaml#1986, ocsigen/js_of_ocaml#1989) * Compiler: faster constant sharing (ocsigen/js_of_ocaml#1988) * Compiler: faster js code generation (ocsigen/js_of_ocaml#1985, ocsigen/js_of_ocaml#2066) * Compiler: improve performance of Javascript linking * Compiler: more efficient code generation from bytecode (ocsigen/js_of_ocaml#1972) * Compiler: faster compilation by improving the scheduling of optimization passes (ocsigen/js_of_ocaml#1962, ocsigen/js_of_ocaml#2001, ocsigen/js_of_ocaml#2012, ocsigen/js_of_ocaml#2027) * Compiler: faster compilation by stopping sooner when optimizations become unproductive (ocsigen/js_of_ocaml#1939) * Compiler: Propagate arity between compilation units (ocsigen/js_of_ocaml#1594) * Compiler: Add flags to enable/disable warnings (ocsigen/js_of_ocaml#2052) * Compiler/wasm: directly write Wasm binary modules (ocsigen/js_of_ocaml#2000, ocsigen/js_of_ocaml#2003) * Compiler/wasm: faster wat output (ocsigen/js_of_ocaml#1992) * Compiler/wasm: use a Wasm text files preprocessor (ocsigen/js_of_ocaml#1822) * Compiler/wasm: optimize integer operations (ocsigen/js_of_ocaml#2032) * Compiler/wasm: use type analysis to remove some unnecessary uses of JavasScript strict equality (ocsigen/js_of_ocaml#2040) * Compiler/wasm: use more precise environment types (ocsigen/js_of_ocaml#2041) * Compiler/wasm: optimize calls to statically known function (ocsigen/js_of_ocaml#2044) * Runtime: use es6 class (ocsigen/js_of_ocaml#1840) * Runtime: support more Unix functions (ocsigen/js_of_ocaml#1829) * Runtime: remove polyfill for Map to simplify MlObjectTable implementation (ocsigen/js_of_ocaml#1846) * Runtime: refactor caml_xmlhttprequest_create implementation (ocsigen/js_of_ocaml#1846) * Runtime: update constant imports to use `node:fs` module (ocsigen/js_of_ocaml#1850) * Runtime: make Obj.dup work with floats and boxed numbers (ocsigen/js_of_ocaml#1871) * Runtime: delete BigStringReader, one should use UInt8ArrayReader instead * Runtime: less conversion during un-marshalling (ocsigen/js_of_ocaml#1889) * Runtime: use TextEncoder/TextDecoder for utf8-utf16 conversions * Runtime: use Dataview to convert between floats and bit representation * Runtime: optimize Str.search_forward/search_backward (ocsigen/js_of_ocaml#2056) * Runtime: deprecate caml_ba_create_from (ocsigen/js_of_ocaml#2056) * Runtime: check for unused variable in the runtime (ocsigen/js_of_ocaml#2056) * Runtime/wasm: implement BLAKE2b primitives for Wasm (ocsigen/js_of_ocaml#1873) * Runtime/wasm: support jsoo_env and keep track of backtrace status (ocsigen/js_of_ocaml#1881) * Runtime/wasm: support unmarshaling compressed data (ocsigen/js_of_ocaml#1898) * Runtime/wasm: make resuming a continuation more efficient in Wasm (ocsigen/js_of_ocaml#1892) * Runtime/wasm: use imported string constants for JavaScript strings (ocsigen/js_of_ocaml#2022) * Runtime/wasm: use DataView primitives to implement bigarrays (ocsigen/js_of_ocaml#1979) * Ppx: explicitly disallow polymorphic method (ocsigen/js_of_ocaml#1897) * Ppx: allow "function" in object literals (ocsigen/js_of_ocaml#1897) * Lib: add Dom_html.window.matchMedia & Dom_html.mediaQueryList (ocsigen/js_of_ocaml#2017) * Lib: make the Wasm version of Json.output work with native ints and JavaScript objects (ocsigen/js_of_ocaml#1872) ## Bug fixes * Compiler: fix stack overflow issues with double translation (ocsigen/js_of_ocaml#1869) * Compiler: minifier fix (ocsigen/js_of_ocaml#1867) * Compiler: fix shortvar with --enable es6 (AssignTarget was not properly handled) * Compiler: fix assert failure with double translation (ocsigen/js_of_ocaml#1870) * Compiler: fix path rewriting of Wasm source maps (ocsigen/js_of_ocaml#1882) * Compiler: fix global dead code in presence of dead tailcall (ocsigen/js_of_ocaml#2010) * Compiler/wasm: fix bound check for empty float array (ocsigen/js_of_ocaml#1904) * Runtime: fix path normalization (ocsigen/js_of_ocaml#1848) * Runtime: fix reading from the pseudo-filesystem (ocsigen/js_of_ocaml#1859) * Runtime: fix initialization of standard streams under Windows (ocsigen/js_of_ocaml#1849) * Runtime: fix Int64.of_string overflow check (ocsigen/js_of_ocaml#1874) * Runtime: fix caml_string_concat when not using JS strings (ocsigen/js_of_ocaml#1874) * Runtime: consistent bigarray hashing across all architectures (ocsigen/js_of_ocaml#1977) * Runtime: fix caml_utf8_of_utf16 bug in high surrogate case (ocsigen/js_of_ocaml#2008) * Runtime: fix method lookup (ocsigen/js_of_ocaml#2034, ocsigen/js_of_ocaml#2038, ocsigen/js_of_ocaml#2039) * Lib: fix Dom_html.Keyboard_code.of_event (ocsigen/js_of_ocaml#1878) * Tools: fix jsoo_mktop and jsoo_mkcmis (ocsigen/js_of_ocaml#1877) * Toplevel: fix for when use-js-strings is disabled (ocsigen/js_of_ocaml#1997)
CHANGES: ## Features/Changes * Misc: drop support for OCaml 4.12 and bellow * Misc: switch to dune.3.19 * Misc: initial support for ocaml 5.4 (ocsigen/js_of_ocaml#2030, ocsigen/js_of_ocaml#2058) * Compiler: support for OCaml 4.14.3+trunk (ocsigen/js_of_ocaml#1844) * Compiler: add the `--empty-sourcemap` flag * Compiler: improve debug/sourcemap location of closures (ocsigen/js_of_ocaml#1947) * Compiler: optimize compilation of switches (ocsigen/js_of_ocaml#1921, ocsigen/js_of_ocaml#2057) * Compiler: evaluate statically more primitives (ocsigen/js_of_ocaml#1912, ocsigen/js_of_ocaml#1915, ocsigen/js_of_ocaml#1965, ocsigen/js_of_ocaml#1969) * Compiler: rewrote inlining pass (ocsigen/js_of_ocaml#1935, ocsigen/js_of_ocaml#2018, ocsigen/js_of_ocaml#2027) * Compiler: improve tailcall optimization (ocsigen/js_of_ocaml#1943) * Compiler: improve deadcode optimization (ocsigen/js_of_ocaml#1963, ocsigen/js_of_ocaml#1962, ocsigen/js_of_ocaml#1967) * Compiler: deadcode elimination of cyclic values (ocsigen/js_of_ocaml#1978) * Compiler: remove empty blocks (ocsigen/js_of_ocaml#1934) * Compiler: improve coloring optimization (ocsigen/js_of_ocaml#1971, ocsigen/js_of_ocaml#1984, ocsigen/js_of_ocaml#1986, ocsigen/js_of_ocaml#1989) * Compiler: faster constant sharing (ocsigen/js_of_ocaml#1988) * Compiler: faster js code generation (ocsigen/js_of_ocaml#1985, ocsigen/js_of_ocaml#2066) * Compiler: improve performance of Javascript linking * Compiler: more efficient code generation from bytecode (ocsigen/js_of_ocaml#1972) * Compiler: faster compilation by improving the scheduling of optimization passes (ocsigen/js_of_ocaml#1962, ocsigen/js_of_ocaml#2001, ocsigen/js_of_ocaml#2012, ocsigen/js_of_ocaml#2027) * Compiler: faster compilation by stopping sooner when optimizations become unproductive (ocsigen/js_of_ocaml#1939) * Compiler: Propagate arity between compilation units (ocsigen/js_of_ocaml#1594) * Compiler: Add flags to enable/disable warnings (ocsigen/js_of_ocaml#2052) * Compiler/wasm: directly write Wasm binary modules (ocsigen/js_of_ocaml#2000, ocsigen/js_of_ocaml#2003) * Compiler/wasm: faster wat output (ocsigen/js_of_ocaml#1992) * Compiler/wasm: use a Wasm text files preprocessor (ocsigen/js_of_ocaml#1822) * Compiler/wasm: optimize integer operations (ocsigen/js_of_ocaml#2032) * Compiler/wasm: use type analysis to remove some unnecessary uses of JavasScript strict equality (ocsigen/js_of_ocaml#2040) * Compiler/wasm: use more precise environment types (ocsigen/js_of_ocaml#2041) * Compiler/wasm: optimize calls to statically known function (ocsigen/js_of_ocaml#2044) * Runtime: use es6 class (ocsigen/js_of_ocaml#1840) * Runtime: support more Unix functions (ocsigen/js_of_ocaml#1829) * Runtime: remove polyfill for Map to simplify MlObjectTable implementation (ocsigen/js_of_ocaml#1846) * Runtime: refactor caml_xmlhttprequest_create implementation (ocsigen/js_of_ocaml#1846) * Runtime: update constant imports to use `node:fs` module (ocsigen/js_of_ocaml#1850) * Runtime: make Obj.dup work with floats and boxed numbers (ocsigen/js_of_ocaml#1871) * Runtime: delete BigStringReader, one should use UInt8ArrayReader instead * Runtime: less conversion during un-marshalling (ocsigen/js_of_ocaml#1889) * Runtime: use TextEncoder/TextDecoder for utf8-utf16 conversions * Runtime: use Dataview to convert between floats and bit representation * Runtime: optimize Str.search_forward/search_backward (ocsigen/js_of_ocaml#2056) * Runtime: deprecate caml_ba_create_from (ocsigen/js_of_ocaml#2056) * Runtime: check for unused variable in the runtime (ocsigen/js_of_ocaml#2056) * Runtime/wasm: implement BLAKE2b primitives for Wasm (ocsigen/js_of_ocaml#1873) * Runtime/wasm: support jsoo_env and keep track of backtrace status (ocsigen/js_of_ocaml#1881) * Runtime/wasm: support unmarshaling compressed data (ocsigen/js_of_ocaml#1898) * Runtime/wasm: make resuming a continuation more efficient in Wasm (ocsigen/js_of_ocaml#1892) * Runtime/wasm: use imported string constants for JavaScript strings (ocsigen/js_of_ocaml#2022) * Runtime/wasm: use DataView primitives to implement bigarrays (ocsigen/js_of_ocaml#1979) * Ppx: explicitly disallow polymorphic method (ocsigen/js_of_ocaml#1897) * Ppx: allow "function" in object literals (ocsigen/js_of_ocaml#1897) * Lib: add Dom_html.window.matchMedia & Dom_html.mediaQueryList (ocsigen/js_of_ocaml#2017) * Lib: make the Wasm version of Json.output work with native ints and JavaScript objects (ocsigen/js_of_ocaml#1872) ## Bug fixes * Compiler: fix stack overflow issues with double translation (ocsigen/js_of_ocaml#1869) * Compiler: minifier fix (ocsigen/js_of_ocaml#1867) * Compiler: fix shortvar with --enable es6 (AssignTarget was not properly handled) * Compiler: fix assert failure with double translation (ocsigen/js_of_ocaml#1870) * Compiler: fix path rewriting of Wasm source maps (ocsigen/js_of_ocaml#1882) * Compiler: fix global dead code in presence of dead tailcall (ocsigen/js_of_ocaml#2010) * Compiler/wasm: fix bound check for empty float array (ocsigen/js_of_ocaml#1904) * Runtime: fix path normalization (ocsigen/js_of_ocaml#1848) * Runtime: fix reading from the pseudo-filesystem (ocsigen/js_of_ocaml#1859) * Runtime: fix initialization of standard streams under Windows (ocsigen/js_of_ocaml#1849) * Runtime: fix Int64.of_string overflow check (ocsigen/js_of_ocaml#1874) * Runtime: fix caml_string_concat when not using JS strings (ocsigen/js_of_ocaml#1874) * Runtime: consistent bigarray hashing across all architectures (ocsigen/js_of_ocaml#1977) * Runtime: fix caml_utf8_of_utf16 bug in high surrogate case (ocsigen/js_of_ocaml#2008) * Runtime: fix method lookup (ocsigen/js_of_ocaml#2034, ocsigen/js_of_ocaml#2038, ocsigen/js_of_ocaml#2039) * Lib: fix Dom_html.Keyboard_code.of_event (ocsigen/js_of_ocaml#1878) * Tools: fix jsoo_mktop and jsoo_mkcmis (ocsigen/js_of_ocaml#1877) * Toplevel: fix for when use-js-strings is disabled (ocsigen/js_of_ocaml#1997)
This PR enhances error handling in the
caml_xmlhttprequest_create
implementation and removes the unnecessary Map polyfill to simplify theMlObjectTable
implementation. It provides more detailed error messages whencaml_xmlhttprequest_create
fails and updates documentation to reflect the use of these APIs.