Skip to content

Commit 24bba08

Browse files
committed
remove unused code
1 parent 716db8e commit 24bba08

File tree

7 files changed

+8
-31
lines changed

7 files changed

+8
-31
lines changed

jscomp/build_tests/bscx/input.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ var fs = require('fs')
44
var assert = require('assert')
55
var path = require('path')
66

7-
p.execSync(`bsc -bs-main main.ml`, { cwd: __dirname })
8-
7+
p.execSync(`bsc -c -bs-main main.ml`, { cwd: __dirname, shell:true })
98

9+
// TODO: test main.js correct ness
1010
try {
11-
assert.equal(require(path.join(__dirname, `main.js`)).v, 5)
11+
assert.equal(require(path.join(__dirname, `a2.js`)).v, 2)
1212
} finally {
1313
fs.readdirSync(`.`, 'utf8').forEach(x => {
1414
if (x !== 'input.js' && x.endsWith('.js')) {

jscomp/build_tests/namespace/src/demo.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

jscomp/build_tests/namespace/src/main.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

jscomp/core/js_dump_program.ml

+1-5
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,11 @@ module L = Js_dump_lit
2727

2828

2929
let string_of_module_id
30-
~hint_output_dir
3130
module_system
3231
id
3332
=
3433
Js_packages_info.string_of_module_id
35-
~hint_output_dir module_system
34+
module_system
3635
(Js_packages_state.get_packages_info ())
3736
Lam_compile_env.get_package_path_from_cmj
3837
id
@@ -57,7 +56,6 @@ let node_program ~output_prefix f ( x : J.deps_program) =
5756
(fun x ->
5857
Lam_module_ident.id x,
5958
string_of_module_id
60-
~hint_output_dir:(Filename.dirname output_prefix)
6159
NodeJS
6260
x)
6361
x.modules)
@@ -76,7 +74,6 @@ let amd_program ~output_prefix kind f ( x : J.deps_program) =
7674
List.iter (fun x ->
7775
let s : string =
7876
string_of_module_id
79-
~hint_output_dir:(Filename.dirname output_prefix)
8077
kind
8178
x in
8279
P.string f L.comma ;
@@ -116,7 +113,6 @@ let es6_program ~output_prefix fmt f ( x : J.deps_program) =
116113
(fun x ->
117114
Lam_module_ident.id x,
118115
string_of_module_id
119-
~hint_output_dir:(Filename.dirname output_prefix)
120116
fmt
121117
x)
122118
x.modules)

jscomp/core/js_packages_info.ml

+2-14
Original file line numberDiff line numberDiff line change
@@ -137,21 +137,12 @@ let query_package_infos
137137
can be cached
138138
*)
139139
let get_output_dir ~pkg_dir module_system
140-
~hint_output_dir
141140
({module_systems } : t ) =
142-
match module_systems with
143-
| []->
144-
if Filename.is_relative hint_output_dir then
145-
Filename.concat (Lazy.force Ext_filename.cwd )
146-
hint_output_dir
147-
else
148-
hint_output_dir
149-
| _ ->
150-
begin match List.find (fun (k,_) ->
141+
match List.find (fun (k,_) ->
151142
compatible k module_system) module_systems with
152143
| (_, path) -> Filename.concat pkg_dir path
153144
| exception _ -> assert false
154-
end
145+
155146

156147

157148
let add_npm_package_path s (packages_info : t) : t =
@@ -187,7 +178,6 @@ let string_of_module_id_in_browser (x : Lam_module_ident.t) =
187178

188179

189180
let string_of_module_id
190-
~hint_output_dir
191181
(module_system : module_system)
192182
(current_package_info : t)
193183
(get_package_path_from_cmj :
@@ -215,7 +205,6 @@ let string_of_module_id
215205
let current_unit_dir =
216206
`Dir (get_output_dir
217207
~pkg_dir:package_dir module_system
218-
~hint_output_dir
219208
current_package_info
220209
) in
221210
Ext_filename.node_relative_path different_package current_unit_dir dependency
@@ -262,7 +251,6 @@ let string_of_module_id
262251
(get_output_dir
263252
~pkg_dir:(Lazy.force Ext_filename.package_dir)
264253
module_system
265-
~hint_output_dir
266254
current_package_info
267255
)
268256
((Filename.dirname

jscomp/core/js_packages_info.mli

-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@ val add_npm_package_path :
6363
Note that it has to be consistent to how it is generated
6464
*)
6565
val string_of_module_id :
66-
hint_output_dir:string ->
6766
module_system ->
6867
t ->
6968
(Lam_module_ident.t ->

jscomp/ext/ext_filename.mli

-6
Original file line numberDiff line numberDiff line change
@@ -55,12 +55,6 @@ val node_relative_path : bool -> t -> [`File of string] -> string
5555
val chop_extension : ?loc:string -> string -> string
5656

5757

58-
59-
60-
61-
62-
val cwd : string Lazy.t
63-
6458
(* It is lazy so that it will not hit errors when in script mode *)
6559
val package_dir : string Lazy.t
6660

0 commit comments

Comments
 (0)