From a908a5e5cdb76422d75f7e910357c46e68334723 Mon Sep 17 00:00:00 2001 From: Hongbo Zhang Date: Thu, 27 Aug 2020 11:20:47 +0800 Subject: [PATCH 01/13] -warn-error as default to make bsb the source of truth --- jscomp/core/bs_conditional_initial.ml | 1 - jscomp/ext/bsc_warnings.ml | 1 - jscomp/main/js_main.ml | 6 ++---- jscomp/others/release.ninja | 2 +- jscomp/runtime/release.ninja | 2 +- jscomp/stdlib-406/release.ninja | 2 +- jscomp/test/build.ninja | 2 +- scripts/ninja.js | 10 +++++----- 8 files changed, 11 insertions(+), 15 deletions(-) diff --git a/jscomp/core/bs_conditional_initial.ml b/jscomp/core/bs_conditional_initial.ml index a1124f72be..dcba9dd1bc 100644 --- a/jscomp/core/bs_conditional_initial.ml +++ b/jscomp/core/bs_conditional_initial.ml @@ -35,7 +35,6 @@ let setup_env () = Matching.call_switcher_variant_constr := Polyvar_pattern_match.call_switcher_variant_constr; Clflags.no_std_include := true; Warnings.parse_options false Bsc_warnings.defaults_w; - Warnings.parse_options true Bsc_warnings.defaults_warn_error; Clflags.dump_location := false; Clflags.compile_only := true; Config.bs_only := true; diff --git a/jscomp/ext/bsc_warnings.ml b/jscomp/ext/bsc_warnings.ml index 00ba12796e..c671f48f8f 100644 --- a/jscomp/ext/bsc_warnings.ml +++ b/jscomp/ext/bsc_warnings.ml @@ -73,5 +73,4 @@ - 102 Bs_polymorphic_comparison *) let defaults_w = "+a-4-9-20-40-41-42-50-61-102" -let defaults_warn_error = "-a+5+6+101";; (*TODO: add +10*) diff --git a/jscomp/main/js_main.ml b/jscomp/main/js_main.ml index f010b15379..de03215eeb 100644 --- a/jscomp/main/js_main.ml +++ b/jscomp/main/js_main.ml @@ -294,10 +294,8 @@ let buckle_script_flags : (string * Bsc_args.spec * string) array = .. a range of consecutive warning numbers\n\ default setting is " ^ Bsc_warnings.defaults_w; - "-warn-error", string_call (Warnings.parse_options true), - " Enable or disable error status for warnings according\n\ - to . See option -w for the syntax of .\n\ - Default setting is " ^ Bsc_warnings.defaults_warn_error; + "-warn-error", string_call (fun _ -> ()), + "Deprecated: warnings are errors"; "-o", string_optional_set Clflags.output_name, " set output file name to "; diff --git a/jscomp/others/release.ninja b/jscomp/others/release.ninja index 9ea6d11c58..e695804538 100644 --- a/jscomp/others/release.ninja +++ b/jscomp/others/release.ninja @@ -1,5 +1,5 @@ -bsc_flags = -no-keep-locs -absname -no-alias-deps -bs-no-version-header -bs-no-check-div-by-zero -nostdlib -bs-cross-module-opt -bs-package-name bs-platform -bs-package-output commonjs:lib/js -bs-package-output es6:lib/es6 -nopervasives -unsafe -w +50 -warn-error A -open Bs_stdlib_mini -I ./runtime +bsc_flags = -no-keep-locs -absname -no-alias-deps -bs-no-version-header -bs-no-check-div-by-zero -nostdlib -bs-cross-module-opt -bs-package-name bs-platform -bs-package-output commonjs:lib/js -bs-package-output es6:lib/es6 -nopervasives -unsafe -w +50 -open Bs_stdlib_mini -I ./runtime rule cc command = $bsc -bs-cmi -bs-cmj $bsc_flags -I others $in diff --git a/jscomp/runtime/release.ninja b/jscomp/runtime/release.ninja index afb4b3d528..48808eb32f 100644 --- a/jscomp/runtime/release.ninja +++ b/jscomp/runtime/release.ninja @@ -1,5 +1,5 @@ -bsc_no_open_flags = -no-keep-locs -absname -no-alias-deps -bs-no-version-header -bs-no-check-div-by-zero -nostdlib -bs-cross-module-opt -bs-package-name bs-platform -bs-package-output commonjs:lib/js -bs-package-output es6:lib/es6 -nopervasives -unsafe -w +50 -warn-error A +bsc_no_open_flags = -no-keep-locs -absname -no-alias-deps -bs-no-version-header -bs-no-check-div-by-zero -nostdlib -bs-cross-module-opt -bs-package-name bs-platform -bs-package-output commonjs:lib/js -bs-package-output es6:lib/es6 -nopervasives -unsafe -w +50 bsc_flags = $bsc_no_open_flags -open Bs_stdlib_mini rule cc diff --git a/jscomp/stdlib-406/release.ninja b/jscomp/stdlib-406/release.ninja index dea618a6d0..f4f127e058 100644 --- a/jscomp/stdlib-406/release.ninja +++ b/jscomp/stdlib-406/release.ninja @@ -1,5 +1,5 @@ -bsc_flags = -no-keep-locs -absname -no-alias-deps -bs-no-version-header -bs-no-check-div-by-zero -nostdlib -bs-cross-module-opt -bs-package-name bs-platform -bs-package-output commonjs:lib/js -bs-package-output es6:lib/es6 -w -9-3-106 -warn-error A -I runtime -I others +bsc_flags = -no-keep-locs -absname -no-alias-deps -bs-no-version-header -bs-no-check-div-by-zero -nostdlib -bs-cross-module-opt -bs-package-name bs-platform -bs-package-output commonjs:lib/js -bs-package-output es6:lib/es6 -w -9-3-106 -I runtime -I others rule cc command = $bsc -bs-cmi -bs-cmj $bsc_flags -I stdlib-406 $in diff --git a/jscomp/test/build.ninja b/jscomp/test/build.ninja index a9b734be24..d58d59f165 100644 --- a/jscomp/test/build.ninja +++ b/jscomp/test/build.ninja @@ -1,5 +1,5 @@ -bsc_flags = -absname -bs-no-version-header -bs-cross-module-opt -bs-package-name bs-platform -bs-package-output commonjs:jscomp/test -w -3-6-26-27-29-30-32..40-44-45-52-60-9-106+104 -warn-error A -I runtime -I $stdlib -I others +bsc_flags = -absname -bs-no-version-header -bs-cross-module-opt -bs-package-name bs-platform -bs-package-output commonjs:jscomp/test -w -3-6-26-27-29-30-32..40-44-45-52-60-9-106+104 -I runtime -I $stdlib -I others rule cc command = $bsc -bs-cmi -bs-cmj $bsc_flags -I test $in diff --git a/scripts/ninja.js b/scripts/ninja.js index 811d8869ac..bded5701e1 100755 --- a/scripts/ninja.js +++ b/scripts/ninja.js @@ -873,7 +873,7 @@ async function runtimeNinja(devmode = true) { : "build.ninja" : "release.ninja"; var templateRuntimeRules = ` -bsc_no_open_flags = ${commonBsFlags} -bs-cross-module-opt -bs-package-name bs-platform -bs-package-output commonjs:lib/js -bs-package-output es6:lib/es6 -nopervasives -unsafe -w +50 -warn-error A +bsc_no_open_flags = ${commonBsFlags} -bs-cross-module-opt -bs-package-name bs-platform -bs-package-output commonjs:lib/js -bs-package-output es6:lib/es6 -nopervasives -unsafe -w +50 bsc_flags = $bsc_no_open_flags -open Bs_stdlib_mini ${ruleCC(ninjaCwd)} ${ninjaQuickBuidList([ @@ -972,7 +972,7 @@ async function othersNinja(devmode = true) { var ninjaCwd = "others"; var templateOthersRules = ` -bsc_flags = ${commonBsFlags} -bs-cross-module-opt -bs-package-name bs-platform -bs-package-output commonjs:lib/js -bs-package-output es6:lib/es6 -nopervasives -unsafe -w +50 -warn-error A -open Bs_stdlib_mini -I ./runtime +bsc_flags = ${commonBsFlags} -bs-cross-module-opt -bs-package-name bs-platform -bs-package-output commonjs:lib/js -bs-package-output es6:lib/es6 -nopervasives -unsafe -w +50 -open Bs_stdlib_mini -I ./runtime ${ruleCC(ninjaCwd)} ${ devmode @@ -1099,7 +1099,7 @@ async function stdlibNinja(devmode = true) { var bsc_builtin_overrides = [[bsc_flags, `$${bsc_flags} -nopervasives`]]; // It is interesting `-w -a` would generate not great code sometimes // deprecations diabled due to string_of_float - var warnings = "-w -9-3-106 -warn-error A"; + var warnings = "-w -9-3-106"; var templateStdlibRules = ` ${bsc_flags} = ${commonBsFlags} -bs-cross-module-opt -bs-package-name bs-platform -bs-package-output commonjs:lib/js -bs-package-output es6:lib/es6 ${warnings} -I runtime -I others ${ruleCC(ninjaCwd)} @@ -1235,7 +1235,7 @@ async function testNinja() { var ninjaOutput = useEnv ? "env.ninja" : "build.ninja"; var ninjaCwd = `test`; var templateTestRules = ` -bsc_flags = -absname -bs-no-version-header -bs-cross-module-opt -bs-package-name bs-platform -bs-package-output commonjs:jscomp/test -w -3-6-26-27-29-30-32..40-44-45-52-60-9-106+104 -warn-error A -I runtime -I $stdlib -I others +bsc_flags = -absname -bs-no-version-header -bs-cross-module-opt -bs-package-name bs-platform -bs-package-output commonjs:jscomp/test -w -3-6-26-27-29-30-32..40-44-45-52-60-9-106+104 -I runtime -I $stdlib -I others ${ruleCC(ninjaCwd)} @@ -1611,7 +1611,7 @@ function nativeNinja() { subninja ${getPreprocessorFileName()} rule optc command = BS_NATIVE=${!!process.env - .BS_NATIVE} $ocamlopt -safe-string -I +compiler-libs -opaque ${includes} -g -linscan -w A-4-9-40..42-30-48-50 -warn-error A -absname -c $in + .BS_NATIVE} $ocamlopt -safe-string -I +compiler-libs -opaque ${includes} -g -linscan -w A-4-9-40..42-30-48-50 -absname -c $in description = $out : $in rule archive command = $ocamlopt -a $in -o $out From 9ee46dcabc6d488303e13553e100565cf0693508 Mon Sep 17 00:00:00 2001 From: Hongbo Zhang Date: Thu, 27 Aug 2020 11:20:55 +0800 Subject: [PATCH 02/13] snapshot --- lib/4.06.1/bsb.ml | 1 - lib/4.06.1/unstable/bsb_native.ml | 1 - lib/4.06.1/unstable/bspack.ml | 30 ++++++++- lib/4.06.1/unstable/js_compiler.ml | 64 ++++++++++++-------- lib/4.06.1/unstable/js_refmt_compiler.ml | 63 +++++++++++-------- lib/4.06.1/unstable/native_ppx.ml | 30 ++++++++- lib/4.06.1/whole_compiler.ml | 77 +++++++++--------------- 7 files changed, 160 insertions(+), 106 deletions(-) diff --git a/lib/4.06.1/bsb.ml b/lib/4.06.1/bsb.ml index e9b610a25c..4428a503cb 100644 --- a/lib/4.06.1/bsb.ml +++ b/lib/4.06.1/bsb.ml @@ -7326,7 +7326,6 @@ module Bsc_warnings - 102 Bs_polymorphic_comparison *) let defaults_w = "+a-4-9-20-40-41-42-50-61-102" -let defaults_warn_error = "-a+5+6+101";; (*TODO: add +10*) end diff --git a/lib/4.06.1/unstable/bsb_native.ml b/lib/4.06.1/unstable/bsb_native.ml index 729854a80e..e2964b39cc 100644 --- a/lib/4.06.1/unstable/bsb_native.ml +++ b/lib/4.06.1/unstable/bsb_native.ml @@ -7332,7 +7332,6 @@ module Bsc_warnings - 102 Bs_polymorphic_comparison *) let defaults_w = "+a-4-9-20-40-41-42-50-61-102" -let defaults_warn_error = "-a+5+6+101";; (*TODO: add +10*) end diff --git a/lib/4.06.1/unstable/bspack.ml b/lib/4.06.1/unstable/bspack.ml index 09ecba4f49..92a155acdb 100644 --- a/lib/4.06.1/unstable/bspack.ml +++ b/lib/4.06.1/unstable/bspack.ml @@ -3383,7 +3383,9 @@ type t = | Wildcard_arg_to_constant_constr (* 28 *) | Eol_in_string (* 29 *) | Duplicate_definitions of string * string * string * string (* 30 *) + | Multiple_definition of string * string * string (* 31 *) + | Unused_value_declaration of string (* 32 *) | Unused_open of string (* 33 *) | Unused_type_declaration of string (* 34 *) @@ -3403,14 +3405,18 @@ type t = | Eliminated_optional_arguments of string list (* 48 *) | No_cmi_file of string * string option (* 49 *) | Bad_docstring of bool (* 50 *) + | Expect_tailcall (* 51 *) + | Fragile_literal_pattern (* 52 *) | Misplaced_attribute of string (* 53 *) | Duplicated_attribute of string (* 54 *) | Inlining_impossible of string (* 55 *) | Unreachable_case (* 56 *) | Ambiguous_pattern of string list (* 57 *) + | No_cmx_file of string (* 58 *) + | Assignment_to_non_mutable_value (* 59 *) | Unused_module of string (* 60 *) | Unboxable_type_in_prim_decl of string (* 61 *) @@ -3461,7 +3467,7 @@ val mk_lazy: (unit -> 'a) -> 'a Lazy.t the warning settings at the time [mk_lazy] is called. *) -val nerrors : int ref +val disabled : bool ref val message : t -> string val number: t -> int val super_report : @@ -3530,7 +3536,9 @@ type t = | Wildcard_arg_to_constant_constr (* 28 *) | Eol_in_string (* 29 *) | Duplicate_definitions of string * string * string * string (*30 *) + | Multiple_definition of string * string * string (* 31 *) + | Unused_value_declaration of string (* 32 *) | Unused_open of string (* 33 *) | Unused_type_declaration of string (* 34 *) @@ -3550,14 +3558,18 @@ type t = | Eliminated_optional_arguments of string list (* 48 *) | No_cmi_file of string * string option (* 49 *) | Bad_docstring of bool (* 50 *) + | Expect_tailcall (* 51 *) + | Fragile_literal_pattern (* 52 *) | Misplaced_attribute of string (* 53 *) | Duplicated_attribute of string (* 54 *) | Inlining_impossible of string (* 55 *) | Unreachable_case (* 56 *) | Ambiguous_pattern of string list (* 57 *) + | No_cmx_file of string (* 58 *) + | Assignment_to_non_mutable_value (* 59 *) | Unused_module of string (* 60 *) | Unboxable_type_in_prim_decl of string (* 61 *) @@ -3612,7 +3624,9 @@ let number = function | Wildcard_arg_to_constant_constr -> 28 | Eol_in_string -> 29 | Duplicate_definitions _ -> 30 + | Multiple_definition _ -> 31 + | Unused_value_declaration _ -> 32 | Unused_open _ -> 33 | Unused_type_declaration _ -> 34 @@ -3632,14 +3646,18 @@ let number = function | Eliminated_optional_arguments _ -> 48 | No_cmi_file _ -> 49 | Bad_docstring _ -> 50 + | Expect_tailcall -> 51 + | Fragile_literal_pattern -> 52 | Misplaced_attribute _ -> 53 | Duplicated_attribute _ -> 54 | Inlining_impossible _ -> 55 | Unreachable_case -> 56 | Ambiguous_pattern _ -> 57 + | No_cmx_file _ -> 58 + | Assignment_to_non_mutable_value -> 59 | Unused_module _ -> 60 | Unboxable_type_in_prim_decl _ -> 61 @@ -3717,7 +3735,9 @@ let backup () = !current let restore x = current := x let is_active x = not !disabled && (!current).active.(number x);; -let is_error x = not !disabled && (!current).error.(number x);; + +let is_error = is_active + let mk_lazy f = let state = backup () in @@ -3881,10 +3901,12 @@ let message = function | Duplicate_definitions (kind, cname, tc1, tc2) -> Printf.sprintf "the %s %s is defined in both types %s and %s." kind cname tc1 tc2 + | Multiple_definition(modname, file1, file2) -> Printf.sprintf "files %s and %s both define a module named %s" file1 file2 modname + | Unused_value_declaration v -> "unused value " ^ v ^ "." | Unused_open s -> "unused open " ^ s ^ "." | Unused_type_declaration s -> "unused type " ^ s ^ "." @@ -3964,8 +3986,10 @@ let message = function | Bad_docstring unattached -> if unattached then "unattached documentation comment (ignored)" else "ambiguous documentation comment" + | Expect_tailcall -> Printf.sprintf "expected tailcall" + | Fragile_literal_pattern -> Printf.sprintf "Code should not depend on the actual values of\n\ @@ -3994,10 +4018,12 @@ let message = function "Ambiguous or-pattern variables under guard;\n\ %s may match different arguments. (See manual section 8.5)" msg + | No_cmx_file name -> Printf.sprintf "no cmx file was found in path for module %s, \ and its interface was not compiled with -opaque" name + | Assignment_to_non_mutable_value -> "A potential assignment to a non-mutable value was detected \n\ in this source file. Such assignments may generate incorrect code \n\ diff --git a/lib/4.06.1/unstable/js_compiler.ml b/lib/4.06.1/unstable/js_compiler.ml index 051f66bd62..7e963a42dd 100644 --- a/lib/4.06.1/unstable/js_compiler.ml +++ b/lib/4.06.1/unstable/js_compiler.ml @@ -3650,7 +3650,9 @@ type t = | Wildcard_arg_to_constant_constr (* 28 *) | Eol_in_string (* 29 *) | Duplicate_definitions of string * string * string * string (* 30 *) + | Multiple_definition of string * string * string (* 31 *) + | Unused_value_declaration of string (* 32 *) | Unused_open of string (* 33 *) | Unused_type_declaration of string (* 34 *) @@ -3670,14 +3672,18 @@ type t = | Eliminated_optional_arguments of string list (* 48 *) | No_cmi_file of string * string option (* 49 *) | Bad_docstring of bool (* 50 *) + | Expect_tailcall (* 51 *) + | Fragile_literal_pattern (* 52 *) | Misplaced_attribute of string (* 53 *) | Duplicated_attribute of string (* 54 *) | Inlining_impossible of string (* 55 *) | Unreachable_case (* 56 *) | Ambiguous_pattern of string list (* 57 *) + | No_cmx_file of string (* 58 *) + | Assignment_to_non_mutable_value (* 59 *) | Unused_module of string (* 60 *) | Unboxable_type_in_prim_decl of string (* 61 *) @@ -3728,7 +3734,7 @@ val mk_lazy: (unit -> 'a) -> 'a Lazy.t the warning settings at the time [mk_lazy] is called. *) -val nerrors : int ref +val disabled : bool ref val message : t -> string val number: t -> int val super_report : @@ -3797,7 +3803,9 @@ type t = | Wildcard_arg_to_constant_constr (* 28 *) | Eol_in_string (* 29 *) | Duplicate_definitions of string * string * string * string (*30 *) + | Multiple_definition of string * string * string (* 31 *) + | Unused_value_declaration of string (* 32 *) | Unused_open of string (* 33 *) | Unused_type_declaration of string (* 34 *) @@ -3817,14 +3825,18 @@ type t = | Eliminated_optional_arguments of string list (* 48 *) | No_cmi_file of string * string option (* 49 *) | Bad_docstring of bool (* 50 *) + | Expect_tailcall (* 51 *) + | Fragile_literal_pattern (* 52 *) | Misplaced_attribute of string (* 53 *) | Duplicated_attribute of string (* 54 *) | Inlining_impossible of string (* 55 *) | Unreachable_case (* 56 *) | Ambiguous_pattern of string list (* 57 *) + | No_cmx_file of string (* 58 *) + | Assignment_to_non_mutable_value (* 59 *) | Unused_module of string (* 60 *) | Unboxable_type_in_prim_decl of string (* 61 *) @@ -3879,7 +3891,9 @@ let number = function | Wildcard_arg_to_constant_constr -> 28 | Eol_in_string -> 29 | Duplicate_definitions _ -> 30 + | Multiple_definition _ -> 31 + | Unused_value_declaration _ -> 32 | Unused_open _ -> 33 | Unused_type_declaration _ -> 34 @@ -3899,14 +3913,18 @@ let number = function | Eliminated_optional_arguments _ -> 48 | No_cmi_file _ -> 49 | Bad_docstring _ -> 50 + | Expect_tailcall -> 51 + | Fragile_literal_pattern -> 52 | Misplaced_attribute _ -> 53 | Duplicated_attribute _ -> 54 | Inlining_impossible _ -> 55 | Unreachable_case -> 56 | Ambiguous_pattern _ -> 57 + | No_cmx_file _ -> 58 + | Assignment_to_non_mutable_value -> 59 | Unused_module _ -> 60 | Unboxable_type_in_prim_decl _ -> 61 @@ -3984,7 +4002,9 @@ let backup () = !current let restore x = current := x let is_active x = not !disabled && (!current).active.(number x);; -let is_error x = not !disabled && (!current).error.(number x);; + +let is_error = is_active + let mk_lazy f = let state = backup () in @@ -4148,10 +4168,12 @@ let message = function | Duplicate_definitions (kind, cname, tc1, tc2) -> Printf.sprintf "the %s %s is defined in both types %s and %s." kind cname tc1 tc2 + | Multiple_definition(modname, file1, file2) -> Printf.sprintf "files %s and %s both define a module named %s" file1 file2 modname + | Unused_value_declaration v -> "unused value " ^ v ^ "." | Unused_open s -> "unused open " ^ s ^ "." | Unused_type_declaration s -> "unused type " ^ s ^ "." @@ -4231,8 +4253,10 @@ let message = function | Bad_docstring unattached -> if unattached then "unattached documentation comment (ignored)" else "ambiguous documentation comment" + | Expect_tailcall -> Printf.sprintf "expected tailcall" + | Fragile_literal_pattern -> Printf.sprintf "Code should not depend on the actual values of\n\ @@ -4261,10 +4285,12 @@ let message = function "Ambiguous or-pattern variables under guard;\n\ %s may match different arguments. (See manual section 8.5)" msg + | No_cmx_file name -> Printf.sprintf "no cmx file was found in path for module %s, \ and its interface was not compiled with -opaque" name + | Assignment_to_non_mutable_value -> "A potential assignment to a non-mutable value was detected \n\ in this source file. Such assignments may generate incorrect code \n\ @@ -18141,7 +18167,6 @@ module Bsc_warnings - 102 Bs_polymorphic_comparison *) let defaults_w = "+a-4-9-20-40-41-42-50-61-102" -let defaults_warn_error = "-a+5+6+101";; (*TODO: add +10*) end @@ -81758,7 +81783,6 @@ let setup_env () = Matching.call_switcher_variant_constr := Polyvar_pattern_match.call_switcher_variant_constr; Clflags.no_std_include := true; Warnings.parse_options false Bsc_warnings.defaults_w; - Warnings.parse_options true Bsc_warnings.defaults_warn_error; Clflags.dump_location := false; Clflags.compile_only := true; Config.bs_only := true; @@ -399974,6 +399998,7 @@ let compile Ext_string.compare (Lam_module_ident.name id1) (Lam_module_ident.name id2) ) in + Warnings.check_fatal (); let effect = Lam_stats_export.get_dependent_module_effect maybe_pure external_module_ids in @@ -400005,36 +400030,23 @@ let lambda_as_module (if !Js_config.bs_suffix then Literals.suffix_bs_js else Literals.suffix_js) in let package_info = Js_packages_state.get_packages_info () in - if Js_packages_info.is_empty package_info && !Js_config.js_stdout then begin - Js_dump_program.dump_deps_program ~output_prefix NodeJS lambda_output stdout; - if !Warnings.nerrors > 0 then begin - Warnings.nerrors := 0; - exit 77 - end - end else + if Js_packages_info.is_empty package_info && !Js_config.js_stdout then + Js_dump_program.dump_deps_program ~output_prefix NodeJS lambda_output stdout + else Js_packages_info.iter package_info (fun {module_system; path = _path} -> let output_chan chan = Js_dump_program.dump_deps_program ~output_prefix module_system lambda_output chan in - let target_file = - (Lazy.force Ext_path.package_dir // - _path // - basename - (* #913 only generate little-case js file *) - ) in - if !Warnings.nerrors > 0 then begin - Warnings.nerrors := 0 ; - if Sys.file_exists target_file then Sys.remove target_file; - exit 77 - (* don't write js file, we need remove js files - otherwise the js files are out-of-date - exit 177 *) - end else if not @@ !Clflags.dont_write_files then Ext_pervasives.with_file_as_chan - target_file output_chan ) + + (Lazy.force Ext_path.package_dir // + _path // + basename + (* #913 only generate little-case js file *) + ) output_chan ) diff --git a/lib/4.06.1/unstable/js_refmt_compiler.ml b/lib/4.06.1/unstable/js_refmt_compiler.ml index 155c3edc21..55053e73ae 100644 --- a/lib/4.06.1/unstable/js_refmt_compiler.ml +++ b/lib/4.06.1/unstable/js_refmt_compiler.ml @@ -3650,7 +3650,9 @@ type t = | Wildcard_arg_to_constant_constr (* 28 *) | Eol_in_string (* 29 *) | Duplicate_definitions of string * string * string * string (* 30 *) + | Multiple_definition of string * string * string (* 31 *) + | Unused_value_declaration of string (* 32 *) | Unused_open of string (* 33 *) | Unused_type_declaration of string (* 34 *) @@ -3670,14 +3672,18 @@ type t = | Eliminated_optional_arguments of string list (* 48 *) | No_cmi_file of string * string option (* 49 *) | Bad_docstring of bool (* 50 *) + | Expect_tailcall (* 51 *) + | Fragile_literal_pattern (* 52 *) | Misplaced_attribute of string (* 53 *) | Duplicated_attribute of string (* 54 *) | Inlining_impossible of string (* 55 *) | Unreachable_case (* 56 *) | Ambiguous_pattern of string list (* 57 *) + | No_cmx_file of string (* 58 *) + | Assignment_to_non_mutable_value (* 59 *) | Unused_module of string (* 60 *) | Unboxable_type_in_prim_decl of string (* 61 *) @@ -3728,7 +3734,7 @@ val mk_lazy: (unit -> 'a) -> 'a Lazy.t the warning settings at the time [mk_lazy] is called. *) -val nerrors : int ref +val disabled : bool ref val message : t -> string val number: t -> int val super_report : @@ -3797,7 +3803,9 @@ type t = | Wildcard_arg_to_constant_constr (* 28 *) | Eol_in_string (* 29 *) | Duplicate_definitions of string * string * string * string (*30 *) + | Multiple_definition of string * string * string (* 31 *) + | Unused_value_declaration of string (* 32 *) | Unused_open of string (* 33 *) | Unused_type_declaration of string (* 34 *) @@ -3817,14 +3825,18 @@ type t = | Eliminated_optional_arguments of string list (* 48 *) | No_cmi_file of string * string option (* 49 *) | Bad_docstring of bool (* 50 *) + | Expect_tailcall (* 51 *) + | Fragile_literal_pattern (* 52 *) | Misplaced_attribute of string (* 53 *) | Duplicated_attribute of string (* 54 *) | Inlining_impossible of string (* 55 *) | Unreachable_case (* 56 *) | Ambiguous_pattern of string list (* 57 *) + | No_cmx_file of string (* 58 *) + | Assignment_to_non_mutable_value (* 59 *) | Unused_module of string (* 60 *) | Unboxable_type_in_prim_decl of string (* 61 *) @@ -3879,7 +3891,9 @@ let number = function | Wildcard_arg_to_constant_constr -> 28 | Eol_in_string -> 29 | Duplicate_definitions _ -> 30 + | Multiple_definition _ -> 31 + | Unused_value_declaration _ -> 32 | Unused_open _ -> 33 | Unused_type_declaration _ -> 34 @@ -3899,14 +3913,18 @@ let number = function | Eliminated_optional_arguments _ -> 48 | No_cmi_file _ -> 49 | Bad_docstring _ -> 50 + | Expect_tailcall -> 51 + | Fragile_literal_pattern -> 52 | Misplaced_attribute _ -> 53 | Duplicated_attribute _ -> 54 | Inlining_impossible _ -> 55 | Unreachable_case -> 56 | Ambiguous_pattern _ -> 57 + | No_cmx_file _ -> 58 + | Assignment_to_non_mutable_value -> 59 | Unused_module _ -> 60 | Unboxable_type_in_prim_decl _ -> 61 @@ -3984,7 +4002,9 @@ let backup () = !current let restore x = current := x let is_active x = not !disabled && (!current).active.(number x);; -let is_error x = not !disabled && (!current).error.(number x);; + +let is_error = is_active + let mk_lazy f = let state = backup () in @@ -4148,10 +4168,12 @@ let message = function | Duplicate_definitions (kind, cname, tc1, tc2) -> Printf.sprintf "the %s %s is defined in both types %s and %s." kind cname tc1 tc2 + | Multiple_definition(modname, file1, file2) -> Printf.sprintf "files %s and %s both define a module named %s" file1 file2 modname + | Unused_value_declaration v -> "unused value " ^ v ^ "." | Unused_open s -> "unused open " ^ s ^ "." | Unused_type_declaration s -> "unused type " ^ s ^ "." @@ -4231,8 +4253,10 @@ let message = function | Bad_docstring unattached -> if unattached then "unattached documentation comment (ignored)" else "ambiguous documentation comment" + | Expect_tailcall -> Printf.sprintf "expected tailcall" + | Fragile_literal_pattern -> Printf.sprintf "Code should not depend on the actual values of\n\ @@ -4261,10 +4285,12 @@ let message = function "Ambiguous or-pattern variables under guard;\n\ %s may match different arguments. (See manual section 8.5)" msg + | No_cmx_file name -> Printf.sprintf "no cmx file was found in path for module %s, \ and its interface was not compiled with -opaque" name + | Assignment_to_non_mutable_value -> "A potential assignment to a non-mutable value was detected \n\ in this source file. Such assignments may generate incorrect code \n\ @@ -18141,7 +18167,6 @@ module Bsc_warnings - 102 Bs_polymorphic_comparison *) let defaults_w = "+a-4-9-20-40-41-42-50-61-102" -let defaults_warn_error = "-a+5+6+101";; (*TODO: add +10*) end @@ -81758,7 +81783,6 @@ let setup_env () = Matching.call_switcher_variant_constr := Polyvar_pattern_match.call_switcher_variant_constr; Clflags.no_std_include := true; Warnings.parse_options false Bsc_warnings.defaults_w; - Warnings.parse_options true Bsc_warnings.defaults_warn_error; Clflags.dump_location := false; Clflags.compile_only := true; Config.bs_only := true; @@ -399974,6 +399998,7 @@ let compile Ext_string.compare (Lam_module_ident.name id1) (Lam_module_ident.name id2) ) in + Warnings.check_fatal (); let effect = Lam_stats_export.get_dependent_module_effect maybe_pure external_module_ids in @@ -400005,35 +400030,23 @@ let lambda_as_module (if !Js_config.bs_suffix then Literals.suffix_bs_js else Literals.suffix_js) in let package_info = Js_packages_state.get_packages_info () in - if Js_packages_info.is_empty package_info && !Js_config.js_stdout then begin - Js_dump_program.dump_deps_program ~output_prefix NodeJS lambda_output stdout; - if !Warnings.nerrors > 0 then begin - Warnings.nerrors := 0; - end - end else + if Js_packages_info.is_empty package_info && !Js_config.js_stdout then + Js_dump_program.dump_deps_program ~output_prefix NodeJS lambda_output stdout + else Js_packages_info.iter package_info (fun {module_system; path = _path} -> let output_chan chan = Js_dump_program.dump_deps_program ~output_prefix module_system lambda_output chan in - let target_file = - (Lazy.force Ext_path.package_dir // - _path // - basename - (* #913 only generate little-case js file *) - ) in - if !Warnings.nerrors > 0 then begin - Warnings.nerrors := 0 ; - if Sys.file_exists target_file then Sys.remove target_file; - exit 77 - (* don't write js file, we need remove js files - otherwise the js files are out-of-date - exit 177 *) - end else if not @@ !Clflags.dont_write_files then Ext_pervasives.with_file_as_chan - target_file output_chan ) + + (Lazy.force Ext_path.package_dir // + _path // + basename + (* #913 only generate little-case js file *) + ) output_chan ) diff --git a/lib/4.06.1/unstable/native_ppx.ml b/lib/4.06.1/unstable/native_ppx.ml index 9b0be08cb1..e3756d28a9 100644 --- a/lib/4.06.1/unstable/native_ppx.ml +++ b/lib/4.06.1/unstable/native_ppx.ml @@ -3383,7 +3383,9 @@ type t = | Wildcard_arg_to_constant_constr (* 28 *) | Eol_in_string (* 29 *) | Duplicate_definitions of string * string * string * string (* 30 *) + | Multiple_definition of string * string * string (* 31 *) + | Unused_value_declaration of string (* 32 *) | Unused_open of string (* 33 *) | Unused_type_declaration of string (* 34 *) @@ -3403,14 +3405,18 @@ type t = | Eliminated_optional_arguments of string list (* 48 *) | No_cmi_file of string * string option (* 49 *) | Bad_docstring of bool (* 50 *) + | Expect_tailcall (* 51 *) + | Fragile_literal_pattern (* 52 *) | Misplaced_attribute of string (* 53 *) | Duplicated_attribute of string (* 54 *) | Inlining_impossible of string (* 55 *) | Unreachable_case (* 56 *) | Ambiguous_pattern of string list (* 57 *) + | No_cmx_file of string (* 58 *) + | Assignment_to_non_mutable_value (* 59 *) | Unused_module of string (* 60 *) | Unboxable_type_in_prim_decl of string (* 61 *) @@ -3461,7 +3467,7 @@ val mk_lazy: (unit -> 'a) -> 'a Lazy.t the warning settings at the time [mk_lazy] is called. *) -val nerrors : int ref +val disabled : bool ref val message : t -> string val number: t -> int val super_report : @@ -3530,7 +3536,9 @@ type t = | Wildcard_arg_to_constant_constr (* 28 *) | Eol_in_string (* 29 *) | Duplicate_definitions of string * string * string * string (*30 *) + | Multiple_definition of string * string * string (* 31 *) + | Unused_value_declaration of string (* 32 *) | Unused_open of string (* 33 *) | Unused_type_declaration of string (* 34 *) @@ -3550,14 +3558,18 @@ type t = | Eliminated_optional_arguments of string list (* 48 *) | No_cmi_file of string * string option (* 49 *) | Bad_docstring of bool (* 50 *) + | Expect_tailcall (* 51 *) + | Fragile_literal_pattern (* 52 *) | Misplaced_attribute of string (* 53 *) | Duplicated_attribute of string (* 54 *) | Inlining_impossible of string (* 55 *) | Unreachable_case (* 56 *) | Ambiguous_pattern of string list (* 57 *) + | No_cmx_file of string (* 58 *) + | Assignment_to_non_mutable_value (* 59 *) | Unused_module of string (* 60 *) | Unboxable_type_in_prim_decl of string (* 61 *) @@ -3612,7 +3624,9 @@ let number = function | Wildcard_arg_to_constant_constr -> 28 | Eol_in_string -> 29 | Duplicate_definitions _ -> 30 + | Multiple_definition _ -> 31 + | Unused_value_declaration _ -> 32 | Unused_open _ -> 33 | Unused_type_declaration _ -> 34 @@ -3632,14 +3646,18 @@ let number = function | Eliminated_optional_arguments _ -> 48 | No_cmi_file _ -> 49 | Bad_docstring _ -> 50 + | Expect_tailcall -> 51 + | Fragile_literal_pattern -> 52 | Misplaced_attribute _ -> 53 | Duplicated_attribute _ -> 54 | Inlining_impossible _ -> 55 | Unreachable_case -> 56 | Ambiguous_pattern _ -> 57 + | No_cmx_file _ -> 58 + | Assignment_to_non_mutable_value -> 59 | Unused_module _ -> 60 | Unboxable_type_in_prim_decl _ -> 61 @@ -3717,7 +3735,9 @@ let backup () = !current let restore x = current := x let is_active x = not !disabled && (!current).active.(number x);; -let is_error x = not !disabled && (!current).error.(number x);; + +let is_error = is_active + let mk_lazy f = let state = backup () in @@ -3881,10 +3901,12 @@ let message = function | Duplicate_definitions (kind, cname, tc1, tc2) -> Printf.sprintf "the %s %s is defined in both types %s and %s." kind cname tc1 tc2 + | Multiple_definition(modname, file1, file2) -> Printf.sprintf "files %s and %s both define a module named %s" file1 file2 modname + | Unused_value_declaration v -> "unused value " ^ v ^ "." | Unused_open s -> "unused open " ^ s ^ "." | Unused_type_declaration s -> "unused type " ^ s ^ "." @@ -3964,8 +3986,10 @@ let message = function | Bad_docstring unattached -> if unattached then "unattached documentation comment (ignored)" else "ambiguous documentation comment" + | Expect_tailcall -> Printf.sprintf "expected tailcall" + | Fragile_literal_pattern -> Printf.sprintf "Code should not depend on the actual values of\n\ @@ -3994,10 +4018,12 @@ let message = function "Ambiguous or-pattern variables under guard;\n\ %s may match different arguments. (See manual section 8.5)" msg + | No_cmx_file name -> Printf.sprintf "no cmx file was found in path for module %s, \ and its interface was not compiled with -opaque" name + | Assignment_to_non_mutable_value -> "A potential assignment to a non-mutable value was detected \n\ in this source file. Such assignments may generate incorrect code \n\ diff --git a/lib/4.06.1/whole_compiler.ml b/lib/4.06.1/whole_compiler.ml index d004fecd0d..d32c906422 100644 --- a/lib/4.06.1/whole_compiler.ml +++ b/lib/4.06.1/whole_compiler.ml @@ -3327,7 +3327,7 @@ type t = | Wildcard_arg_to_constant_constr (* 28 *) | Eol_in_string (* 29 *) | Duplicate_definitions of string * string * string * string (* 30 *) - | Multiple_definition of string * string * string (* 31 *) + | Unused_value_declaration of string (* 32 *) | Unused_open of string (* 33 *) | Unused_type_declaration of string (* 34 *) @@ -3347,14 +3347,14 @@ type t = | Eliminated_optional_arguments of string list (* 48 *) | No_cmi_file of string * string option (* 49 *) | Bad_docstring of bool (* 50 *) - | Expect_tailcall (* 51 *) + | Fragile_literal_pattern (* 52 *) | Misplaced_attribute of string (* 53 *) | Duplicated_attribute of string (* 54 *) | Inlining_impossible of string (* 55 *) | Unreachable_case (* 56 *) | Ambiguous_pattern of string list (* 57 *) - | No_cmx_file of string (* 58 *) + | Assignment_to_non_mutable_value (* 59 *) | Unused_module of string (* 60 *) | Unboxable_type_in_prim_decl of string (* 61 *) @@ -3405,7 +3405,7 @@ val mk_lazy: (unit -> 'a) -> 'a Lazy.t the warning settings at the time [mk_lazy] is called. *) -val nerrors : int ref +val disabled : bool ref val message : t -> string val number: t -> int val super_report : @@ -3474,7 +3474,7 @@ type t = | Wildcard_arg_to_constant_constr (* 28 *) | Eol_in_string (* 29 *) | Duplicate_definitions of string * string * string * string (*30 *) - | Multiple_definition of string * string * string (* 31 *) + | Unused_value_declaration of string (* 32 *) | Unused_open of string (* 33 *) | Unused_type_declaration of string (* 34 *) @@ -3494,14 +3494,14 @@ type t = | Eliminated_optional_arguments of string list (* 48 *) | No_cmi_file of string * string option (* 49 *) | Bad_docstring of bool (* 50 *) - | Expect_tailcall (* 51 *) + | Fragile_literal_pattern (* 52 *) | Misplaced_attribute of string (* 53 *) | Duplicated_attribute of string (* 54 *) | Inlining_impossible of string (* 55 *) | Unreachable_case (* 56 *) | Ambiguous_pattern of string list (* 57 *) - | No_cmx_file of string (* 58 *) + | Assignment_to_non_mutable_value (* 59 *) | Unused_module of string (* 60 *) | Unboxable_type_in_prim_decl of string (* 61 *) @@ -3556,7 +3556,7 @@ let number = function | Wildcard_arg_to_constant_constr -> 28 | Eol_in_string -> 29 | Duplicate_definitions _ -> 30 - | Multiple_definition _ -> 31 + | Unused_value_declaration _ -> 32 | Unused_open _ -> 33 | Unused_type_declaration _ -> 34 @@ -3576,14 +3576,14 @@ let number = function | Eliminated_optional_arguments _ -> 48 | No_cmi_file _ -> 49 | Bad_docstring _ -> 50 - | Expect_tailcall -> 51 + | Fragile_literal_pattern -> 52 | Misplaced_attribute _ -> 53 | Duplicated_attribute _ -> 54 | Inlining_impossible _ -> 55 | Unreachable_case -> 56 | Ambiguous_pattern _ -> 57 - | No_cmx_file _ -> 58 + | Assignment_to_non_mutable_value -> 59 | Unused_module _ -> 60 | Unboxable_type_in_prim_decl _ -> 61 @@ -3661,7 +3661,9 @@ let backup () = !current let restore x = current := x let is_active x = not !disabled && (!current).active.(number x);; -let is_error x = not !disabled && (!current).error.(number x);; + +let is_error = is_active + let mk_lazy f = let state = backup () in @@ -3825,10 +3827,7 @@ let message = function | Duplicate_definitions (kind, cname, tc1, tc2) -> Printf.sprintf "the %s %s is defined in both types %s and %s." kind cname tc1 tc2 - | Multiple_definition(modname, file1, file2) -> - Printf.sprintf - "files %s and %s both define a module named %s" - file1 file2 modname + | Unused_value_declaration v -> "unused value " ^ v ^ "." | Unused_open s -> "unused open " ^ s ^ "." | Unused_type_declaration s -> "unused type " ^ s ^ "." @@ -3908,8 +3907,7 @@ let message = function | Bad_docstring unattached -> if unattached then "unattached documentation comment (ignored)" else "ambiguous documentation comment" - | Expect_tailcall -> - Printf.sprintf "expected tailcall" + | Fragile_literal_pattern -> Printf.sprintf "Code should not depend on the actual values of\n\ @@ -3938,10 +3936,7 @@ let message = function "Ambiguous or-pattern variables under guard;\n\ %s may match different arguments. (See manual section 8.5)" msg - | No_cmx_file name -> - Printf.sprintf - "no cmx file was found in path for module %s, \ - and its interface was not compiled with -opaque" name + | Assignment_to_non_mutable_value -> "A potential assignment to a non-mutable value was detected \n\ in this source file. Such assignments may generate incorrect code \n\ @@ -304628,7 +304623,6 @@ module Bsc_warnings - 102 Bs_polymorphic_comparison *) let defaults_w = "+a-4-9-20-40-41-42-50-61-102" -let defaults_warn_error = "-a+5+6+101";; (*TODO: add +10*) end @@ -365637,7 +365631,6 @@ let setup_env () = Matching.call_switcher_variant_constr := Polyvar_pattern_match.call_switcher_variant_constr; Clflags.no_std_include := true; Warnings.parse_options false Bsc_warnings.defaults_w; - Warnings.parse_options true Bsc_warnings.defaults_warn_error; Clflags.dump_location := false; Clflags.compile_only := true; Config.bs_only := true; @@ -402861,6 +402854,7 @@ let compile Ext_string.compare (Lam_module_ident.name id1) (Lam_module_ident.name id2) ) in + Warnings.check_fatal (); let effect = Lam_stats_export.get_dependent_module_effect maybe_pure external_module_ids in @@ -402892,36 +402886,23 @@ let lambda_as_module (if !Js_config.bs_suffix then Literals.suffix_bs_js else Literals.suffix_js) in let package_info = Js_packages_state.get_packages_info () in - if Js_packages_info.is_empty package_info && !Js_config.js_stdout then begin - Js_dump_program.dump_deps_program ~output_prefix NodeJS lambda_output stdout; - if !Warnings.nerrors > 0 then begin - Warnings.nerrors := 0; - exit 77 - end - end else + if Js_packages_info.is_empty package_info && !Js_config.js_stdout then + Js_dump_program.dump_deps_program ~output_prefix NodeJS lambda_output stdout + else Js_packages_info.iter package_info (fun {module_system; path = _path} -> let output_chan chan = Js_dump_program.dump_deps_program ~output_prefix module_system lambda_output chan in - let target_file = - (Lazy.force Ext_path.package_dir // - _path // - basename - (* #913 only generate little-case js file *) - ) in - if !Warnings.nerrors > 0 then begin - Warnings.nerrors := 0 ; - if Sys.file_exists target_file then Sys.remove target_file; - exit 77 - (* don't write js file, we need remove js files - otherwise the js files are out-of-date - exit 177 *) - end else if not @@ !Clflags.dont_write_files then Ext_pervasives.with_file_as_chan - target_file output_chan ) + + (Lazy.force Ext_path.package_dir // + _path // + basename + (* #913 only generate little-case js file *) + ) output_chan ) @@ -437195,10 +437176,8 @@ let buckle_script_flags : (string * Bsc_args.spec * string) array = .. a range of consecutive warning numbers\n\ default setting is " ^ Bsc_warnings.defaults_w; - "-warn-error", string_call (Warnings.parse_options true), - " Enable or disable error status for warnings according\n\ - to . See option -w for the syntax of .\n\ - Default setting is " ^ Bsc_warnings.defaults_warn_error; + "-warn-error", string_call (fun _ -> ()), + "Deprecated: warnings are errors"; "-o", string_optional_set Clflags.output_name, " set output file name to "; From f39eb87a0818ee2ed8ce3fd8cc381dfb8643aefc Mon Sep 17 00:00:00 2001 From: Hongbo Zhang Date: Thu, 27 Aug 2020 11:25:23 +0800 Subject: [PATCH 03/13] remove error options --- jscomp/bsb/bsb_templates.ml | 3 --- jscomp/bsb/templates/basic/bsconfig.json | 3 --- jscomp/build_tests/case3/bsconfig.json | 3 --- jscomp/build_tests/custom_namespace/bsconfig.json | 3 +-- jscomp/build_tests/customize_namespace/bsconfig.json | 3 --- jscomp/build_tests/cycle/bsconfig.json | 3 --- jscomp/build_tests/devdeps/bsconfig.json | 3 --- jscomp/build_tests/devonly/bsconfig.json | 3 --- .../build_tests/duplicated_symlinked_packages/a/bsconfig.json | 3 --- .../build_tests/duplicated_symlinked_packages/b/bsconfig.json | 3 --- .../build_tests/duplicated_symlinked_packages/c/bsconfig.json | 3 --- jscomp/build_tests/install/bsconfig.json | 3 --- jscomp/build_tests/namespace/bsconfig.json | 3 +-- jscomp/build_tests/nested/bsconfig.json | 3 --- jscomp/build_tests/nnest/bsconfig.json | 3 --- jscomp/build_tests/top/bsconfig.json | 3 --- jscomp/build_tests/white space/bsconfig.json | 3 +-- lib/4.06.1/bsb.ml | 3 --- lib/4.06.1/unstable/bsb_native.ml | 3 --- 19 files changed, 3 insertions(+), 54 deletions(-) diff --git a/jscomp/bsb/bsb_templates.ml b/jscomp/bsb/bsb_templates.ml index 7af8cbc9fd..2c11507fe5 100644 --- a/jscomp/bsb/bsb_templates.ml +++ b/jscomp/bsb/bsb_templates.ml @@ -21,9 +21,6 @@ let root = OCamlRes.Res.([ \ \"suffix\": \".bs.js\",\n\ \ \"bs-dependencies\": [\n\ \ ],\n\ - \ \"warnings\": {\n\ - \ \"error\" : \"+101\"\n\ - \ },\n\ \ \"refmt\": 3\n\ }\n\ ") ; diff --git a/jscomp/bsb/templates/basic/bsconfig.json b/jscomp/bsb/templates/basic/bsconfig.json index 3c17902b95..abf5531168 100644 --- a/jscomp/bsb/templates/basic/bsconfig.json +++ b/jscomp/bsb/templates/basic/bsconfig.json @@ -12,8 +12,5 @@ "suffix": ".bs.js", "bs-dependencies": [ ], - "warnings": { - "error" : "+101" - }, "refmt": 3 } diff --git a/jscomp/build_tests/case3/bsconfig.json b/jscomp/build_tests/case3/bsconfig.json index 8e6ae5fbca..fdcf35fdb3 100644 --- a/jscomp/build_tests/case3/bsconfig.json +++ b/jscomp/build_tests/case3/bsconfig.json @@ -12,8 +12,5 @@ "suffix": ".bs.js", "bs-dependencies": [ ], - "warnings": { - "error" : "+101" - }, "refmt": 3 } diff --git a/jscomp/build_tests/custom_namespace/bsconfig.json b/jscomp/build_tests/custom_namespace/bsconfig.json index fe59a20d05..a117eaae1f 100644 --- a/jscomp/build_tests/custom_namespace/bsconfig.json +++ b/jscomp/build_tests/custom_namespace/bsconfig.json @@ -13,8 +13,7 @@ "bsc-flags" : ["-bs-no-version-header"], "bs-dependencies": [], "warnings": { - "number" : "-40+6+7", - "error" : true + "number" : "-40+6+7" }, "suffix": ".bs.js" } diff --git a/jscomp/build_tests/customize_namespace/bsconfig.json b/jscomp/build_tests/customize_namespace/bsconfig.json index 9226b7587d..5db0876529 100644 --- a/jscomp/build_tests/customize_namespace/bsconfig.json +++ b/jscomp/build_tests/customize_namespace/bsconfig.json @@ -14,8 +14,5 @@ "depa", "depb" ], - "warnings": { - "error" : "+101" - }, "refmt": 3 } diff --git a/jscomp/build_tests/cycle/bsconfig.json b/jscomp/build_tests/cycle/bsconfig.json index be2fb9bf4e..8c5a34c96d 100644 --- a/jscomp/build_tests/cycle/bsconfig.json +++ b/jscomp/build_tests/cycle/bsconfig.json @@ -12,8 +12,5 @@ "suffix": ".bs.js", "bs-dependencies": [ ], - "warnings": { - "error" : "+101" - }, "refmt": 3 } diff --git a/jscomp/build_tests/devdeps/bsconfig.json b/jscomp/build_tests/devdeps/bsconfig.json index e8828b20c9..b892b17311 100644 --- a/jscomp/build_tests/devdeps/bsconfig.json +++ b/jscomp/build_tests/devdeps/bsconfig.json @@ -18,8 +18,5 @@ "bs-dependencies": [ ], "bs-dev-dependencies": ["weird"], - "warnings": { - "error" : "+101" - }, "refmt": 3 } diff --git a/jscomp/build_tests/devonly/bsconfig.json b/jscomp/build_tests/devonly/bsconfig.json index 97ddb400ca..65808749c7 100644 --- a/jscomp/build_tests/devonly/bsconfig.json +++ b/jscomp/build_tests/devonly/bsconfig.json @@ -16,8 +16,5 @@ "suffix": ".bs.js", "bs-dependencies": [ ], - "warnings": { - "error" : "+101" - }, "refmt": 3 } diff --git a/jscomp/build_tests/duplicated_symlinked_packages/a/bsconfig.json b/jscomp/build_tests/duplicated_symlinked_packages/a/bsconfig.json index f814332dc1..6d90704345 100644 --- a/jscomp/build_tests/duplicated_symlinked_packages/a/bsconfig.json +++ b/jscomp/build_tests/duplicated_symlinked_packages/a/bsconfig.json @@ -14,9 +14,6 @@ "c", "z" ], - "warnings": { - "error" : "+101" - }, "namespace": true, "refmt": 3 } diff --git a/jscomp/build_tests/duplicated_symlinked_packages/b/bsconfig.json b/jscomp/build_tests/duplicated_symlinked_packages/b/bsconfig.json index bd40f3d14e..501bc6d159 100644 --- a/jscomp/build_tests/duplicated_symlinked_packages/b/bsconfig.json +++ b/jscomp/build_tests/duplicated_symlinked_packages/b/bsconfig.json @@ -13,9 +13,6 @@ "bs-dependencies": [ "c" ], - "warnings": { - "error" : "+101" - }, "namespace": true, "refmt": 3 } diff --git a/jscomp/build_tests/duplicated_symlinked_packages/c/bsconfig.json b/jscomp/build_tests/duplicated_symlinked_packages/c/bsconfig.json index 2a28e8de06..ab8f1553f5 100644 --- a/jscomp/build_tests/duplicated_symlinked_packages/c/bsconfig.json +++ b/jscomp/build_tests/duplicated_symlinked_packages/c/bsconfig.json @@ -13,9 +13,6 @@ "bs-dependencies": [ ], - "warnings": { - "error" : "+101" - }, "namespace": true, "refmt": 3 } diff --git a/jscomp/build_tests/install/bsconfig.json b/jscomp/build_tests/install/bsconfig.json index a6647280ad..2424ce641f 100644 --- a/jscomp/build_tests/install/bsconfig.json +++ b/jscomp/build_tests/install/bsconfig.json @@ -12,9 +12,6 @@ "suffix": ".bs.js", "bs-dependencies": [ ], - "warnings": { - "error" : "+101" - }, "refmt": 3 } \ No newline at end of file diff --git a/jscomp/build_tests/namespace/bsconfig.json b/jscomp/build_tests/namespace/bsconfig.json index a6185ac73c..f90595a9f1 100644 --- a/jscomp/build_tests/namespace/bsconfig.json +++ b/jscomp/build_tests/namespace/bsconfig.json @@ -16,8 +16,7 @@ "libb" ], "warnings": { - "number" : "-40+6+7", - "error" : true + "number" : "-40+6+7" }, "suffix": ".bs.js" } \ No newline at end of file diff --git a/jscomp/build_tests/nested/bsconfig.json b/jscomp/build_tests/nested/bsconfig.json index 86ec4ebd39..868d5c6557 100644 --- a/jscomp/build_tests/nested/bsconfig.json +++ b/jscomp/build_tests/nested/bsconfig.json @@ -9,8 +9,5 @@ "package-specs" : { "module": "commonjs", "in-source": true - }, - "warnings": { - "error" : true } } \ No newline at end of file diff --git a/jscomp/build_tests/nnest/bsconfig.json b/jscomp/build_tests/nnest/bsconfig.json index 312792e0e4..3faa3dad44 100644 --- a/jscomp/build_tests/nnest/bsconfig.json +++ b/jscomp/build_tests/nnest/bsconfig.json @@ -10,8 +10,5 @@ "module": "commonjs", "in-source": true }, - "warnings": { - "error" : true - }, "namespace": true } \ No newline at end of file diff --git a/jscomp/build_tests/top/bsconfig.json b/jscomp/build_tests/top/bsconfig.json index 7b2ccdf460..c83575d362 100644 --- a/jscomp/build_tests/top/bsconfig.json +++ b/jscomp/build_tests/top/bsconfig.json @@ -20,8 +20,5 @@ "suffix": ".bs.js", "bs-dependencies": [ ], - "warnings": { - "error" : "+101" - }, "refmt": 3 } diff --git a/jscomp/build_tests/white space/bsconfig.json b/jscomp/build_tests/white space/bsconfig.json index 9764a3e016..7107a19c44 100644 --- a/jscomp/build_tests/white space/bsconfig.json +++ b/jscomp/build_tests/white space/bsconfig.json @@ -9,7 +9,6 @@ ,"in-source": true }], "warnings": { - "number": "A", - "error" : true + "number": "A" } } \ No newline at end of file diff --git a/lib/4.06.1/bsb.ml b/lib/4.06.1/bsb.ml index 4428a503cb..b3710c4f95 100644 --- a/lib/4.06.1/bsb.ml +++ b/lib/4.06.1/bsb.ml @@ -14689,9 +14689,6 @@ let root = OCamlRes.Res.([ \ \"suffix\": \".bs.js\",\n\ \ \"bs-dependencies\": [\n\ \ ],\n\ - \ \"warnings\": {\n\ - \ \"error\" : \"+101\"\n\ - \ },\n\ \ \"refmt\": 3\n\ }\n\ ") ; diff --git a/lib/4.06.1/unstable/bsb_native.ml b/lib/4.06.1/unstable/bsb_native.ml index e2964b39cc..0b6eb36719 100644 --- a/lib/4.06.1/unstable/bsb_native.ml +++ b/lib/4.06.1/unstable/bsb_native.ml @@ -14846,9 +14846,6 @@ let root = OCamlRes.Res.([ \ \"suffix\": \".bs.js\",\n\ \ \"bs-dependencies\": [\n\ \ ],\n\ - \ \"warnings\": {\n\ - \ \"error\" : \"+101\"\n\ - \ },\n\ \ \"refmt\": 3\n\ }\n\ ") ; From 1ac584d970fb5bd64bb9cc62f0bb541623a339d8 Mon Sep 17 00:00:00 2001 From: Hongbo Zhang Date: Thu, 27 Aug 2020 11:31:16 +0800 Subject: [PATCH 04/13] clean up: not parse warnings.error --- jscomp/bsb/bsb_warning.ml | 49 +++++++------------------------ lib/4.06.1/bsb.ml | 49 +++++++------------------------ lib/4.06.1/unstable/bsb_native.ml | 49 +++++++------------------------ 3 files changed, 30 insertions(+), 117 deletions(-) diff --git a/jscomp/bsb/bsb_warning.ml b/jscomp/bsb/bsb_warning.ml index c78e18b67d..093ac0fca1 100644 --- a/jscomp/bsb/bsb_warning.ml +++ b/jscomp/bsb/bsb_warning.ml @@ -23,16 +23,10 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *) -type warning_error = - | Warn_error_false - (* default [false] to make our changes non-intrusive *) - | Warn_error_true - | Warn_error_number of string type t0 = { - number : string option; - error : warning_error -} + number : string option; +} [@@ocaml.unboxed] type nonrec t = t0 option @@ -70,27 +64,13 @@ let to_merlin_string x = let from_map (m : Ext_json_types.t Map_string.t) = let number_opt = Map_string.find_opt m Bsb_build_schemas.number in - let error_opt = Map_string.find_opt m Bsb_build_schemas.error in - match number_opt, error_opt with - | None, None -> None - | _, _ -> - let error = - match error_opt with - | Some (True _) -> Warn_error_true - | Some (False _) -> Warn_error_false - | Some (Str {str ; }) - -> Warn_error_number str - | Some x -> Bsb_exception.config_error x "expect true/false or string" - | None -> Warn_error_false - (** To make it less intrusive : warning error has to be enabled*) - in - let number = - match number_opt with - | Some (Str { str = number}) -> Some number - | None -> None - | Some x -> Bsb_exception.config_error x "expect a string" - in - Some {number; error } + let number = + match number_opt with + | Some (Str { str = number}) -> Some number + | None -> None + | Some x -> Bsb_exception.config_error x "expect a string" + in + Some {number } let to_bsb_string ~toplevel warning = @@ -103,15 +83,6 @@ let to_bsb_string ~toplevel warning = Ext_string.empty | Some x -> prepare_warning_concat ~beg:true x - ) ^ - ( - match warning.error with - | Warn_error_true -> - " -warn-error A" - | Warn_error_number y -> - " -warn-error " ^ y - | Warn_error_false -> - Ext_string.empty - ) + ) else " -w a" (* TODO: this is the current default behavior *) diff --git a/lib/4.06.1/bsb.ml b/lib/4.06.1/bsb.ml index b3710c4f95..798dd4b860 100644 --- a/lib/4.06.1/bsb.ml +++ b/lib/4.06.1/bsb.ml @@ -7402,16 +7402,10 @@ end = struct * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *) -type warning_error = - | Warn_error_false - (* default [false] to make our changes non-intrusive *) - | Warn_error_true - | Warn_error_number of string type t0 = { - number : string option; - error : warning_error -} + number : string option; +} [@@ocaml.unboxed] type nonrec t = t0 option @@ -7449,27 +7443,13 @@ let to_merlin_string x = let from_map (m : Ext_json_types.t Map_string.t) = let number_opt = Map_string.find_opt m Bsb_build_schemas.number in - let error_opt = Map_string.find_opt m Bsb_build_schemas.error in - match number_opt, error_opt with - | None, None -> None - | _, _ -> - let error = - match error_opt with - | Some (True _) -> Warn_error_true - | Some (False _) -> Warn_error_false - | Some (Str {str ; }) - -> Warn_error_number str - | Some x -> Bsb_exception.config_error x "expect true/false or string" - | None -> Warn_error_false - (** To make it less intrusive : warning error has to be enabled*) - in - let number = - match number_opt with - | Some (Str { str = number}) -> Some number - | None -> None - | Some x -> Bsb_exception.config_error x "expect a string" - in - Some {number; error } + let number = + match number_opt with + | Some (Str { str = number}) -> Some number + | None -> None + | Some x -> Bsb_exception.config_error x "expect a string" + in + Some {number } let to_bsb_string ~toplevel warning = @@ -7482,16 +7462,7 @@ let to_bsb_string ~toplevel warning = Ext_string.empty | Some x -> prepare_warning_concat ~beg:true x - ) ^ - ( - match warning.error with - | Warn_error_true -> - " -warn-error A" - | Warn_error_number y -> - " -warn-error " ^ y - | Warn_error_false -> - Ext_string.empty - ) + ) else " -w a" (* TODO: this is the current default behavior *) diff --git a/lib/4.06.1/unstable/bsb_native.ml b/lib/4.06.1/unstable/bsb_native.ml index 0b6eb36719..8a24958776 100644 --- a/lib/4.06.1/unstable/bsb_native.ml +++ b/lib/4.06.1/unstable/bsb_native.ml @@ -7408,16 +7408,10 @@ end = struct * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *) -type warning_error = - | Warn_error_false - (* default [false] to make our changes non-intrusive *) - | Warn_error_true - | Warn_error_number of string type t0 = { - number : string option; - error : warning_error -} + number : string option; +} [@@ocaml.unboxed] type nonrec t = t0 option @@ -7455,27 +7449,13 @@ let to_merlin_string x = let from_map (m : Ext_json_types.t Map_string.t) = let number_opt = Map_string.find_opt m Bsb_build_schemas.number in - let error_opt = Map_string.find_opt m Bsb_build_schemas.error in - match number_opt, error_opt with - | None, None -> None - | _, _ -> - let error = - match error_opt with - | Some (True _) -> Warn_error_true - | Some (False _) -> Warn_error_false - | Some (Str {str ; }) - -> Warn_error_number str - | Some x -> Bsb_exception.config_error x "expect true/false or string" - | None -> Warn_error_false - (** To make it less intrusive : warning error has to be enabled*) - in - let number = - match number_opt with - | Some (Str { str = number}) -> Some number - | None -> None - | Some x -> Bsb_exception.config_error x "expect a string" - in - Some {number; error } + let number = + match number_opt with + | Some (Str { str = number}) -> Some number + | None -> None + | Some x -> Bsb_exception.config_error x "expect a string" + in + Some {number } let to_bsb_string ~toplevel warning = @@ -7488,16 +7468,7 @@ let to_bsb_string ~toplevel warning = Ext_string.empty | Some x -> prepare_warning_concat ~beg:true x - ) ^ - ( - match warning.error with - | Warn_error_true -> - " -warn-error A" - | Warn_error_number y -> - " -warn-error " ^ y - | Warn_error_false -> - Ext_string.empty - ) + ) else " -w a" (* TODO: this is the current default behavior *) From 670c9a28a0e786fab79abe14ec9e6cedf4bb93bc Mon Sep 17 00:00:00 2001 From: Hongbo Zhang Date: Thu, 27 Aug 2020 14:11:23 +0800 Subject: [PATCH 05/13] fix bucklescript-tea warnings --- jscomp/build_tests/bucklescript-tea/input.js | 5 ++--- .../bucklescript-tea/src/tea_app.ml | 18 +++++++++--------- .../bucklescript-tea/src/tea_html.ml | 12 ++++++------ .../bucklescript-tea/src/tea_html_cmds.ml | 2 +- .../bucklescript-tea/src/tea_http.ml | 4 ++-- .../bucklescript-tea/src/tea_result.ml | 4 ++-- .../bucklescript-tea/src/tea_task.ml | 6 +++--- .../bucklescript-tea/src/tea_time.ml | 2 +- .../bucklescript-tea/src/web_json.ml | 2 +- .../bucklescript-tea/src/web_node.ml | 2 +- .../bucklescript-tea/src/web_window_history.ml | 14 +++++++------- .../src/web_window_localstorage.ml | 12 ++++++------ .../bucklescript-tea/src/web_xmlhttprequest.ml | 12 ++++++------ 13 files changed, 47 insertions(+), 48 deletions(-) diff --git a/jscomp/build_tests/bucklescript-tea/input.js b/jscomp/build_tests/bucklescript-tea/input.js index 28c8207603..a3cbe13190 100644 --- a/jscomp/build_tests/bucklescript-tea/input.js +++ b/jscomp/build_tests/bucklescript-tea/input.js @@ -1,10 +1,9 @@ var p = require("child_process"); +const { assert } = require("console"); var o = p.spawnSync(`bsb`); console.log(o.stderr + ""); console.log("-----"); console.log(o.stdout + ""); -if (o.error) { - throw o.error; -} +assert(o.status === 0) \ No newline at end of file diff --git a/jscomp/build_tests/bucklescript-tea/src/tea_app.ml b/jscomp/build_tests/bucklescript-tea/src/tea_app.ml index 8e25032d19..834dbbe0d6 100644 --- a/jscomp/build_tests/bucklescript-tea/src/tea_app.ml +++ b/jscomp/build_tests/bucklescript-tea/src/tea_app.ml @@ -195,7 +195,7 @@ let programLoop update view subscriptions initModel initCmd = function (* We own the passed in node, clear it out TODO: Clear it out properly *) (* let () = Js.log ("Blah", Web.Node.firstChild parentNode, Js.Null.test (Web.Node.firstChild parentNode), false, true) in *) let clearPnode () = while (Js.Array.length (Web.Node.childNodes parentNode)) > 0 do - match Js.Null.to_opt (Web.Node.firstChild parentNode) with + match Js.Null.toOption (Web.Node.firstChild parentNode) with | None -> () | Some firstChild -> let _removedChild = Web.Node.removeChild parentNode firstChild in () done in @@ -256,7 +256,7 @@ let program : ('flags, 'model, 'msg) program -> Web.Node.t Js.null_undefined -> fun {init; update; view; subscriptions; shutdown} pnode flags -> let () = Web.polyfills () in let initModel, initCmd = init flags in - let opnode = Js.Null_undefined.to_opt pnode in + let opnode = Js.Null_undefined.toOption pnode in let pumpInterface = programLoop update view subscriptions initModel initCmd opnode in programStateWrapper initModel pumpInterface shutdown @@ -286,7 +286,7 @@ let map func vnode = Vdom.map func vnode (* let fullProgram program pnode flags = - match Js.Null_undefined.to_opt pnode with + match Js.Null_undefined.toOption pnode with | None -> Web.Document.body () | Some parentNode -> parentNode *) @@ -346,7 +346,7 @@ let programLoop = function let program {init; update; view} pnode flags = let initModel, initCmd = init flags in - let opnode = Js.Null_undefined.to_opt pnode in + let opnode = Js.Null_undefined.toOption pnode in let modelState = programStateWrapperInit initModel in let rec viewState msgHandler = programLoopInit msgHandler view initModel opnode and pump_unfixed msgHandler = programLoop viewState update view initModel msgHandler in @@ -360,17 +360,17 @@ let program {init; update; view} pnode flags = initModel initCmds view - (Js.Null_undefined.to_opt pnode) *) + (Js.Null_undefined.toOption pnode) *) (* { internal = (fun () -> Js.log "internal update"); init = init; update = update; view = view; - } (Js.Null_undefined.to_opt pnode) flags *) + } (Js.Null_undefined.toOption pnode) flags *) - (* match Js.Null_undefined.to_opt pnode with + (* match Js.Null_undefined.toOption pnode with | None -> Web.Document.body () | Some parentNode -> parentNode *) @@ -379,11 +379,11 @@ let program {init; update; view} pnode flags = | None -> Js.log 42 | Some parentNode -> Js.log 84 *) -(* let beginnerProgram program pnode = match Js.Null_undefined.to_opt pnode with +(* let beginnerProgram program pnode = match Js.Null_undefined.toOption pnode with | None -> Web.Document.body () | Some node -> node *) -(* let beginnerPrograms pnode = match Js.Null_undefined.to_opt pnode with +(* let beginnerPrograms pnode = match Js.Null_undefined.toOption pnode with | None -> Web.Document.body () | Some node -> Web.Node.style node *) diff --git a/jscomp/build_tests/bucklescript-tea/src/tea_html.ml b/jscomp/build_tests/bucklescript-tea/src/tea_html.ml index 70f1fd7b6d..50b2a1d778 100644 --- a/jscomp/build_tests/bucklescript-tea/src/tea_html.ml +++ b/jscomp/build_tests/bucklescript-tea/src/tea_html.ml @@ -170,9 +170,9 @@ let onMsg eventName msg = onMsg eventName msg let onInputOpt ?(key="") msg = onCB "input" key (fun ev -> - match Js.Undefined.to_opt ev##target with + match Js.Undefined.toOption ev##target with | None -> None - | Some target -> match Js.Undefined.to_opt target##value with + | Some target -> match Js.Undefined.toOption target##value with | None -> None | Some value -> msg value ) @@ -182,9 +182,9 @@ let onInput ?(key="") msg = onInputOpt ~key:key (fun ev -> Some (msg ev)) let onChangeOpt ?(key="") msg = onCB "change" key (fun ev -> - match Js.Undefined.to_opt ev##target with + match Js.Undefined.toOption ev##target with | None -> None - | Some target -> match Js.Undefined.to_opt target##value with + | Some target -> match Js.Undefined.toOption target##value with | None -> None | Some value -> msg value ) @@ -206,9 +206,9 @@ let onFocus msg = let onCheckOpt ?(key="") msg = onCB "change" key (fun ev -> - match Js.Undefined.to_opt ev##target with + match Js.Undefined.toOption ev##target with | None -> None - | Some target -> match Js.Undefined.to_opt target##checked with + | Some target -> match Js.Undefined.toOption target##checked with | None -> None | Some value -> msg value ) diff --git a/jscomp/build_tests/bucklescript-tea/src/tea_html_cmds.ml b/jscomp/build_tests/bucklescript-tea/src/tea_html_cmds.ml index 0644581329..a4c277aa4e 100644 --- a/jscomp/build_tests/bucklescript-tea/src/tea_html_cmds.ml +++ b/jscomp/build_tests/bucklescript-tea/src/tea_html_cmds.ml @@ -1,6 +1,6 @@ let focus id = - Tea_cmd.call (fun _enqueue -> match Js.Null_undefined.to_opt (Web.Document.getElementById id) with + Tea_cmd.call (fun _enqueue -> match Js.Null_undefined.toOption (Web.Document.getElementById id) with | None -> Js.log ("Attempted to focus a non-existant element of: ", id) | Some elem -> (* let () = Js.log ("Focusing element", id, elem) in *) diff --git a/jscomp/build_tests/bucklescript-tea/src/tea_http.ml b/jscomp/build_tests/bucklescript-tea/src/tea_http.ml index d0b90e1b6a..34dbb247d0 100644 --- a/jscomp/build_tests/bucklescript-tea/src/tea_http.ml +++ b/jscomp/build_tests/bucklescript-tea/src/tea_http.ml @@ -153,12 +153,12 @@ let send resultToMessage (Request (request, maybeEvents)) = () ) -external encodeURIComponent : string -> string = "" [@@bs.val] +external encodeURIComponent : string -> string = "encodeURIComponent" [@@bs.val] let encodeUri str = encodeURIComponent str -external decodeURIComponent : string -> string = "" [@@bs.val] +external decodeURIComponent : string -> string = "decodeURIComponent" [@@bs.val] let decodeUri str = try Some (decodeURIComponent str) diff --git a/jscomp/build_tests/bucklescript-tea/src/tea_result.ml b/jscomp/build_tests/bucklescript-tea/src/tea_result.ml index 5a61466a18..c01c8563e5 100644 --- a/jscomp/build_tests/bucklescript-tea/src/tea_result.ml +++ b/jscomp/build_tests/bucklescript-tea/src/tea_result.ml @@ -1,7 +1,7 @@ (* TODO: Remove this when Bucklescript is updated to OCaml 4.03 as it includes result *) -type ('a, 'b) t (* result *) = +type ('a, 'b) t (* result *) = ('a,'b) result = | Ok of 'a | Error of 'b @@ -55,6 +55,6 @@ let rec error_of_any = function | Error e -> Some e | Ok _ -> error_of_any tl -let rec error_of_first fst = function +let error_of_first fst = function | Error e -> Some e | Ok _ -> error fst diff --git a/jscomp/build_tests/bucklescript-tea/src/tea_task.ml b/jscomp/build_tests/bucklescript-tea/src/tea_task.ml index 24fd9294fb..f199130e11 100644 --- a/jscomp/build_tests/bucklescript-tea/src/tea_task.ml +++ b/jscomp/build_tests/bucklescript-tea/src/tea_task.ml @@ -177,11 +177,11 @@ let testing () = let () = doTest (Ok 42) e0 in let e1 = fail "file not found" |> onError (fun _msg -> fail 42) in let () = doTest (Error 42) e1 in - let n0 = sequence [ mapError string_of_int (fail 42); mapError string_of_float (fail 3.14) ] in + let n0 = sequence [ mapError string_of_int (fail 42); mapError Js.Float.toString (fail 3.14) ] in let () = doTest (Error "42") n0 in - let n1 = sequence [ mapError string_of_int (succeed 1); mapError string_of_float (fail 3.14)] in + let n1 = sequence [ mapError string_of_int (succeed 1); mapError Js.Float.toString (fail 3.14)] in let () = doTest (Error "3.14") n1 in - let n2 = sequence [ mapError string_of_int (succeed 1); mapError string_of_float (succeed 2)] in + let n2 = sequence [ mapError string_of_int (succeed 1); mapError Js.Float.toString (succeed 2)] in let () = doTest (Ok [1;2]) n2 in let _c0 = perform (fun _ -> 42) (succeed 18) in (* (\* Should not compile *\) let _c1 = perform (fun _ -> 42) (fail 18) in *) diff --git a/jscomp/build_tests/bucklescript-tea/src/tea_time.ml b/jscomp/build_tests/bucklescript-tea/src/tea_time.ml index 8e0e33e453..fe13884fd9 100644 --- a/jscomp/build_tests/bucklescript-tea/src/tea_time.ml +++ b/jscomp/build_tests/bucklescript-tea/src/tea_time.ml @@ -13,7 +13,7 @@ type 'msg myCmd = let every interval tagger = let open Vdom in - let key = string_of_float interval in + let key = Js.Float.toString interval in let enableCall callbacks = let id = (Web.Window.setInterval (fun () -> callbacks.enqueue (tagger (Web.Date.now ())) ) interval) in (* let () = Js.log ("Time.every", "enable", interval, tagger, callbacks) in *) diff --git a/jscomp/build_tests/bucklescript-tea/src/web_json.ml b/jscomp/build_tests/bucklescript-tea/src/web_json.ml index 3228b75ebe..5acacd419d 100644 --- a/jscomp/build_tests/bucklescript-tea/src/web_json.ml +++ b/jscomp/build_tests/bucklescript-tea/src/web_json.ml @@ -5,7 +5,7 @@ type nothingYet external stringify : 't -> nothingYet Js.null -> int -> string = "JSON.stringify" [@@bs.val] let string_of_json ?(indent=2) value = - match Js.Undefined.to_opt value with + match Js.Undefined.toOption value with | None -> "undefined" | Some v -> try stringify v Js.Null.empty indent diff --git a/jscomp/build_tests/bucklescript-tea/src/web_node.ml b/jscomp/build_tests/bucklescript-tea/src/web_node.ml index a8ec9d46b3..6cd87393e9 100644 --- a/jscomp/build_tests/bucklescript-tea/src/web_node.ml +++ b/jscomp/build_tests/bucklescript-tea/src/web_node.ml @@ -52,7 +52,7 @@ let setStyle n key value = setStyle n##style key value let setStyleProperty n ?(priority=false) key value = let style = n##style in - match Js.Undefined.to_opt style##setProperty with + match Js.Undefined.toOption style##setProperty with | None -> setStyle n key value (* TODO: Change this to setAttribute sometime, maybe... *) | Some _valid -> style##setProperty__ key value (if priority then (Js.Null.return "important") else Js.Null.empty) diff --git a/jscomp/build_tests/bucklescript-tea/src/web_window_history.ml b/jscomp/build_tests/bucklescript-tea/src/web_window_history.ml index ffdb8b82d0..8c59cca485 100644 --- a/jscomp/build_tests/bucklescript-tea/src/web_window_history.ml +++ b/jscomp/build_tests/bucklescript-tea/src/web_window_history.ml @@ -11,30 +11,30 @@ type t = < > Js.t -let length window = match Js.Undefined.to_opt window##history with +let length window = match Js.Undefined.toOption window##history with | None -> -1 | Some history -> history##length -let back window = match Js.Undefined.to_opt window##history with +let back window = match Js.Undefined.toOption window##history with | None -> () | Some history -> history##back -let forward window = match Js.Undefined.to_opt window##history with +let forward window = match Js.Undefined.toOption window##history with | None -> () | Some history -> history##forward -let go window to' = match Js.Undefined.to_opt window##history with +let go window to' = match Js.Undefined.toOption window##history with | None -> () | Some history -> history##go to' -let pushState window state title url = match Js.Undefined.to_opt window##history with +let pushState window state title url = match Js.Undefined.toOption window##history with | None -> () | Some history -> history##pushState state title url -let replaceState window state title url = match Js.Undefined.to_opt window##history with +let replaceState window state title url = match Js.Undefined.toOption window##history with | None -> () | Some history -> history##replaceState state title url -let state window = match Js.Undefined.to_opt window##history with +let state window = match Js.Undefined.toOption window##history with | None -> Js.Undefined.empty | Some history -> history##state diff --git a/jscomp/build_tests/bucklescript-tea/src/web_window_localstorage.ml b/jscomp/build_tests/bucklescript-tea/src/web_window_localstorage.ml index b08e9f96df..427ae07ab2 100644 --- a/jscomp/build_tests/bucklescript-tea/src/web_window_localstorage.ml +++ b/jscomp/build_tests/bucklescript-tea/src/web_window_localstorage.ml @@ -9,33 +9,33 @@ type t = < setItem : string -> string -> unit [@bs.meth]; > Js.t -let length window = match Js.Undefined.to_opt window##localStorage with +let length window = match Js.Undefined.toOption window##localStorage with | None -> None | Some localStorage -> Some (localStorage##length) -let clear window = match Js.Undefined.to_opt window##localStorage with +let clear window = match Js.Undefined.toOption window##localStorage with | None -> None | Some localStorage -> Some (localStorage##clear ()) -let key window idx = match Js.Undefined.to_opt window##localStorage with +let key window idx = match Js.Undefined.toOption window##localStorage with | None -> None | Some localStorage -> Some (localStorage##key idx) -let getItem window key = match Js.Undefined.to_opt window##localStorage with +let getItem window key = match Js.Undefined.toOption window##localStorage with | None -> None | Some localStorage -> try Some (localStorage##getItem key) with _ -> None -let removeItem window key = match Js.Undefined.to_opt window##localStorage with +let removeItem window key = match Js.Undefined.toOption window##localStorage with | None -> None | Some localStorage -> Some (localStorage##removeItem key) -let setItem window key value = match Js.Undefined.to_opt window##localStorage with +let setItem window key value = match Js.Undefined.toOption window##localStorage with | None -> None | Some localStorage -> Some (localStorage##setItem key value) diff --git a/jscomp/build_tests/bucklescript-tea/src/web_xmlhttprequest.ml b/jscomp/build_tests/bucklescript-tea/src/web_xmlhttprequest.ml index 82309fad45..767034688a 100644 --- a/jscomp/build_tests/bucklescript-tea/src/web_xmlhttprequest.ml +++ b/jscomp/build_tests/bucklescript-tea/src/web_xmlhttprequest.ml @@ -73,14 +73,14 @@ type body = let abort x = x##abort () let getAllResponseHeaders x = - let open Tea_result in - match Js.Null.to_opt (x##getAllResponseHeaders ()) with + let open! Tea_result in + match Js.Null.toOption (x##getAllResponseHeaders ()) with | None -> Error IncompleteResponse | Some "" -> Error NetworkError | Some s -> Ok s let getAllResponseHeadersAsList x = - let open Tea_result in + let open! Tea_result in match getAllResponseHeaders x with | Error _ as err -> err | Ok s -> Ok @@ -104,7 +104,7 @@ let getAllResponseHeadersAsDict x = let insert d (k, v) = StringMap.add k v d in Tea_result.Ok (List.fold_left insert StringMap.empty l) -let getResponseHeader key x = Js.Null.to_opt (x##getResponse key) +let getResponseHeader key x = Js.Null.toOption (x##getResponse key) let open_ method' url ?(async=true) ?(user="") ?(password="") x = x##_open method' url async user password @@ -193,7 +193,7 @@ let get_responseType x = | s -> RawResponseType s let get_response x = - match Js.Null.to_opt x##response with + match Js.Null.toOption x##response with | None -> NoResponse | Some resp -> match get_responseType x with @@ -209,7 +209,7 @@ let get_responseText x = x##responseText let get_responseURL x = x##responseURL -let get_responseXML x = Js.Null.to_opt x##responseXML +let get_responseXML x = Js.Null.toOption x##responseXML let get_status x = x##status From f92bea414fb328cf7ffde6fe04888c0fae24fcce Mon Sep 17 00:00:00 2001 From: Hongbo Zhang Date: Thu, 27 Aug 2020 14:24:29 +0800 Subject: [PATCH 06/13] fix one ci test failure --- jscomp/build_tests/namespace/input.js | 66 ++++++++++++++++----------- 1 file changed, 39 insertions(+), 27 deletions(-) diff --git a/jscomp/build_tests/namespace/input.js b/jscomp/build_tests/namespace/input.js index 04b2157256..f1cb507ccf 100644 --- a/jscomp/build_tests/namespace/input.js +++ b/jscomp/build_tests/namespace/input.js @@ -1,32 +1,44 @@ +var child_process = require("child_process"); +var fs = require("fs"); +var path = require("path"); +child_process.execSync(`bsb -clean-world && bsb -make-world`, { + cwd: __dirname, + stdio: [0, 1, 2], +}); +var x = require("./src/demo.bs.js"); +var assert = require("assert"); +var demo_bs_js = fs.readFileSync( + path.join(__dirname, "src", "demo.bs.js"), + "utf8" +); +assert.ok(demo_bs_js.includes("liba/src/demo.bs.js")); +assert.equal(x.v, 3); -var child_process = require('child_process') -var fs = require('fs') -var path = require('path') -child_process.execSync(`bsb -clean-world && bsb -make-world`, {cwd:__dirname, stdio:[0,1,2]}) +var merlin = fs.readFileSync(path.join(__dirname, ".merlin"), "utf8"); +var warn_flag = "-40+6+7"; // Note it is additive now +assert.ok(merlin.includes("-open")); +assert.ok(merlin.includes(warn_flag)); +assert.ok(merlin.includes("emptydir") !== true); -var x = require('./src/demo.bs.js') -var assert = require('assert') -var demo_bs_js = fs.readFileSync( path.join(__dirname,'src', 'demo.bs.js'),'utf8') -assert.ok(demo_bs_js.includes('liba/src/demo.bs.js')) -assert.equal(x.v, 3 ) - -var merlin = fs.readFileSync(path.join(__dirname,'.merlin'), 'utf8') -var warn_flag = '-40+6+7' // Note it is additive now -assert.ok(merlin.includes('-open')) -assert.ok(merlin.includes(warn_flag)) -assert.ok(merlin.includes('emptydir')!==true) -var testWarnError = /warnings\s*=\s*[^\r\n]*-warn-error/ - -function hasWarnError(file){ - var content = fs.readFileSync(file,'utf8') - return testWarnError.test(content) +var testDepsNoWarning = "-w a" +function hasWarnError(file) { + return fs.readFileSync(file, "utf8").includes(testDepsNoWarning); } -var content = fs.readFileSync(path.join(__dirname,'lib','bs','build.ninja')) -assert.ok(content.includes('emptydir')!==true) -assert.ok(testWarnError.test(content)) -assert.ok(content.includes(warn_flag)) -assert.ok(!hasWarnError(path.join(__dirname,'node_modules','liba','lib','bs','build.ninja'))) -assert.ok(!hasWarnError(path.join(__dirname,'node_modules','libb','lib','bs','build.ninja'))) -assert.ok(content.includes('.bs.js')) \ No newline at end of file +var content = + fs.readFileSync(path.join(__dirname, "lib", "bs", "build.ninja")) + ""; +assert.ok(content.includes("emptydir") !== true); +assert.ok(!content.includes(testDepsNoWarning)); +assert.ok(content.includes(warn_flag)); +assert.ok( + hasWarnError( + path.join(__dirname, "node_modules", "liba", "lib", "bs", "build.ninja") + ) +); +assert.ok( + hasWarnError( + path.join(__dirname, "node_modules", "libb", "lib", "bs", "build.ninja") + ) +); +assert.ok(content.includes(".bs.js")); From 7af7f834517ab1772c873c5055d19a703c5c2e9c Mon Sep 17 00:00:00 2001 From: Hongbo Zhang Date: Thu, 27 Aug 2020 15:20:28 +0800 Subject: [PATCH 07/13] fix another CI --- jscomp/build_tests/react_ppx/src/React.bs.js | 12 ++++++------ .../build_tests/react_ppx/src/gpr_3695_test.bs.js | 6 +++--- .../build_tests/react_ppx/src/gpr_3987_test.bs.js | 14 +++++--------- jscomp/build_tests/react_ppx/src/gpr_3987_test.re | 4 ++-- .../react_ppx/src/recursive_component_test.bs.js | 2 +- .../react_ppx/src/recursive_component_test.re | 7 +++++++ 6 files changed, 24 insertions(+), 21 deletions(-) diff --git a/jscomp/build_tests/react_ppx/src/React.bs.js b/jscomp/build_tests/react_ppx/src/React.bs.js index f38b4ed5fd..3f1bab6b78 100644 --- a/jscomp/build_tests/react_ppx/src/React.bs.js +++ b/jscomp/build_tests/react_ppx/src/React.bs.js @@ -1,16 +1,16 @@ -// Generated by BUCKLESCRIPT, PLEASE EDIT WITH CARE +// Generated by ReScript, PLEASE EDIT WITH CARE 'use strict'; -var Ref = { }; +var Ref = {}; -var Children = { }; +var Children = {}; -var Context = { }; +var Context = {}; -var Fragment = { }; +var Fragment = {}; -var Suspense = { }; +var Suspense = {}; exports.Ref = Ref; exports.Children = Children; diff --git a/jscomp/build_tests/react_ppx/src/gpr_3695_test.bs.js b/jscomp/build_tests/react_ppx/src/gpr_3695_test.bs.js index a750b74410..a49281dcf5 100644 --- a/jscomp/build_tests/react_ppx/src/gpr_3695_test.bs.js +++ b/jscomp/build_tests/react_ppx/src/gpr_3695_test.bs.js @@ -1,12 +1,12 @@ -// Generated by BUCKLESCRIPT, PLEASE EDIT WITH CARE +// Generated by ReScript, PLEASE EDIT WITH CARE 'use strict'; var Foo = require("Foo"); var Curry = require("bs-platform/lib/js/curry.js"); -var React = { }; +var React = {}; -var Test = { }; +var Test = {}; function test(className) { return Curry._1(Foo, { diff --git a/jscomp/build_tests/react_ppx/src/gpr_3987_test.bs.js b/jscomp/build_tests/react_ppx/src/gpr_3987_test.bs.js index 2d54c0606d..9144226068 100644 --- a/jscomp/build_tests/react_ppx/src/gpr_3987_test.bs.js +++ b/jscomp/build_tests/react_ppx/src/gpr_3987_test.bs.js @@ -1,4 +1,4 @@ -// Generated by BUCKLESCRIPT, PLEASE EDIT WITH CARE +// Generated by ReScript, PLEASE EDIT WITH CARE 'use strict'; var React = require("react"); @@ -34,12 +34,10 @@ var BuckleScript3987ReproOk = { }; React.createElement(make, makeProps("test", (function (param, param$1) { - return /* () */0; - }), /* () */0)); + + }), undefined)); function Gpr_3987_test$BuckleScript3987ReproOk2(Props) { - Props.onChange; - Props.value; return null; } @@ -50,13 +48,11 @@ var BuckleScript3987ReproOk2 = { React.createElement(Gpr_3987_test$BuckleScript3987ReproOk2, { value: "test", onChange: (function (param, param$1) { - return /* () */0; + }) }); function Gpr_3987_test$BuckleScript3987ReproError(Props) { - Props.value; - Props.onChange; return null; } @@ -67,7 +63,7 @@ var BuckleScript3987ReproError = { React.createElement(Gpr_3987_test$BuckleScript3987ReproError, { value: "test", onChange: (function (param, param$1) { - return /* () */0; + }) }); diff --git a/jscomp/build_tests/react_ppx/src/gpr_3987_test.re b/jscomp/build_tests/react_ppx/src/gpr_3987_test.re index 38b9e1b8f0..6aeedc4f88 100644 --- a/jscomp/build_tests/react_ppx/src/gpr_3987_test.re +++ b/jscomp/build_tests/react_ppx/src/gpr_3987_test.re @@ -48,7 +48,7 @@ module BuckleScript3987ReproOk2 = { type onChange = (. string, int) => unit; [@react.component] - let make = (~value: string, ~onChange: onChange) => { + let make = (~value as _, ~onChange as _ : onChange) => { React.null; }; }; @@ -59,7 +59,7 @@ let _ = ()} />; /* Inline uncurried prop type causes an error */ module BuckleScript3987ReproError = { [@react.component] - let make = (~value: string, ~onChange: (. string, int) => unit) => { + let make = (~value as _: string, ~onChange as _ : (. string, int) => unit) => { React.null; }; }; diff --git a/jscomp/build_tests/react_ppx/src/recursive_component_test.bs.js b/jscomp/build_tests/react_ppx/src/recursive_component_test.bs.js index c03652d3be..b389e4231d 100644 --- a/jscomp/build_tests/react_ppx/src/recursive_component_test.bs.js +++ b/jscomp/build_tests/react_ppx/src/recursive_component_test.bs.js @@ -1,4 +1,4 @@ -// Generated by BUCKLESCRIPT, PLEASE EDIT WITH CARE +// Generated by ReScript, PLEASE EDIT WITH CARE 'use strict'; var React = require("react"); diff --git a/jscomp/build_tests/react_ppx/src/recursive_component_test.re b/jscomp/build_tests/react_ppx/src/recursive_component_test.re index fcb8b04606..3bc8f2bf3b 100644 --- a/jscomp/build_tests/react_ppx/src/recursive_component_test.re +++ b/jscomp/build_tests/react_ppx/src/recursive_component_test.re @@ -1,3 +1,10 @@ +[@warning "-39"]; +// https://github.com/rescript-lang/rescript-compiler/issues/4511 +/* +[@bs.config { + flags : [|"-dsource"|] +}]; +*/ [@react.component] let rec make = (~foo, ()) => React.createElement(make, makeProps(~foo, ())); From 8e5c70bb0a40377e5a8098ed4d12846912477c15 Mon Sep 17 00:00:00 2001 From: Hongbo Zhang Date: Thu, 27 Aug 2020 15:48:56 +0800 Subject: [PATCH 08/13] fix ci --- jscomp/build_tests/ocamlgraph/bsconfig.json | 1 + 1 file changed, 1 insertion(+) diff --git a/jscomp/build_tests/ocamlgraph/bsconfig.json b/jscomp/build_tests/ocamlgraph/bsconfig.json index b39bdbd291..bd15931a04 100644 --- a/jscomp/build_tests/ocamlgraph/bsconfig.json +++ b/jscomp/build_tests/ocamlgraph/bsconfig.json @@ -54,5 +54,6 @@ "command": "ocamlyacc $in" } ], + "bsc-flags" : ["-w", "a"], "namespace": true } \ No newline at end of file From 352b6141b5c0ad0545a338972626cc0800a82f27 Mon Sep 17 00:00:00 2001 From: Hongbo Zhang Date: Thu, 27 Aug 2020 17:42:29 +0800 Subject: [PATCH 09/13] fix ci --- jscomp/build_tests/nnest/input.js | 39 +++++++++++++++---------------- 1 file changed, 19 insertions(+), 20 deletions(-) diff --git a/jscomp/build_tests/nnest/input.js b/jscomp/build_tests/nnest/input.js index 25cd5a7852..895802aa64 100644 --- a/jscomp/build_tests/nnest/input.js +++ b/jscomp/build_tests/nnest/input.js @@ -1,28 +1,27 @@ // @ts-check -var p = require('child_process') -var assert = require('assert') -var fs = require('fs') -var path = require('path') -p.execSync(`bsb`, {cwd : __dirname, stdio:[0,1,2]}) +var p = require("child_process"); +var assert = require("assert"); +var fs = require("fs"); +var path = require("path"); +p.execSync(`bsb`, { cwd: __dirname, stdio: [0, 1, 2] }); -var content = fs.readFileSync(path.join(__dirname,'src','demo.js'),'utf8') +var content = fs.readFileSync(path.join(__dirname, "src", "demo.js"), "utf8"); -assert.ok(content.match(/A0_a1_main/g).length === 3 ) -assert.ok(content.match(/B0_b1_main/g).length === 3 ) -assert.ok(content.match(/A0_main/g).length === 2) -assert.ok(content.match(/a0_main/g).length === 1) -assert.ok(content.match(/B0_main/g).length === 2) -assert.ok(content.match(/b0_main/g).length === 1) +assert.ok(content.match(/A0_a1_main/g).length === 3); +assert.ok(content.match(/B0_b1_main/g).length === 3); +assert.ok(content.match(/A0_main/g).length === 2); +assert.ok(content.match(/a0_main/g).length === 1); +assert.ok(content.match(/B0_main/g).length === 2); +assert.ok(content.match(/b0_main/g).length === 1); +assert.ok(require("./src/demo.js").v === 4, "nested"); -assert.ok(require('./src/demo.js').v === 4,'nested') +// var testWarnError = /warnings\s*=\s*[^\r\n]*-warn-error/; -var testWarnError = /warnings\s*=\s*[^\r\n]*-warn-error/ +// function hasWarnError(file) { +// var content = fs.readFileSync(file, "utf8"); +// return testWarnError.test(content); +// } -function hasWarnError(file){ - var content = fs.readFileSync(file,'utf8') - return testWarnError.test(content) -} - -assert.ok(hasWarnError(path.join(__dirname,'lib','bs','build.ninja'))) +// assert.ok(hasWarnError(path.join(__dirname,'lib','bs','build.ninja'))) From 36f10a09b5b8385de0644c3df8d9ebdb46d8db81 Mon Sep 17 00:00:00 2001 From: Hongbo Zhang Date: Thu, 27 Aug 2020 18:06:29 +0800 Subject: [PATCH 10/13] fix ci --- .../super_errors/expected/highlighting4.re.expected | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/jscomp/build_tests/super_errors/expected/highlighting4.re.expected b/jscomp/build_tests/super_errors/expected/highlighting4.re.expected index e2ac98ea08..24159ce1da 100644 --- a/jscomp/build_tests/super_errors/expected/highlighting4.re.expected +++ b/jscomp/build_tests/super_errors/expected/highlighting4.re.expected @@ -1,9 +1,9 @@ - Warning number 3 + Warning number 3 (configured as error) /.../fixtures/highlighting4.re 5:10 3 │ [@deprecated] 4 │ type a = int; - 5 │ type b = a + 5 │ type b = a deprecated: a \ No newline at end of file From 2ed9241730743b3dee9d290d2d444ddf24070cc7 Mon Sep 17 00:00:00 2001 From: Hongbo Zhang Date: Fri, 28 Aug 2020 12:31:12 +0800 Subject: [PATCH 11/13] add more test case --- jscomp/test/build.ninja | 1 + jscomp/test/recursive_react_component.js | 13 ++++++++++ jscomp/test/recursive_react_component.re | 10 ++++++++ lib/4.06.1/unstable/bspack.ml | 32 ++++++++++++------------ lib/4.06.1/unstable/js_compiler.ml | 32 ++++++++++++------------ lib/4.06.1/unstable/js_refmt_compiler.ml | 32 ++++++++++++------------ lib/4.06.1/unstable/native_ppx.ml | 32 ++++++++++++------------ lib/4.06.1/whole_compiler.ml | 32 ++++++++++++------------ 8 files changed, 104 insertions(+), 80 deletions(-) create mode 100644 jscomp/test/recursive_react_component.js create mode 100644 jscomp/test/recursive_react_component.re diff --git a/jscomp/test/build.ninja b/jscomp/test/build.ninja index d58d59f165..6992c07fd9 100644 --- a/jscomp/test/build.ninja +++ b/jscomp/test/build.ninja @@ -547,6 +547,7 @@ build test/record_name_test.cmi test/record_name_test.cmj : cc test/record_name_ build test/record_with_test.cmi test/record_with_test.cmj : cc test/record_with_test.ml | test/mt.cmj $stdlib build test/recursive_module.cmi test/recursive_module.cmj : cc test/recursive_module.ml | test/mt.cmj $stdlib build test/recursive_module_test.cmi test/recursive_module_test.cmj : cc test/recursive_module_test.ml | test/mt.cmj $stdlib +build test/recursive_react_component.cmi test/recursive_react_component.cmj : cc test/recursive_react_component.re | test/react.cmj $stdlib build test/recursive_records_test.cmi test/recursive_records_test.cmj : cc test/recursive_records_test.ml | test/mt.cmj $stdlib build test/recursive_unbound_module_test.cmi test/recursive_unbound_module_test.cmj : cc test/recursive_unbound_module_test.ml | $stdlib build test/regression_print.cmi test/regression_print.cmj : cc test/regression_print.ml | $stdlib diff --git a/jscomp/test/recursive_react_component.js b/jscomp/test/recursive_react_component.js new file mode 100644 index 0000000000..510ba11dcc --- /dev/null +++ b/jscomp/test/recursive_react_component.js @@ -0,0 +1,13 @@ +'use strict'; + +var React = require("react"); + +function make(Props) { + var foo = Props.foo; + return React.createElement(make, { + foo: foo + }); +} + +exports.make = make; +/* react Not a pure module */ diff --git a/jscomp/test/recursive_react_component.re b/jscomp/test/recursive_react_component.re new file mode 100644 index 0000000000..4aa1e58256 --- /dev/null +++ b/jscomp/test/recursive_react_component.re @@ -0,0 +1,10 @@ + +[@bs.config { + flags : [|"-bs-jsx","3", "-dsource", + // "-w","A" + |] +}]; + +[@react.component] +let rec make = (~foo, ()) => + React.createElement(make, makeProps(~foo, ())); \ No newline at end of file diff --git a/lib/4.06.1/unstable/bspack.ml b/lib/4.06.1/unstable/bspack.ml index 92a155acdb..07b5d03d23 100644 --- a/lib/4.06.1/unstable/bspack.ml +++ b/lib/4.06.1/unstable/bspack.ml @@ -4040,23 +4040,23 @@ let message = function | Bs_unused_attribute s -> - "Unused BuckleScript attribute: " ^ s ^ "\n\ + "Unused attribute: " ^ s ^ "\n\ This means such annotation is not annotated properly. \n\ for example, some annotations is only meaningful in externals \n" | Bs_polymorphic_comparison -> - "polymorphic comparison introduced (maybe unsafe)" + "Polymorphic comparison introduced (maybe unsafe)" | Bs_ffi_warning s -> - "BuckleScript FFI warning: " ^ s + "FFI warning: " ^ s | Bs_derive_warning s -> - "BuckleScript bs.deriving warning: " ^ s + "bs.deriving warning: " ^ s | Bs_fragile_external s -> - "BuckleScript warning: " ^ s ^" : the external name is inferred from val name is unsafe from refactoring when changing value name" + s ^ " : the external name is inferred from val name is unsafe from refactoring when changing value name" | Bs_unimplemented_primitive s -> - "BuckleScript warning: Unimplemented primitive used:" ^ s + "Unimplemented primitive used:" ^ s | Bs_integer_literal_overflow -> - "BuckleScript warning: Integer literal exceeds the range of representable integers of type int" + "Integer literal exceeds the range of representable integers of type int" | Bs_uninterpreted_delimiters s -> - "BuckleScript warning: Uninterpreted delimiters " ^ s + "Uninterpreted delimiters " ^ s ;; @@ -4193,14 +4193,14 @@ let descriptions = 62, "Type constraint on GADT type declaration"; - 101, "BuckleScript warning: Unused bs attributes"; - 102, "BuckleScript warning: polymorphic comparison introduced (maybe unsafe)"; - 103, "BuckleScript warning: about fragile FFI definitions" ; - 104, "BuckleScript warning: bs.deriving warning with customized message "; - 105, "BuckleScript warning: the external name is inferred from val name is unsafe from refactoring when changing value name"; - 106, "BuckleScript warning: Unimplemented primitive used:"; - 107, "BuckleScript warning: Integer literal exceeds the range of representable integers of type int"; - 108, "BuckleScript warning: Uninterpreted delimiters (for unicode)" + 101, "Unused bs attributes"; + 102, "Polymorphic comparison introduced (maybe unsafe)"; + 103, "Fragile FFI definitions" ; + 104, "bs.deriving warning with customized message "; + 105, "External name is inferred from val name is unsafe from refactoring when changing value name"; + 106, "Unimplemented primitive used:"; + 107, "Integer literal exceeds the range of representable integers of type int"; + 108, "Uninterpreted delimiters (for unicode)" ] ;; diff --git a/lib/4.06.1/unstable/js_compiler.ml b/lib/4.06.1/unstable/js_compiler.ml index 7e963a42dd..4072d83e4d 100644 --- a/lib/4.06.1/unstable/js_compiler.ml +++ b/lib/4.06.1/unstable/js_compiler.ml @@ -4307,23 +4307,23 @@ let message = function | Bs_unused_attribute s -> - "Unused BuckleScript attribute: " ^ s ^ "\n\ + "Unused attribute: " ^ s ^ "\n\ This means such annotation is not annotated properly. \n\ for example, some annotations is only meaningful in externals \n" | Bs_polymorphic_comparison -> - "polymorphic comparison introduced (maybe unsafe)" + "Polymorphic comparison introduced (maybe unsafe)" | Bs_ffi_warning s -> - "BuckleScript FFI warning: " ^ s + "FFI warning: " ^ s | Bs_derive_warning s -> - "BuckleScript bs.deriving warning: " ^ s + "bs.deriving warning: " ^ s | Bs_fragile_external s -> - "BuckleScript warning: " ^ s ^" : the external name is inferred from val name is unsafe from refactoring when changing value name" + s ^ " : the external name is inferred from val name is unsafe from refactoring when changing value name" | Bs_unimplemented_primitive s -> - "BuckleScript warning: Unimplemented primitive used:" ^ s + "Unimplemented primitive used:" ^ s | Bs_integer_literal_overflow -> - "BuckleScript warning: Integer literal exceeds the range of representable integers of type int" + "Integer literal exceeds the range of representable integers of type int" | Bs_uninterpreted_delimiters s -> - "BuckleScript warning: Uninterpreted delimiters " ^ s + "Uninterpreted delimiters " ^ s ;; @@ -4460,14 +4460,14 @@ let descriptions = 62, "Type constraint on GADT type declaration"; - 101, "BuckleScript warning: Unused bs attributes"; - 102, "BuckleScript warning: polymorphic comparison introduced (maybe unsafe)"; - 103, "BuckleScript warning: about fragile FFI definitions" ; - 104, "BuckleScript warning: bs.deriving warning with customized message "; - 105, "BuckleScript warning: the external name is inferred from val name is unsafe from refactoring when changing value name"; - 106, "BuckleScript warning: Unimplemented primitive used:"; - 107, "BuckleScript warning: Integer literal exceeds the range of representable integers of type int"; - 108, "BuckleScript warning: Uninterpreted delimiters (for unicode)" + 101, "Unused bs attributes"; + 102, "Polymorphic comparison introduced (maybe unsafe)"; + 103, "Fragile FFI definitions" ; + 104, "bs.deriving warning with customized message "; + 105, "External name is inferred from val name is unsafe from refactoring when changing value name"; + 106, "Unimplemented primitive used:"; + 107, "Integer literal exceeds the range of representable integers of type int"; + 108, "Uninterpreted delimiters (for unicode)" ] ;; diff --git a/lib/4.06.1/unstable/js_refmt_compiler.ml b/lib/4.06.1/unstable/js_refmt_compiler.ml index 55053e73ae..99024ed21b 100644 --- a/lib/4.06.1/unstable/js_refmt_compiler.ml +++ b/lib/4.06.1/unstable/js_refmt_compiler.ml @@ -4307,23 +4307,23 @@ let message = function | Bs_unused_attribute s -> - "Unused BuckleScript attribute: " ^ s ^ "\n\ + "Unused attribute: " ^ s ^ "\n\ This means such annotation is not annotated properly. \n\ for example, some annotations is only meaningful in externals \n" | Bs_polymorphic_comparison -> - "polymorphic comparison introduced (maybe unsafe)" + "Polymorphic comparison introduced (maybe unsafe)" | Bs_ffi_warning s -> - "BuckleScript FFI warning: " ^ s + "FFI warning: " ^ s | Bs_derive_warning s -> - "BuckleScript bs.deriving warning: " ^ s + "bs.deriving warning: " ^ s | Bs_fragile_external s -> - "BuckleScript warning: " ^ s ^" : the external name is inferred from val name is unsafe from refactoring when changing value name" + s ^ " : the external name is inferred from val name is unsafe from refactoring when changing value name" | Bs_unimplemented_primitive s -> - "BuckleScript warning: Unimplemented primitive used:" ^ s + "Unimplemented primitive used:" ^ s | Bs_integer_literal_overflow -> - "BuckleScript warning: Integer literal exceeds the range of representable integers of type int" + "Integer literal exceeds the range of representable integers of type int" | Bs_uninterpreted_delimiters s -> - "BuckleScript warning: Uninterpreted delimiters " ^ s + "Uninterpreted delimiters " ^ s ;; @@ -4460,14 +4460,14 @@ let descriptions = 62, "Type constraint on GADT type declaration"; - 101, "BuckleScript warning: Unused bs attributes"; - 102, "BuckleScript warning: polymorphic comparison introduced (maybe unsafe)"; - 103, "BuckleScript warning: about fragile FFI definitions" ; - 104, "BuckleScript warning: bs.deriving warning with customized message "; - 105, "BuckleScript warning: the external name is inferred from val name is unsafe from refactoring when changing value name"; - 106, "BuckleScript warning: Unimplemented primitive used:"; - 107, "BuckleScript warning: Integer literal exceeds the range of representable integers of type int"; - 108, "BuckleScript warning: Uninterpreted delimiters (for unicode)" + 101, "Unused bs attributes"; + 102, "Polymorphic comparison introduced (maybe unsafe)"; + 103, "Fragile FFI definitions" ; + 104, "bs.deriving warning with customized message "; + 105, "External name is inferred from val name is unsafe from refactoring when changing value name"; + 106, "Unimplemented primitive used:"; + 107, "Integer literal exceeds the range of representable integers of type int"; + 108, "Uninterpreted delimiters (for unicode)" ] ;; diff --git a/lib/4.06.1/unstable/native_ppx.ml b/lib/4.06.1/unstable/native_ppx.ml index e3756d28a9..f21b4c2ab1 100644 --- a/lib/4.06.1/unstable/native_ppx.ml +++ b/lib/4.06.1/unstable/native_ppx.ml @@ -4040,23 +4040,23 @@ let message = function | Bs_unused_attribute s -> - "Unused BuckleScript attribute: " ^ s ^ "\n\ + "Unused attribute: " ^ s ^ "\n\ This means such annotation is not annotated properly. \n\ for example, some annotations is only meaningful in externals \n" | Bs_polymorphic_comparison -> - "polymorphic comparison introduced (maybe unsafe)" + "Polymorphic comparison introduced (maybe unsafe)" | Bs_ffi_warning s -> - "BuckleScript FFI warning: " ^ s + "FFI warning: " ^ s | Bs_derive_warning s -> - "BuckleScript bs.deriving warning: " ^ s + "bs.deriving warning: " ^ s | Bs_fragile_external s -> - "BuckleScript warning: " ^ s ^" : the external name is inferred from val name is unsafe from refactoring when changing value name" + s ^ " : the external name is inferred from val name is unsafe from refactoring when changing value name" | Bs_unimplemented_primitive s -> - "BuckleScript warning: Unimplemented primitive used:" ^ s + "Unimplemented primitive used:" ^ s | Bs_integer_literal_overflow -> - "BuckleScript warning: Integer literal exceeds the range of representable integers of type int" + "Integer literal exceeds the range of representable integers of type int" | Bs_uninterpreted_delimiters s -> - "BuckleScript warning: Uninterpreted delimiters " ^ s + "Uninterpreted delimiters " ^ s ;; @@ -4193,14 +4193,14 @@ let descriptions = 62, "Type constraint on GADT type declaration"; - 101, "BuckleScript warning: Unused bs attributes"; - 102, "BuckleScript warning: polymorphic comparison introduced (maybe unsafe)"; - 103, "BuckleScript warning: about fragile FFI definitions" ; - 104, "BuckleScript warning: bs.deriving warning with customized message "; - 105, "BuckleScript warning: the external name is inferred from val name is unsafe from refactoring when changing value name"; - 106, "BuckleScript warning: Unimplemented primitive used:"; - 107, "BuckleScript warning: Integer literal exceeds the range of representable integers of type int"; - 108, "BuckleScript warning: Uninterpreted delimiters (for unicode)" + 101, "Unused bs attributes"; + 102, "Polymorphic comparison introduced (maybe unsafe)"; + 103, "Fragile FFI definitions" ; + 104, "bs.deriving warning with customized message "; + 105, "External name is inferred from val name is unsafe from refactoring when changing value name"; + 106, "Unimplemented primitive used:"; + 107, "Integer literal exceeds the range of representable integers of type int"; + 108, "Uninterpreted delimiters (for unicode)" ] ;; diff --git a/lib/4.06.1/whole_compiler.ml b/lib/4.06.1/whole_compiler.ml index d32c906422..9b136cf1bb 100644 --- a/lib/4.06.1/whole_compiler.ml +++ b/lib/4.06.1/whole_compiler.ml @@ -3953,23 +3953,23 @@ let message = function | Bs_unused_attribute s -> - "Unused BuckleScript attribute: " ^ s ^ "\n\ + "Unused attribute: " ^ s ^ "\n\ This means such annotation is not annotated properly. \n\ for example, some annotations is only meaningful in externals \n" | Bs_polymorphic_comparison -> - "polymorphic comparison introduced (maybe unsafe)" + "Polymorphic comparison introduced (maybe unsafe)" | Bs_ffi_warning s -> - "BuckleScript FFI warning: " ^ s + "FFI warning: " ^ s | Bs_derive_warning s -> - "BuckleScript bs.deriving warning: " ^ s + "bs.deriving warning: " ^ s | Bs_fragile_external s -> - "BuckleScript warning: " ^ s ^" : the external name is inferred from val name is unsafe from refactoring when changing value name" + s ^ " : the external name is inferred from val name is unsafe from refactoring when changing value name" | Bs_unimplemented_primitive s -> - "BuckleScript warning: Unimplemented primitive used:" ^ s + "Unimplemented primitive used:" ^ s | Bs_integer_literal_overflow -> - "BuckleScript warning: Integer literal exceeds the range of representable integers of type int" + "Integer literal exceeds the range of representable integers of type int" | Bs_uninterpreted_delimiters s -> - "BuckleScript warning: Uninterpreted delimiters " ^ s + "Uninterpreted delimiters " ^ s ;; @@ -4106,14 +4106,14 @@ let descriptions = 62, "Type constraint on GADT type declaration"; - 101, "BuckleScript warning: Unused bs attributes"; - 102, "BuckleScript warning: polymorphic comparison introduced (maybe unsafe)"; - 103, "BuckleScript warning: about fragile FFI definitions" ; - 104, "BuckleScript warning: bs.deriving warning with customized message "; - 105, "BuckleScript warning: the external name is inferred from val name is unsafe from refactoring when changing value name"; - 106, "BuckleScript warning: Unimplemented primitive used:"; - 107, "BuckleScript warning: Integer literal exceeds the range of representable integers of type int"; - 108, "BuckleScript warning: Uninterpreted delimiters (for unicode)" + 101, "Unused bs attributes"; + 102, "Polymorphic comparison introduced (maybe unsafe)"; + 103, "Fragile FFI definitions" ; + 104, "bs.deriving warning with customized message "; + 105, "External name is inferred from val name is unsafe from refactoring when changing value name"; + 106, "Unimplemented primitive used:"; + 107, "Integer literal exceeds the range of representable integers of type int"; + 108, "Uninterpreted delimiters (for unicode)" ] ;; From c8c0baf920304464a61e24774f6a6b0758537f49 Mon Sep 17 00:00:00 2001 From: Hongbo Zhang Date: Mon, 31 Aug 2020 09:38:14 +0800 Subject: [PATCH 12/13] snapshot --- lib/4.06.1/unstable/bspack.ml | 2 +- lib/4.06.1/unstable/js_compiler.ml | 34 ++++++++++++++++-------- lib/4.06.1/unstable/js_refmt_compiler.ml | 34 ++++++++++++++++-------- lib/4.06.1/unstable/native_ppx.ml | 2 +- lib/4.06.1/whole_compiler.ml | 34 ++++++++++++++++-------- ocaml | 2 +- 6 files changed, 72 insertions(+), 36 deletions(-) diff --git a/lib/4.06.1/unstable/bspack.ml b/lib/4.06.1/unstable/bspack.ml index 07b5d03d23..1b91ac8898 100644 --- a/lib/4.06.1/unstable/bspack.ml +++ b/lib/4.06.1/unstable/bspack.ml @@ -3467,7 +3467,7 @@ val mk_lazy: (unit -> 'a) -> 'a Lazy.t the warning settings at the time [mk_lazy] is called. *) -val disabled : bool ref +val nerrors : int ref val message : t -> string val number: t -> int val super_report : diff --git a/lib/4.06.1/unstable/js_compiler.ml b/lib/4.06.1/unstable/js_compiler.ml index 4072d83e4d..6d98d3e5cb 100644 --- a/lib/4.06.1/unstable/js_compiler.ml +++ b/lib/4.06.1/unstable/js_compiler.ml @@ -3734,7 +3734,7 @@ val mk_lazy: (unit -> 'a) -> 'a Lazy.t the warning settings at the time [mk_lazy] is called. *) -val disabled : bool ref +val nerrors : int ref val message : t -> string val number: t -> int val super_report : @@ -399998,7 +399998,6 @@ let compile Ext_string.compare (Lam_module_ident.name id1) (Lam_module_ident.name id2) ) in - Warnings.check_fatal (); let effect = Lam_stats_export.get_dependent_module_effect maybe_pure external_module_ids in @@ -400030,23 +400029,36 @@ let lambda_as_module (if !Js_config.bs_suffix then Literals.suffix_bs_js else Literals.suffix_js) in let package_info = Js_packages_state.get_packages_info () in - if Js_packages_info.is_empty package_info && !Js_config.js_stdout then - Js_dump_program.dump_deps_program ~output_prefix NodeJS lambda_output stdout - else + if Js_packages_info.is_empty package_info && !Js_config.js_stdout then begin + Js_dump_program.dump_deps_program ~output_prefix NodeJS lambda_output stdout; + if !Warnings.nerrors > 0 then begin + Warnings.nerrors := 0; + exit 77 + end + end else Js_packages_info.iter package_info (fun {module_system; path = _path} -> let output_chan chan = Js_dump_program.dump_deps_program ~output_prefix module_system lambda_output chan in + let target_file = + (Lazy.force Ext_path.package_dir // + _path // + basename + (* #913 only generate little-case js file *) + ) in + if !Warnings.nerrors > 0 then begin + Warnings.nerrors := 0 ; + if Sys.file_exists target_file then Sys.remove target_file; + exit 77 + (* don't write js file, we need remove js files + otherwise the js files are out-of-date + exit 177 *) + end else if not @@ !Clflags.dont_write_files then Ext_pervasives.with_file_as_chan - - (Lazy.force Ext_path.package_dir // - _path // - basename - (* #913 only generate little-case js file *) - ) output_chan ) + target_file output_chan ) diff --git a/lib/4.06.1/unstable/js_refmt_compiler.ml b/lib/4.06.1/unstable/js_refmt_compiler.ml index 99024ed21b..7290b5469b 100644 --- a/lib/4.06.1/unstable/js_refmt_compiler.ml +++ b/lib/4.06.1/unstable/js_refmt_compiler.ml @@ -3734,7 +3734,7 @@ val mk_lazy: (unit -> 'a) -> 'a Lazy.t the warning settings at the time [mk_lazy] is called. *) -val disabled : bool ref +val nerrors : int ref val message : t -> string val number: t -> int val super_report : @@ -399998,7 +399998,6 @@ let compile Ext_string.compare (Lam_module_ident.name id1) (Lam_module_ident.name id2) ) in - Warnings.check_fatal (); let effect = Lam_stats_export.get_dependent_module_effect maybe_pure external_module_ids in @@ -400030,23 +400029,36 @@ let lambda_as_module (if !Js_config.bs_suffix then Literals.suffix_bs_js else Literals.suffix_js) in let package_info = Js_packages_state.get_packages_info () in - if Js_packages_info.is_empty package_info && !Js_config.js_stdout then - Js_dump_program.dump_deps_program ~output_prefix NodeJS lambda_output stdout - else + if Js_packages_info.is_empty package_info && !Js_config.js_stdout then begin + Js_dump_program.dump_deps_program ~output_prefix NodeJS lambda_output stdout; + if !Warnings.nerrors > 0 then begin + Warnings.nerrors := 0; + exit 77 + end + end else Js_packages_info.iter package_info (fun {module_system; path = _path} -> let output_chan chan = Js_dump_program.dump_deps_program ~output_prefix module_system lambda_output chan in + let target_file = + (Lazy.force Ext_path.package_dir // + _path // + basename + (* #913 only generate little-case js file *) + ) in + if !Warnings.nerrors > 0 then begin + Warnings.nerrors := 0 ; + if Sys.file_exists target_file then Sys.remove target_file; + exit 77 + (* don't write js file, we need remove js files + otherwise the js files are out-of-date + exit 177 *) + end else if not @@ !Clflags.dont_write_files then Ext_pervasives.with_file_as_chan - - (Lazy.force Ext_path.package_dir // - _path // - basename - (* #913 only generate little-case js file *) - ) output_chan ) + target_file output_chan ) diff --git a/lib/4.06.1/unstable/native_ppx.ml b/lib/4.06.1/unstable/native_ppx.ml index f21b4c2ab1..1dade87da2 100644 --- a/lib/4.06.1/unstable/native_ppx.ml +++ b/lib/4.06.1/unstable/native_ppx.ml @@ -3467,7 +3467,7 @@ val mk_lazy: (unit -> 'a) -> 'a Lazy.t the warning settings at the time [mk_lazy] is called. *) -val disabled : bool ref +val nerrors : int ref val message : t -> string val number: t -> int val super_report : diff --git a/lib/4.06.1/whole_compiler.ml b/lib/4.06.1/whole_compiler.ml index 9b136cf1bb..b0b945d808 100644 --- a/lib/4.06.1/whole_compiler.ml +++ b/lib/4.06.1/whole_compiler.ml @@ -3405,7 +3405,7 @@ val mk_lazy: (unit -> 'a) -> 'a Lazy.t the warning settings at the time [mk_lazy] is called. *) -val disabled : bool ref +val nerrors : int ref val message : t -> string val number: t -> int val super_report : @@ -402854,7 +402854,6 @@ let compile Ext_string.compare (Lam_module_ident.name id1) (Lam_module_ident.name id2) ) in - Warnings.check_fatal (); let effect = Lam_stats_export.get_dependent_module_effect maybe_pure external_module_ids in @@ -402886,23 +402885,36 @@ let lambda_as_module (if !Js_config.bs_suffix then Literals.suffix_bs_js else Literals.suffix_js) in let package_info = Js_packages_state.get_packages_info () in - if Js_packages_info.is_empty package_info && !Js_config.js_stdout then - Js_dump_program.dump_deps_program ~output_prefix NodeJS lambda_output stdout - else + if Js_packages_info.is_empty package_info && !Js_config.js_stdout then begin + Js_dump_program.dump_deps_program ~output_prefix NodeJS lambda_output stdout; + if !Warnings.nerrors > 0 then begin + Warnings.nerrors := 0; + exit 77 + end + end else Js_packages_info.iter package_info (fun {module_system; path = _path} -> let output_chan chan = Js_dump_program.dump_deps_program ~output_prefix module_system lambda_output chan in + let target_file = + (Lazy.force Ext_path.package_dir // + _path // + basename + (* #913 only generate little-case js file *) + ) in + if !Warnings.nerrors > 0 then begin + Warnings.nerrors := 0 ; + if Sys.file_exists target_file then Sys.remove target_file; + exit 77 + (* don't write js file, we need remove js files + otherwise the js files are out-of-date + exit 177 *) + end else if not @@ !Clflags.dont_write_files then Ext_pervasives.with_file_as_chan - - (Lazy.force Ext_path.package_dir // - _path // - basename - (* #913 only generate little-case js file *) - ) output_chan ) + target_file output_chan ) diff --git a/ocaml b/ocaml index f6900f7016..c7767462f3 160000 --- a/ocaml +++ b/ocaml @@ -1 +1 @@ -Subproject commit f6900f7016cf8b55d35067be28caa5f19dba1eb0 +Subproject commit c7767462f3b3b42de9f6e662fa0a94381fd404fd From 3ce95387887e08a3674393ead10be8ae05edbdce Mon Sep 17 00:00:00 2001 From: Hongbo Zhang Date: Mon, 31 Aug 2020 09:51:48 +0800 Subject: [PATCH 13/13] bump the version number to prepare a dev release to test the warn-as-errors changes --- jscomp/common/bs_version.ml | 2 +- lib/4.06.1/bsb.ml | 2 +- lib/4.06.1/unstable/bsb_native.ml | 2 +- lib/4.06.1/unstable/js_compiler.ml | 2 +- lib/4.06.1/unstable/js_refmt_compiler.ml | 2 +- lib/4.06.1/whole_compiler.ml | 2 +- package.json | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/jscomp/common/bs_version.ml b/jscomp/common/bs_version.ml index 23426c8ddf..a29826ec1b 100644 --- a/jscomp/common/bs_version.ml +++ b/jscomp/common/bs_version.ml @@ -22,7 +22,7 @@ * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *) -let version = "8.2.0" +let version = "8.3.0" let header = "// Generated by ReScript, PLEASE EDIT WITH CARE" let package_name = "bs-platform" diff --git a/lib/4.06.1/bsb.ml b/lib/4.06.1/bsb.ml index 798dd4b860..3ee9b90713 100644 --- a/lib/4.06.1/bsb.ml +++ b/lib/4.06.1/bsb.ml @@ -55,7 +55,7 @@ end = struct * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *) -let version = "8.2.0" +let version = "8.3.0" let header = "// Generated by ReScript, PLEASE EDIT WITH CARE" let package_name = "bs-platform" diff --git a/lib/4.06.1/unstable/bsb_native.ml b/lib/4.06.1/unstable/bsb_native.ml index 8a24958776..4dc8972412 100644 --- a/lib/4.06.1/unstable/bsb_native.ml +++ b/lib/4.06.1/unstable/bsb_native.ml @@ -55,7 +55,7 @@ end = struct * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *) -let version = "8.2.0" +let version = "8.3.0" let header = "// Generated by ReScript, PLEASE EDIT WITH CARE" let package_name = "bs-platform" diff --git a/lib/4.06.1/unstable/js_compiler.ml b/lib/4.06.1/unstable/js_compiler.ml index 6d98d3e5cb..f805127392 100644 --- a/lib/4.06.1/unstable/js_compiler.ml +++ b/lib/4.06.1/unstable/js_compiler.ml @@ -18083,7 +18083,7 @@ end = struct * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *) -let version = "8.2.0" +let version = "8.3.0" let header = "// Generated by ReScript, PLEASE EDIT WITH CARE" let package_name = "bs-platform" diff --git a/lib/4.06.1/unstable/js_refmt_compiler.ml b/lib/4.06.1/unstable/js_refmt_compiler.ml index 7290b5469b..89f9ec88f1 100644 --- a/lib/4.06.1/unstable/js_refmt_compiler.ml +++ b/lib/4.06.1/unstable/js_refmt_compiler.ml @@ -18083,7 +18083,7 @@ end = struct * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *) -let version = "8.2.0" +let version = "8.3.0" let header = "// Generated by ReScript, PLEASE EDIT WITH CARE" let package_name = "bs-platform" diff --git a/lib/4.06.1/whole_compiler.ml b/lib/4.06.1/whole_compiler.ml index b0b945d808..8e517fd384 100644 --- a/lib/4.06.1/whole_compiler.ml +++ b/lib/4.06.1/whole_compiler.ml @@ -304539,7 +304539,7 @@ end = struct * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *) -let version = "8.2.0" +let version = "8.3.0" let header = "// Generated by ReScript, PLEASE EDIT WITH CARE" let package_name = "bs-platform" diff --git a/package.json b/package.json index 48831cd341..5437e73368 100644 --- a/package.json +++ b/package.json @@ -18,7 +18,7 @@ "coverage": "nyc --timeout=3000 --reporter=html mocha jscomp/test/*test.js && open ./coverage/index.html" }, "name": "bs-platform", - "version": "8.2.0", + "version": "8.3.0", "description": "ReScript compiler, OCaml standard libary by ReScript and its required runtime support", "repository": { "type": "git",