diff --git a/jscomp/common/ext_log.ml b/jscomp/common/ext_log.ml index 1a56351b406..ab58b99adb7 100644 --- a/jscomp/common/ext_log.ml +++ b/jscomp/common/ext_log.ml @@ -26,7 +26,7 @@ type 'a logging = ('a, Format.formatter, unit, unit, unit, unit) format6 -> 'a (* TODO: add {[@.]} later for all *) let dwarn ?(__POS__ : (string * int * int * int) option) f = - if Js_config.get_diagnose () then + if !Js_config.diagnose then match __POS__ with | None -> Format.fprintf Format.err_formatter ("WARN: " ^^ f ^^ "@.") | Some (file, line, _, _) -> diff --git a/jscomp/common/js_config.ml b/jscomp/common/js_config.ml index 6f2a2c99779..0b479fa4a77 100644 --- a/jscomp/common/js_config.ml +++ b/jscomp/common/js_config.ml @@ -34,12 +34,6 @@ let directives = ref [] let cross_module_inline = ref false let diagnose = ref false -let get_diagnose () = - !diagnose -#ifndef RELEASE - || Sys.getenv_opt "RES_DEBUG_FILE" <> None -#endif - (* let (//) = Filename.concat *) (* let get_packages_info () = !packages_info *) diff --git a/jscomp/common/js_config.mli b/jscomp/common/js_config.mli index 6fc7a00199f..f5df0349d3b 100644 --- a/jscomp/common/js_config.mli +++ b/jscomp/common/js_config.mli @@ -52,9 +52,6 @@ val cross_module_inline : bool ref val diagnose : bool ref (** diagnose option *) -val get_diagnose : unit -> bool -(* val set_diagnose : bool -> unit *) - val no_builtin_ppx : bool ref (** options for builtin ppx *) diff --git a/jscomp/core/bs_cmi_load.ml b/jscomp/core/bs_cmi_load.ml index 7736bb782fb..6cc14490d56 100644 --- a/jscomp/core/bs_cmi_load.ml +++ b/jscomp/core/bs_cmi_load.ml @@ -47,10 +47,10 @@ let load_cmi ~unit_name : Env.Persistent_signature.t option = let {Cmij_cache.module_names; module_data} = Lazy.force cmi_cache in match Ext_string_array.find_sorted module_names unit_name with | Some index -> - if Js_config.get_diagnose () then + if !Js_config.diagnose then Format.fprintf Format.err_formatter ">Cmi: %s@." unit_name; let cmi = Cmij_cache.unmarshal_cmi_data module_data.(index) in - if Js_config.get_diagnose () then + if !Js_config.diagnose then Format.fprintf Format.err_formatter " - if Js_config.get_diagnose () then + if !Js_config.diagnose then Format.fprintf Format.err_formatter ">Cmj: %s@." unit_name; let cmj_table : Js_cmj_format.t = let { Cmij_cache.values; pure } = @@ -53,7 +53,7 @@ let load_builin_unit (unit_name : string) : Js_cmj_format.cmj_load_info = } (* FIXME when we change it *) in - if Js_config.get_diagnose () then + if !Js_config.diagnose then Format.fprintf Format.err_formatter " diff --git a/jscomp/core/lam_util.ml b/jscomp/core/lam_util.ml index fe2522b6575..88a5614cdd8 100644 --- a/jscomp/core/lam_util.ml +++ b/jscomp/core/lam_util.ml @@ -217,7 +217,7 @@ let dump ext lam = #else let log_counter = ref 0 let dump ext lam = - if Js_config.get_diagnose () + if !Js_config.diagnose then (* ATTENTION: easy to introduce a bug during refactoring when forgeting `begin` `end`*) begin diff --git a/scripts/dbg b/scripts/dbg deleted file mode 100755 index a596910b350..00000000000 --- a/scripts/dbg +++ /dev/null @@ -1,13 +0,0 @@ -#!/usr/bin/env node -var cp = require("child_process"); -var path = require("path"); - -var file = process.argv[2]; -console.log(file); -var fmt = path.parse(file); - -process.env.RES_DEBUG_FILE = 1; -var ninja = path.join(__dirname, "..", process.platform, "ninja.exe"); -cp.execSync(`touch ${file} && ${ninja} ${fmt.dir}/${fmt.name}.cmj`, { - stdio: [0, 1, 2] -});