Skip to content

Emit directive abover header comment #6171

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@
> - :house: [Internal]
> - :nail_care: [Polish]

# 10.1.5

#### :bug: Bug Fix

- Emit directive above header comment. https://github.com/rescript-lang/rescript-compiler/pull/6171

# 10.1.4

#### :bug: Bug Fix
Expand Down
7 changes: 4 additions & 3 deletions jscomp/core/js_dump_program.ml
Original file line number Diff line number Diff line change
Expand Up @@ -102,12 +102,13 @@ let es6_program ~output_dir fmt f (x : J.deps_program) =
let pp_deps_program ~(output_prefix : string)
(kind : Js_packages_info.module_system) (program : J.deps_program)
(f : Ext_pp.t) =
!Js_config.directives
|> List.iter (fun prim ->
P.string f prim;
P.newline f);
if not !Js_config.no_version_header then (
P.string f Bs_version.header;
P.newline f);
!Js_config.directives |> List.iter (fun prim ->
P.string f prim;
P.newline f);

if deps_program_is_empty program then P.string f empty_explanation
(* This is empty module, it won't be referred anywhere *)
Expand Down
7 changes: 4 additions & 3 deletions lib/4.06.1/unstable/js_compiler.ml
Original file line number Diff line number Diff line change
Expand Up @@ -89348,12 +89348,13 @@ let es6_program ~output_dir fmt f (x : J.deps_program) =
let pp_deps_program ~(output_prefix : string)
(kind : Js_packages_info.module_system) (program : J.deps_program)
(f : Ext_pp.t) =
!Js_config.directives
|> List.iter (fun prim ->
P.string f prim;
P.newline f);
if not !Js_config.no_version_header then (
P.string f Bs_version.header;
P.newline f);
!Js_config.directives |> List.iter (fun prim ->
P.string f prim;
P.newline f);

if deps_program_is_empty program then P.string f empty_explanation
(* This is empty module, it won't be referred anywhere *)
Expand Down
7 changes: 4 additions & 3 deletions lib/4.06.1/unstable/js_playground_compiler.ml
Original file line number Diff line number Diff line change
Expand Up @@ -89348,12 +89348,13 @@ let es6_program ~output_dir fmt f (x : J.deps_program) =
let pp_deps_program ~(output_prefix : string)
(kind : Js_packages_info.module_system) (program : J.deps_program)
(f : Ext_pp.t) =
!Js_config.directives
|> List.iter (fun prim ->
P.string f prim;
P.newline f);
if not !Js_config.no_version_header then (
P.string f Bs_version.header;
P.newline f);
!Js_config.directives |> List.iter (fun prim ->
P.string f prim;
P.newline f);

if deps_program_is_empty program then P.string f empty_explanation
(* This is empty module, it won't be referred anywhere *)
Expand Down
7 changes: 4 additions & 3 deletions lib/4.06.1/whole_compiler.ml
Original file line number Diff line number Diff line change
Expand Up @@ -258863,12 +258863,13 @@ let es6_program ~output_dir fmt f (x : J.deps_program) =
let pp_deps_program ~(output_prefix : string)
(kind : Js_packages_info.module_system) (program : J.deps_program)
(f : Ext_pp.t) =
!Js_config.directives
|> List.iter (fun prim ->
P.string f prim;
P.newline f);
if not !Js_config.no_version_header then (
P.string f Bs_version.header;
P.newline f);
!Js_config.directives |> List.iter (fun prim ->
P.string f prim;
P.newline f);

if deps_program_is_empty program then P.string f empty_explanation
(* This is empty module, it won't be referred anywhere *)
Expand Down