-
-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: attempt to add test for printexn issue
- Loading branch information
1 parent
f4ddebb
commit b575d90
Showing
1 changed file
with
26 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
An example that uses exceptions runtime | ||
|
||
$ export MELANGELIB="$INSIDE_DUNE/lib/melange" | ||
$ mkdir -p node_modules/melange | ||
$ ln -s $INSIDE_DUNE/lib node_modules/melange/lib | ||
|
||
$ cat > x.ml <<EOF | ||
> let run f = | ||
> try f () with | ||
> | exn -> Printexc.exn_slot_id exn | ||
> let result = run (fun _ -> failwith "oops") | ||
> EOF | ||
$ cat > dune-project <<EOF | ||
> (lang dune 3.7) | ||
> (using melange 0.1) | ||
> EOF | ||
$ cat > dune <<EOF | ||
> (melange.emit | ||
> (target melange) | ||
> (alias melange) | ||
> (module_system commonjs)) | ||
> EOF | ||
$ dune build @melange | ||
$ node ./_build/default/melange/x.js 2>&1 | awk '/exn_slot_id/' | ||
return Printexc.exn_slot_id(Caml_js_exceptions.internalToOCamlException(raw_exn)); | ||
TypeError: Printexc.exn_slot_id is not a function |