Skip to content

Commit

Permalink
JavaScript linker: add 'wasm' flag
Browse files Browse the repository at this point in the history
  • Loading branch information
vouillon committed Sep 17, 2024
1 parent 7a2a688 commit f4e7c74
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
9 changes: 8 additions & 1 deletion compiler/lib/linker.ml
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,14 @@ module Fragment = struct
List.fold_left
~f:(fun m (k, v) -> StringMap.add k v m)
~init:StringMap.empty
[ "js-string", Config.Flag.use_js_string; "effects", Config.Flag.effects ]
[ "js-string", Config.Flag.use_js_string
; "effects", Config.Flag.effects
; ( "wasm"
, fun () ->
match Config.target () with
| `JavaScript -> false
| `Wasm -> true )
]

type t =
| Always_include of Javascript.program pack
Expand Down
1 change: 1 addition & 0 deletions runtime/sys.js
Original file line number Diff line number Diff line change
Expand Up @@ -357,6 +357,7 @@ function caml_sys_is_regular_file(name) {
}
//Always
//Requires: caml_fatal_uncaught_exception
//If: !wasm
function caml_setup_uncaught_exception_handler() {
var process = globalThis.process;
if(process && process.on) {
Expand Down

0 comments on commit f4e7c74

Please sign in to comment.