Skip to content

Commit 2f3e494

Browse files
authored
Merge pull request rescript-lang#2523 from ulrikstrid/no-use-strict-in-es6
Only use 'use strict'; in amdjs and commonjs
2 parents 72f2345 + 66705ad commit 2f3e494

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

jscomp/core/js_dump_program.ml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,8 @@ let dump_program (x : J.program) oc =
6060

6161

6262
let node_program ~output_dir f ( x : J.deps_program) =
63+
P.string f L.strict_directive;
64+
P.newline f ;
6365
let cxt =
6466
Js_dump_import_export.requires
6567
L.require
@@ -78,6 +80,8 @@ let node_program ~output_dir f ( x : J.deps_program) =
7880

7981
let amd_program ~output_dir kind f ( x : J.deps_program) =
8082
let cxt = Ext_pp_scope.empty in
83+
P.string f L.strict_directive;
84+
P.newline f ;
8185
P.vgroup f 1 @@ fun _ ->
8286
P.string f L.define;
8387
P.string f "([";
@@ -156,9 +160,7 @@ let pp_deps_program
156160
P.string f empty_explanation
157161
(* This is empty module, it won't be referred anywhere *)
158162
else
159-
let output_dir = Filename.dirname output_prefix in
160-
P.string f L.strict_directive;
161-
P.newline f ;
163+
let output_dir = Filename.dirname output_prefix in
162164
begin
163165
ignore (match kind with
164166
| Es6 | Es6_global ->

0 commit comments

Comments
 (0)