forked from ocaml/dune
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
…caml#11252) * test(melange): show that .js file emission doesn't respect flags Signed-off-by: Antonio Nuno Monteiro <[email protected]> * fix(melange): pass `melange.emit`'s `compile_flags` to js emission Signed-off-by: Antonio Nuno Monteiro <[email protected]> * chore: add changelog entry Signed-off-by: Antonio Nuno Monteiro <[email protected]> --------- Signed-off-by: Antonio Nuno Monteiro <[email protected]>
- Loading branch information
1 parent
7bef0bf
commit 8a7ace8
Showing
3 changed files
with
49 additions
and
10 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,3 @@ | ||
- Pass `melange.emit`'s `compile_flags` to the JS emission phase. (@amonteiro, | ||
#11252) | ||
|
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
31 changes: 31 additions & 0 deletions
31
test/blackbox-tests/test-cases/melange/flags-for-emission.t
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,31 @@ | ||
Test compile_flags are passed to JS file emission | ||
|
||
$ cat > dune-project <<EOF | ||
> (lang dune 3.13) | ||
> (using melange 0.1) | ||
> EOF | ||
$ cat > main.ml <<EOF | ||
> let () = Js.log "hello" | ||
> EOF | ||
$ cat > dune <<EOF | ||
> (melange.emit | ||
> (target output) | ||
> (emit_stdlib false) | ||
> (modules main) | ||
> (compile_flags :standard --mel-no-version-header)) | ||
> EOF | ||
$ dune build @melange | ||
File is generated with the "Generated by Melange" header even though we | ||
specified the opposite in flags | ||
$ cat _build/default/output/main.js | ||
'use strict'; | ||
console.log("hello"); | ||
/* Not a pure module */ |