-
Notifications
You must be signed in to change notification settings - Fork 194
Closed
Description
Consider the program
let m = (=) (fun g -> "") (fun v -> "") in 0
If I compile it to ocaml bytecodes and run it it raises an exception as expected:
$ ocamlc -o issues/eqfun.byte ./issues/eqfun.ml
File "./issues/eqfun.ml", line 2, characters 6-7:
Warning 26: unused variable m.
$ ./issues/eqfun.byte
Fatal error: exception Invalid_argument("compare: functional value")
$
However with js_of_ocaml the exception disappears:
$ js_of_ocaml -o issues/eqfun.js issues/eqfun.byte
$ node issues/eqfun.js
$
There is a similar issue with the difference operator, e.g., if I change (=)
to (<>)
in the above example I observe the same difference in behaviour. However with, e.g., the operator compare
js_of_ocaml will produce code that raises an exception.
This is with ocaml version 4.04.0, js_of_ocaml version 2.8.4, and node version 6.10.3.
Metadata
Metadata
Assignees
Labels
No labels