-
Notifications
You must be signed in to change notification settings - Fork 197
Closed
ocaml/opam-repository
#23733Labels
Description
Describe the bug
The value passed using the --custom-header is not placed in the beginning of the file. For example:
js_of_ocaml --custom-header="#!/usr/bin/env node" main.bc
This produces the following code where the header is in the third line
// Generated by js_of_ocaml
//# buildInfo:effects=false, kind=exe, use-js-string=true, version=5.1.1
#!/usr/bin/env node
(function(a){typeof .......
Expected behavior
That the first line of the file is the header and any other text comes after.
#!/usr/bin/env node
// Generated by js_of_ocaml
//# buildInfo:effects=false, kind=exe, use-js-string=true, version=5.1.1
This produces the following error when running the code:
SyntaxError: Invalid or unexpected token
at wrapSafe (internal/modules/cjs/loader.js:915:16)
at Module._compile (internal/modules/cjs/loader.js:963:27)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
at Module.load (internal/modules/cjs/loader.js:863:32)
at Function.Module._load (internal/modules/cjs/loader.js:708:14)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:60:12)
at internal/main/run_main_module.js:17:47
F/home/leonardo/main.js:3
#!/usr/bin/env node
^
Versions
Version of packages used to reproduce the bug
Ocaml 4.14.0
js_of_ocaml version=5.1.1