From 8d6156c0284b94c14b8413ef611a65ed68546f30 Mon Sep 17 00:00:00 2001 From: Hyeseong Kim Date: Sun, 11 Aug 2024 09:45:47 +0900 Subject: [PATCH 1/8] emit arrow syntax for non top level functions --- .../react_ppx/src/gpr_3987_test.bs.js | 6 +- jscomp/core/js_dump.ml | 22 +- jscomp/core/js_dump_lit.ml | 10 +- .../src/ErrorHandler.res.js | 2 +- .../typescript-react-example/src/Hooks.res.js | 16 +- .../src/ImmutableArray.res.js | 38 ++-- .../src/ImportJsValue.res.js | 2 +- .../src/Records.res.js | 18 +- .../src/TestPromise.res.js | 2 +- .../src/Uncurried.res.js | 6 +- .../src/nested/Tuples.res.js | 4 +- .../src/nested/Types.res.js | 2 +- jscomp/test/Import.js | 10 +- .../test/PartialApplicationNoRuntimeCurry.js | 4 +- jscomp/test/SafePromises.js | 6 +- jscomp/test/UncurriedAlways.js | 2 +- jscomp/test/UncurriedExternals.js | 6 +- jscomp/test/UntaggedVariants.js | 6 +- jscomp/test/a_filename_test.js | 2 +- jscomp/test/a_list_test.js | 8 +- jscomp/test/a_string_test.js | 14 +- jscomp/test/and_or_tailcall_test.js | 4 +- jscomp/test/ari_regress_test.js | 10 +- jscomp/test/arith_parser.js | 22 +- jscomp/test/arity_deopt.js | 8 +- jscomp/test/arity_infer.js | 10 +- jscomp/test/array_data_util.js | 4 +- jscomp/test/array_subtle_test.js | 2 +- jscomp/test/array_test.js | 44 ++-- jscomp/test/ast_abstract_test.js | 2 +- jscomp/test/async_await.js | 2 +- jscomp/test/async_inline.js | 10 +- jscomp/test/async_inside_loop.js | 2 +- jscomp/test/attr_test.js | 2 +- jscomp/test/bdd.js | 6 +- jscomp/test/belt_result_alias_test.js | 4 +- jscomp/test/bench.js | 12 +- jscomp/test/bs_abstract_test.js | 4 +- jscomp/test/bs_array_test.js | 102 ++++----- jscomp/test/bs_auto_uncurry.js | 20 +- jscomp/test/bs_auto_uncurry_test.js | 18 +- jscomp/test/bs_hashmap_test.js | 2 +- jscomp/test/bs_hashset_int_test.js | 2 +- jscomp/test/bs_ignore_effect.js | 2 +- jscomp/test/bs_list_test.js | 160 +++++++------- jscomp/test/bs_map_set_dict_test.js | 18 +- jscomp/test/bs_map_test.js | 8 +- jscomp/test/bs_mutable_set_test.js | 50 ++--- jscomp/test/bs_poly_map_test.js | 42 ++-- jscomp/test/bs_poly_mutable_map_test.js | 6 +- jscomp/test/bs_poly_mutable_set_test.js | 30 +-- jscomp/test/bs_poly_set_test.js | 40 ++-- jscomp/test/bs_queue_test.js | 10 +- jscomp/test/bs_set_int_test.js | 16 +- jscomp/test/bs_sort_test.js | 16 +- jscomp/test/bs_stack_test.js | 2 +- jscomp/test/bs_string_test.js | 4 +- jscomp/test/buffer_test.js | 6 +- jscomp/test/bytes_split_gpr_743_test.js | 2 +- jscomp/test/caml_compare_bigint_test.js | 68 +++--- jscomp/test/caml_compare_test.js | 108 +++++----- jscomp/test/caml_format_test.js | 36 ++-- jscomp/test/chain_code_test.js | 2 +- jscomp/test/chn_test.js | 4 +- jscomp/test/class_type_ffi_test.js | 2 +- jscomp/test/coercion_module_alias_test.js | 2 +- jscomp/test/complex_if_test.js | 2 +- jscomp/test/complex_test.js | 2 +- jscomp/test/complex_while_loop.js | 6 +- jscomp/test/condition_compilation_test.js | 2 +- jscomp/test/const_block_test.js | 2 +- jscomp/test/cps_test.js | 24 +-- jscomp/test/demo_page.js | 2 +- jscomp/test/demo_pipe.js | 4 +- jscomp/test/digest_test.js | 16 +- jscomp/test/div_by_zero_test.js | 26 +-- jscomp/test/dollar_escape_test.js | 2 +- jscomp/test/earger_curry_test.js | 18 +- jscomp/test/epsilon_test.js | 4 +- jscomp/test/es6_module_test.js | 4 +- jscomp/test/event_ffi.js | 6 +- jscomp/test/exception_raise_test.js | 4 +- jscomp/test/exception_rebound_err_test.js | 2 +- jscomp/test/ext_array_test.js | 4 +- jscomp/test/ext_bytes_test.js | 4 +- jscomp/test/ext_filename_test.js | 22 +- jscomp/test/ext_list_test.js | 14 +- jscomp/test/ext_string_test.js | 20 +- jscomp/test/extensible_variant_test.js | 6 +- jscomp/test/ffi_arity_test.js | 16 +- jscomp/test/ffi_array_test.js | 4 +- jscomp/test/ffi_js_test.js | 2 +- jscomp/test/ffi_splice_test.js | 2 +- jscomp/test/flexible_array_test.js | 8 +- jscomp/test/float_of_bits_test.js | 10 +- jscomp/test/float_test.js | 16 +- jscomp/test/for_loop_test.js | 72 +++---- jscomp/test/for_side_effect_test.js | 2 +- jscomp/test/format_test.js | 8 +- jscomp/test/functor_app_test.js | 2 +- jscomp/test/functor_def.js | 2 +- jscomp/test/functor_ffi.js | 2 +- jscomp/test/functors.js | 16 +- jscomp/test/genlex_test.js | 2 +- .../test/global_exception_regression_test.js | 4 +- jscomp/test/global_module_alias_test.js | 2 +- jscomp/test/google_closure_test.js | 2 +- jscomp/test/gpr496_test.js | 2 +- jscomp/test/gpr_1154_test.js | 2 +- jscomp/test/gpr_1409_test.js | 4 +- jscomp/test/gpr_1423_app_test.js | 4 +- jscomp/test/gpr_1438.js | 2 +- jscomp/test/gpr_1503_test.js | 2 +- jscomp/test/gpr_1539_test.js | 2 +- jscomp/test/gpr_1658_test.js | 2 +- jscomp/test/gpr_1667_test.js | 2 +- jscomp/test/gpr_1692_test.js | 2 +- jscomp/test/gpr_1701_test.js | 2 +- jscomp/test/gpr_1716_test.js | 2 +- jscomp/test/gpr_1728_test.js | 2 +- jscomp/test/gpr_1749_test.js | 2 +- jscomp/test/gpr_1760_test.js | 2 +- jscomp/test/gpr_1762_test.js | 2 +- jscomp/test/gpr_1817_test.js | 2 +- jscomp/test/gpr_1822_test.js | 2 +- jscomp/test/gpr_1943_test.js | 2 +- jscomp/test/gpr_2316_test.js | 2 +- jscomp/test/gpr_2487.js | 2 +- jscomp/test/gpr_2608_test.js | 4 +- jscomp/test/gpr_2682_test.js | 4 +- jscomp/test/gpr_3536_test.js | 6 +- jscomp/test/gpr_3566_test.js | 8 +- jscomp/test/gpr_3697_test.js | 2 +- jscomp/test/gpr_3875_test.js | 2 +- jscomp/test/gpr_405_test.js | 6 +- jscomp/test/gpr_4274_test.js | 6 +- jscomp/test/gpr_459_test.js | 2 +- jscomp/test/gpr_858_unit2_test.js | 6 +- jscomp/test/gpr_904_test.js | 2 +- jscomp/test/gpr_977_test.js | 2 +- jscomp/test/hash_test.js | 2 +- jscomp/test/hashtbl_test.js | 14 +- jscomp/test/ignore_test.js | 2 +- jscomp/test/import2.js | 2 +- jscomp/test/import_external.js | 2 +- jscomp/test/import_side_effect.js | 2 +- jscomp/test/import_side_effect_free.js | 2 +- jscomp/test/inline_map2_test.js | 74 +++---- jscomp/test/inline_map_demo.js | 4 +- jscomp/test/inline_map_test.js | 4 +- jscomp/test/inline_record_test.js | 4 +- jscomp/test/inline_regression_test.js | 4 +- jscomp/test/inner_unused.js | 2 +- jscomp/test/installation_test.js | 2 +- jscomp/test/int32_test.js | 22 +- jscomp/test/int64_mul_div_test.js | 34 +-- jscomp/test/int64_string_test.js | 2 +- jscomp/test/int64_test.js | 114 +++++----- jscomp/test/int_hashtbl_test.js | 14 +- jscomp/test/int_overflow_test.js | 28 +-- jscomp/test/int_switch_test.js | 10 +- jscomp/test/js_array_test.js | 158 +++++++------- jscomp/test/js_bool_test.js | 6 +- jscomp/test/js_cast_test.js | 2 +- jscomp/test/js_date_test.js | 134 ++++++------ jscomp/test/js_dict_test.js | 28 +-- jscomp/test/js_exception_catch_test.js | 32 +-- jscomp/test/js_float_test.js | 104 ++++----- jscomp/test/js_global_test.js | 16 +- jscomp/test/js_int_test.js | 52 ++--- jscomp/test/js_json_test.js | 98 ++++----- jscomp/test/js_math_test.js | 116 +++++----- jscomp/test/js_null_test.js | 30 +-- jscomp/test/js_null_undefined_test.js | 62 +++--- jscomp/test/js_nullable_test.js | 2 +- jscomp/test/js_obj_test.js | 4 +- jscomp/test/js_option_test.js | 60 +++--- jscomp/test/js_re_test.js | 36 ++-- jscomp/test/js_string_test.js | 120 +++++------ jscomp/test/js_undefined_test.js | 30 +-- jscomp/test/jsoo_400_test.js | 4 +- jscomp/test/key_word_property_plus_test.js | 4 +- jscomp/test/lazy_demo.js | 4 +- jscomp/test/lazy_test.js | 44 ++-- jscomp/test/lib_js_test.js | 2 +- jscomp/test/libarg_test.js | 2 +- jscomp/test/libqueue_test.js | 4 +- jscomp/test/limits_test.js | 2 +- jscomp/test/list_stack.js | 2 +- jscomp/test/list_test.js | 16 +- jscomp/test/loop_regression_test.js | 2 +- jscomp/test/map_find_test.js | 8 +- jscomp/test/map_test.js | 12 +- jscomp/test/mario_game.js | 20 +- jscomp/test/method_name_test.js | 2 +- jscomp/test/mock_mt.js | 2 +- jscomp/test/module_alias_test.js | 2 +- jscomp/test/module_parameter_test.js | 4 +- jscomp/test/module_splice_test.js | 2 +- jscomp/test/more_poly_variant_test.js | 2 +- jscomp/test/mpr_6033_test.js | 4 +- jscomp/test/mt.js | 14 +- jscomp/test/mt_global.js | 6 +- jscomp/test/mutable_obj_test.js | 2 +- jscomp/test/mutable_uncurry_test.js | 24 +-- jscomp/test/name_mangle_test.js | 2 +- jscomp/test/obj_literal_ppx.js | 2 +- jscomp/test/obj_magic_test.js | 8 +- jscomp/test/ocaml_re_test.js | 80 +++---- jscomp/test/of_string_test.js | 6 +- jscomp/test/offset.js | 2 +- jscomp/test/option_repr_test.js | 14 +- jscomp/test/optional_ffi_test.js | 2 +- jscomp/test/pipe_send_readline.js | 4 +- jscomp/test/poly_variant_test.js | 2 +- jscomp/test/polymorphic_raw_test.js | 2 +- jscomp/test/ppx_apply_test.js | 2 +- jscomp/test/prepend_data_ffi.js | 12 +- jscomp/test/print_alpha_test.js | 6 +- jscomp/test/queue_402.js | 2 +- jscomp/test/queue_test.js | 20 +- jscomp/test/random_test.js | 6 +- jscomp/test/reactTestUtils.js | 12 +- jscomp/test/reasonReact.js | 4 +- jscomp/test/reasonReactRouter.js | 16 +- jscomp/test/rec_fun_test.js | 4 +- jscomp/test/rec_module_test.js | 16 +- jscomp/test/recmodule.js | 10 +- jscomp/test/record_with_test.js | 2 +- jscomp/test/recursive_module.js | 10 +- jscomp/test/recursive_module_test.js | 6 +- jscomp/test/recursive_unbound_module_test.js | 2 +- jscomp/test/res_debug.js | 4 +- jscomp/test/return_check.js | 2 +- jscomp/test/set_gen.js | 6 +- jscomp/test/sexp.js | 32 +-- jscomp/test/sexpm.js | 38 ++-- jscomp/test/sexpm_test.js | 2 +- jscomp/test/side_effect2.js | 2 +- jscomp/test/stack_comp_test.js | 4 +- jscomp/test/stack_test.js | 2 +- jscomp/test/stream_parser_test.js | 28 +-- jscomp/test/string_get_set_test.js | 2 +- jscomp/test/string_runtime_test.js | 8 +- jscomp/test/string_set.js | 2 +- jscomp/test/string_set_test.js | 2 +- jscomp/test/string_test.js | 40 ++-- jscomp/test/string_unicode_test.js | 2 +- jscomp/test/switch_case_test.js | 2 +- jscomp/test/tagged_template_test.js | 12 +- jscomp/test/tailcall_inline_test.js | 6 +- jscomp/test/test_closure.js | 6 +- jscomp/test/test_cps.js | 8 +- jscomp/test/test_demo.js | 4 +- jscomp/test/test_for_loop.js | 32 +-- jscomp/test/test_google_closure.js | 6 +- jscomp/test/test_int_map_find.js | 2 +- jscomp/test/test_list.js | 10 +- jscomp/test/test_react.js | 2 +- jscomp/test/test_set.js | 76 +++---- jscomp/test/test_string_map.js | 4 +- jscomp/test/test_while_closure.js | 6 +- jscomp/test/test_while_side_effect.js | 2 +- jscomp/test/test_zero_nullable.js | 2 +- jscomp/test/ticker.js | 20 +- jscomp/test/to_string_test.js | 4 +- jscomp/test/topsort_test.js | 26 +-- jscomp/test/tramp_fib.js | 10 +- jscomp/test/tuple_alloc.js | 2 +- jscomp/test/typeof_test.js | 28 +-- jscomp/test/uncurried_cast.js | 8 +- jscomp/test/uncurried_default.args.js | 4 +- jscomp/test/uncurry_external_test.js | 2 +- jscomp/test/unit_undefined_test.js | 2 +- jscomp/test/unsafe_ppx_test.js | 10 +- jscomp/test/update_record_test.js | 2 +- jscomp/test/variant.js | 2 +- jscomp/test/webpack_config.js | 8 +- lib/es6/arg.js | 20 +- lib/es6/array.js | 14 +- lib/es6/arrayLabels.js | 14 +- lib/es6/belt_Array.js | 2 +- lib/es6/belt_MapDict.js | 4 +- lib/es6/belt_internalAVLset.js | 2 +- lib/es6/belt_internalAVLtree.js | 2 +- lib/es6/belt_internalBuckets.js | 12 +- lib/es6/belt_internalMapInt.js | 2 +- lib/es6/belt_internalMapString.js | 2 +- lib/es6/belt_internalSetBuckets.js | 6 +- lib/es6/caml_format.js | 10 +- lib/es6/caml_hash.js | 2 +- lib/es6/caml_int64.js | 2 +- lib/es6/caml_module.js | 6 +- lib/es6/caml_obj.js | 10 +- lib/es6/camlinternalLazy.js | 2 +- lib/es6/curry.js | 60 +++--- lib/es6/digest.js | 4 +- lib/es6/filename.js | 8 +- lib/es6/genlex.js | 28 +-- lib/es6/hashtbl.js | 58 ++--- lib/es6/hashtblLabels.js | 42 ++-- lib/es6/lazy.js | 2 +- lib/es6/lexing.js | 4 +- lib/es6/list.js | 8 +- lib/es6/listLabels.js | 8 +- lib/es6/map.js | 86 ++++---- lib/es6/mapLabels.js | 94 ++++---- lib/es6/moreLabels.js | 200 +++++++++--------- lib/es6/parsing.js | 4 +- lib/es6/pervasives.js | 4 +- lib/es6/random.js | 4 +- lib/es6/set.js | 86 ++++---- lib/es6/setLabels.js | 102 ++++----- lib/es6/sort.js | 6 +- lib/es6/stream.js | 20 +- lib/es6/string.js | 2 +- lib/es6/stringLabels.js | 2 +- lib/js/arg.js | 20 +- lib/js/array.js | 14 +- lib/js/arrayLabels.js | 14 +- lib/js/belt_Array.js | 2 +- lib/js/belt_MapDict.js | 4 +- lib/js/belt_internalAVLset.js | 2 +- lib/js/belt_internalAVLtree.js | 2 +- lib/js/belt_internalBuckets.js | 12 +- lib/js/belt_internalMapInt.js | 2 +- lib/js/belt_internalMapString.js | 2 +- lib/js/belt_internalSetBuckets.js | 6 +- lib/js/caml_format.js | 10 +- lib/js/caml_hash.js | 2 +- lib/js/caml_int64.js | 2 +- lib/js/caml_module.js | 6 +- lib/js/caml_obj.js | 10 +- lib/js/camlinternalLazy.js | 2 +- lib/js/curry.js | 60 +++--- lib/js/digest.js | 4 +- lib/js/filename.js | 8 +- lib/js/genlex.js | 28 +-- lib/js/hashtbl.js | 58 ++--- lib/js/hashtblLabels.js | 42 ++-- lib/js/lazy.js | 2 +- lib/js/lexing.js | 4 +- lib/js/list.js | 8 +- lib/js/listLabels.js | 8 +- lib/js/map.js | 86 ++++---- lib/js/mapLabels.js | 94 ++++---- lib/js/moreLabels.js | 200 +++++++++--------- lib/js/parsing.js | 4 +- lib/js/pervasives.js | 4 +- lib/js/random.js | 4 +- lib/js/set.js | 86 ++++---- lib/js/setLabels.js | 102 ++++----- lib/js/sort.js | 6 +- lib/js/stream.js | 20 +- lib/js/string.js | 2 +- lib/js/stringLabels.js | 2 +- 356 files changed, 2918 insertions(+), 2908 deletions(-) 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 e2a8d1556e1..575038f3f6b 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 @@ -33,7 +33,7 @@ let Gpr3987ReproOk = { make: make }; -React.createElement(make, makeProps("test", (function (param, param$1) { +React.createElement(make, makeProps("test", ((param, param$1) => { }), undefined)); @@ -47,7 +47,7 @@ let Gpr3987ReproOk2 = { React.createElement(Gpr_3987_test$Gpr3987ReproOk2, { value: "test", - onChange: (function (param, param$1) { + onChange: ((param, param$1) => { }) }); @@ -62,7 +62,7 @@ let Gpr3987ReproError = { React.createElement(Gpr_3987_test$Gpr3987ReproError, { value: "test", - onChange: (function (param, param$1) { + onChange: ((param, param$1) => { }) }); diff --git a/jscomp/core/js_dump.ml b/jscomp/core/js_dump.ml index a09885ae2f9..ac4daa087e1 100644 --- a/jscomp/core/js_dump.ml +++ b/jscomp/core/js_dump.ml @@ -360,6 +360,12 @@ and pp_function ~return_unit ~async ~is_method ?directive cxt (f : P.t) ~fn_stat (* the context will be continued after this function *) let outer_cxt = Ext_pp_scope.merge cxt set_env in + (* whether the function output can use arrow syntax *) + let arrow = match fn_state with + | Name_top _ -> false + | _ -> not is_method + in + (* the context used to be printed inside this function when printing a function, @@ -388,6 +394,10 @@ and pp_function ~return_unit ~async ~is_method ?directive cxt (f : P.t) ~fn_stat P.paren_group f 1 (fun _ -> formal_parameter_list inner_cxt f l) in P.space f; + if arrow then ( + P.string f (L.arrow); + P.space f; + ); P.brace_vgroup f 1 (fun _ -> function_body ?directive ~return_unit cxt f b) in let enclose () = @@ -396,24 +406,20 @@ and pp_function ~return_unit ~async ~is_method ?directive cxt (f : P.t) ~fn_stat match fn_state with | Is_return -> return_sp f; - P.string f (L.function_async ~async); - P.space f; + P.string f (L.function_ ~async ~arrow); param_body () | No_name { single_arg } -> (* see # 1692, add a paren for annoymous function for safety *) P.cond_paren_group f (not single_arg) (fun _ -> - P.string f (L.function_async ~async); - P.space f; + P.string f (L.function_ ~async ~arrow); param_body ()) | Name_non_top x -> ignore (pp_var_assign inner_cxt f x : cxt); - P.string f (L.function_async ~async); - P.space f; + P.string f (L.function_ ~async ~arrow); param_body (); semi f | Name_top x -> - P.string f (L.function_async ~async); - P.space f; + P.string f (L.function_ ~async ~arrow); ignore (Ext_pp_scope.ident inner_cxt f x : cxt); param_body ()) in diff --git a/jscomp/core/js_dump_lit.ml b/jscomp/core/js_dump_lit.ml index ee8b5bbe285..c341c7f1c6b 100644 --- a/jscomp/core/js_dump_lit.ml +++ b/jscomp/core/js_dump_lit.ml @@ -22,12 +22,16 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *) - let await = "await" -let function_ = "function" +let function_ ~async ~arrow = + match (async, arrow) with + | (true, true) -> "async " + | (false, true) -> "" + | (true, false) -> "async function " + | (false, false) -> "function " -let function_async ~async = if async then "async function" else "function" +let arrow = "=>" let let_ = "let" diff --git a/jscomp/gentype_tests/typescript-react-example/src/ErrorHandler.res.js b/jscomp/gentype_tests/typescript-react-example/src/ErrorHandler.res.js index 447f327d1df..b1de694a228 100644 --- a/jscomp/gentype_tests/typescript-react-example/src/ErrorHandler.res.js +++ b/jscomp/gentype_tests/typescript-react-example/src/ErrorHandler.res.js @@ -2,7 +2,7 @@ function Make($$Error) { - let notify = function (x) { + let notify = (x) => { return $$Error.notification(x); }; return { diff --git a/jscomp/gentype_tests/typescript-react-example/src/Hooks.res.js b/jscomp/gentype_tests/typescript-react-example/src/Hooks.res.js index 48388edd951..3030cabe6ec 100644 --- a/jscomp/gentype_tests/typescript-react-example/src/Hooks.res.js +++ b/jscomp/gentype_tests/typescript-react-example/src/Hooks.res.js @@ -6,14 +6,14 @@ import * as ImportHookDefault from "./ImportHookDefault.res.js"; function Hooks(Props) { let vehicle = Props.vehicle; - let match = React.useState(function () { + let match = React.useState(() => { return 0; }); let setCount = match[1]; let count = match[0]; return React.createElement("div", undefined, React.createElement("p", undefined, "Hooks example " + (vehicle.name + (" clicked " + (String(count) + " times")))), React.createElement("button", { - onClick: (function (param) { - setCount(function (param) { + onClick: ((param) => { + setCount((param) => { return count + 1 | 0; }); }) @@ -23,7 +23,7 @@ function Hooks(Props) { age: 71 }, children: null, - renderMe: (function (x) { + renderMe: ((x) => { return x.randomString; }) }, "child1", "child2"), React.createElement(ImportHookDefault.make, { @@ -32,7 +32,7 @@ function Hooks(Props) { age: 42 }, children: null, - renderMe: (function (x) { + renderMe: ((x) => { return x.randomString; }) }, "child1", "child2")); @@ -114,7 +114,7 @@ let WithRename = { }; function makeWithRef(vehicle) { - return function (ref) { + return (ref) => { if (ref == null) { return null; } else { @@ -133,11 +133,11 @@ let WithRef = { makeWithRef: Hooks$WithRef$makeWithRef }; -let testForwardRef = React.forwardRef(function (x, y) { +let testForwardRef = React.forwardRef((x, y) => { return makeWithRef(x.vehicle)(y); }); -let input = React.forwardRef(function (r, ref) { +let input = React.forwardRef((r, ref) => { return React.createElement("div", { ref: ref }, r.x); diff --git a/jscomp/gentype_tests/typescript-react-example/src/ImmutableArray.res.js b/jscomp/gentype_tests/typescript-react-example/src/ImmutableArray.res.js index 8f0f9094275..1ae06e84055 100644 --- a/jscomp/gentype_tests/typescript-react-example/src/ImmutableArray.res.js +++ b/jscomp/gentype_tests/typescript-react-example/src/ImmutableArray.res.js @@ -51,7 +51,7 @@ let rangeBy = Belt_Array.rangeBy; let makeByU = Belt_Array.makeByU; function makeBy(c, f) { - return Belt_Array.makeBy(c, (function (x) { + return Belt_Array.makeBy(c, ((x) => { return f(x); })); } @@ -59,7 +59,7 @@ function makeBy(c, f) { let makeByAndShuffleU = Belt_Array.makeByAndShuffleU; function makeByAndShuffle(c, f) { - return Belt_Array.makeByAndShuffle(c, (function (x) { + return Belt_Array.makeByAndShuffle(c, ((x) => { return f(x); })); } @@ -69,7 +69,7 @@ let zip = Belt_Array.zip; let zipByU = Belt_Array.zipByU; function zipBy(a1, a2, f) { - return Belt_Array.zipBy(a1, a2, (function (x, y) { + return Belt_Array.zipBy(a1, a2, ((x, y) => { return f(x, y); })); } @@ -91,7 +91,7 @@ function copy(a) { let forEachU = Belt_Array.forEachU; function forEach(a, f) { - Belt_Array.forEach(a, (function (x) { + Belt_Array.forEach(a, ((x) => { f(x); })); } @@ -99,7 +99,7 @@ function forEach(a, f) { let mapU = Belt_Array.mapU; function map(a, f) { - return Belt_Array.map(a, (function (x) { + return Belt_Array.map(a, ((x) => { return f(x); })); } @@ -107,7 +107,7 @@ function map(a, f) { let keepWithIndexU = Belt_Array.keepWithIndexU; function keepWithIndex(a, f) { - return Belt_Array.keepWithIndex(a, (function (x, y) { + return Belt_Array.keepWithIndex(a, ((x, y) => { return f(x, y); })); } @@ -115,7 +115,7 @@ function keepWithIndex(a, f) { let keepMapU = Belt_Array.keepMapU; function keepMap(a, f) { - return Belt_Array.keepMap(a, (function (x) { + return Belt_Array.keepMap(a, ((x) => { return f(x); })); } @@ -123,7 +123,7 @@ function keepMap(a, f) { let forEachWithIndexU = Belt_Array.forEachWithIndexU; function forEachWithIndex(a, f) { - Belt_Array.forEachWithIndex(a, (function (x, y) { + Belt_Array.forEachWithIndex(a, ((x, y) => { f(x, y); })); } @@ -131,7 +131,7 @@ function forEachWithIndex(a, f) { let mapWithIndexU = Belt_Array.mapWithIndexU; function mapWithIndex(a, f) { - return Belt_Array.mapWithIndex(a, (function (x, y) { + return Belt_Array.mapWithIndex(a, ((x, y) => { return f(x, y); })); } @@ -139,7 +139,7 @@ function mapWithIndex(a, f) { let partitionU = Belt_Array.partitionU; function partition(a, f) { - return Belt_Array.partition(a, (function (x) { + return Belt_Array.partition(a, ((x) => { return f(x); })); } @@ -147,7 +147,7 @@ function partition(a, f) { let reduceU = Belt_Array.reduceU; function reduce(a, b, f) { - return Belt_Array.reduce(a, b, (function (x, y) { + return Belt_Array.reduce(a, b, ((x, y) => { return f(x, y); })); } @@ -155,7 +155,7 @@ function reduce(a, b, f) { let reduceReverseU = Belt_Array.reduceReverseU; function reduceReverse(a, b, f) { - return Belt_Array.reduceReverse(a, b, (function (x, y) { + return Belt_Array.reduceReverse(a, b, ((x, y) => { return f(x, y); })); } @@ -163,7 +163,7 @@ function reduceReverse(a, b, f) { let reduceReverse2U = Belt_Array.reduceReverse2U; function reduceReverse2(a1, a2, c, f) { - return Belt_Array.reduceReverse2(a1, a2, c, (function (x, y, z) { + return Belt_Array.reduceReverse2(a1, a2, c, ((x, y, z) => { return f(x, y, z); })); } @@ -171,7 +171,7 @@ function reduceReverse2(a1, a2, c, f) { let someU = Belt_Array.someU; function some(a, f) { - return Belt_Array.some(a, (function (x) { + return Belt_Array.some(a, ((x) => { return f(x); })); } @@ -179,7 +179,7 @@ function some(a, f) { let everyU = Belt_Array.everyU; function every(a, f) { - return Belt_Array.every(a, (function (x) { + return Belt_Array.every(a, ((x) => { return f(x); })); } @@ -187,7 +187,7 @@ function every(a, f) { let every2U = Belt_Array.every2U; function every2(a1, a2, f) { - return Belt_Array.every2(a1, a2, (function (x, y) { + return Belt_Array.every2(a1, a2, ((x, y) => { return f(x, y); })); } @@ -195,7 +195,7 @@ function every2(a1, a2, f) { let some2U = Belt_Array.some2U; function some2(a1, a2, f) { - return Belt_Array.some2(a1, a2, (function (x, y) { + return Belt_Array.some2(a1, a2, ((x, y) => { return f(x, y); })); } @@ -203,7 +203,7 @@ function some2(a1, a2, f) { let cmpU = Belt_Array.cmpU; function cmp(a1, a2, f) { - return Belt_Array.cmp(a1, a2, (function (x, y) { + return Belt_Array.cmp(a1, a2, ((x, y) => { return f(x, y); })); } @@ -211,7 +211,7 @@ function cmp(a1, a2, f) { let eqU = Belt_Array.eqU; function eq(a1, a2, f) { - return Belt_Array.eq(a1, a2, (function (x, y) { + return Belt_Array.eq(a1, a2, ((x, y) => { return f(x, y); })); } diff --git a/jscomp/gentype_tests/typescript-react-example/src/ImportJsValue.res.js b/jscomp/gentype_tests/typescript-react-example/src/ImportJsValue.res.js index 84f321dd72a..1adf55b9242 100644 --- a/jscomp/gentype_tests/typescript-react-example/src/ImportJsValue.res.js +++ b/jscomp/gentype_tests/typescript-react-example/src/ImportJsValue.res.js @@ -51,7 +51,7 @@ function higherOrder(prim) { return ImportJsValueGen$1.higherOrder(prim); } -let returnedFromHigherOrder = ImportJsValueGen$1.higherOrder(function (prim0, prim1) { +let returnedFromHigherOrder = ImportJsValueGen$1.higherOrder((prim0, prim1) => { return prim0 + prim1 | 0; }); diff --git a/jscomp/gentype_tests/typescript-react-example/src/Records.res.js b/jscomp/gentype_tests/typescript-react-example/src/Records.res.js index 36bff493225..f8c2a10020d 100644 --- a/jscomp/gentype_tests/typescript-react-example/src/Records.res.js +++ b/jscomp/gentype_tests/typescript-react-example/src/Records.res.js @@ -6,7 +6,7 @@ import * as Belt_Option from "rescript/lib/es6/belt_Option.js"; import * as Caml_option from "rescript/lib/es6/caml_option.js"; function computeArea(param) { - return Math.imul(Math.imul(param.x, param.y), Belt_Option.mapWithDefault(param.z, 1, (function (n) { + return Math.imul(Math.imul(param.x, param.y), Belt_Option.mapWithDefault(param.z, 1, ((n) => { return n; }))); } @@ -22,7 +22,7 @@ function coord2d(x, y) { let getOpt = Belt_Option.mapWithDefault; function findAddress(business) { - return Belt_Option.mapWithDefault(business.address, /* [] */0, (function (a) { + return Belt_Option.mapWithDefault(business.address, /* [] */0, ((a) => { return { hd: a, tl: /* [] */0 @@ -31,14 +31,14 @@ function findAddress(business) { } function findAllAddresses(businesses) { - return Belt_List.toArray(Belt_List.flatten(Belt_List.fromArray(Belt_Array.map(businesses, (function (business) { - return Belt_List.concat(Belt_Option.mapWithDefault(business.address, /* [] */0, (function (a) { + return Belt_List.toArray(Belt_List.flatten(Belt_List.fromArray(Belt_Array.map(businesses, ((business) => { + return Belt_List.concat(Belt_Option.mapWithDefault(business.address, /* [] */0, ((a) => { return { hd: a, tl: /* [] */0 }; - })), Belt_Option.mapWithDefault(business.owner, /* [] */0, (function (p) { - return Belt_Option.mapWithDefault(p.address, /* [] */0, (function (a) { + })), Belt_Option.mapWithDefault(business.owner, /* [] */0, ((p) => { + return Belt_Option.mapWithDefault(p.address, /* [] */0, ((a) => { return { hd: a, tl: /* [] */0 @@ -75,7 +75,7 @@ function getPayloadRecordPlusOne(param) { } function findAddress2(business) { - return Belt_Option.mapWithDefault(Caml_option.nullable_to_opt(business.address2), /* [] */0, (function (a) { + return Belt_Option.mapWithDefault(Caml_option.nullable_to_opt(business.address2), /* [] */0, ((a) => { return { hd: a, tl: /* [] */0 @@ -94,13 +94,13 @@ let someBusiness2 = { }; function computeArea3(o) { - return Math.imul(Math.imul(o.x, o.y), Belt_Option.mapWithDefault(Caml_option.nullable_to_opt(o.z), 1, (function (n) { + return Math.imul(Math.imul(o.x, o.y), Belt_Option.mapWithDefault(Caml_option.nullable_to_opt(o.z), 1, ((n) => { return n; }))); } function computeArea4(o) { - return Math.imul(Math.imul(o.x, o.y), Belt_Option.mapWithDefault(o.z, 1, (function (n) { + return Math.imul(Math.imul(o.x, o.y), Belt_Option.mapWithDefault(o.z, 1, ((n) => { return n; }))); } diff --git a/jscomp/gentype_tests/typescript-react-example/src/TestPromise.res.js b/jscomp/gentype_tests/typescript-react-example/src/TestPromise.res.js index 7137896d8b0..f2235ac4978 100644 --- a/jscomp/gentype_tests/typescript-react-example/src/TestPromise.res.js +++ b/jscomp/gentype_tests/typescript-react-example/src/TestPromise.res.js @@ -5,7 +5,7 @@ import * as Js_promise from "rescript/lib/es6/js_promise.js"; import * as Caml_option from "rescript/lib/es6/caml_option.js"; function convert(p) { - return Js_promise.then_((function (param) { + return Js_promise.then_(((param) => { return Promise.resolve({ result: param.s }); diff --git a/jscomp/gentype_tests/typescript-react-example/src/Uncurried.res.js b/jscomp/gentype_tests/typescript-react-example/src/Uncurried.res.js index 8420bac6b19..9b755baa66b 100644 --- a/jscomp/gentype_tests/typescript-react-example/src/Uncurried.res.js +++ b/jscomp/gentype_tests/typescript-react-example/src/Uncurried.res.js @@ -38,21 +38,21 @@ function sumU(n, m) { } function sumU2(n) { - return function (m) { + return (m) => { console.log("sumU2 2nd arg", m, "result", n + m | 0); }; } function sumCurried(n) { console.log("sumCurried 1st arg", n); - return function (m) { + return (m) => { console.log("sumCurried 2nd arg", m, "result", n + m | 0); }; } function sumLblCurried(s, n) { console.log(s, "sumLblCurried 1st arg", n); - return function (m) { + return (m) => { console.log("sumLblCurried 2nd arg", m, "result", n + m | 0); }; } diff --git a/jscomp/gentype_tests/typescript-react-example/src/nested/Tuples.res.js b/jscomp/gentype_tests/typescript-react-example/src/nested/Tuples.res.js index 41de58327c1..558398f2338 100644 --- a/jscomp/gentype_tests/typescript-react-example/src/nested/Tuples.res.js +++ b/jscomp/gentype_tests/typescript-react-example/src/nested/Tuples.res.js @@ -7,13 +7,13 @@ function testTuple(param) { } function computeArea(param) { - return Math.imul(Math.imul(param[0], param[1]), Belt_Option.mapWithDefault(param[2], 1, (function (n) { + return Math.imul(Math.imul(param[0], param[1]), Belt_Option.mapWithDefault(param[2], 1, ((n) => { return n; }))); } function computeAreaWithIdent(param) { - return Math.imul(Math.imul(param[0], param[1]), Belt_Option.mapWithDefault(param[2], 1, (function (n) { + return Math.imul(Math.imul(param[0], param[1]), Belt_Option.mapWithDefault(param[2], 1, ((n) => { return n; }))); } diff --git a/jscomp/gentype_tests/typescript-react-example/src/nested/Types.res.js b/jscomp/gentype_tests/typescript-react-example/src/nested/Types.res.js index f11c6c55ccd..6c59cc6b332 100644 --- a/jscomp/gentype_tests/typescript-react-example/src/nested/Types.res.js +++ b/jscomp/gentype_tests/typescript-react-example/src/nested/Types.res.js @@ -57,7 +57,7 @@ function testInstantiateTypeParameter(x) { let currentTime = new Date(); -let optFunction = (function () { +let optFunction = (() => { return 3; }); diff --git a/jscomp/test/Import.js b/jscomp/test/Import.js index b094a389db5..faa1c1f76e2 100644 --- a/jscomp/test/Import.js +++ b/jscomp/test/Import.js @@ -3,15 +3,15 @@ async function eachIntAsync(list, f) { - return (await import("../../lib/js/belt_List.js").then(function (m) { + return (await import("../../lib/js/belt_List.js").then((m) => { return m.forEach; }))(list, f); } function eachIntLazy(list, f) { - return import("../../lib/js/belt_List.js").then(function (m) { + return import("../../lib/js/belt_List.js").then((m) => { return m.forEach; - }).then(function (each) { + }).then((each) => { return Promise.resolve(each(list, f)); }); } @@ -25,7 +25,7 @@ eachIntLazy({ tl: /* [] */0 } } -}, (function (n) { +}, ((n) => { console.log("lazy", n); })); @@ -38,7 +38,7 @@ eachIntAsync({ tl: /* [] */0 } } -}, (function (n) { +}, ((n) => { console.log("async", n); })); diff --git a/jscomp/test/PartialApplicationNoRuntimeCurry.js b/jscomp/test/PartialApplicationNoRuntimeCurry.js index 89cd1695ef9..3c4714cf850 100644 --- a/jscomp/test/PartialApplicationNoRuntimeCurry.js +++ b/jscomp/test/PartialApplicationNoRuntimeCurry.js @@ -3,14 +3,14 @@ function add(x) { - return function (y, z) { + return (y, z) => { return (x + y | 0) + z | 0; }; } function f(u) { let f$1 = add(u); - return function (extra) { + return (extra) => { return f$1(1, extra); }; } diff --git a/jscomp/test/SafePromises.js b/jscomp/test/SafePromises.js index 73ff7b3c4e8..34f367fd3be 100644 --- a/jscomp/test/SafePromises.js +++ b/jscomp/test/SafePromises.js @@ -5,14 +5,14 @@ let Js_promise2 = require("../../lib/js/js_promise2.js"); async function nestedPromise(xxx) { let xx = await xxx; - Js_promise2.then(xx, (function (x) { + Js_promise2.then(xx, ((x) => { return Promise.resolve((console.log("Promise2.then", x), undefined)); })); - Js_promise2.$$catch(xx, (function (x) { + Js_promise2.$$catch(xx, ((x) => { console.log("Promise2.catch_", x); return Promise.resolve(0); })); - xx.then(function (x) { + xx.then((x) => { return Promise.resolve((console.log("Promise.then_", x), undefined)); }); } diff --git a/jscomp/test/UncurriedAlways.js b/jscomp/test/UncurriedAlways.js index 4b284ff2ca3..ba7494c036b 100644 --- a/jscomp/test/UncurriedAlways.js +++ b/jscomp/test/UncurriedAlways.js @@ -20,7 +20,7 @@ let a = 7; console.log(a); -[1].map(function (x) { +[1].map((x) => { return x + 1 | 0; }); diff --git a/jscomp/test/UncurriedExternals.js b/jscomp/test/UncurriedExternals.js index c6928253d2e..08690cf9fdc 100644 --- a/jscomp/test/UncurriedExternals.js +++ b/jscomp/test/UncurriedExternals.js @@ -14,7 +14,7 @@ function dd() { let h = sum(1.0, 2.0); let M = { - sum: (function (prim0, prim1) { + sum: ((prim0, prim1) => { return sum(prim0, prim1); }) }; @@ -49,7 +49,7 @@ function tsiU(c) { }); } -let match = React.useState(function () { +let match = React.useState(() => { return 3; }); @@ -75,7 +75,7 @@ let StandardNotation = { function methodWithAsync() { let $$this = this ; - return async function (arg) { + return async (arg) => { return $$this + arg | 0; }; } diff --git a/jscomp/test/UntaggedVariants.js b/jscomp/test/UntaggedVariants.js index dcb171e280b..8e4a84da8f9 100644 --- a/jscomp/test/UntaggedVariants.js +++ b/jscomp/test/UntaggedVariants.js @@ -367,7 +367,7 @@ function classify$9(v) { } } -let ff = (function (x) { +let ff = ((x) => { return x + 1 | 0; }); @@ -488,7 +488,7 @@ async function classify$10(a) { return; } else { if (Array.isArray(a)) { - console.log(Belt_Array.joinWith(a, "-", (function (x) { + console.log(Belt_Array.joinWith(a, "-", ((x) => { return x; }))); return; @@ -514,7 +514,7 @@ let Arr = { async function classifyAll(t) { if (Array.isArray(t)) { - console.log(Belt_Array.joinWith(t, "-", (function (x) { + console.log(Belt_Array.joinWith(t, "-", ((x) => { return x; }))); return; diff --git a/jscomp/test/a_filename_test.js b/jscomp/test/a_filename_test.js index 5fe5fd915f5..bf31d4354f4 100644 --- a/jscomp/test/a_filename_test.js +++ b/jscomp/test/a_filename_test.js @@ -18,7 +18,7 @@ function eq(loc, x, y) { suites.contents = { hd: [ loc + (" id " + String(test_id.contents)), - (function () { + (() => { return { TAG: "Eq", _0: x, diff --git a/jscomp/test/a_list_test.js b/jscomp/test/a_list_test.js index 824e4783a2d..828ed1b3fbe 100644 --- a/jscomp/test/a_list_test.js +++ b/jscomp/test/a_list_test.js @@ -6,7 +6,7 @@ let Ext_list_test = require("./ext_list_test.js"); let suites_0 = [ "drop", - (function (param) { + ((param) => { return { TAG: "Eq", _0: Ext_list_test.drop(3, { @@ -27,7 +27,7 @@ let suites_0 = [ let suites_1 = { hd: [ "drop1", - (function (param) { + ((param) => { return { TAG: "Eq", _0: Ext_list_test.drop(2, { @@ -50,7 +50,7 @@ let suites_1 = { tl: { hd: [ "flat_map", - (function (param) { + ((param) => { return { TAG: "Eq", _0: { @@ -69,7 +69,7 @@ let suites_1 = { } } }, - _1: Ext_list_test.flat_map((function (x) { + _1: Ext_list_test.flat_map(((x) => { if (x % 2 === 0) { return { hd: 0, diff --git a/jscomp/test/a_string_test.js b/jscomp/test/a_string_test.js index 881f69d6a4e..df1050ab0ba 100644 --- a/jscomp/test/a_string_test.js +++ b/jscomp/test/a_string_test.js @@ -7,7 +7,7 @@ let Ext_string_test = require("./ext_string_test.js"); let suites_0 = [ "split", - (function (param) { + ((param) => { return { TAG: "Eq", _0: Ext_string_test.split(true, "hihi", /* 'i' */105), @@ -28,7 +28,7 @@ let suites_0 = [ let suites_1 = { hd: [ "split_non_empty", - (function (param) { + ((param) => { return { TAG: "Eq", _0: Ext_string_test.split(undefined, "hihi", /* 'i' */105), @@ -45,7 +45,7 @@ let suites_1 = { tl: { hd: [ "split_empty", - (function (param) { + ((param) => { return { TAG: "Eq", _0: Ext_string_test.split(true, "", /* 'i' */105), @@ -56,7 +56,7 @@ let suites_1 = { tl: { hd: [ "split_normal", - (function (param) { + ((param) => { return { TAG: "Eq", _0: Ext_string_test.split(true, "h i i", /* ' ' */32), @@ -76,12 +76,12 @@ let suites_1 = { tl: { hd: [ "split_by", - (function (param) { + ((param) => { return { TAG: "Eq", - _0: List.filter((function (s) { + _0: List.filter(((s) => { return s !== ""; - }), Ext_string_test.split_by(undefined, (function (x) { + }), Ext_string_test.split_by(undefined, ((x) => { if (x === /* ' ' */32) { return true; } else { diff --git a/jscomp/test/and_or_tailcall_test.js b/jscomp/test/and_or_tailcall_test.js index fad105c1a98..db5b1b206bf 100644 --- a/jscomp/test/and_or_tailcall_test.js +++ b/jscomp/test/and_or_tailcall_test.js @@ -33,7 +33,7 @@ function or_f(b, x, _n) { let suites_0 = [ "and_tail", - (function (param) { + ((param) => { return { TAG: "Eq", _0: false, @@ -45,7 +45,7 @@ let suites_0 = [ let suites_1 = { hd: [ "or_tail", - (function (param) { + ((param) => { return { TAG: "Eq", _0: false, diff --git a/jscomp/test/ari_regress_test.js b/jscomp/test/ari_regress_test.js index da79d0742cb..5ad31ea9651 100644 --- a/jscomp/test/ari_regress_test.js +++ b/jscomp/test/ari_regress_test.js @@ -12,7 +12,7 @@ let h = { function g1(x, y) { let u = x + y | 0; h.contents = h.contents + 1 | 0; - return function (xx, yy) { + return (xx, yy) => { return (xx + yy | 0) + u | 0; }; } @@ -27,7 +27,7 @@ function v(__x) { let suites_0 = [ "curry", - (function (param) { + ((param) => { return { TAG: "Eq", _0: g, @@ -39,7 +39,7 @@ let suites_0 = [ let suites_1 = { hd: [ "curry2", - (function (param) { + ((param) => { return { TAG: "Eq", _0: 14, @@ -50,7 +50,7 @@ let suites_1 = { tl: { hd: [ "curry3", - (function (param) { + ((param) => { return { TAG: "Eq", _0: x, @@ -61,7 +61,7 @@ let suites_1 = { tl: { hd: [ "File \"ari_regress_test.res\", line 35, characters 5-12", - (function (param) { + ((param) => { return { TAG: "Eq", _0: h.contents, diff --git a/jscomp/test/arith_parser.js b/jscomp/test/arith_parser.js index 4fb23e6ba07..479635866bf 100644 --- a/jscomp/test/arith_parser.js +++ b/jscomp/test/arith_parser.js @@ -139,7 +139,7 @@ let yynames_block = "\ "; let yyact = [ - (function (param) { + ((param) => { throw new Error("Failure", { cause: { RE_EXN_ID: "Failure", @@ -147,24 +147,24 @@ let yyact = [ } }); }), - (function (__caml_parser_env) { + ((__caml_parser_env) => { return Parsing.peek_val(__caml_parser_env, 1); }), - (function (__caml_parser_env) { + ((__caml_parser_env) => { let _1 = Parsing.peek_val(__caml_parser_env, 0); return { TAG: "Numeral", _0: _1 }; }), - (function (__caml_parser_env) { + ((__caml_parser_env) => { let _1 = Parsing.peek_val(__caml_parser_env, 0); return { TAG: "Variable", _0: _1 }; }), - (function (__caml_parser_env) { + ((__caml_parser_env) => { let _1 = Parsing.peek_val(__caml_parser_env, 2); let _3 = Parsing.peek_val(__caml_parser_env, 0); return { @@ -173,7 +173,7 @@ let yyact = [ _1: _3 }; }), - (function (__caml_parser_env) { + ((__caml_parser_env) => { let _1 = Parsing.peek_val(__caml_parser_env, 2); let _3 = Parsing.peek_val(__caml_parser_env, 0); return { @@ -182,7 +182,7 @@ let yyact = [ _1: _3 }; }), - (function (__caml_parser_env) { + ((__caml_parser_env) => { let _1 = Parsing.peek_val(__caml_parser_env, 2); let _3 = Parsing.peek_val(__caml_parser_env, 0); return { @@ -191,7 +191,7 @@ let yyact = [ _1: _3 }; }), - (function (__caml_parser_env) { + ((__caml_parser_env) => { let _1 = Parsing.peek_val(__caml_parser_env, 2); let _3 = Parsing.peek_val(__caml_parser_env, 0); return { @@ -200,17 +200,17 @@ let yyact = [ _1: _3 }; }), - (function (__caml_parser_env) { + ((__caml_parser_env) => { let _2 = Parsing.peek_val(__caml_parser_env, 0); return { TAG: "Negate", _0: _2 }; }), - (function (__caml_parser_env) { + ((__caml_parser_env) => { return Parsing.peek_val(__caml_parser_env, 1); }), - (function (__caml_parser_env) { + ((__caml_parser_env) => { throw new Error(Parsing.YYexit, { cause: { RE_EXN_ID: Parsing.YYexit, diff --git a/jscomp/test/arity_deopt.js b/jscomp/test/arity_deopt.js index 72352a0e4b1..d326e8484bc 100644 --- a/jscomp/test/arity_deopt.js +++ b/jscomp/test/arity_deopt.js @@ -16,7 +16,7 @@ function eq(loc, x, y) { suites.contents = { hd: [ loc + (" id " + String(test_id.contents)), - (function () { + (() => { return { TAG: "Eq", _0: x, @@ -33,19 +33,19 @@ function f0(x, y, z) { } function f1(x) { - return function (y, z) { + return (y, z) => { return (x + y | 0) + z | 0; }; } function f2(x, y) { - return function (z) { + return (z) => { return (x + y | 0) + z | 0; }; } function f3(x) { - return function (y, z) { + return (y, z) => { return (x + y | 0) + z | 0; }; } diff --git a/jscomp/test/arity_infer.js b/jscomp/test/arity_infer.js index 68084b77bdc..db7b502df43 100644 --- a/jscomp/test/arity_infer.js +++ b/jscomp/test/arity_infer.js @@ -5,7 +5,7 @@ function f0(x) { let tmp; if (x > 3) { - tmp = (function (x) { + tmp = ((x) => { return x + 1 | 0; }); } else { @@ -31,22 +31,22 @@ function f3(x) { let tmp; switch (x) { case 0 : - tmp = (function (x) { + tmp = ((x) => { return x + 1 | 0; }); break; case 1 : - tmp = (function (x) { + tmp = ((x) => { return x + 2 | 0; }); break; case 2 : - tmp = (function (x) { + tmp = ((x) => { return x + 3 | 0; }); break; case 3 : - tmp = (function (x) { + tmp = ((x) => { return x + 4 | 0; }); break; diff --git a/jscomp/test/array_data_util.js b/jscomp/test/array_data_util.js index cc98eaa8a80..88f49228459 100644 --- a/jscomp/test/array_data_util.js +++ b/jscomp/test/array_data_util.js @@ -4,13 +4,13 @@ let Belt_Array = require("../../lib/js/belt_Array.js"); function range(i, j) { - return Belt_Array.makeBy((j - i | 0) + 1 | 0, (function (k) { + return Belt_Array.makeBy((j - i | 0) + 1 | 0, ((k) => { return k + i | 0; })); } function randomRange(i, j) { - let v = Belt_Array.makeBy((j - i | 0) + 1 | 0, (function (k) { + let v = Belt_Array.makeBy((j - i | 0) + 1 | 0, ((k) => { return k + i | 0; })); Belt_Array.shuffleInPlace(v); diff --git a/jscomp/test/array_subtle_test.js b/jscomp/test/array_subtle_test.js index 20c655d7d5e..84f7ab3f9ee 100644 --- a/jscomp/test/array_subtle_test.js +++ b/jscomp/test/array_subtle_test.js @@ -19,7 +19,7 @@ function eq(loc, param) { suites.contents = { hd: [ loc + (" id " + String(test_id.contents)), - (function () { + (() => { return { TAG: "Eq", _0: x, diff --git a/jscomp/test/array_test.js b/jscomp/test/array_test.js index 3045800bd1d..e1506bdbfd3 100644 --- a/jscomp/test/array_test.js +++ b/jscomp/test/array_test.js @@ -58,10 +58,10 @@ function is_sorted(x) { let array_suites_0 = [ "init", - (function (param) { + ((param) => { return { TAG: "Eq", - _0: $$Array.init(5, (function (x) { + _0: $$Array.init(5, ((x) => { return x; })), _1: [ @@ -78,9 +78,9 @@ let array_suites_0 = [ let array_suites_1 = { hd: [ "toList", - (function (param) { - let aux = function (xs) { - return List.fold_left((function (acc, param) { + ((param) => { + let aux = (xs) => { + return List.fold_left(((acc, param) => { return { hd: [ $$Array.to_list(param[0]), @@ -107,7 +107,7 @@ let array_suites_1 = { tl: { hd: [ "concat", - (function (param) { + ((param) => { return { TAG: "Eq", _0: [ @@ -144,7 +144,7 @@ let array_suites_1 = { tl: { hd: [ "make", - (function (param) { + ((param) => { return { TAG: "Eq", _0: [ @@ -152,10 +152,10 @@ let array_suites_1 = { Caml_array.make_float(100) ], _1: [ - $$Array.init(100, (function (param) { + $$Array.init(100, ((param) => { return /* 'a' */97; })), - $$Array.init(100, (function (param) { + $$Array.init(100, ((param) => { return 0; })) ] @@ -165,7 +165,7 @@ let array_suites_1 = { tl: { hd: [ "sub", - (function (param) { + ((param) => { return { TAG: "Eq", _0: $$Array.sub([ @@ -185,13 +185,13 @@ let array_suites_1 = { tl: { hd: [ "blit", - (function (param) { + ((param) => { let u = [ 100, 0, 0 ]; - let v = $$Array.init(3, (function (x) { + let v = $$Array.init(3, ((x) => { return (x << 1); })); $$Array.blit(v, 1, u, 1, 2); @@ -219,8 +219,8 @@ let array_suites_1 = { tl: { hd: [ "File \"array_test.res\", line 75, characters 8-15", - (function (param) { - let a0 = $$Array.init(100, (function (i) { + ((param) => { + let a0 = $$Array.init(100, ((i) => { return (i << 0); })); $$Array.blit(a0, 10, a0, 5, 20); @@ -252,7 +252,7 @@ let array_suites_1 = { 26, 27, 28 - ], (function (prim0, prim1) { + ], ((prim0, prim1) => { return prim0 === prim1; })) }; @@ -261,8 +261,8 @@ let array_suites_1 = { tl: { hd: [ "File \"array_test.res\", line 118, characters 8-15", - (function (param) { - let a0 = $$Array.init(100, (function (i) { + ((param) => { + let a0 = $$Array.init(100, ((i) => { return (i << 0); })); $$Array.blit(a0, 5, a0, 10, 20); @@ -296,7 +296,7 @@ let array_suites_1 = { 18, 19, 20 - ], (function (prim0, prim1) { + ], ((prim0, prim1) => { return prim0 === prim1; })) }; @@ -305,7 +305,7 @@ let array_suites_1 = { tl: { hd: [ "make", - (function (param) { + ((param) => { return { TAG: "Eq", _0: Caml_array.make(2, 1), @@ -319,7 +319,7 @@ let array_suites_1 = { tl: { hd: [ "sort", - (function (param) { + ((param) => { let u = [ 3, 0, @@ -340,8 +340,8 @@ let array_suites_1 = { tl: { hd: [ "sort_large", - (function (param) { - let v = $$Array.init(4, (function (i) { + ((param) => { + let v = $$Array.init(4, ((i) => { return i % 17; })); $$Array.sort(Caml.int_compare, v); diff --git a/jscomp/test/ast_abstract_test.js b/jscomp/test/ast_abstract_test.js index 27d20ddd01b..9acc7fa5cf3 100644 --- a/jscomp/test/ast_abstract_test.js +++ b/jscomp/test/ast_abstract_test.js @@ -17,7 +17,7 @@ function eq(loc, x, y) { suites.contents = { hd: [ loc + (" id " + String(test_id.contents)), - (function () { + (() => { return { TAG: "Eq", _0: x, diff --git a/jscomp/test/async_await.js b/jscomp/test/async_await.js index ae29f576683..7fad4a84168 100644 --- a/jscomp/test/async_await.js +++ b/jscomp/test/async_await.js @@ -12,7 +12,7 @@ async function useNext() { } function Make(I) { - let get = async function (key) { + let get = async (key) => { return await I.get(key); }; return { diff --git a/jscomp/test/async_inline.js b/jscomp/test/async_inline.js index e08f9e8df52..bb5dfebc5ce 100644 --- a/jscomp/test/async_inline.js +++ b/jscomp/test/async_inline.js @@ -10,14 +10,14 @@ async function willBeInlined() { let inlined = willBeInlined(); function wrapSomethingAsync() { - ((async function (param) { + ((async (param) => { let test = await Promise.resolve("Test"); console.log(test); })(777)); } function wrapSomethingAsync2() { - ((async function () { + ((async () => { let test = await Promise.resolve("Test"); console.log(test); })()); @@ -64,19 +64,19 @@ let tui = 3; let tuia = uncurriedIdAsync(3); function nested1() { - return async function (y) { + return async (y) => { return await y; }; } async function nested2() { - return async function (y) { + return async (y) => { return await y; }; } function onSubmit() { - return React.useCallback(async function (b) { + return React.useCallback(async (b) => { return await b; }); } diff --git a/jscomp/test/async_inside_loop.js b/jscomp/test/async_inside_loop.js index 0f1d7d0fe1a..889065bf7e4 100644 --- a/jscomp/test/async_inside_loop.js +++ b/jscomp/test/async_inside_loop.js @@ -4,7 +4,7 @@ async function topLevelAsyncFunction() { for (let innerScopeVal = 0; innerScopeVal <= 3; ++innerScopeVal) { - let asyncClosureAccessingScopedVal = async function () { + let asyncClosureAccessingScopedVal = async () => { console.log("Accessing scoped var inside loop", innerScopeVal); return await Promise.resolve(); }; diff --git a/jscomp/test/attr_test.js b/jscomp/test/attr_test.js index 2d54972a0bd..684edfb40ee 100644 --- a/jscomp/test/attr_test.js +++ b/jscomp/test/attr_test.js @@ -15,7 +15,7 @@ function max2(x, y) { let hh = 1 + 2; function f(x) { - des(x, (function () { + des(x, (() => { console.log("hei"); })); } diff --git a/jscomp/test/bdd.js b/jscomp/test/bdd.js index f408c2c3d77..8fd5e52ed8c 100644 --- a/jscomp/test/bdd.js +++ b/jscomp/test/bdd.js @@ -58,7 +58,7 @@ function resize(newSize) { let arr = htab.contents; let newSz_1 = newSize - 1 | 0; let newArr = Caml_array.make(newSize, /* [] */0); - let copyBucket = function (_bucket) { + let copyBucket = (_bucket) => { while (true) { let bucket = _bucket; if (!bucket) { @@ -334,14 +334,14 @@ function xor(n1, n2) { } function hwb(n) { - let h = function (i, j) { + let h = (i, j) => { if (i === j) { return mkNode("Zero", i, "One"); } else { return xor(and2(not(mkNode("Zero", j, "One")), h(i, j - 1 | 0)), and2(mkNode("Zero", j, "One"), g(i, j - 1 | 0))); } }; - let g = function (i, j) { + let g = (i, j) => { if (i === j) { return mkNode("Zero", i, "One"); } else { diff --git a/jscomp/test/belt_result_alias_test.js b/jscomp/test/belt_result_alias_test.js index 8cc5b930958..db2c05e7a60 100644 --- a/jscomp/test/belt_result_alias_test.js +++ b/jscomp/test/belt_result_alias_test.js @@ -6,14 +6,14 @@ let Belt_Result = require("../../lib/js/belt_Result.js"); Belt_Result.map({ TAG: "Ok", _0: "Test" -}, (function (r) { +}, ((r) => { return "Value: " + r; })); Belt_Result.getWithDefault(Belt_Result.map({ TAG: "Error", _0: "error" -}, (function (r) { +}, ((r) => { return "Value: " + r; })), "success"); diff --git a/jscomp/test/bench.js b/jscomp/test/bench.js index d1403d2e368..4d573c95bfe 100644 --- a/jscomp/test/bench.js +++ b/jscomp/test/bench.js @@ -5,7 +5,7 @@ let Caml_array = require("../../lib/js/caml_array.js"); let Pervasives = require("../../lib/js/pervasives.js"); function map(f, a) { - let f$1 = function (x) { + let f$1 = (x) => { return f(x); }; let l = a.length; @@ -20,7 +20,7 @@ function map(f, a) { } function init(l, f) { - let f$1 = function (x) { + let f$1 = (x) => { return f(x); }; if (l === 0) { @@ -42,7 +42,7 @@ function init(l, f) { } function fold_left(f, x, a) { - let f$1 = function (x, y) { + let f$1 = (x, y) => { return f(x, y); }; let r = x; @@ -53,13 +53,13 @@ function fold_left(f, x, a) { } function f2() { - let arr = init(3000000, (function (i) { + let arr = init(3000000, ((i) => { return i; })); - let b = map((function (i) { + let b = map(((i) => { return i + i - 1; }), arr); - let v = fold_left((function (prim0, prim1) { + let v = fold_left(((prim0, prim1) => { return prim0 + prim1; }), 0, b); console.log(Pervasives.string_of_float(v)); diff --git a/jscomp/test/bs_abstract_test.js b/jscomp/test/bs_abstract_test.js index 650119951db..ddd0f78a1fd 100644 --- a/jscomp/test/bs_abstract_test.js +++ b/jscomp/test/bs_abstract_test.js @@ -10,7 +10,7 @@ let v = { v.tl = v; let f = { - k: (function (x, y) { + k: ((x, y) => { return x === y; }), y: "x" @@ -21,7 +21,7 @@ function uf(u) { } function uf1(u) { - return function (extra) { + return (extra) => { return u.y1(1, extra); }; } diff --git a/jscomp/test/bs_array_test.js b/jscomp/test/bs_array_test.js index 00f3f1dda66..e91410a8f51 100644 --- a/jscomp/test/bs_array_test.js +++ b/jscomp/test/bs_array_test.js @@ -32,7 +32,7 @@ function neq(loc, x, y) { suites.contents = { hd: [ loc + (" id " + String(test_id.contents)), - (function () { + (() => { return { TAG: "Neq", _0: x, @@ -53,11 +53,11 @@ console.log([ 2, 3, 4 -].filter(function (x) { +].filter((x) => { return x > 2; -}).map(function (x, i) { +}).map((x, i) => { return x + i | 0; -}).reduce((function (x, y) { +}).reduce(((x, y) => { return x + y | 0; }), 0)); @@ -80,14 +80,14 @@ eq("File \"bs_array_test.res\", line 31, characters 4-11", [ undefined ]); -$$throw("File \"bs_array_test.res\", line 35, characters 8-15", (function () { +$$throw("File \"bs_array_test.res\", line 35, characters 8-15", (() => { Belt_Array.getExn([ 0, 1 ], -1); })); -$$throw("File \"bs_array_test.res\", line 36, characters 8-15", (function () { +$$throw("File \"bs_array_test.res\", line 36, characters 8-15", (() => { Belt_Array.getExn([ 0, 1 @@ -109,14 +109,14 @@ b("File \"bs_array_test.res\", line 38, characters 4-11", Caml_obj.equal([ 1 ])); -$$throw("File \"bs_array_test.res\", line 44, characters 8-15", (function () { +$$throw("File \"bs_array_test.res\", line 44, characters 8-15", (() => { Belt_Array.setExn([ 0, 1 ], -1, 0); })); -$$throw("File \"bs_array_test.res\", line 45, characters 8-15", (function () { +$$throw("File \"bs_array_test.res\", line 45, characters 8-15", (() => { Belt_Array.setExn([ 0, 1 @@ -186,7 +186,7 @@ function add(x, y) { return x + y | 0; } -let v$5 = Belt_Array.makeBy(3000, (function (i) { +let v$5 = Belt_Array.makeBy(3000, ((i) => { return i; })); @@ -232,14 +232,14 @@ b("File \"bs_array_test.res\", line 101, characters 4-11", Caml_obj.equal(Belt_A b("File \"bs_array_test.res\", line 102, characters 4-11", Caml_obj.equal(Belt_Array.rangeBy(3, 3, 1), [3])); -eq("File \"bs_array_test.res\", line 106, characters 5-12", Belt_Array.reduceReverse([], 100, (function (prim0, prim1) { +eq("File \"bs_array_test.res\", line 106, characters 5-12", Belt_Array.reduceReverse([], 100, ((prim0, prim1) => { return prim0 - prim1 | 0; })), 100); eq("File \"bs_array_test.res\", line 107, characters 5-12", Belt_Array.reduceReverse([ 1, 2 -], 100, (function (prim0, prim1) { +], 100, ((prim0, prim1) => { return prim0 - prim1 | 0; })), 97); @@ -248,7 +248,7 @@ eq("File \"bs_array_test.res\", line 108, characters 5-12", Belt_Array.reduceRev 2, 3, 4 -], 100, (function (prim0, prim1) { +], 100, ((prim0, prim1) => { return prim0 - prim1 | 0; })), 90); @@ -257,7 +257,7 @@ eq("File \"bs_array_test.res\", line 109, characters 5-12", Belt_Array.reduceWit 2, 3, 4 -], 0, (function (acc, x, i) { +], 0, ((acc, x, i) => { return (acc + x | 0) + i | 0; })), 16); @@ -268,7 +268,7 @@ b("File \"bs_array_test.res\", line 110, characters 4-11", Belt_Array.reduceReve ], [ 1, 2 -], 0, (function (acc, x, y) { +], 0, ((acc, x, y) => { return (acc + x | 0) + y | 0; })) === 6); @@ -300,11 +300,11 @@ function makeMatrixExn(sx, sy, init) { return res; } -eq("File \"bs_array_test.res\", line 129, characters 5-12", Belt_Array.makeBy(0, (function (param) { +eq("File \"bs_array_test.res\", line 129, characters 5-12", Belt_Array.makeBy(0, ((param) => { return 1; })), []); -eq("File \"bs_array_test.res\", line 130, characters 5-12", Belt_Array.makeBy(3, (function (i) { +eq("File \"bs_array_test.res\", line 130, characters 5-12", Belt_Array.makeBy(3, ((i) => { return i; })), [ 0, @@ -345,7 +345,7 @@ eq("File \"bs_array_test.res\", line 134, characters 5-12", makeMatrixExn(1, 1, eq("File \"bs_array_test.res\", line 135, characters 5-12", [].slice(0), []); -eq("File \"bs_array_test.res\", line 136, characters 5-12", Belt_Array.map([], (function (prim) { +eq("File \"bs_array_test.res\", line 136, characters 5-12", Belt_Array.map([], ((prim) => { return prim + 1 | 0; })), []); @@ -387,7 +387,7 @@ eq("File \"bs_array_test.res\", line 142, characters 5-12", Belt_Array.map([ 1, 2, 3 -], (function (prim) { +], ((prim) => { return prim + 1 | 0; })), [ 2, @@ -428,19 +428,19 @@ eq("File \"bs_array_test.res\", line 146, characters 5-12", Belt_List.toArray({ 3 ]); -let v$6 = Belt_Array.makeBy(10, (function (i) { +let v$6 = Belt_Array.makeBy(10, ((i) => { return i; })); -let v0 = Belt_Array.keep(v$6, (function (x) { +let v0 = Belt_Array.keep(v$6, ((x) => { return x % 2 === 0; })); -let v1 = Belt_Array.keep(v$6, (function (x) { +let v1 = Belt_Array.keep(v$6, ((x) => { return x % 3 === 0; })); -let v2 = Belt_Array.keepMap(v$6, (function (x) { +let v2 = Belt_Array.keepMap(v$6, ((x) => { if (x % 2 === 0) { return x + 1 | 0; } @@ -478,7 +478,7 @@ let a = [ 5 ]; -let match = Belt_Array.partition(a, (function (x) { +let match = Belt_Array.partition(a, ((x) => { return x % 2 === 0; })); @@ -493,7 +493,7 @@ eq("File \"bs_array_test.res\", line 169, characters 5-12", match[1], [ 5 ]); -let match$1 = Belt_Array.partition(a, (function (x) { +let match$1 = Belt_Array.partition(a, ((x) => { return x === 2; })); @@ -506,7 +506,7 @@ eq("File \"bs_array_test.res\", line 172, characters 5-12", match$1[1], [ 5 ]); -let match$2 = Belt_Array.partition([], (function (x) { +let match$2 = Belt_Array.partition([], ((x) => { return false; })); @@ -633,7 +633,7 @@ eq("File \"bs_array_test.res\", line 205, characters 5-12", Belt_Array.sliceToEn eq("File \"bs_array_test.res\", line 206, characters 5-12", Belt_Array.sliceToEnd(a$2, 6), []); -let a$3 = Belt_Array.makeBy(10, (function (x) { +let a$3 = Belt_Array.makeBy(10, ((x) => { return x; })); @@ -802,7 +802,7 @@ eq("File \"bs_array_test.res\", line 236, characters 5-12", b$1, [ 3 ]); -let a0 = Belt_Array.makeBy(10, (function (x) { +let a0 = Belt_Array.makeBy(10, ((x) => { return x; })); @@ -876,7 +876,7 @@ Belt_Array.blit(a0, -11, b0, -11, 2); eq("File \"bs_array_test.res\", line 253, characters 5-12", b0.slice(0), a0); -let aa = Belt_Array.makeBy(10, (function (x) { +let aa = Belt_Array.makeBy(10, ((x) => { return x; })); @@ -1015,7 +1015,7 @@ eq("File \"bs_array_test.res\", line 273, characters 5-12", Belt_Array.zipBy([ 1, 2, 3 -], (function (prim0, prim1) { +], ((prim0, prim1) => { return prim0 - prim1 | 0; })), [ 1, @@ -1032,13 +1032,13 @@ eq("File \"bs_array_test.res\", line 274, characters 5-12", Belt_Array.zipBy([ 3, 4, 1 -], (function (prim0, prim1) { +], ((prim0, prim1) => { return prim0 - prim1 | 0; })), Belt_Array.map([ 1, 1, 1 -], (function (x) { +], ((x) => { return -x | 0; }))); @@ -1072,7 +1072,7 @@ function sumUsingForEach(xs) { let v = { contents: 0 }; - Belt_Array.forEach(xs, (function (x) { + Belt_Array.forEach(xs, ((x) => { v.contents = v.contents + x | 0; })); return v.contents; @@ -1092,7 +1092,7 @@ b("File \"bs_array_test.res\", line 288, characters 4-11", !Belt_Array.every([ 2, 3, 4 -], (function (x) { +], ((x) => { return x > 2; }))); @@ -1101,7 +1101,7 @@ b("File \"bs_array_test.res\", line 289, characters 4-11", Belt_Array.some([ 3, 7, 8 -], (function (x) { +], ((x) => { return x % 2 === 0; }))); @@ -1109,14 +1109,14 @@ b("File \"bs_array_test.res\", line 290, characters 4-11", !Belt_Array.some([ 1, 3, 7 -], (function (x) { +], ((x) => { return x % 2 === 0; }))); b("File \"bs_array_test.res\", line 291, characters 4-11", !Belt_Array.eq([ 0, 1 -], [1], (function (prim0, prim1) { +], [1], ((prim0, prim1) => { return prim0 === prim1; }))); @@ -1128,7 +1128,7 @@ b("File \"bs_array_test.res\", line 293, characters 4-11", (Belt_Array.forEachWi 1, 1, 1 -], (function (i, v) { +], ((i, v) => { c$1.contents = (c$1.contents + i | 0) + v | 0; })), c$1.contents === 6)); @@ -1170,7 +1170,7 @@ function some2(xs, ys, x) { eq("File \"bs_array_test.res\", line 326, characters 5-12", every2(/* [] */0, { hd: 1, tl: /* [] */0 -}, (function (x, y) { +}, ((x, y) => { return x > y; })), true); @@ -1183,7 +1183,7 @@ eq("File \"bs_array_test.res\", line 327, characters 5-12", every2({ }, { hd: 1, tl: /* [] */0 -}, (function (x, y) { +}, ((x, y) => { return x > y; })), true); @@ -1193,7 +1193,7 @@ eq("File \"bs_array_test.res\", line 328, characters 5-12", every2({ }, { hd: 1, tl: /* [] */0 -}, (function (x, y) { +}, ((x, y) => { return x > y; })), true); @@ -1209,7 +1209,7 @@ eq("File \"bs_array_test.res\", line 329, characters 5-12", every2({ hd: 4, tl: /* [] */0 } -}, (function (x, y) { +}, ((x, y) => { return x > y; })), false); @@ -1225,14 +1225,14 @@ eq("File \"bs_array_test.res\", line 330, characters 5-12", every2({ hd: 0, tl: /* [] */0 } -}, (function (x, y) { +}, ((x, y) => { return x > y; })), true); eq("File \"bs_array_test.res\", line 331, characters 5-12", some2(/* [] */0, { hd: 1, tl: /* [] */0 -}, (function (x, y) { +}, ((x, y) => { return x > y; })), false); @@ -1245,7 +1245,7 @@ eq("File \"bs_array_test.res\", line 332, characters 5-12", some2({ }, { hd: 1, tl: /* [] */0 -}, (function (x, y) { +}, ((x, y) => { return x > y; })), true); @@ -1261,7 +1261,7 @@ eq("File \"bs_array_test.res\", line 333, characters 5-12", some2({ hd: 4, tl: /* [] */0 } -}, (function (x, y) { +}, ((x, y) => { return x > y; })), true); @@ -1277,7 +1277,7 @@ eq("File \"bs_array_test.res\", line 334, characters 5-12", some2({ hd: 4, tl: /* [] */0 } -}, (function (x, y) { +}, ((x, y) => { return x > y; })), false); @@ -1293,7 +1293,7 @@ eq("File \"bs_array_test.res\", line 335, characters 5-12", some2({ hd: 2, tl: /* [] */0 } -}, (function (x, y) { +}, ((x, y) => { return x > y; })), true); @@ -1446,7 +1446,7 @@ eq("File \"bs_array_test.res\", line 357, characters 5-12", Belt_Array.getBy([ 1, 2, 3 -], (function (x) { +], ((x) => { return x > 1; })), 2); @@ -1454,7 +1454,7 @@ eq("File \"bs_array_test.res\", line 358, characters 5-12", Belt_Array.getBy([ 1, 2, 3 -], (function (x) { +], ((x) => { return x > 3; })), undefined); @@ -1462,7 +1462,7 @@ eq("File \"bs_array_test.res\", line 362, characters 5-12", Belt_Array.getIndexB 1, 2, 3 -], (function (x) { +], ((x) => { return x > 1; })), 1); @@ -1470,7 +1470,7 @@ eq("File \"bs_array_test.res\", line 363, characters 5-12", Belt_Array.getIndexB 1, 2, 3 -], (function (x) { +], ((x) => { return x > 3; })), undefined); diff --git a/jscomp/test/bs_auto_uncurry.js b/jscomp/test/bs_auto_uncurry.js index 3ea45355c0a..1d9cb675312 100644 --- a/jscomp/test/bs_auto_uncurry.js +++ b/jscomp/test/bs_auto_uncurry.js @@ -12,7 +12,7 @@ let xbs = Array.prototype.map.call([ 2, 3, 5 -], (function (x) { +], ((x) => { return x + 1 | 0; })); @@ -38,18 +38,18 @@ let xs = Array.prototype.map.call([ 2, 1 ] -], (function (param) { +], ((param) => { return (param[1] + param[0] | 0) + 1 | 0; })); function f_0() { - return hi(function () { + return hi(() => { }); } function f_01() { - return hi(function (x) { + return hi((x) => { if (x === undefined) { console.log("x"); return; @@ -59,7 +59,7 @@ function f_01() { } function f_02(xs) { - return hi(function (x) { + return hi((x) => { xs.contents = x; console.log("x"); }); @@ -78,31 +78,31 @@ function h1(x, y, u, z) { } function add3(x) { - return function (y, z) { + return (y, z) => { return (x + y | 0) + z | 0; }; } function h2(x) { - return ff(x, (function (prim0, prim1) { + return ff(x, ((prim0, prim1) => { return prim0 + prim1 | 0; })); } function h3(x) { - return ff(x, (function (y, z) { + return ff(x, ((y, z) => { return (1 + y | 0) + z | 0; })); } function h4(x) { - return ff1(x, 3, (function (y, z) { + return ff1(x, 3, ((y, z) => { return (1 + y | 0) + z | 0; })); } function h5(x) { - return ff2(x, "3", (function (y, z) { + return ff2(x, "3", ((y, z) => { return (2 + y | 0) + z | 0; })); } diff --git a/jscomp/test/bs_auto_uncurry_test.js b/jscomp/test/bs_auto_uncurry_test.js index 0e218a19996..31051da5f43 100644 --- a/jscomp/test/bs_auto_uncurry_test.js +++ b/jscomp/test/bs_auto_uncurry_test.js @@ -16,7 +16,7 @@ function eq(loc, x, y) { suites.contents = { hd: [ loc + (" id " + String(test_id.contents)), - (function () { + (() => { return { TAG: "Eq", _0: x, @@ -38,14 +38,14 @@ let xs = { contents: /* [] */0 }; -hi(function (x) { +hi((x) => { xs.contents = { hd: x, tl: xs.contents }; }); -hi(function (x) { +hi((x) => { xs.contents = { hd: x, tl: xs.contents @@ -64,7 +64,7 @@ eq("File \"bs_auto_uncurry_test.res\", line 28, characters 5-12", [ 1, 2, 3 -].map(function (x) { +].map((x) => { return x + 1 | 0; }), [ 2, @@ -76,7 +76,7 @@ eq("File \"bs_auto_uncurry_test.res\", line 29, characters 5-12", [ 1, 2, 3 -].map(function (x) { +].map((x) => { return x + 1 | 0; }), [ 2, @@ -88,7 +88,7 @@ eq("File \"bs_auto_uncurry_test.res\", line 31, characters 5-12", [ 1, 2, 3 -].reduce((function (prim0, prim1) { +].reduce(((prim0, prim1) => { return prim0 + prim1 | 0; }), 0), 6); @@ -96,7 +96,7 @@ eq("File \"bs_auto_uncurry_test.res\", line 33, characters 5-12", [ 1, 2, 3 -].reduce((function (x, y, i) { +].reduce(((x, y, i) => { return (x + y | 0) + i | 0; }), 0), 9); @@ -104,7 +104,7 @@ eq("File \"bs_auto_uncurry_test.res\", line 35, characters 5-12", [ 1, 2, 3 -].some(function (x) { +].some((x) => { return x < 1; }), false); @@ -112,7 +112,7 @@ eq("File \"bs_auto_uncurry_test.res\", line 37, characters 5-12", [ 1, 2, 3 -].every(function (x) { +].every((x) => { return x > 0; }), true); diff --git a/jscomp/test/bs_hashmap_test.js b/jscomp/test/bs_hashmap_test.js index 8dc9d9d08f2..8d1200d5f04 100644 --- a/jscomp/test/bs_hashmap_test.js +++ b/jscomp/test/bs_hashmap_test.js @@ -98,7 +98,7 @@ for (let i$1 = 0; i$1 <= 2000; ++i$1) { eqx("File \"bs_hashmap_test.res\", line 57, characters 6-13", v$1.size, 98000); -b("File \"bs_hashmap_test.res\", line 58, characters 4-11", Belt_Array.every(Array_data_util.range(2001, 100000), (function (x) { +b("File \"bs_hashmap_test.res\", line 58, characters 4-11", Belt_Array.every(Array_data_util.range(2001, 100000), ((x) => { return Belt_HashMap.has(v$1, x); }))); diff --git a/jscomp/test/bs_hashset_int_test.js b/jscomp/test/bs_hashset_int_test.js index 36dbe3366df..f69b2c6b72b 100644 --- a/jscomp/test/bs_hashset_int_test.js +++ b/jscomp/test/bs_hashset_int_test.js @@ -33,7 +33,7 @@ function sum2(h) { let v = { contents: 0 }; - Belt_HashSetInt.forEach(h, (function (x) { + Belt_HashSetInt.forEach(h, ((x) => { v.contents = v.contents + x | 0; })); return v.contents; diff --git a/jscomp/test/bs_ignore_effect.js b/jscomp/test/bs_ignore_effect.js index 9aebbaf3a1a..835d0222a16 100644 --- a/jscomp/test/bs_ignore_effect.js +++ b/jscomp/test/bs_ignore_effect.js @@ -16,7 +16,7 @@ function eq(loc, x, y) { suites.contents = { hd: [ loc + (" id " + String(test_id.contents)), - (function () { + (() => { return { TAG: "Eq", _0: x, diff --git a/jscomp/test/bs_list_test.js b/jscomp/test/bs_list_test.js index ab3f5d2f580..7367afd169d 100644 --- a/jscomp/test/bs_list_test.js +++ b/jscomp/test/bs_list_test.js @@ -31,7 +31,7 @@ function sum(xs) { let v = { contents: 0 }; - Belt_List.forEach(xs, (function (x) { + Belt_List.forEach(xs, ((x) => { v.contents = v.contents + x | 0; })); return v.contents; @@ -41,13 +41,13 @@ function sum2(xs, ys) { let v = { contents: 0 }; - Belt_List.forEach2(xs, ys, (function (x, y) { + Belt_List.forEach2(xs, ys, ((x, y) => { v.contents = (v.contents + x | 0) + y | 0; })); return v.contents; } -let u = Belt_List.makeBy(5, (function (i) { +let u = Belt_List.makeBy(5, ((i) => { return Math.imul(i, i); })); @@ -59,7 +59,7 @@ for (let i = 0; i <= 4; ++i) { f(i); } -eq("File \"bs_list_test.res\", line 31, characters 5-12", Belt_List.map(u, (function (i) { +eq("File \"bs_list_test.res\", line 31, characters 5-12", Belt_List.map(u, ((i) => { return i + 1 | 0; })), { hd: 1, @@ -90,7 +90,7 @@ eq("File \"bs_list_test.res\", line 32, characters 5-12", Belt_List.getBy({ } } } -}, (function (x) { +}, ((x) => { return x % 2 === 0; })), 4); @@ -106,7 +106,7 @@ eq("File \"bs_list_test.res\", line 33, characters 5-12", Belt_List.getBy({ } } } -}, (function (x) { +}, ((x) => { return x % 5 === 0; })), undefined); @@ -128,7 +128,7 @@ eq("FLATTEN", Belt_List.flatten({ tl: { hd: /* [] */0, tl: { - hd: Belt_List.makeBy(4, (function (i) { + hd: Belt_List.makeBy(4, ((i) => { return i; })), tl: /* [] */0 @@ -213,7 +213,7 @@ eq("CONCATMANY", Belt_List.concatMany([ tl: /* [] */0 }, /* [] */0, - Belt_List.makeBy(4, (function (i) { + Belt_List.makeBy(4, ((i) => { return i; })) ]), { @@ -321,13 +321,13 @@ eq("CONCATMANY", Belt_List.concatMany([{ } }); -eq("File \"bs_list_test.res\", line 66, characters 2-9", Belt_List.toArray(Belt_List.concat(Belt_List.makeBy(100, (function (i) { +eq("File \"bs_list_test.res\", line 66, characters 2-9", Belt_List.toArray(Belt_List.concat(Belt_List.makeBy(100, ((i) => { return i; -})), Belt_List.makeBy(100, (function (i) { +})), Belt_List.makeBy(100, ((i) => { return i; -})))), Belt_Array.concat(Belt_Array.makeBy(100, (function (i) { +})))), Belt_Array.concat(Belt_Array.makeBy(100, ((i) => { return i; -})), Belt_Array.makeBy(100, (function (i) { +})), Belt_Array.makeBy(100, ((i) => { return i; })))); @@ -522,7 +522,7 @@ eq("PARTITION", Belt_List.partition({ } } } -}, (function (x) { +}, ((x) => { return !mod2(x); })), [ /* [] */0, @@ -726,7 +726,7 @@ function id(x) { return x; } -eq("MAP", Belt_List.map(Belt_List.makeBy(5, id), (function (x) { +eq("MAP", Belt_List.map(Belt_List.makeBy(5, id), ((x) => { return (x << 1); })), { hd: 0, @@ -750,7 +750,7 @@ eq("MAP", Belt_List.map(/* [] */0, id), /* [] */0); eq("MAP", Belt_List.map({ hd: 1, tl: /* [] */0 -}, (function (x) { +}, ((x) => { return -x | 0; })), { hd: -1, @@ -765,7 +765,7 @@ let length_10_id = Belt_List.makeBy(10, id); let length_8_id = Belt_List.makeBy(8, id); -let d = Belt_List.makeBy(10, (function (x) { +let d = Belt_List.makeBy(10, ((x) => { return (x << 1); })); @@ -783,7 +783,7 @@ eq("MAP2", Belt_List.zipBy({ eq("MAP2", Belt_List.zipBy(/* [] */0, /* [] */0, add), /* [] */0); -eq("MAP2", Belt_List.zipBy(length_10_id, length_10_id, add), Belt_List.concat(Belt_List.map(length_8_id, (function (x) { +eq("MAP2", Belt_List.zipBy(length_10_id, length_10_id, add), Belt_List.concat(Belt_List.map(length_8_id, ((x) => { return (x << 1); })), { hd: 16, @@ -793,11 +793,11 @@ eq("MAP2", Belt_List.zipBy(length_10_id, length_10_id, add), Belt_List.concat(Be } })); -eq("MAP2", Belt_List.zipBy(length_10_id, length_8_id, add), Belt_List.mapWithIndex(length_8_id, (function (i, x) { +eq("MAP2", Belt_List.zipBy(length_10_id, length_8_id, add), Belt_List.mapWithIndex(length_8_id, ((i, x) => { return i + x | 0; }))); -eq("MAP2", Belt_List.reverse(Belt_List.mapReverse2(length_10_id, length_10_id, add)), Belt_List.map(length_10_id, (function (x) { +eq("MAP2", Belt_List.reverse(Belt_List.mapReverse2(length_10_id, length_10_id, add)), Belt_List.map(length_10_id, ((x) => { return (x << 1); }))); @@ -822,7 +822,7 @@ eq("MAP2", Belt_List.mapReverse2({ hd: 2, tl: /* [] */0 } -}, (function (x, y) { +}, ((x, y) => { return x + y | 0; })), { hd: 4, @@ -1017,7 +1017,7 @@ b("File \"bs_list_test.res\", line 205, characters 4-11", Belt_List.hasAssoc({ tl: /* [] */0 } } -}, 2, (function (prim0, prim1) { +}, 2, ((prim0, prim1) => { return prim0 === prim1; }))); @@ -1039,7 +1039,7 @@ b("File \"bs_list_test.res\", line 206, characters 4-11", !Belt_List.hasAssoc({ tl: /* [] */0 } } -}, 4, (function (prim0, prim1) { +}, 4, ((prim0, prim1) => { return prim0 === prim1; }))); @@ -1061,7 +1061,7 @@ b("File \"bs_list_test.res\", line 207, characters 4-11", Belt_List.hasAssoc({ tl: /* [] */0 } } -}, 4, (function (x, y) { +}, 4, ((x, y) => { return (x + 1 | 0) === y; }))); @@ -1083,7 +1083,7 @@ eq("REMOVEASSOQ", Belt_List.removeAssoc({ tl: /* [] */0 } } -}, 3, (function (prim0, prim1) { +}, 3, ((prim0, prim1) => { return prim0 === prim1; })), { hd: [ @@ -1117,7 +1117,7 @@ eq("REMOVEASSOQ", Belt_List.removeAssoc({ tl: /* [] */0 } } -}, 1, (function (prim0, prim1) { +}, 1, ((prim0, prim1) => { return prim0 === prim1; })), { hd: [ @@ -1151,7 +1151,7 @@ eq("REMOVEASSOQ", Belt_List.removeAssoc({ tl: /* [] */0 } } -}, 2, (function (prim0, prim1) { +}, 2, ((prim0, prim1) => { return prim0 === prim1; })), { hd: [ @@ -1185,7 +1185,7 @@ eq("REMOVEASSOQ", Belt_List.removeAssoc({ tl: /* [] */0 } } -}, 0, (function (prim0, prim1) { +}, 0, ((prim0, prim1) => { return prim0 === prim1; })), { hd: [ @@ -1329,7 +1329,7 @@ let ll0 = Belt_List.removeAssoc(ll, 0, eqx); b("File \"bs_list_test.res\", line 222, characters 4-11", ll === ll0); -let ll1 = Belt_List.setAssoc(ll, 2, "22", (function (prim0, prim1) { +let ll1 = Belt_List.setAssoc(ll, 2, "22", ((prim0, prim1) => { return prim0 === prim1; })); @@ -1353,7 +1353,7 @@ eq("File \"bs_list_test.res\", line 224, characters 5-12", ll1, { } }); -let ll2 = Belt_List.setAssoc(ll1, 22, "2", (function (prim0, prim1) { +let ll2 = Belt_List.setAssoc(ll1, 22, "2", ((prim0, prim1) => { return prim0 === prim1; })); @@ -1385,7 +1385,7 @@ b("File \"bs_list_test.res\", line 229, characters 4-11", Caml_obj.equal(Belt_Li tl: /* [] */0 } } -}, 2, "x", (function (prim0, prim1) { +}, 2, "x", ((prim0, prim1) => { return prim0 === prim1; })), { hd: [ @@ -1419,7 +1419,7 @@ b("File \"bs_list_test.res\", line 234, characters 4-11", Caml_obj.equal(Belt_Li ], tl: /* [] */0 } -}, 2, "2", (function (prim0, prim1) { +}, 2, "2", ((prim0, prim1) => { return prim0 === prim1; })), { hd: [ @@ -1441,7 +1441,7 @@ b("File \"bs_list_test.res\", line 234, characters 4-11", Caml_obj.equal(Belt_Li } })); -eq("File \"bs_list_test.res\", line 237, characters 5-12", Belt_List.setAssoc(/* [] */0, 1, "1", (function (prim0, prim1) { +eq("File \"bs_list_test.res\", line 237, characters 5-12", Belt_List.setAssoc(/* [] */0, 1, "1", ((prim0, prim1) => { return prim0 === prim1; })), { hd: [ @@ -1459,7 +1459,7 @@ eq("File \"bs_list_test.res\", line 239, characters 5-12", Belt_List.setAssoc({ "2" ], tl: /* [] */0 -}, 1, "1", (function (prim0, prim1) { +}, 1, "1", ((prim0, prim1) => { return prim0 === prim1; })), { hd: [ @@ -1481,7 +1481,7 @@ eq("File \"bs_list_test.res\", line 241, characters 5-12", Belt_List.setAssoc({ ], tl: /* [] */0 } -}, 1, "1", (function (prim0, prim1) { +}, 1, "1", ((prim0, prim1) => { return prim0 === prim1; })), { hd: [ @@ -1515,7 +1515,7 @@ b("File \"bs_list_test.res\", line 242, characters 4-11", Caml_obj.equal(Belt_Li tl: /* [] */0 } } -}, 2, (function (prim0, prim1) { +}, 2, ((prim0, prim1) => { return prim0 === prim1; })), "b")); @@ -1537,7 +1537,7 @@ b("File \"bs_list_test.res\", line 243, characters 4-11", Belt_List.getAssoc({ tl: /* [] */0 } } -}, 4, (function (prim0, prim1) { +}, 4, ((prim0, prim1) => { return prim0 === prim1; })) === undefined); @@ -1551,15 +1551,15 @@ eq("File \"bs_list_test.res\", line 248, characters 4-11", [ eq("File \"bs_list_test.res\", line 255, characters 5-12", Belt_List.head(/* [] */0), undefined); -$$throw("File \"bs_list_test.res\", line 256, characters 8-15", (function () { +$$throw("File \"bs_list_test.res\", line 256, characters 8-15", (() => { Belt_List.headExn(/* [] */0); })); -$$throw("File \"bs_list_test.res\", line 257, characters 8-15", (function () { +$$throw("File \"bs_list_test.res\", line 257, characters 8-15", (() => { Belt_List.tailExn(/* [] */0); })); -$$throw("File \"bs_list_test.res\", line 258, characters 8-15", (function () { +$$throw("File \"bs_list_test.res\", line 258, characters 8-15", (() => { Belt_List.getExn({ hd: 0, tl: { @@ -1569,7 +1569,7 @@ $$throw("File \"bs_list_test.res\", line 258, characters 8-15", (function () { }, -1); })); -$$throw("File \"bs_list_test.res\", line 259, characters 8-15", (function () { +$$throw("File \"bs_list_test.res\", line 259, characters 8-15", (() => { Belt_List.getExn({ hd: 0, tl: { @@ -1585,7 +1585,7 @@ eq("File \"bs_list_test.res\", line 260, characters 5-12", Belt_List.map({ hd: 1, tl: /* [] */0 } -}, (function (i) { +}, ((i) => { return Belt_List.getExn({ hd: 0, tl: { @@ -1611,7 +1611,7 @@ eq("File \"bs_list_test.res\", line 262, characters 5-12", Belt_List.tailExn({ tl: /* [] */0 }), /* [] */0); -Belt_List.forEachWithIndex(length_10_id, (function (i, x) { +Belt_List.forEachWithIndex(length_10_id, ((i, x) => { eq("File \"bs_list_test.res\", line 263, characters 48-55", Belt_List.get(length_10_id, i), x); })); @@ -1619,7 +1619,7 @@ eq("File \"bs_list_test.res\", line 264, characters 5-12", Belt_List.tail(/* [] eq("File \"bs_list_test.res\", line 265, characters 5-12", Belt_List.drop(/* [] */0, 3), undefined); -eq("File \"bs_list_test.res\", line 266, characters 5-12", Belt_List.mapWithIndex(/* [] */0, (function (i, x) { +eq("File \"bs_list_test.res\", line 266, characters 5-12", Belt_List.mapWithIndex(/* [] */0, ((i, x) => { return i + x | 0; })), /* [] */0); @@ -1645,9 +1645,9 @@ eq("File \"bs_list_test.res\", line 290, characters 5-12", Belt_List.reduce(leng eq("File \"bs_list_test.res\", line 291, characters 5-12", Belt_List.reduceReverse(length_10_id, 0, add), 45); -eq("File \"bs_list_test.res\", line 292, characters 5-12", Belt_List.reduceReverse(Belt_List.makeBy(10000, (function (i) { +eq("File \"bs_list_test.res\", line 292, characters 5-12", Belt_List.reduceReverse(Belt_List.makeBy(10000, ((i) => { return i; -})), 0, (function (prim0, prim1) { +})), 0, ((prim0, prim1) => { return prim0 + prim1 | 0; })), 49995000); @@ -1657,7 +1657,7 @@ eq("File \"bs_list_test.res\", line 296, characters 5-12", sum2(length_8_id, len eq("File \"bs_list_test.res\", line 297, characters 5-12", sum2(length_10_id, length_8_id), 56); -eq("File \"bs_list_test.res\", line 298, characters 5-12", Belt_List.reduce2(length_10_id, length_8_id, 0, (function (acc, x, y) { +eq("File \"bs_list_test.res\", line 298, characters 5-12", Belt_List.reduce2(length_10_id, length_8_id, 0, ((acc, x, y) => { return (acc + x | 0) + y | 0; })), 56); @@ -1679,15 +1679,15 @@ eq("File \"bs_list_test.res\", line 299, characters 5-12", Belt_List.reduce2({ tl: /* [] */0 } } -}, 0, (function (a, b, c) { +}, 0, ((a, b, c) => { return (a + b | 0) + c | 0; })), 18); -eq("File \"bs_list_test.res\", line 300, characters 5-12", Belt_List.reduceReverse2(length_10_id, length_8_id, 0, (function (acc, x, y) { +eq("File \"bs_list_test.res\", line 300, characters 5-12", Belt_List.reduceReverse2(length_10_id, length_8_id, 0, ((acc, x, y) => { return (acc + x | 0) + y | 0; })), 56); -eq("File \"bs_list_test.res\", line 301, characters 5-12", Belt_List.reduceReverse2(length_10_id, length_10_id, 0, (function (acc, x, y) { +eq("File \"bs_list_test.res\", line 301, characters 5-12", Belt_List.reduceReverse2(length_10_id, length_10_id, 0, ((acc, x, y) => { return (acc + x | 0) + y | 0; })), 90); @@ -1706,7 +1706,7 @@ eq("File \"bs_list_test.res\", line 302, characters 5-12", Belt_List.reduceRever hd: 2, tl: /* [] */0 } -}, 0, (function (acc, x, y) { +}, 0, ((acc, x, y) => { return (acc + x | 0) + y | 0; })), 6); @@ -1761,7 +1761,7 @@ eq("File \"bs_list_test.res\", line 309, characters 5-12", Belt_List.has({ tl: /* [] */0 } } -}, "2", (function (x, s) { +}, "2", ((x, s) => { return String(x) === s; })), true); @@ -1774,7 +1774,7 @@ eq("File \"bs_list_test.res\", line 310, characters 5-12", Belt_List.has({ tl: /* [] */0 } } -}, "0", (function (x, s) { +}, "0", ((x, s) => { return String(x) === s; })), false); @@ -1790,7 +1790,7 @@ b("File \"bs_list_test.res\", line 312, characters 4-11", Belt_List.reduceRevers } } } -}, 0, (function (prim0, prim1) { +}, 0, ((prim0, prim1) => { return prim0 + prim1 | 0; })) === 10); @@ -1806,7 +1806,7 @@ b("File \"bs_list_test.res\", line 313, characters 4-11", Belt_List.reduceRevers } } } -}, 10, (function (prim0, prim1) { +}, 10, ((prim0, prim1) => { return prim0 - prim1 | 0; })) === 0); @@ -1848,7 +1848,7 @@ b("File \"bs_list_test.res\", line 315, characters 4-11", Belt_List.reduce({ } } } -}, 0, (function (prim0, prim1) { +}, 0, ((prim0, prim1) => { return prim0 + prim1 | 0; })) === 10); @@ -1864,7 +1864,7 @@ b("File \"bs_list_test.res\", line 316, characters 4-11", Belt_List.reduce({ } } } -}, 10, (function (prim0, prim1) { +}, 10, ((prim0, prim1) => { return prim0 - prim1 | 0; })) === 0); @@ -1906,7 +1906,7 @@ b("File \"bs_list_test.res\", line 318, characters 4-11", Belt_List.reduceWithIn } } } -}, 0, (function (acc, x, i) { +}, 0, ((acc, x, i) => { return (acc + x | 0) + i | 0; })) === 16); @@ -1925,25 +1925,25 @@ b("File \"bs_list_test.res\", line 319, characters 4-11", Belt_List.reduceRevers hd: 2, tl: /* [] */0 } -}, 0, (function (acc, x, y) { +}, 0, ((acc, x, y) => { return (acc + x | 0) + y | 0; })) === 6); -let a$1 = Belt_List.makeBy(10000, (function (i) { +let a$1 = Belt_List.makeBy(10000, ((i) => { return i; })); b("File \"bs_list_test.res\", line 322, characters 4-11", Belt_List.reduceReverse2(a$1, { hd: 0, tl: a$1 -}, 0, (function (acc, x, y) { +}, 0, ((acc, x, y) => { return (acc + x | 0) + y | 0; })) === 99980001); eq("File \"bs_list_test.res\", line 328, characters 5-12", Belt_List.every2(/* [] */0, { hd: 1, tl: /* [] */0 -}, (function (x, y) { +}, ((x, y) => { return x > y; })), true); @@ -1956,7 +1956,7 @@ eq("File \"bs_list_test.res\", line 329, characters 5-12", Belt_List.every2({ }, { hd: 1, tl: /* [] */0 -}, (function (x, y) { +}, ((x, y) => { return x > y; })), true); @@ -1966,7 +1966,7 @@ eq("File \"bs_list_test.res\", line 330, characters 5-12", Belt_List.every2({ }, { hd: 1, tl: /* [] */0 -}, (function (x, y) { +}, ((x, y) => { return x > y; })), true); @@ -1982,7 +1982,7 @@ eq("File \"bs_list_test.res\", line 331, characters 5-12", Belt_List.every2({ hd: 4, tl: /* [] */0 } -}, (function (x, y) { +}, ((x, y) => { return x > y; })), false); @@ -1998,14 +1998,14 @@ eq("File \"bs_list_test.res\", line 332, characters 5-12", Belt_List.every2({ hd: 0, tl: /* [] */0 } -}, (function (x, y) { +}, ((x, y) => { return x > y; })), true); eq("File \"bs_list_test.res\", line 333, characters 5-12", Belt_List.some2(/* [] */0, { hd: 1, tl: /* [] */0 -}, (function (x, y) { +}, ((x, y) => { return x > y; })), false); @@ -2018,7 +2018,7 @@ eq("File \"bs_list_test.res\", line 334, characters 5-12", Belt_List.some2({ }, { hd: 1, tl: /* [] */0 -}, (function (x, y) { +}, ((x, y) => { return x > y; })), true); @@ -2034,7 +2034,7 @@ eq("File \"bs_list_test.res\", line 335, characters 5-12", Belt_List.some2({ hd: 4, tl: /* [] */0 } -}, (function (x, y) { +}, ((x, y) => { return x > y; })), true); @@ -2050,7 +2050,7 @@ eq("File \"bs_list_test.res\", line 336, characters 5-12", Belt_List.some2({ hd: 4, tl: /* [] */0 } -}, (function (x, y) { +}, ((x, y) => { return x > y; })), false); @@ -2066,7 +2066,7 @@ eq("File \"bs_list_test.res\", line 337, characters 5-12", Belt_List.some2({ hd: 2, tl: /* [] */0 } -}, (function (x, y) { +}, ((x, y) => { return x > y; })), true); @@ -2085,12 +2085,12 @@ eq("File \"bs_list_test.res\", line 338, characters 5-12", Belt_List.some2({ hd: -2, tl: /* [] */0 } -}, (function (x, y) { +}, ((x, y) => { return x === y; })), false); function makeTest(n) { - eq("File \"bs_list_test.res\", line 341, characters 23-30", Belt_List.make(n, 3), Belt_List.makeBy(n, (function (param) { + eq("File \"bs_list_test.res\", line 341, characters 23-30", Belt_List.make(n, 3), Belt_List.makeBy(n, ((param) => { return 3; }))); } @@ -2371,7 +2371,7 @@ b("File \"bs_list_test.res\", line 374, characters 4-11", !Belt_List.eq({ hd: 2, tl: /* [] */0 } -}, (function (x, y) { +}, ((x, y) => { return x === y; }))); @@ -2393,7 +2393,7 @@ b("File \"bs_list_test.res\", line 375, characters 4-11", Belt_List.eq({ tl: /* [] */0 } } -}, (function (x, y) { +}, ((x, y) => { return x === y; }))); @@ -2415,7 +2415,7 @@ b("File \"bs_list_test.res\", line 376, characters 4-11", !Belt_List.eq({ tl: /* [] */0 } } -}, (function (x, y) { +}, ((x, y) => { return x === y; }))); @@ -2440,15 +2440,15 @@ b("File \"bs_list_test.res\", line 377, characters 4-11", !Belt_List.eq({ } } } -}, (function (prim0, prim1) { +}, ((prim0, prim1) => { return prim0 === prim1; }))); -let u0 = Belt_List.makeBy(20, (function (x) { +let u0 = Belt_List.makeBy(20, ((x) => { return x; })); -let u1 = Belt_List.keepMap(u0, (function (x) { +let u1 = Belt_List.keepMap(u0, ((x) => { if (x % 7 === 0) { return x + 1 | 0; } @@ -2478,7 +2478,7 @@ b("File \"bs_list_test.res\", line 390, characters 4-11", Caml_obj.equal(Belt_Li } } } -}, (function (x) { +}, ((x) => { if (x % 2 === 0) { return -x | 0; } @@ -2503,7 +2503,7 @@ b("File \"bs_list_test.res\", line 404, characters 4-11", Belt_List.keepMap({ } } } -}, (function (x) { +}, ((x) => { if (x % 5 === 0) { return x; } diff --git a/jscomp/test/bs_map_set_dict_test.js b/jscomp/test/bs_map_set_dict_test.js index a032c6e69e0..37de71b0265 100644 --- a/jscomp/test/bs_map_set_dict_test.js +++ b/jscomp/test/bs_map_set_dict_test.js @@ -53,7 +53,7 @@ let m00 = { }; let I2 = { - cmp: (function (x, y) { + cmp: ((x, y) => { return Caml.int_compare(y, x); }) }; @@ -114,12 +114,12 @@ function f(none) { } function $eq$tilde(a, b) { - return function (extra) { + return (extra) => { return Belt_Map.eq(a, b, extra); }; } -let u0 = Belt_Map.fromArray(Belt_Array.map(Array_data_util.randomRange(0, 39), (function (x) { +let u0 = Belt_Map.fromArray(Belt_Array.map(Array_data_util.randomRange(0, 39), ((x) => { return [ x, x @@ -128,12 +128,12 @@ let u0 = Belt_Map.fromArray(Belt_Array.map(Array_data_util.randomRange(0, 39), ( let u1 = Belt_Map.set(u0, 39, 120); -b("File \"bs_map_set_dict_test.res\", line 72, characters 4-11", Belt_Array.every2(Belt_MapDict.toArray(u0.data), Belt_Array.map(Array_data_util.range(0, 39), (function (x) { +b("File \"bs_map_set_dict_test.res\", line 72, characters 4-11", Belt_Array.every2(Belt_MapDict.toArray(u0.data), Belt_Array.map(Array_data_util.range(0, 39), ((x) => { return [ x, x ]; -})), (function (param, param$1) { +})), ((param, param$1) => { if (param[0] === param$1[0]) { return param[1] === param$1[1]; } else { @@ -141,12 +141,12 @@ b("File \"bs_map_set_dict_test.res\", line 72, characters 4-11", Belt_Array.ever } }))); -b("File \"bs_map_set_dict_test.res\", line 79, characters 4-11", Belt_List.every2(Belt_MapDict.toList(u0.data), Belt_List.fromArray(Belt_Array.map(Array_data_util.range(0, 39), (function (x) { +b("File \"bs_map_set_dict_test.res\", line 79, characters 4-11", Belt_List.every2(Belt_MapDict.toList(u0.data), Belt_List.fromArray(Belt_Array.map(Array_data_util.range(0, 39), ((x) => { return [ x, x ]; -}))), (function (param, param$1) { +}))), ((param, param$1) => { if (param[0] === param$1[0]) { return param[1] === param$1[1]; } else { @@ -158,14 +158,14 @@ eq("File \"bs_map_set_dict_test.res\", line 84, characters 5-12", Belt_Map.get(u eq("File \"bs_map_set_dict_test.res\", line 85, characters 5-12", Belt_Map.get(u1, 39), 120); -let u = Belt_Map.fromArray(Belt_Array.makeByAndShuffle(10000, (function (x) { +let u = Belt_Map.fromArray(Belt_Array.makeByAndShuffle(10000, ((x) => { return [ x, x ]; })), Icmp); -eq("File \"bs_map_set_dict_test.res\", line 90, characters 5-12", Belt_Array.makeBy(10000, (function (x) { +eq("File \"bs_map_set_dict_test.res\", line 90, characters 5-12", Belt_Array.makeBy(10000, ((x) => { return [ x, x diff --git a/jscomp/test/bs_map_test.js b/jscomp/test/bs_map_test.js index 689645a29f4..466ba4f88ff 100644 --- a/jscomp/test/bs_map_test.js +++ b/jscomp/test/bs_map_test.js @@ -19,7 +19,7 @@ function eq(loc, x, y) { suites.contents = { hd: [ loc + (" id " + String(test_id.contents)), - (function () { + (() => { return { TAG: "Eq", _0: x, @@ -36,7 +36,7 @@ function b(loc, v) { suites.contents = { hd: [ loc + (" id " + String(test_id.contents)), - (function () { + (() => { return { TAG: "Ok", _0: v @@ -55,7 +55,7 @@ function emptyMap() { } -let v = Belt_Array.makeByAndShuffle(1000000, (function (i) { +let v = Belt_Array.makeByAndShuffle(1000000, ((i) => { return [ i, i @@ -68,7 +68,7 @@ Belt_MapInt.checkInvariantInternal(u); let firstHalf = Belt_Array.slice(v, 0, 2000); -let xx = Belt_Array.reduce(firstHalf, u, (function (acc, param) { +let xx = Belt_Array.reduce(firstHalf, u, ((acc, param) => { return Belt_MapInt.remove(acc, param[0]); })); diff --git a/jscomp/test/bs_mutable_set_test.js b/jscomp/test/bs_mutable_set_test.js index 484e86f3183..3a5851b068b 100644 --- a/jscomp/test/bs_mutable_set_test.js +++ b/jscomp/test/bs_mutable_set_test.js @@ -113,11 +113,11 @@ let v = { data: Belt_internalSetInt.fromArray(xs$1) }; -let bs = Belt_Array.map(Array_data_util.randomRange(500, 1499), (function (x) { +let bs = Belt_Array.map(Array_data_util.randomRange(500, 1499), ((x) => { return Belt_MutableSetInt.removeCheck(v, x); })); -let indeedRemoved = Belt_Array.reduce(bs, 0, (function (acc, x) { +let indeedRemoved = Belt_Array.reduce(bs, 0, ((acc, x) => { if (x) { return acc + 1 | 0; } else { @@ -129,11 +129,11 @@ eq("File \"bs_mutable_set_test.res\", line 72, characters 9-16", indeedRemoved, eq("File \"bs_mutable_set_test.res\", line 73, characters 9-16", Belt_internalAVLset.size(v.data), 501); -let cs = Belt_Array.map(Array_data_util.randomRange(500, 2000), (function (x) { +let cs = Belt_Array.map(Array_data_util.randomRange(500, 2000), ((x) => { return Belt_MutableSetInt.addCheck(v, x); })); -let indeedAded = Belt_Array.reduce(cs, 0, (function (acc, x) { +let indeedAded = Belt_Array.reduce(cs, 0, ((acc, x) => { if (x) { return acc + 1 | 0; } else { @@ -157,13 +157,13 @@ eq("File \"bs_mutable_set_test.res\", line 87, characters 9-16", Belt_internalAV eq("File \"bs_mutable_set_test.res\", line 88, characters 9-16", Belt_internalAVLset.maxUndefined(v.data), 2000); -eq("File \"bs_mutable_set_test.res\", line 89, characters 9-16", Belt_MutableSetInt.reduce(v, 0, (function (x, y) { +eq("File \"bs_mutable_set_test.res\", line 89, characters 9-16", Belt_MutableSetInt.reduce(v, 0, ((x, y) => { return x + y | 0; })), 1876250); -b("File \"bs_mutable_set_test.res\", line 90, characters 8-15", Belt_List.eq(Belt_internalAVLset.toList(v.data), Belt_List.makeBy(1501, (function (i) { +b("File \"bs_mutable_set_test.res\", line 90, characters 8-15", Belt_List.eq(Belt_internalAVLset.toList(v.data), Belt_List.makeBy(1501, ((i) => { return i + 500 | 0; -})), (function (x, y) { +})), ((x, y) => { return x === y; }))); @@ -185,11 +185,11 @@ let aa = match$1[0]; b("File \"bs_mutable_set_test.res\", line 96, characters 8-15", match[1]); -b("File \"bs_mutable_set_test.res\", line 97, characters 8-15", Belt_Array.eq(Belt_internalAVLset.toArray(aa.data), Array_data_util.range(500, 999), (function (x, y) { +b("File \"bs_mutable_set_test.res\", line 97, characters 8-15", Belt_Array.eq(Belt_internalAVLset.toArray(aa.data), Array_data_util.range(500, 999), ((x, y) => { return x === y; }))); -b("File \"bs_mutable_set_test.res\", line 98, characters 8-15", Belt_Array.eq(Belt_internalAVLset.toArray(bb.data), Array_data_util.range(1001, 2000), (function (prim0, prim1) { +b("File \"bs_mutable_set_test.res\", line 98, characters 8-15", Belt_Array.eq(Belt_internalAVLset.toArray(bb.data), Array_data_util.range(1001, 2000), ((prim0, prim1) => { return prim0 === prim1; }))); @@ -213,11 +213,11 @@ let aa$1 = match$3[0]; b("File \"bs_mutable_set_test.res\", line 105, characters 8-15", !match$2[1]); -b("File \"bs_mutable_set_test.res\", line 106, characters 8-15", Belt_Array.eq(Belt_internalAVLset.toArray(aa$1.data), Array_data_util.range(500, 999), (function (prim0, prim1) { +b("File \"bs_mutable_set_test.res\", line 106, characters 8-15", Belt_Array.eq(Belt_internalAVLset.toArray(aa$1.data), Array_data_util.range(500, 999), ((prim0, prim1) => { return prim0 === prim1; }))); -b("File \"bs_mutable_set_test.res\", line 107, characters 8-15", Belt_Array.eq(Belt_internalAVLset.toArray(bb$1.data), Array_data_util.range(1001, 2000), (function (prim0, prim1) { +b("File \"bs_mutable_set_test.res\", line 107, characters 8-15", Belt_Array.eq(Belt_internalAVLset.toArray(bb$1.data), Array_data_util.range(1001, 2000), ((prim0, prim1) => { return prim0 === prim1; }))); @@ -378,15 +378,15 @@ let a0 = { data: Belt_internalSetInt.fromArray(xs$24) }; -let a1 = Belt_MutableSetInt.keep(a0, (function (x) { +let a1 = Belt_MutableSetInt.keep(a0, ((x) => { return x % 2 === 0; })); -let a2 = Belt_MutableSetInt.keep(a0, (function (x) { +let a2 = Belt_MutableSetInt.keep(a0, ((x) => { return x % 2 !== 0; })); -let match$4 = Belt_MutableSetInt.partition(a0, (function (x) { +let match$4 = Belt_MutableSetInt.partition(a0, ((x) => { return x % 2 === 0; })); @@ -413,7 +413,7 @@ Belt_List.forEach({ } } } -}, (function (x) { +}, ((x) => { Belt_internalAVLset.checkInvariantInternal(x.data); })); @@ -427,7 +427,7 @@ for (let i$2 = 0; i$2 <= 100000; ++i$2) { Belt_internalAVLset.checkInvariantInternal(v$1.data); -b("File \"bs_mutable_set_test.res\", line 188, characters 10-17", Belt_Range.every(0, 100000, (function (i) { +b("File \"bs_mutable_set_test.res\", line 188, characters 10-17", Belt_Range.every(0, 100000, ((i) => { return Belt_internalSetInt.has(v$1.data, i); }))); @@ -471,7 +471,7 @@ eq("File \"bs_mutable_set_test.res\", line 216, characters 5-12", Belt_internalA b("File \"bs_mutable_set_test.res\", line 217, characters 4-11", Belt_MutableSetInt.isEmpty(v$3)); -let xs$25 = Belt_Array.makeBy(30, (function (i) { +let xs$25 = Belt_Array.makeBy(30, ((i) => { return i; })); @@ -504,7 +504,7 @@ function id(loc, x) { data: Belt_internalAVLset.fromSortedArrayUnsafe(x) }; Belt_internalAVLset.checkInvariantInternal(u.data); - b(loc, Belt_Array.every2(Belt_internalAVLset.toArray(u.data), x, (function (prim0, prim1) { + b(loc, Belt_Array.every2(Belt_internalAVLset.toArray(u.data), x, ((prim0, prim1) => { return prim0 === prim1; }))); } @@ -598,15 +598,15 @@ let v$5 = { data: Belt_internalSetInt.fromArray(xs$26) }; -let copyV = Belt_MutableSetInt.keep(v$5, (function (x) { +let copyV = Belt_MutableSetInt.keep(v$5, ((x) => { return x % 8 === 0; })); -let match$5 = Belt_MutableSetInt.partition(v$5, (function (x) { +let match$5 = Belt_MutableSetInt.partition(v$5, ((x) => { return x % 8 === 0; })); -let cc$1 = Belt_MutableSetInt.keep(v$5, (function (x) { +let cc$1 = Belt_MutableSetInt.keep(v$5, ((x) => { return x % 8 !== 0; })); @@ -616,7 +616,7 @@ for (let i$6 = 0; i$6 <= 200; ++i$6) { eq("File \"bs_mutable_set_test.res\", line 264, characters 5-12", Belt_internalAVLset.size(copyV.data), 126); -eq("File \"bs_mutable_set_test.res\", line 265, characters 5-12", Belt_internalAVLset.toArray(copyV.data), Belt_Array.makeBy(126, (function (i) { +eq("File \"bs_mutable_set_test.res\", line 265, characters 5-12", Belt_internalAVLset.toArray(copyV.data), Belt_Array.makeBy(126, ((i) => { return (i << 3); }))); @@ -648,7 +648,7 @@ b("File \"bs_mutable_set_test.res\", line 275, characters 4-11", Belt_MutableSet data: Belt_internalSetInt.fromArray(xs$29) })); -let xs$30 = Belt_Array.map(Array_data_util.randomRange(0, 1000), (function (x) { +let xs$30 = Belt_Array.map(Array_data_util.randomRange(0, 1000), ((x) => { return (x << 1); })); @@ -660,7 +660,7 @@ let match$8 = Belt_MutableSetInt.split(d, 1001); let match$9 = match$8[0]; -let xs$31 = Belt_Array.makeBy(501, (function (x) { +let xs$31 = Belt_Array.makeBy(501, ((x) => { return (x << 1); })); @@ -668,7 +668,7 @@ b("File \"bs_mutable_set_test.res\", line 278, characters 4-11", Belt_MutableSet data: Belt_internalSetInt.fromArray(xs$31) })); -let xs$32 = Belt_Array.makeBy(500, (function (x) { +let xs$32 = Belt_Array.makeBy(500, ((x) => { return 1002 + (x << 1) | 0; })); diff --git a/jscomp/test/bs_poly_map_test.js b/jscomp/test/bs_poly_map_test.js index aa8030e6e3d..e9fac4d6d8e 100644 --- a/jscomp/test/bs_poly_map_test.js +++ b/jscomp/test/bs_poly_map_test.js @@ -46,7 +46,7 @@ function emptyMap() { } function mergeInter(s1, s2) { - let m = Belt_Map.merge(s1, s2, (function (k, v1, v2) { + let m = Belt_Map.merge(s1, s2, ((k, v1, v2) => { if (v1 !== undefined && v2 !== undefined) { return Caml_option.some(undefined); } @@ -56,7 +56,7 @@ function mergeInter(s1, s2) { } function mergeUnion(s1, s2) { - let m = Belt_Map.merge(s1, s2, (function (k, v1, v2) { + let m = Belt_Map.merge(s1, s2, ((k, v1, v2) => { if (v1 !== undefined || v2 !== undefined) { return Caml_option.some(undefined); } @@ -66,7 +66,7 @@ function mergeUnion(s1, s2) { } function mergeDiff(s1, s2) { - let m = Belt_Map.merge(s1, s2, (function (k, v1, v2) { + let m = Belt_Map.merge(s1, s2, ((k, v1, v2) => { if (v1 !== undefined && v2 === undefined) { return Caml_option.some(undefined); } @@ -76,7 +76,7 @@ function mergeDiff(s1, s2) { } function randomRange(i, j) { - return Belt_Array.map(Array_data_util.randomRange(i, j), (function (x) { + return Belt_Array.map(Array_data_util.randomRange(i, j), ((x) => { return [ x, x @@ -102,7 +102,7 @@ let a1 = Belt_Map.set(a0, 3, 33); let a2 = Belt_Map.remove(a1, 3); -let a3 = Belt_Map.update(a2, 3, (function (k) { +let a3 = Belt_Map.update(a2, 3, ((k) => { if (k !== undefined) { return k + 1 | 0; } else { @@ -110,7 +110,7 @@ let a3 = Belt_Map.update(a2, 3, (function (k) { } })); -let a4 = Belt_Map.update(a2, 3, (function (k) { +let a4 = Belt_Map.update(a2, 3, ((k) => { if (k !== undefined) { return k + 1 | 0; } @@ -169,8 +169,8 @@ eq("File \"bs_poly_map_test.res\", line 108, characters 5-12", Belt_Map.get(u1$1 eq("File \"bs_poly_map_test.res\", line 109, characters 5-12", Belt_Map.get(u0$1, 3), 3); function acc(m, is) { - return Belt_Array.reduce(is, m, (function (a, i) { - return Belt_Map.update(a, i, (function (n) { + return Belt_Array.reduce(is, m, ((a, i) => { + return Belt_Map.update(a, i, ((n) => { if (n !== undefined) { return n + 1 | 0; } else { @@ -189,12 +189,12 @@ let m = { let m1 = acc(m, Belt_Array.concat(Array_data_util.randomRange(0, 20), Array_data_util.randomRange(10, 30))); -b("File \"bs_poly_map_test.res\", line 126, characters 4-11", Belt_Map.eq(m1, Belt_Map.fromArray(Belt_Array.makeBy(31, (function (i) { +b("File \"bs_poly_map_test.res\", line 126, characters 4-11", Belt_Map.eq(m1, Belt_Map.fromArray(Belt_Array.makeBy(31, ((i) => { return [ i, i >= 10 && i <= 20 ? 2 : 1 ]; -})), Icmp), (function (x, y) { +})), Icmp), ((x, y) => { return x === y; }))); @@ -205,21 +205,21 @@ let v0 = { data: undefined }; -let v1 = Belt_Map.mergeMany(v0, Belt_Array.map(Array_data_util.randomRange(0, 10000), (function (x) { +let v1 = Belt_Map.mergeMany(v0, Belt_Array.map(Array_data_util.randomRange(0, 10000), ((x) => { return [ x, x ]; }))); -let v2 = Belt_Map.fromArray(Belt_Array.map(Array_data_util.randomRange(0, 10000), (function (x) { +let v2 = Belt_Map.fromArray(Belt_Array.map(Array_data_util.randomRange(0, 10000), ((x) => { return [ x, x ]; })), Icmp); -b("File \"bs_poly_map_test.res\", line 150, characters 4-11", Belt_Map.eq(v1, v2, (function (x, y) { +b("File \"bs_poly_map_test.res\", line 150, characters 4-11", Belt_Map.eq(v1, v2, ((x, y) => { return x === y; }))); @@ -269,15 +269,15 @@ b("File \"bs_poly_map_test.res\", line 182, characters 4-11", Belt_MapDict.isEmp b("File \"bs_poly_map_test.res\", line 184, characters 4-11", pres !== undefined ? pres === 5000 : false); -b("File \"bs_poly_map_test.res\", line 190, characters 4-11", Belt_Array.eq(Belt_MapDict.keysToArray(match$1[0].data), Belt_Array.makeBy(5000, (function (i) { +b("File \"bs_poly_map_test.res\", line 190, characters 4-11", Belt_Array.eq(Belt_MapDict.keysToArray(match$1[0].data), Belt_Array.makeBy(5000, ((i) => { return i; -})), (function (prim0, prim1) { +})), ((prim0, prim1) => { return prim0 === prim1; }))); -b("File \"bs_poly_map_test.res\", line 191, characters 4-11", Belt_Array.eq(Belt_MapDict.keysToArray(match$1[1].data), Belt_Array.makeBy(5000, (function (i) { +b("File \"bs_poly_map_test.res\", line 191, characters 4-11", Belt_Array.eq(Belt_MapDict.keysToArray(match$1[1].data), Belt_Array.makeBy(5000, ((i) => { return 5001 + i | 0; -})), (function (prim0, prim1) { +})), ((prim0, prim1) => { return prim0 === prim1; }))); @@ -289,15 +289,15 @@ let match$6 = match$5[0]; b("File \"bs_poly_map_test.res\", line 196, characters 4-11", match$5[1] === undefined); -b("File \"bs_poly_map_test.res\", line 202, characters 4-11", Belt_Array.eq(Belt_MapDict.keysToArray(match$6[0].data), Belt_Array.makeBy(5000, (function (i) { +b("File \"bs_poly_map_test.res\", line 202, characters 4-11", Belt_Array.eq(Belt_MapDict.keysToArray(match$6[0].data), Belt_Array.makeBy(5000, ((i) => { return i; -})), (function (prim0, prim1) { +})), ((prim0, prim1) => { return prim0 === prim1; }))); -b("File \"bs_poly_map_test.res\", line 203, characters 4-11", Belt_Array.eq(Belt_MapDict.keysToArray(match$6[1].data), Belt_Array.makeBy(5000, (function (i) { +b("File \"bs_poly_map_test.res\", line 203, characters 4-11", Belt_Array.eq(Belt_MapDict.keysToArray(match$6[1].data), Belt_Array.makeBy(5000, ((i) => { return 5001 + i | 0; -})), (function (prim0, prim1) { +})), ((prim0, prim1) => { return prim0 === prim1; }))); diff --git a/jscomp/test/bs_poly_mutable_map_test.js b/jscomp/test/bs_poly_mutable_map_test.js index 85020d2acae..ae483b1e6c7 100644 --- a/jscomp/test/bs_poly_mutable_map_test.js +++ b/jscomp/test/bs_poly_mutable_map_test.js @@ -38,7 +38,7 @@ function ff(x) { } function randomRange(i, j) { - return Belt_Array.map(Array_data_util.randomRange(i, j), (function (x) { + return Belt_Array.map(Array_data_util.randomRange(i, j), ((x) => { return [ x, x @@ -79,11 +79,11 @@ let a0$1 = Belt_MutableMap.fromArray(randomRange(0, 10000), Icmp); Belt_MutableMap.set(a0$1, 2000, 33); -Belt_MutableMap.removeMany(a0$1, Belt_Array.map(randomRange(0, 1998), (function (prim) { +Belt_MutableMap.removeMany(a0$1, Belt_Array.map(randomRange(0, 1998), ((prim) => { return prim[0]; }))); -Belt_MutableMap.removeMany(a0$1, Belt_Array.map(randomRange(2002, 11000), (function (prim) { +Belt_MutableMap.removeMany(a0$1, Belt_Array.map(randomRange(2002, 11000), ((prim) => { return prim[0]; }))); diff --git a/jscomp/test/bs_poly_mutable_set_test.js b/jscomp/test/bs_poly_mutable_set_test.js index 26d94fd88b7..5df8eef073b 100644 --- a/jscomp/test/bs_poly_mutable_set_test.js +++ b/jscomp/test/bs_poly_mutable_set_test.js @@ -118,11 +118,11 @@ b("File \"bs_poly_mutable_set_test.res\", line 54, characters 4-11", Belt_Mutabl let v = Belt_MutableSet.fromArray(Array_data_util.randomRange(1000, 2000), IntCmp); -let bs = Belt_Array.map(Array_data_util.randomRange(500, 1499), (function (x) { +let bs = Belt_Array.map(Array_data_util.randomRange(500, 1499), ((x) => { return Belt_MutableSet.removeCheck(v, x); })); -let indeedRemoved = Belt_Array.reduce(bs, 0, (function (acc, x) { +let indeedRemoved = Belt_Array.reduce(bs, 0, ((acc, x) => { if (x) { return acc + 1 | 0; } else { @@ -134,11 +134,11 @@ eq("File \"bs_poly_mutable_set_test.res\", line 67, characters 5-12", indeedRemo eq("File \"bs_poly_mutable_set_test.res\", line 68, characters 5-12", Belt_internalAVLset.size(v.data), 501); -let cs = Belt_Array.map(Array_data_util.randomRange(500, 2000), (function (x) { +let cs = Belt_Array.map(Array_data_util.randomRange(500, 2000), ((x) => { return Belt_MutableSet.addCheck(v, x); })); -let indeedAded = Belt_Array.reduce(cs, 0, (function (acc, x) { +let indeedAded = Belt_Array.reduce(cs, 0, ((acc, x) => { if (x) { return acc + 1 | 0; } else { @@ -163,13 +163,13 @@ eq("File \"bs_poly_mutable_set_test.res\", line 82, characters 5-12", Belt_inter eq("File \"bs_poly_mutable_set_test.res\", line 83, characters 5-12", Belt_internalAVLset.maxUndefined(v.data), 2000); -eq("File \"bs_poly_mutable_set_test.res\", line 84, characters 5-12", Belt_MutableSet.reduce(v, 0, (function (x, y) { +eq("File \"bs_poly_mutable_set_test.res\", line 84, characters 5-12", Belt_MutableSet.reduce(v, 0, ((x, y) => { return x + y | 0; })), 1876250); -b("File \"bs_poly_mutable_set_test.res\", line 85, characters 4-11", Belt_List.eq(Belt_internalAVLset.toList(v.data), Belt_List.makeBy(1501, (function (i) { +b("File \"bs_poly_mutable_set_test.res\", line 85, characters 4-11", Belt_List.eq(Belt_internalAVLset.toList(v.data), Belt_List.makeBy(1501, ((i) => { return i + 500 | 0; -})), (function (x, y) { +})), ((x, y) => { return x === y; }))); @@ -191,11 +191,11 @@ let aa = match$1[0]; b("File \"bs_poly_mutable_set_test.res\", line 91, characters 4-11", match[1]); -b("File \"bs_poly_mutable_set_test.res\", line 92, characters 4-11", Belt_Array.eq(Belt_internalAVLset.toArray(aa.data), Array_data_util.range(500, 999), (function (prim0, prim1) { +b("File \"bs_poly_mutable_set_test.res\", line 92, characters 4-11", Belt_Array.eq(Belt_internalAVLset.toArray(aa.data), Array_data_util.range(500, 999), ((prim0, prim1) => { return prim0 === prim1; }))); -b("File \"bs_poly_mutable_set_test.res\", line 93, characters 4-11", Belt_Array.eq(Belt_internalAVLset.toArray(bb.data), Array_data_util.range(1001, 2000), (function (prim0, prim1) { +b("File \"bs_poly_mutable_set_test.res\", line 93, characters 4-11", Belt_Array.eq(Belt_internalAVLset.toArray(bb.data), Array_data_util.range(1001, 2000), ((prim0, prim1) => { return prim0 === prim1; }))); @@ -219,11 +219,11 @@ let aa$1 = match$3[0]; b("File \"bs_poly_mutable_set_test.res\", line 100, characters 4-11", !match$2[1]); -b("File \"bs_poly_mutable_set_test.res\", line 101, characters 4-11", Belt_Array.eq(Belt_internalAVLset.toArray(aa$1.data), Array_data_util.range(500, 999), (function (prim0, prim1) { +b("File \"bs_poly_mutable_set_test.res\", line 101, characters 4-11", Belt_Array.eq(Belt_internalAVLset.toArray(aa$1.data), Array_data_util.range(500, 999), ((prim0, prim1) => { return prim0 === prim1; }))); -b("File \"bs_poly_mutable_set_test.res\", line 102, characters 4-11", Belt_Array.eq(Belt_internalAVLset.toArray(bb$1.data), Array_data_util.range(1001, 2000), (function (prim0, prim1) { +b("File \"bs_poly_mutable_set_test.res\", line 102, characters 4-11", Belt_Array.eq(Belt_internalAVLset.toArray(bb$1.data), Array_data_util.range(1001, 2000), ((prim0, prim1) => { return prim0 === prim1; }))); @@ -288,15 +288,15 @@ b("File \"bs_poly_mutable_set_test.res\", line 150, characters 4-11", Belt_Mutab let a0 = Belt_MutableSet.fromArray(Array_data_util.randomRange(0, 1000), IntCmp); -let a1 = Belt_MutableSet.keep(a0, (function (x) { +let a1 = Belt_MutableSet.keep(a0, ((x) => { return x % 2 === 0; })); -let a2 = Belt_MutableSet.keep(a0, (function (x) { +let a2 = Belt_MutableSet.keep(a0, ((x) => { return x % 2 !== 0; })); -let match$4 = Belt_MutableSet.partition(a0, (function (x) { +let match$4 = Belt_MutableSet.partition(a0, ((x) => { return x % 2 === 0; })); @@ -323,7 +323,7 @@ Belt_List.forEach({ } } } -}, (function (x) { +}, ((x) => { Belt_internalAVLset.checkInvariantInternal(x.data); })); diff --git a/jscomp/test/bs_poly_set_test.js b/jscomp/test/bs_poly_set_test.js index 186f46caffd..dcde2d812de 100644 --- a/jscomp/test/bs_poly_set_test.js +++ b/jscomp/test/bs_poly_set_test.js @@ -146,7 +146,7 @@ let u26 = Belt_Set.add({ data: undefined }, 3); -let ss = Belt_Array.makeByAndShuffle(100, (function (i) { +let ss = Belt_Array.makeByAndShuffle(100, ((i) => { return (i << 1); })); @@ -200,7 +200,7 @@ function testIterToList(xs) { let v = { contents: /* [] */0 }; - Belt_SetDict.forEach(xs.data, (function (x) { + Belt_SetDict.forEach(xs.data, ((x) => { v.contents = { hd: x, tl: v.contents @@ -213,7 +213,7 @@ function testIterToList2(xs) { let v = { contents: /* [] */0 }; - Belt_SetDict.forEach(xs.data, (function (x) { + Belt_SetDict.forEach(xs.data, ((x) => { v.contents = { hd: x, tl: v.contents @@ -228,19 +228,19 @@ let u1$1 = Belt_Set.remove(u0$1, 17); let u2$1 = Belt_Set.add(u1$1, 33); -b("File \"bs_poly_set_test.res\", line 110, characters 4-11", Belt_List.every2(testIterToList(u0$1), Belt_List.makeBy(21, (function (i) { +b("File \"bs_poly_set_test.res\", line 110, characters 4-11", Belt_List.every2(testIterToList(u0$1), Belt_List.makeBy(21, ((i) => { return i; -})), (function (x, y) { +})), ((x, y) => { return x === y; }))); -b("File \"bs_poly_set_test.res\", line 111, characters 4-11", Belt_List.every2(testIterToList2(u0$1), Belt_List.makeBy(21, (function (i) { +b("File \"bs_poly_set_test.res\", line 111, characters 4-11", Belt_List.every2(testIterToList2(u0$1), Belt_List.makeBy(21, ((i) => { return i; -})), (function (x, y) { +})), ((x, y) => { return x === y; }))); -b("File \"bs_poly_set_test.res\", line 112, characters 4-11", Belt_List.every2(testIterToList(u0$1), Belt_SetDict.toList(u0$1.data), (function (x, y) { +b("File \"bs_poly_set_test.res\", line 112, characters 4-11", Belt_List.every2(testIterToList(u0$1), Belt_SetDict.toList(u0$1.data), ((x, y) => { return x === y; }))); @@ -262,7 +262,7 @@ function f$2(x) { b("File \"bs_poly_set_test.res\", line 115, characters 4-11", Belt_SetDict.every(u0$1.data, f$2)); -b("File \"bs_poly_set_test.res\", line 116, characters 4-11", Belt_SetDict.every(u0$1.data, (function (x) { +b("File \"bs_poly_set_test.res\", line 116, characters 4-11", Belt_SetDict.every(u0$1.data, ((x) => { return x < 24; }))); @@ -290,15 +290,15 @@ b("File \"bs_poly_set_test.res\", line 120, characters 4-11", Belt_Set.cmp(u0$1, let a0 = Belt_Set.fromArray(Array_data_util.randomRange(0, 1000), IntCmp); -let a1 = Belt_Set.keep(a0, (function (x) { +let a1 = Belt_Set.keep(a0, ((x) => { return x % 2 === 0; })); -let a2 = Belt_Set.keep(a0, (function (x) { +let a2 = Belt_Set.keep(a0, ((x) => { return x % 2 !== 0; })); -let match = Belt_Set.partition(a0, (function (x) { +let match = Belt_Set.partition(a0, ((x) => { return x % 2 === 0; })); @@ -314,11 +314,11 @@ eq("File \"bs_poly_set_test.res\", line 129, characters 5-12", Belt_Set.getExn(a eq("File \"bs_poly_set_test.res\", line 130, characters 5-12", Belt_Set.getExn(a0, 4), 4); -t("File \"bs_poly_set_test.res\", line 131, characters 4-11", (function () { +t("File \"bs_poly_set_test.res\", line 131, characters 4-11", (() => { Belt_Set.getExn(a0, 1002); })); -t("File \"bs_poly_set_test.res\", line 132, characters 4-11", (function () { +t("File \"bs_poly_set_test.res\", line 132, characters 4-11", (() => { Belt_Set.getExn(a0, -1); })); @@ -332,11 +332,11 @@ let match$2 = match$1[0]; b("File \"bs_poly_set_test.res\", line 136, characters 4-11", match$1[1]); -eq("File \"bs_poly_set_test.res\", line 137, characters 5-12", Belt_SetDict.toArray(match$2[0].data), Belt_Array.makeBy(200, (function (i) { +eq("File \"bs_poly_set_test.res\", line 137, characters 5-12", Belt_SetDict.toArray(match$2[0].data), Belt_Array.makeBy(200, ((i) => { return i; }))); -eq("File \"bs_poly_set_test.res\", line 138, characters 5-12", Belt_SetDict.toList(match$2[1].data), Belt_List.makeBy(800, (function (i) { +eq("File \"bs_poly_set_test.res\", line 138, characters 5-12", Belt_SetDict.toList(match$2[1].data), Belt_List.makeBy(800, ((i) => { return i + 201 | 0; }))); @@ -352,11 +352,11 @@ let a8 = match$4[0]; b("File \"bs_poly_set_test.res\", line 141, characters 4-11", !match$3[1]); -eq("File \"bs_poly_set_test.res\", line 142, characters 5-12", Belt_SetDict.toArray(a8.data), Belt_Array.makeBy(200, (function (i) { +eq("File \"bs_poly_set_test.res\", line 142, characters 5-12", Belt_SetDict.toArray(a8.data), Belt_Array.makeBy(200, ((i) => { return i; }))); -eq("File \"bs_poly_set_test.res\", line 143, characters 5-12", Belt_SetDict.toList(a9.data), Belt_List.makeBy(800, (function (i) { +eq("File \"bs_poly_set_test.res\", line 143, characters 5-12", Belt_SetDict.toList(a9.data), Belt_List.makeBy(800, ((i) => { return i + 201 | 0; }))); @@ -379,13 +379,13 @@ Belt_List.forEach({ } } } -}, (function (x) { +}, ((x) => { Belt_SetDict.checkInvariantInternal(x.data); })); let a = Belt_Set.fromArray([], IntCmp); -let m$1 = Belt_Set.keep(a, (function (x) { +let m$1 = Belt_Set.keep(a, ((x) => { return x % 2 === 0; })); diff --git a/jscomp/test/bs_queue_test.js b/jscomp/test/bs_queue_test.js index cb4358d47ef..9880a4536f5 100644 --- a/jscomp/test/bs_queue_test.js +++ b/jscomp/test/bs_queue_test.js @@ -767,7 +767,7 @@ let i$7 = { contents: 1 }; -Belt_MutableQueue.forEach(q$5, (function (j) { +Belt_MutableQueue.forEach(q$5, ((j) => { if (i$7.contents !== j) { throw new Error("Assert_failure", { cause: { @@ -1312,9 +1312,9 @@ if (!Caml_obj.equal(Belt_MutableQueue.toArray(q2$4), v)) { }); } -if (Belt_MutableQueue.reduce(q2$4, 0, (function (x, y) { +if (Belt_MutableQueue.reduce(q2$4, 0, ((x, y) => { return x - y | 0; - })) !== Belt_Array.reduce(v, 0, (function (x, y) { + })) !== Belt_Array.reduce(v, 0, ((x, y) => { return x - y | 0; }))) { throw new Error("Assert_failure", { @@ -1338,7 +1338,7 @@ let q$6 = Belt_MutableQueue.fromArray([ 4 ]); -let q1$5 = Belt_MutableQueue.map(q$6, (function (x) { +let q1$5 = Belt_MutableQueue.map(q$6, ((x) => { return x - 1 | 0; })); @@ -1353,7 +1353,7 @@ let q$7 = Belt_MutableQueue.fromArray([]); b("File \"bs_queue_test.res\", line 198, characters 4-11", q$7.length === 0); -let q$8 = Belt_MutableQueue.map(Belt_MutableQueue.fromArray([]), (function (x) { +let q$8 = Belt_MutableQueue.map(Belt_MutableQueue.fromArray([]), ((x) => { return x + 1 | 0; })); diff --git a/jscomp/test/bs_set_int_test.js b/jscomp/test/bs_set_int_test.js index b3eb0f0a2a0..f4d273c517d 100644 --- a/jscomp/test/bs_set_int_test.js +++ b/jscomp/test/bs_set_int_test.js @@ -55,13 +55,13 @@ let u = Belt_SetInt.intersect(Belt_SetInt.fromArray([ b("File \"bs_set_int_test.res\", line 27, characters 11-18", Belt_SetInt.eq(Belt_SetInt.fromArray([3]), u)); function range(i, j) { - return $$Array.init((j - i | 0) + 1 | 0, (function (k) { + return $$Array.init((j - i | 0) + 1 | 0, ((k) => { return k + i | 0; })); } function revRange(i, j) { - return $$Array.of_list(List.rev($$Array.to_list($$Array.init((j - i | 0) + 1 | 0, (function (k) { + return $$Array.of_list(List.rev($$Array.to_list($$Array.init((j - i | 0) + 1 | 0, ((k) => { return k + i | 0; }))))); } @@ -72,7 +72,7 @@ let i = range(100, 1500); b("File \"bs_set_int_test.res\", line 37, characters 4-11", Belt_SetInt.eq(Belt_SetInt.fromArray(i), v)); -let match = Belt_SetInt.partition(v, (function (x) { +let match = Belt_SetInt.partition(v, ((x) => { return x % 3 === 0; })); @@ -162,9 +162,9 @@ function approx(loc, x, y) { b(loc, x === y); } -eq("File \"bs_set_int_test.res\", line 125, characters 5-12", Belt_SetInt.reduce(v$1, 0, (function (x, y) { +eq("File \"bs_set_int_test.res\", line 125, characters 5-12", Belt_SetInt.reduce(v$1, 0, ((x, y) => { return x + y | 0; -})), Belt_Array.reduce(ss, 0, (function (prim0, prim1) { +})), Belt_Array.reduce(ss, 0, ((prim0, prim1) => { return prim0 + prim1 | 0; }))); @@ -216,7 +216,7 @@ let v$10 = Belt_SetInt.remove(v$9, 1); b("File \"bs_set_int_test.res\", line 146, characters 4-11", Belt_SetInt.isEmpty(v$10)); -let v$11 = Belt_Array.makeByAndShuffle(1000000, (function (i) { +let v$11 = Belt_Array.makeByAndShuffle(1000000, ((i) => { return i; })); @@ -341,11 +341,11 @@ let v3 = Belt_SetInt.removeMany(v2, [ 2001 ]); -let us = Belt_Array.map(Array_data_util.randomRange(1000, 3000), (function (x) { +let us = Belt_Array.map(Array_data_util.randomRange(1000, 3000), ((x) => { return Belt_SetInt.has(v$12, x); })); -let counted = Belt_Array.reduce(us, 0, (function (acc, x) { +let counted = Belt_Array.reduce(us, 0, ((acc, x) => { if (x) { return acc + 1 | 0; } else { diff --git a/jscomp/test/bs_sort_test.js b/jscomp/test/bs_sort_test.js index e52e8cfe623..ef50111c63f 100644 --- a/jscomp/test/bs_sort_test.js +++ b/jscomp/test/bs_sort_test.js @@ -92,13 +92,13 @@ eq("File \"bs_sort_test.res\", line 52, characters 5-12", diffs(Array_data_util. 2 ]); -b("File \"bs_sort_test.res\", line 56, characters 4-11", Belt_Range.every(0, 200, (function (i) { +b("File \"bs_sort_test.res\", line 56, characters 4-11", Belt_Range.every(0, 200, ((i) => { let v = Array_data_util.randomRange(0, i); Belt_SortArray.stableSortInPlaceBy(v, cmp); return Belt_SortArray.isSorted(v, cmp); }))); -b("File \"bs_sort_test.res\", line 64, characters 4-11", Belt_Range.every(0, 200, (function (i) { +b("File \"bs_sort_test.res\", line 64, characters 4-11", Belt_Range.every(0, 200, ((i) => { let v = Array_data_util.randomRange(0, i); Belt_SortArray.stableSortInPlaceBy(v, cmp); return Belt_SortArray.isSorted(v, cmp); @@ -151,7 +151,7 @@ let u$1 = [ ] ]; -eq("File \"bs_sort_test.res\", line 95, characters 5-12", Belt_SortArray.stableSortBy(u$1, (function (param, param$1) { +eq("File \"bs_sort_test.res\", line 95, characters 5-12", Belt_SortArray.stableSortBy(u$1, ((param, param$1) => { return param[0] - param$1[0] | 0; })), [ [ @@ -187,7 +187,7 @@ let u$2 = [ ] ]; -eq("File \"bs_sort_test.res\", line 98, characters 4-11", Belt_SortArray.stableSortBy(u$2, (function (param, param$1) { +eq("File \"bs_sort_test.res\", line 98, characters 4-11", Belt_SortArray.stableSortBy(u$2, ((param, param$1) => { return param[0] - param$1[0] | 0; })), [ [ @@ -235,7 +235,7 @@ let u$3 = [ ] ]; -eq("File \"bs_sort_test.res\", line 104, characters 4-11", Belt_SortArray.stableSortBy(u$3, (function (param, param$1) { +eq("File \"bs_sort_test.res\", line 104, characters 4-11", Belt_SortArray.stableSortBy(u$3, ((param, param$1) => { return param[0] - param$1[0] | 0; })), [ [ @@ -323,11 +323,11 @@ eq("File \"bs_sort_test.res\", line 116, characters 5-12", Belt_SortArray.binary let aa = Array_data_util.range(0, 1000); -b("File \"bs_sort_test.res\", line 118, characters 4-11", Belt_Range.every(0, 1000, (function (i) { +b("File \"bs_sort_test.res\", line 118, characters 4-11", Belt_Range.every(0, 1000, ((i) => { return Belt_SortArray.binarySearchBy(aa, i, cmp) === i; }))); -let cc = Belt_Array.map(Array_data_util.range(0, 2000), (function (x) { +let cc = Belt_Array.map(Array_data_util.range(0, 2000), ((x) => { return (x << 1); })); @@ -339,7 +339,7 @@ eq("File \"bs_sort_test.res\", line 123, characters 5-12", Belt_SortArray.binary eq("File \"bs_sort_test.res\", line 125, characters 5-12", Belt_SortArray.binarySearchBy(cc, 1, cmp) ^ -1, 1); -b("File \"bs_sort_test.res\", line 126, characters 6-13", Belt_Range.every(0, 1999, (function (i) { +b("File \"bs_sort_test.res\", line 126, characters 6-13", Belt_Range.every(0, 1999, ((i) => { return (Belt_SortArray.binarySearchBy(cc, (i << 1) + 1 | 0, cmp) ^ -1) === (i + 1 | 0); }))); diff --git a/jscomp/test/bs_stack_test.js b/jscomp/test/bs_stack_test.js index 793432b9f38..1db4d7d4144 100644 --- a/jscomp/test/bs_stack_test.js +++ b/jscomp/test/bs_stack_test.js @@ -63,7 +63,7 @@ function inOrder3(v) { Belt_MutableStack.push(s, v$1); current = v$1.left; }; - Belt_MutableStack.dynamicPopIter(s, (function (popped) { + Belt_MutableStack.dynamicPopIter(s, ((popped) => { Belt_MutableQueue.add(q, popped.value); let current = popped.right; while (current !== undefined) { diff --git a/jscomp/test/bs_string_test.js b/jscomp/test/bs_string_test.js index 7570541190c..10a6d1b8e6e 100644 --- a/jscomp/test/bs_string_test.js +++ b/jscomp/test/bs_string_test.js @@ -16,7 +16,7 @@ function eq(loc, x, y) { suites.contents = { hd: [ loc + (" id " + String(test_id.contents)), - (function () { + (() => { return { TAG: "Eq", _0: x, @@ -28,7 +28,7 @@ function eq(loc, x, y) { }; } -eq("File \"bs_string_test.res\", line 10, characters 2-9", "ghso ghso g".split(" ").reduce((function (x, y) { +eq("File \"bs_string_test.res\", line 10, characters 2-9", "ghso ghso g".split(" ").reduce(((x, y) => { return x + ("-" + y); }), ""), "-ghso-ghso-g"); diff --git a/jscomp/test/buffer_test.js b/jscomp/test/buffer_test.js index 8c5c3c9701f..d50fa12382f 100644 --- a/jscomp/test/buffer_test.js +++ b/jscomp/test/buffer_test.js @@ -11,7 +11,7 @@ let v = "gso"; let suites_0 = [ "equal", - (function (param) { + ((param) => { return { TAG: "Eq", _0: [ @@ -29,7 +29,7 @@ let suites_0 = [ let suites_1 = { hd: [ "equal2", - (function (param) { + ((param) => { let u = Bytes.make(3, /* 'a' */97); u[0] = /* 'b' */98; return { @@ -48,7 +48,7 @@ let suites_1 = { tl: { hd: [ "buffer", - (function (param) { + ((param) => { let v = Buffer.create(30); for (let i = 0; i <= 10; ++i) { Buffer.add_string(v, String(i)); diff --git a/jscomp/test/bytes_split_gpr_743_test.js b/jscomp/test/bytes_split_gpr_743_test.js index 476a31379c4..b92203941e8 100644 --- a/jscomp/test/bytes_split_gpr_743_test.js +++ b/jscomp/test/bytes_split_gpr_743_test.js @@ -20,7 +20,7 @@ function eq(loc, param) { suites.contents = { hd: [ loc + (" id " + String(test_id.contents)), - (function () { + (() => { return { TAG: "Eq", _0: x, diff --git a/jscomp/test/caml_compare_bigint_test.js b/jscomp/test/caml_compare_bigint_test.js index 1427f44a73c..0b92a76b35c 100644 --- a/jscomp/test/caml_compare_bigint_test.js +++ b/jscomp/test/caml_compare_bigint_test.js @@ -9,7 +9,7 @@ function isLessThan(title, small, big) { return { hd: [ "compare: " + title, - (function (param) { + ((param) => { return { TAG: "Eq", _0: true, @@ -20,7 +20,7 @@ function isLessThan(title, small, big) { tl: { hd: [ "compare: " + title, - (function (param) { + ((param) => { return { TAG: "Eq", _0: true, @@ -31,7 +31,7 @@ function isLessThan(title, small, big) { tl: { hd: [ "< operator: " + title, - (function (param) { + ((param) => { return { TAG: "Eq", _0: true, @@ -42,7 +42,7 @@ function isLessThan(title, small, big) { tl: { hd: [ "<= operator: " + title, - (function (param) { + ((param) => { return { TAG: "Eq", _0: true, @@ -53,7 +53,7 @@ function isLessThan(title, small, big) { tl: { hd: [ "> operator: " + title, - (function (param) { + ((param) => { return { TAG: "Eq", _0: true, @@ -64,7 +64,7 @@ function isLessThan(title, small, big) { tl: { hd: [ ">= operator: " + title, - (function (param) { + ((param) => { return { TAG: "Eq", _0: true, @@ -75,7 +75,7 @@ function isLessThan(title, small, big) { tl: { hd: [ "min: " + title, - (function (param) { + ((param) => { return { TAG: "Eq", _0: small, @@ -86,7 +86,7 @@ function isLessThan(title, small, big) { tl: { hd: [ "min: " + title, - (function (param) { + ((param) => { return { TAG: "Eq", _0: small, @@ -97,7 +97,7 @@ function isLessThan(title, small, big) { tl: { hd: [ "max: " + title, - (function (param) { + ((param) => { return { TAG: "Eq", _0: big, @@ -108,7 +108,7 @@ function isLessThan(title, small, big) { tl: { hd: [ "max: " + title, - (function (param) { + ((param) => { return { TAG: "Eq", _0: big, @@ -119,7 +119,7 @@ function isLessThan(title, small, big) { tl: { hd: [ "!== operator: " + title, - (function (param) { + ((param) => { return { TAG: "Eq", _0: true, @@ -130,7 +130,7 @@ function isLessThan(title, small, big) { tl: { hd: [ "!== operator: " + title, - (function (param) { + ((param) => { return { TAG: "Eq", _0: true, @@ -141,7 +141,7 @@ function isLessThan(title, small, big) { tl: { hd: [ "!= operator: " + title, - (function (param) { + ((param) => { return { TAG: "Eq", _0: true, @@ -152,7 +152,7 @@ function isLessThan(title, small, big) { tl: { hd: [ "!= operator: " + title, - (function (param) { + ((param) => { return { TAG: "Eq", _0: true, @@ -163,7 +163,7 @@ function isLessThan(title, small, big) { tl: { hd: [ "== operator: " + title, - (function (param) { + ((param) => { return { TAG: "Eq", _0: false, @@ -174,7 +174,7 @@ function isLessThan(title, small, big) { tl: { hd: [ "== operator: " + title, - (function (param) { + ((param) => { return { TAG: "Eq", _0: false, @@ -185,7 +185,7 @@ function isLessThan(title, small, big) { tl: { hd: [ "=== operator: " + title, - (function (param) { + ((param) => { return { TAG: "Eq", _0: false, @@ -196,7 +196,7 @@ function isLessThan(title, small, big) { tl: { hd: [ "=== operator: " + title, - (function (param) { + ((param) => { return { TAG: "Eq", _0: false, @@ -229,7 +229,7 @@ function isEqual(title, num1, num2) { return { hd: [ "< operator: " + title, - (function (param) { + ((param) => { return { TAG: "Eq", _0: false, @@ -240,7 +240,7 @@ function isEqual(title, num1, num2) { tl: { hd: [ "<= operator: " + title, - (function (param) { + ((param) => { return { TAG: "Eq", _0: true, @@ -251,7 +251,7 @@ function isEqual(title, num1, num2) { tl: { hd: [ "> operator: " + title, - (function (param) { + ((param) => { return { TAG: "Eq", _0: false, @@ -262,7 +262,7 @@ function isEqual(title, num1, num2) { tl: { hd: [ ">= operator: " + title, - (function (param) { + ((param) => { return { TAG: "Eq", _0: true, @@ -273,7 +273,7 @@ function isEqual(title, num1, num2) { tl: { hd: [ "min: " + title, - (function (param) { + ((param) => { return { TAG: "Eq", _0: num1, @@ -284,7 +284,7 @@ function isEqual(title, num1, num2) { tl: { hd: [ "max: " + title, - (function (param) { + ((param) => { return { TAG: "Eq", _0: num1, @@ -295,7 +295,7 @@ function isEqual(title, num1, num2) { tl: { hd: [ "compare: " + title, - (function (param) { + ((param) => { return { TAG: "Eq", _0: 0, @@ -306,7 +306,7 @@ function isEqual(title, num1, num2) { tl: { hd: [ "compare: " + title, - (function (param) { + ((param) => { return { TAG: "Eq", _0: 0, @@ -317,7 +317,7 @@ function isEqual(title, num1, num2) { tl: { hd: [ "!= operator: " + title, - (function (param) { + ((param) => { return { TAG: "Eq", _0: false, @@ -328,7 +328,7 @@ function isEqual(title, num1, num2) { tl: { hd: [ "!= operator: " + title, - (function (param) { + ((param) => { return { TAG: "Eq", _0: false, @@ -339,7 +339,7 @@ function isEqual(title, num1, num2) { tl: { hd: [ "!= operator: " + title, - (function (param) { + ((param) => { return { TAG: "Eq", _0: false, @@ -350,7 +350,7 @@ function isEqual(title, num1, num2) { tl: { hd: [ "!= operator: " + title, - (function (param) { + ((param) => { return { TAG: "Eq", _0: false, @@ -361,7 +361,7 @@ function isEqual(title, num1, num2) { tl: { hd: [ "== operator: " + title, - (function (param) { + ((param) => { return { TAG: "Eq", _0: true, @@ -372,7 +372,7 @@ function isEqual(title, num1, num2) { tl: { hd: [ "== operator: " + title, - (function (param) { + ((param) => { return { TAG: "Eq", _0: true, @@ -383,7 +383,7 @@ function isEqual(title, num1, num2) { tl: { hd: [ "=== operator: " + title, - (function (param) { + ((param) => { return { TAG: "Eq", _0: true, @@ -394,7 +394,7 @@ function isEqual(title, num1, num2) { tl: { hd: [ "=== operator: " + title, - (function (param) { + ((param) => { return { TAG: "Eq", _0: true, diff --git a/jscomp/test/caml_compare_test.js b/jscomp/test/caml_compare_test.js index 2df1c2ab5b1..17775ed42c0 100644 --- a/jscomp/test/caml_compare_test.js +++ b/jscomp/test/caml_compare_test.js @@ -8,9 +8,9 @@ let Caml_js_exceptions = require("../../lib/js/caml_js_exceptions.js"); let function_equal_test; try { - function_equal_test = Caml_obj.equal((function (x) { + function_equal_test = Caml_obj.equal(((x) => { return x + 1 | 0; - }), (function (x) { + }), ((x) => { return x + 2 | 0; })); } catch (raw_exn) { @@ -22,7 +22,7 @@ let suites = { contents: { hd: [ "File \"caml_compare_test.res\", line 12, characters 5-12", - (function () { + (() => { return { TAG: "Eq", _0: true, @@ -33,7 +33,7 @@ let suites = { tl: { hd: [ "option2", - (function () { + (() => { return { TAG: "Eq", _0: true, @@ -44,7 +44,7 @@ let suites = { tl: { hd: [ "File \"caml_compare_test.res\", line 14, characters 5-12", - (function () { + (() => { return { TAG: "Eq", _0: true, @@ -58,7 +58,7 @@ let suites = { tl: { hd: [ "listeq", - (function () { + (() => { return { TAG: "Eq", _0: true, @@ -87,7 +87,7 @@ let suites = { tl: { hd: [ "listneq", - (function () { + (() => { return { TAG: "Eq", _0: true, @@ -116,7 +116,7 @@ let suites = { tl: { hd: [ "custom_u", - (function () { + (() => { return { TAG: "Eq", _0: true, @@ -155,7 +155,7 @@ let suites = { tl: { hd: [ "custom_u2", - (function () { + (() => { return { TAG: "Eq", _0: true, @@ -194,7 +194,7 @@ let suites = { tl: { hd: [ "function", - (function () { + (() => { return { TAG: "Eq", _0: true, @@ -205,7 +205,7 @@ let suites = { tl: { hd: [ "File \"caml_compare_test.res\", line 20, characters 5-12", - (function () { + (() => { return { TAG: "Eq", _0: true, @@ -216,7 +216,7 @@ let suites = { tl: { hd: [ "File \"caml_compare_test.res\", line 21, characters 5-12", - (function () { + (() => { return { TAG: "Eq", _0: true, @@ -230,7 +230,7 @@ let suites = { tl: { hd: [ "File \"caml_compare_test.res\", line 22, characters 5-12", - (function () { + (() => { return { TAG: "Eq", _0: true, @@ -244,7 +244,7 @@ let suites = { tl: { hd: [ "File \"caml_compare_test.res\", line 24, characters 6-13", - (function () { + (() => { return { TAG: "Eq", _0: true, @@ -312,7 +312,7 @@ let suites = { tl: { hd: [ "File \"caml_compare_test.res\", line 27, characters 5-12", - (function () { + (() => { return { TAG: "Eq", _0: true, @@ -332,7 +332,7 @@ let suites = { tl: { hd: [ "File \"caml_compare_test.res\", line 28, characters 5-12", - (function () { + (() => { return { TAG: "Eq", _0: true, @@ -346,7 +346,7 @@ let suites = { tl: { hd: [ "File \"caml_compare_test.res\", line 30, characters 6-13", - (function () { + (() => { return { TAG: "Eq", _0: true, @@ -414,7 +414,7 @@ let suites = { tl: { hd: [ "File \"caml_compare_test.res\", line 33, characters 5-12", - (function () { + (() => { return { TAG: "Eq", _0: false, @@ -425,7 +425,7 @@ let suites = { tl: { hd: [ "File \"caml_compare_test.res\", line 34, characters 5-12", - (function () { + (() => { return { TAG: "Eq", _0: false, @@ -436,7 +436,7 @@ let suites = { tl: { hd: [ "File \"caml_compare_test.res\", line 36, characters 6-13", - (function () { + (() => { return { TAG: "Eq", _0: false, @@ -504,7 +504,7 @@ let suites = { tl: { hd: [ "File \"caml_compare_test.res\", line 40, characters 6-13", - (function () { + (() => { return { TAG: "Eq", _0: false, @@ -572,7 +572,7 @@ let suites = { tl: { hd: [ "cmp_id", - (function () { + (() => { return { TAG: "Eq", _0: Caml_obj.compare({ @@ -589,7 +589,7 @@ let suites = { tl: { hd: [ "cmp_val", - (function () { + (() => { return { TAG: "Eq", _0: Caml_obj.compare({ @@ -604,7 +604,7 @@ let suites = { tl: { hd: [ "cmp_val2", - (function () { + (() => { return { TAG: "Eq", _0: Caml_obj.compare({ @@ -619,7 +619,7 @@ let suites = { tl: { hd: [ "cmp_empty", - (function () { + (() => { return { TAG: "Eq", _0: Caml_obj.compare({}, {}), @@ -630,7 +630,7 @@ let suites = { tl: { hd: [ "cmp_empty2", - (function () { + (() => { return { TAG: "Eq", _0: Caml_obj.compare({}, {x:1}), @@ -641,7 +641,7 @@ let suites = { tl: { hd: [ "cmp_swap", - (function () { + (() => { return { TAG: "Eq", _0: Caml_obj.compare({ @@ -658,7 +658,7 @@ let suites = { tl: { hd: [ "cmp_size", - (function () { + (() => { return { TAG: "Eq", _0: Caml_obj.compare({x:1}, {x:1, y:2}), @@ -669,7 +669,7 @@ let suites = { tl: { hd: [ "cmp_size2", - (function () { + (() => { return { TAG: "Eq", _0: Caml_obj.compare({x:1, y:2}, {x:1}), @@ -680,7 +680,7 @@ let suites = { tl: { hd: [ "cmp_order", - (function () { + (() => { return { TAG: "Eq", _0: Caml_obj.compare({ @@ -697,7 +697,7 @@ let suites = { tl: { hd: [ "cmp_order2", - (function () { + (() => { return { TAG: "Eq", _0: Caml_obj.compare({ @@ -714,7 +714,7 @@ let suites = { tl: { hd: [ "cmp_in_list", - (function () { + (() => { return { TAG: "Eq", _0: Caml_obj.compare({ @@ -735,7 +735,7 @@ let suites = { tl: { hd: [ "cmp_in_list2", - (function () { + (() => { return { TAG: "Eq", _0: Caml_obj.compare({ @@ -756,7 +756,7 @@ let suites = { tl: { hd: [ "cmp_with_list", - (function () { + (() => { return { TAG: "Eq", _0: Caml_obj.compare({ @@ -777,7 +777,7 @@ let suites = { tl: { hd: [ "cmp_with_list2", - (function () { + (() => { return { TAG: "Eq", _0: Caml_obj.compare({ @@ -798,7 +798,7 @@ let suites = { tl: { hd: [ "eq_id", - (function () { + (() => { return { TAG: "Ok", _0: Caml_obj.equal({ @@ -814,7 +814,7 @@ let suites = { tl: { hd: [ "eq_val", - (function () { + (() => { return { TAG: "Eq", _0: Caml_obj.equal({ @@ -829,7 +829,7 @@ let suites = { tl: { hd: [ "eq_val2", - (function () { + (() => { return { TAG: "Eq", _0: Caml_obj.equal({ @@ -844,7 +844,7 @@ let suites = { tl: { hd: [ "eq_empty", - (function () { + (() => { return { TAG: "Eq", _0: Caml_obj.equal({}, {}), @@ -855,7 +855,7 @@ let suites = { tl: { hd: [ "eq_empty2", - (function () { + (() => { return { TAG: "Eq", _0: Caml_obj.equal({}, {x:1}), @@ -866,7 +866,7 @@ let suites = { tl: { hd: [ "eq_swap", - (function () { + (() => { return { TAG: "Ok", _0: Caml_obj.equal({ @@ -882,7 +882,7 @@ let suites = { tl: { hd: [ "eq_size", - (function () { + (() => { return { TAG: "Eq", _0: Caml_obj.equal({x:1}, {x:1, y:2}), @@ -893,7 +893,7 @@ let suites = { tl: { hd: [ "eq_size2", - (function () { + (() => { return { TAG: "Eq", _0: Caml_obj.equal({x:1, y:2}, {x:1}), @@ -904,7 +904,7 @@ let suites = { tl: { hd: [ "eq_in_list", - (function () { + (() => { return { TAG: "Eq", _0: Caml_obj.equal({ @@ -925,7 +925,7 @@ let suites = { tl: { hd: [ "eq_in_list2", - (function () { + (() => { return { TAG: "Eq", _0: Caml_obj.equal({ @@ -946,7 +946,7 @@ let suites = { tl: { hd: [ "eq_with_list", - (function () { + (() => { return { TAG: "Eq", _0: Caml_obj.equal({ @@ -967,7 +967,7 @@ let suites = { tl: { hd: [ "eq_with_list2", - (function () { + (() => { return { TAG: "Eq", _0: Caml_obj.equal({ @@ -988,7 +988,7 @@ let suites = { tl: { hd: [ "eq_no_prototype", - (function () { + (() => { return { TAG: "Eq", _0: Caml_obj.equal({x:1}, ((function(){let o = Object.create(null);o.x = 1;return o;})())), @@ -999,7 +999,7 @@ let suites = { tl: { hd: [ "File \"caml_compare_test.res\", line 76, characters 5-12", - (function () { + (() => { return { TAG: "Eq", _0: Caml_obj.compare(null, { @@ -1013,7 +1013,7 @@ let suites = { tl: { hd: [ "File \"caml_compare_test.res\", line 77, characters 5-12", - (function () { + (() => { return { TAG: "Eq", _0: Caml_obj.compare({ @@ -1027,7 +1027,7 @@ let suites = { tl: { hd: [ "File \"caml_compare_test.res\", line 78, characters 5-12", - (function () { + (() => { return { TAG: "Eq", _0: Caml_obj.compare(null, 0), @@ -1038,7 +1038,7 @@ let suites = { tl: { hd: [ "File \"caml_compare_test.res\", line 79, characters 5-12", - (function () { + (() => { return { TAG: "Eq", _0: Caml_obj.compare(0, null), @@ -1049,7 +1049,7 @@ let suites = { tl: { hd: [ "File \"caml_compare_test.res\", line 80, characters 5-12", - (function () { + (() => { return { TAG: "Eq", _0: Caml_obj.compare(undefined, 0), @@ -1060,7 +1060,7 @@ let suites = { tl: { hd: [ "File \"caml_compare_test.res\", line 81, characters 5-12", - (function () { + (() => { return { TAG: "Eq", _0: Caml_obj.compare(0, undefined), diff --git a/jscomp/test/caml_format_test.js b/jscomp/test/caml_format_test.js index f184d33bb2b..5d8d0345801 100644 --- a/jscomp/test/caml_format_test.js +++ b/jscomp/test/caml_format_test.js @@ -79,18 +79,18 @@ let of_string = [ ]; function from_float_of_string(xs) { - return $$Array.mapi((function (i, param) { + return $$Array.mapi(((i, param) => { return Pervasives.string_of_float; }), xs); } function from_of_string(xs) { - return $$Array.to_list($$Array.mapi((function (i, param) { + return $$Array.to_list($$Array.mapi(((i, param) => { let b = param[1]; let a = param[0]; return [ "of_string " + String(i), - (function (param) { + ((param) => { return { TAG: "Eq", _0: Caml_format.int_of_string(b), @@ -144,7 +144,7 @@ let pairs$1 = [ let suites = Pervasives.$at(from_of_string(of_string), Pervasives.$at({ hd: [ "isnan_of_string", - (function () { + (() => { return { TAG: "Eq", _0: true, @@ -153,12 +153,12 @@ let suites = Pervasives.$at(from_of_string(of_string), Pervasives.$at({ }) ], tl: /* [] */0 -}, Pervasives.$at($$Array.to_list($$Array.mapi((function (i, param) { +}, Pervasives.$at($$Array.to_list($$Array.mapi(((i, param) => { let b = param[1]; let a = param[0]; return [ "infinity_of_string " + String(i), - (function () { + (() => { return { TAG: "Eq", _0: a, @@ -169,10 +169,10 @@ let suites = Pervasives.$at(from_of_string(of_string), Pervasives.$at({ }), pairs)), Pervasives.$at({ hd: [ "throw", - (function () { + (() => { return { TAG: "ThrowAny", - _0: (function () { + _0: (() => { Caml_format.float_of_string(""); }) }; @@ -181,7 +181,7 @@ let suites = Pervasives.$at(from_of_string(of_string), Pervasives.$at({ tl: { hd: [ "format_int", - (function () { + (() => { return { TAG: "Eq", _0: " 33", @@ -191,12 +191,12 @@ let suites = Pervasives.$at(from_of_string(of_string), Pervasives.$at({ ], tl: /* [] */0 } -}, $$Array.to_list($$Array.mapi((function (i, param) { +}, $$Array.to_list($$Array.mapi(((i, param) => { let b = param[1]; let a = param[0]; return [ "normal_float_of_string " + String(i), - (function () { + (() => { return { TAG: "Eq", _0: a, @@ -320,7 +320,7 @@ let float_data = [ let int64_suites_0 = [ "i64_simple7", - (function (param) { + ((param) => { return { TAG: "Eq", _0: Caml_int64.to_string([ @@ -335,7 +335,7 @@ let int64_suites_0 = [ let int64_suites_1 = { hd: [ "i64_simple15", - (function (param) { + ((param) => { return { TAG: "Eq", _0: Caml_int64.to_string(Caml_int64.neg_one), @@ -346,7 +346,7 @@ let int64_suites_1 = { tl: { hd: [ "i64_simple16", - (function (param) { + ((param) => { return { TAG: "Eq", _0: Caml_int64.to_string([ @@ -423,13 +423,13 @@ let of_string_data = [ ] ]; -Mt.from_pair_suites("Caml_format_test", Pervasives.$at(suites, Pervasives.$at($$Array.to_list($$Array.mapi((function (i, param) { +Mt.from_pair_suites("Caml_format_test", Pervasives.$at(suites, Pervasives.$at($$Array.to_list($$Array.mapi(((i, param) => { let str_result = param[2]; let f = param[1]; let fmt = param[0]; return [ "loat_format " + String(i), - (function () { + (() => { return { TAG: "Eq", _0: Caml_format.format_float(fmt, f), @@ -437,12 +437,12 @@ Mt.from_pair_suites("Caml_format_test", Pervasives.$at(suites, Pervasives.$at($$ }; }) ]; -}), float_data)), Pervasives.$at(int64_suites, $$Array.to_list($$Array.mapi((function (i, param) { +}), float_data)), Pervasives.$at(int64_suites, $$Array.to_list($$Array.mapi(((i, param) => { let b = param[1]; let a = param[0]; return [ "int64_of_string " + String(i) + " ", - (function () { + (() => { return { TAG: "Eq", _0: Caml_format.int64_of_string(b), diff --git a/jscomp/test/chain_code_test.js b/jscomp/test/chain_code_test.js index a290de375ae..b663f91d564 100644 --- a/jscomp/test/chain_code_test.js +++ b/jscomp/test/chain_code_test.js @@ -16,7 +16,7 @@ function eq(loc, x, y) { suites.contents = { hd: [ loc + (" id " + String(test_id.contents)), - (function () { + (() => { return { TAG: "Eq", _0: x, diff --git a/jscomp/test/chn_test.js b/jscomp/test/chn_test.js index a3f98dfeb4d..b3232f08976 100644 --- a/jscomp/test/chn_test.js +++ b/jscomp/test/chn_test.js @@ -18,7 +18,7 @@ function eq(loc, x, y) { suites.contents = { hd: [ loc + (" id " + String(test_id.contents)), - (function () { + (() => { return { TAG: "Eq", _0: x, @@ -35,7 +35,7 @@ console.log("你好,\n世界"); console.log("\x3f\u003f\b\t\n\v\f\r\0\"'"); function convert(s) { - return $$Array.to_list(Array.from(s, (function (x) { + return $$Array.to_list(Array.from(s, ((x) => { let x$1 = x.codePointAt(0); if (x$1 !== undefined) { return x$1; diff --git a/jscomp/test/class_type_ffi_test.js b/jscomp/test/class_type_ffi_test.js index b38f435362b..b2fea69bc85 100644 --- a/jscomp/test/class_type_ffi_test.js +++ b/jscomp/test/class_type_ffi_test.js @@ -19,7 +19,7 @@ function off2(o, a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12) { } function mk_f() { - return function (a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12) { + return (a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12) => { return a0(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12); }; } diff --git a/jscomp/test/coercion_module_alias_test.js b/jscomp/test/coercion_module_alias_test.js index 996ebb34db1..b548519390f 100644 --- a/jscomp/test/coercion_module_alias_test.js +++ b/jscomp/test/coercion_module_alias_test.js @@ -27,7 +27,7 @@ console.log(prim$2); let f = List.length; function g(x) { - return List.length(List.map((function (prim) { + return List.length(List.map(((prim) => { return prim + 1 | 0; }), x)); } diff --git a/jscomp/test/complex_if_test.js b/jscomp/test/complex_if_test.js index cdd266d2cbf..ede522bf9b0 100644 --- a/jscomp/test/complex_if_test.js +++ b/jscomp/test/complex_if_test.js @@ -122,7 +122,7 @@ function string_escaped(s) { let suites_0 = [ "complete_escape", - (function (param) { + ((param) => { return { TAG: "Eq", _0: Bytes.to_string(escaped(Bytes.of_string("\x00\x01\x02\x03\x04\x05\x06\x07\b\t\n\x0b\x0c\r\x0e\x0f\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\x7f\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xaa\xab\xac\xad\xae\xaf\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff"))), diff --git a/jscomp/test/complex_test.js b/jscomp/test/complex_test.js index 042a16c82b9..457578ed542 100644 --- a/jscomp/test/complex_test.js +++ b/jscomp/test/complex_test.js @@ -6,7 +6,7 @@ let Complex = require("../../lib/js/complex.js"); let suites_0 = [ "basic_add", - (function (param) { + ((param) => { return { TAG: "Eq", _0: { diff --git a/jscomp/test/complex_while_loop.js b/jscomp/test/complex_while_loop.js index 89e5f7a681f..4889894e3d5 100644 --- a/jscomp/test/complex_while_loop.js +++ b/jscomp/test/complex_while_loop.js @@ -4,8 +4,8 @@ function f() { let n = 0; - while ((function () { - let fib = function (x) { + while ((() => { + let fib = (x) => { if (x === 0 || x === 1) { return 1; } else { @@ -20,7 +20,7 @@ function f() { } function ff() { - while ((function () { + while ((() => { let b = 9; return (3 + b | 0) > 10; })()) { diff --git a/jscomp/test/condition_compilation_test.js b/jscomp/test/condition_compilation_test.js index 74f9d79ea3a..8429994f682 100644 --- a/jscomp/test/condition_compilation_test.js +++ b/jscomp/test/condition_compilation_test.js @@ -24,7 +24,7 @@ function eq(loc, x, y) { suites.contents = { hd: [ loc + (" id " + String(test_id.contents)), - (function () { + (() => { return { TAG: "Eq", _0: x, diff --git a/jscomp/test/const_block_test.js b/jscomp/test/const_block_test.js index e4363048341..8dcbd22ee97 100644 --- a/jscomp/test/const_block_test.js +++ b/jscomp/test/const_block_test.js @@ -57,7 +57,7 @@ let suites_0 = [ let suites_1 = { hd: [ "avoid_mutable_inline_test", - (function () { + (() => { Caml_array.set(c, 0, 3); Caml_array.set(c, 1, 4); return { diff --git a/jscomp/test/cps_test.js b/jscomp/test/cps_test.js index 31fe97de7af..f5fc09f0546 100644 --- a/jscomp/test/cps_test.js +++ b/jscomp/test/cps_test.js @@ -9,14 +9,14 @@ function test() { let v = { contents: 0 }; - let f = function (_n, _acc) { + let f = (_n, _acc) => { while (true) { let acc = _acc; let n = _n; if (n === 0) { return acc(); } - _acc = (function () { + _acc = (() => { v.contents = v.contents + n | 0; return acc(); }); @@ -24,7 +24,7 @@ function test() { continue; }; }; - f(10, (function () { + f(10, (() => { })); return v.contents; @@ -34,15 +34,15 @@ function test_closure() { let v = { contents: 0 }; - let arr = Caml_array.make(6, (function (x) { + let arr = Caml_array.make(6, ((x) => { return x; })); for (let i = 0; i <= 5; ++i) { - Caml_array.set(arr, i, (function (param) { + Caml_array.set(arr, i, ((param) => { return i; })); } - $$Array.iter((function (i) { + $$Array.iter(((i) => { v.contents = v.contents + i(0) | 0; }), arr); return v.contents; @@ -52,16 +52,16 @@ function test_closure2() { let v = { contents: 0 }; - let arr = Caml_array.make(6, (function (x) { + let arr = Caml_array.make(6, ((x) => { return x; })); for (let i = 0; i <= 5; ++i) { let j = i + i | 0; - Caml_array.set(arr, i, (function (param) { + Caml_array.set(arr, i, ((param) => { return j; })); } - $$Array.iter((function (i) { + $$Array.iter(((i) => { v.contents = v.contents + i(0) | 0; }), arr); return v.contents; @@ -70,7 +70,7 @@ function test_closure2() { Mt.from_pair_suites("Cps_test", { hd: [ "cps_test_sum", - (function () { + (() => { return { TAG: "Eq", _0: 55, @@ -81,7 +81,7 @@ Mt.from_pair_suites("Cps_test", { tl: { hd: [ "cps_test_closure", - (function () { + (() => { return { TAG: "Eq", _0: 15, @@ -92,7 +92,7 @@ Mt.from_pair_suites("Cps_test", { tl: { hd: [ "cps_test_closure2", - (function () { + (() => { return { TAG: "Eq", _0: 30, diff --git a/jscomp/test/demo_page.js b/jscomp/test/demo_page.js index 2148270da40..9a967984408 100644 --- a/jscomp/test/demo_page.js +++ b/jscomp/test/demo_page.js @@ -41,7 +41,7 @@ function f(extra) { } ReactDom.render(React.createClass({ - render: (function () { + render: (() => { return React.DOM.div({ alt: "pic" }, React.DOM.h1(undefined, "hello react"), React.DOM.h2(undefined, "type safe!")); diff --git a/jscomp/test/demo_pipe.js b/jscomp/test/demo_pipe.js index 2a83141fe62..3023c224dae 100644 --- a/jscomp/test/demo_pipe.js +++ b/jscomp/test/demo_pipe.js @@ -3,9 +3,9 @@ function register(rl) { - return rl.on("line", (function (x) { + return rl.on("line", ((x) => { console.log(x); - })).on("close", (function () { + })).on("close", (() => { console.log("finished"); })); } diff --git a/jscomp/test/digest_test.js b/jscomp/test/digest_test.js index f6f053b4cca..0de15cdac56 100644 --- a/jscomp/test/digest_test.js +++ b/jscomp/test/digest_test.js @@ -148,7 +148,7 @@ let ref = [ Mt.from_pair_suites("Digest_test", Pervasives.$at({ hd: [ "File \"digest_test.res\", line 9, characters 9-16", - (function () { + (() => { return { TAG: "Eq", _0: Digest.to_hex(Digest.string("value")), @@ -159,7 +159,7 @@ Mt.from_pair_suites("Digest_test", Pervasives.$at({ tl: { hd: [ "File \"digest_test.res\", line 11, characters 10-17", - (function () { + (() => { return { TAG: "Eq", _0: Digest.to_hex(Digest.string("The quick brown fox jumps over the lazy dog")), @@ -170,7 +170,7 @@ Mt.from_pair_suites("Digest_test", Pervasives.$at({ tl: { hd: [ "File \"digest_test.res\", line 18, characters 10-17", - (function () { + (() => { return { TAG: "Eq", _0: Digest.to_hex(Digest.string("The quick brown fox jumps over the lazy dog.")), @@ -181,7 +181,7 @@ Mt.from_pair_suites("Digest_test", Pervasives.$at({ tl: { hd: [ "File \"digest_test.res\", line 24, characters 9-16", - (function () { + (() => { return { TAG: "Eq", _0: Digest.to_hex(Digest.string("")), @@ -192,7 +192,7 @@ Mt.from_pair_suites("Digest_test", Pervasives.$at({ tl: { hd: [ "File \"digest_test.res\", line 26, characters 10-17", - (function () { + (() => { return { TAG: "Eq", _0: Digest.to_hex(Digest.string("The quick brown fox jumps over the lazy dog.The quick brown fox jumps over the lazy dog.The quick brown fox jumps over the lazy dog.The quick brown fox jumps over the lazy dog.The quick brown fox jumps over the lazy dog.The quick brown fox jumps over the lazy dog.The quick brown fox jumps over the lazy dog.The quick brown fox jumps over the lazy dog.The quick brown fox jumps over the lazy dog.The quick brown fox jumps over the lazy dog.The quick brown fox jumps over the lazy dog.The quick brown fox jumps over the lazy dog.")), @@ -203,7 +203,7 @@ Mt.from_pair_suites("Digest_test", Pervasives.$at({ tl: { hd: [ "File \"digest_test.res\", line 45, characters 10-17", - (function () { + (() => { return { TAG: "Eq", _0: Digest.to_hex(Digest.string("The quick brown fox jumps over the lazy dog.The quick brown fox jumps over the lazy dog.The quick brown fox jumps over the lazy dog.")), @@ -217,10 +217,10 @@ Mt.from_pair_suites("Digest_test", Pervasives.$at({ } } } -}, $$Array.to_list($$Array.map((function (i) { +}, $$Array.to_list($$Array.map(((i) => { return [ String(i), - (function () { + (() => { return { TAG: "Eq", _0: Digest.to_hex(Digest.string("a".repeat(i))), diff --git a/jscomp/test/div_by_zero_test.js b/jscomp/test/div_by_zero_test.js index 6d14eeef6c4..99d983b7f93 100644 --- a/jscomp/test/div_by_zero_test.js +++ b/jscomp/test/div_by_zero_test.js @@ -18,7 +18,7 @@ function eq(loc, x, y) { suites.contents = { hd: [ loc + (" id " + String(test_id.contents)), - (function () { + (() => { return { TAG: "Eq", _0: x, @@ -39,10 +39,10 @@ function add(suite) { add([ "File \"div_by_zero_test.res\", line 11, characters 7-14", - (function () { + (() => { return { TAG: "ThrowAny", - _0: (function () { + _0: (() => { Caml_int32.div(3, 0); }) }; @@ -51,10 +51,10 @@ add([ add([ "File \"div_by_zero_test.res\", line 12, characters 7-14", - (function () { + (() => { return { TAG: "ThrowAny", - _0: (function () { + _0: (() => { Caml_int32.mod_(3, 0); }) }; @@ -63,10 +63,10 @@ add([ add([ "File \"div_by_zero_test.res\", line 13, characters 7-14", - (function () { + (() => { return { TAG: "ThrowAny", - _0: (function () { + _0: (() => { Caml_int32.div(3, 0); }) }; @@ -75,10 +75,10 @@ add([ add([ "File \"div_by_zero_test.res\", line 14, characters 7-14", - (function () { + (() => { return { TAG: "ThrowAny", - _0: (function () { + _0: (() => { Caml_int32.mod_(3, 0); }) }; @@ -87,10 +87,10 @@ add([ add([ "File \"div_by_zero_test.res\", line 15, characters 7-14", - (function () { + (() => { return { TAG: "ThrowAny", - _0: (function () { + _0: (() => { Caml_int64.div([ 0, 3 @@ -102,10 +102,10 @@ add([ add([ "File \"div_by_zero_test.res\", line 16, characters 7-14", - (function () { + (() => { return { TAG: "ThrowAny", - _0: (function () { + _0: (() => { Caml_int64.mod_([ 0, 3 diff --git a/jscomp/test/dollar_escape_test.js b/jscomp/test/dollar_escape_test.js index 820c31b7eb2..695fa5b07b4 100644 --- a/jscomp/test/dollar_escape_test.js +++ b/jscomp/test/dollar_escape_test.js @@ -16,7 +16,7 @@ function eq(loc, x, y) { suites.contents = { hd: [ loc + (" id " + String(test_id.contents)), - (function () { + (() => { return { TAG: "Eq", _0: x, diff --git a/jscomp/test/earger_curry_test.js b/jscomp/test/earger_curry_test.js index be5e5b3cb08..523572b745a 100644 --- a/jscomp/test/earger_curry_test.js +++ b/jscomp/test/earger_curry_test.js @@ -6,7 +6,7 @@ let Caml_array = require("../../lib/js/caml_array.js"); let Pervasives = require("../../lib/js/pervasives.js"); function map(f, a) { - let f$1 = function (x) { + let f$1 = (x) => { return f(x); }; let l = a.length; @@ -21,7 +21,7 @@ function map(f, a) { } function init(l, f) { - let f$1 = function (x) { + let f$1 = (x) => { return f(x); }; if (l === 0) { @@ -43,7 +43,7 @@ function init(l, f) { } function fold_left(f, x, a) { - let f$1 = function (x, y) { + let f$1 = (x, y) => { return f(x, y); }; let r = x; @@ -54,13 +54,13 @@ function fold_left(f, x, a) { } function f2() { - let arr = init(30000000, (function (i) { + let arr = init(30000000, ((i) => { return i; })); - let b = map((function (i) { + let b = map(((i) => { return i + i - 1; }), arr); - let v = fold_left((function (prim0, prim1) { + let v = fold_left(((prim0, prim1) => { return prim0 + prim1; }), 0, b); console.log(Pervasives.string_of_float(v)); @@ -81,7 +81,7 @@ function eq(loc, x, y) { suites.contents = { hd: [ loc + (" id " + String(test_id.contents)), - (function () { + (() => { return { TAG: "Eq", _0: x, @@ -117,13 +117,13 @@ function add5(a0, a1, a2, a3, a4) { } function f(x) { - return function (extra, extra$1) { + return (extra, extra$1) => { return add5(x, (v.contents = v.contents + 1 | 0, 1), (v.contents = v.contents + 1 | 0, 2), extra, extra$1); }; } function g(x) { - let u = function (a, b) { + let u = (a, b) => { return add5(x, (v.contents = v.contents + 1 | 0, 1), (v.contents = v.contents + 1 | 0, 2), a, b); }; all_v.contents = { diff --git a/jscomp/test/epsilon_test.js b/jscomp/test/epsilon_test.js index 07c8ae1e657..e1d4c563a1a 100644 --- a/jscomp/test/epsilon_test.js +++ b/jscomp/test/epsilon_test.js @@ -8,7 +8,7 @@ let v = (Number.EPSILON?Number.EPSILON:2.220446049250313e-16); let suites_0 = [ "epsilon", - (function (param) { + ((param) => { return { TAG: "Eq", _0: Pervasives.epsilon_float, @@ -20,7 +20,7 @@ let suites_0 = [ let suites_1 = { hd: [ "raw_epsilon", - (function (param) { + ((param) => { return { TAG: "Eq", _0: 2.220446049250313e-16, diff --git a/jscomp/test/es6_module_test.js b/jscomp/test/es6_module_test.js index b990ee9ecbc..449421dd482 100644 --- a/jscomp/test/es6_module_test.js +++ b/jscomp/test/es6_module_test.js @@ -11,7 +11,7 @@ function length(param) { Mt.from_pair_suites("Es6_module_test", { hd: [ "list_length", - (function () { + (() => { return { TAG: "Eq", _0: List.length({ @@ -28,7 +28,7 @@ Mt.from_pair_suites("Es6_module_test", { tl: { hd: [ "length", - (function () { + (() => { return { TAG: "Eq", _0: 3, diff --git a/jscomp/test/event_ffi.js b/jscomp/test/event_ffi.js index d4144f53a30..bcc191972af 100644 --- a/jscomp/test/event_ffi.js +++ b/jscomp/test/event_ffi.js @@ -20,7 +20,7 @@ function h10(x) { } function h30(x) { - return function (a) { + return (a) => { return x(3, 3, a); }; } @@ -42,7 +42,7 @@ function a0() { } function a1() { - return function (x) { + return (x) => { return x; }; } @@ -56,7 +56,7 @@ function a3(x, y, z) { } function xx() { - return function (param) { + return (param) => { console.log(3); }; } diff --git a/jscomp/test/exception_raise_test.js b/jscomp/test/exception_raise_test.js index 70c918c0558..765e0cb2f8b 100644 --- a/jscomp/test/exception_raise_test.js +++ b/jscomp/test/exception_raise_test.js @@ -127,7 +127,7 @@ let suites = { contents: { hd: [ "File \"exception_raise_test.res\", line 120, characters 5-12", - (function () { + (() => { return { TAG: "Eq", _0: [ @@ -148,7 +148,7 @@ let suites = { tl: { hd: [ "File \"exception_raise_test.res\", line 123, characters 6-13", - (function () { + (() => { if (a1.RE_EXN_ID === Js_exn.$$Error) { return { TAG: "Eq", diff --git a/jscomp/test/exception_rebound_err_test.js b/jscomp/test/exception_rebound_err_test.js index 403e7a2b7f3..ad59a802b8a 100644 --- a/jscomp/test/exception_rebound_err_test.js +++ b/jscomp/test/exception_rebound_err_test.js @@ -18,7 +18,7 @@ function eq(loc, x, y) { suites.contents = { hd: [ loc + (" id " + String(test_id.contents)), - (function () { + (() => { return { TAG: "Eq", _0: x, diff --git a/jscomp/test/ext_array_test.js b/jscomp/test/ext_array_test.js index d3793e0f0cc..1c575766589 100644 --- a/jscomp/test/ext_array_test.js +++ b/jscomp/test/ext_array_test.js @@ -112,7 +112,7 @@ function range(from, to_) { } }); } - return $$Array.init((to_ - from | 0) + 1 | 0, (function (i) { + return $$Array.init((to_ - from | 0) + 1 | 0, ((i) => { return i + from | 0; })); } @@ -127,7 +127,7 @@ function map2i(f, a, b) { } }); } - return $$Array.mapi((function (i, a) { + return $$Array.mapi(((i, a) => { return f(i, a, b[i]); }), a); } diff --git a/jscomp/test/ext_bytes_test.js b/jscomp/test/ext_bytes_test.js index d011a861d04..cef53846f6a 100644 --- a/jscomp/test/ext_bytes_test.js +++ b/jscomp/test/ext_bytes_test.js @@ -170,7 +170,7 @@ let f = Char.chr; let a$2 = Bytes.unsafe_to_string(Bytes.init(100, f)); -let b = Bytes.init(100, (function (i) { +let b = Bytes.init(100, ((i) => { return /* '\000' */0; })); @@ -178,7 +178,7 @@ Bytes.blit_string(a$2, 10, b, 5, 10); eq("File \"ext_bytes_test.res\", line 141, characters 4-11", b, Bytes.of_string("\x00\x00\x00\x00\x00\n\x0b\x0c\r\x0e\x0f\x10\x11\x12\x13\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00")); -let s = Bytes.init(50000, (function (i) { +let s = Bytes.init(50000, ((i) => { return Char.chr(i % 137); })); diff --git a/jscomp/test/ext_filename_test.js b/jscomp/test/ext_filename_test.js index e443d103581..035ee6c5876 100644 --- a/jscomp/test/ext_filename_test.js +++ b/jscomp/test/ext_filename_test.js @@ -19,7 +19,7 @@ let node_parent = ".."; let node_current = "."; -let cwd = CamlinternalLazy.from_fun(function () { +let cwd = CamlinternalLazy.from_fun(() => { return Caml_sys.sys_getcwd(); }); @@ -33,7 +33,7 @@ function path_as_directory(x) { function absolute_path(s) { let s$1 = Filename.is_relative(s) ? Filename.concat(CamlinternalLazy.force(cwd), s) : s; - let aux = function (_s) { + let aux = (_s) => { while (true) { let s = _s; let base = Filename.basename(s); @@ -97,7 +97,7 @@ function relative_path(file_or_dir_1, file_or_dir_2) { let relevant_dir2 = file_or_dir_2.NAME === "File" ? Filename.dirname(file_or_dir_2.VAL) : file_or_dir_2.VAL; let dir1 = Ext_string_test.split(undefined, relevant_dir1, os_path_separator_char); let dir2 = Ext_string_test.split(undefined, relevant_dir2, os_path_separator_char); - let go = function (_dir1, _dir2) { + let go = (_dir1, _dir2) => { while (true) { let dir2 = _dir2; let dir1 = _dir1; @@ -106,7 +106,7 @@ function relative_path(file_or_dir_1, file_or_dir_2) { _dir1 = dir1.tl; continue; } - return Pervasives.$at(List.map((function (param) { + return Pervasives.$at(List.map(((param) => { return node_parent; }), dir2), dir1); }; @@ -141,7 +141,7 @@ function node_relative_path(node_modules_shorten, file1, dep_file) { VAL: absolute_path(file1.VAL) })) + (node_sep + Filename.basename(file2)); } - let skip = function (_i) { + let skip = (_i) => { while (true) { let i = _i; if (i >= len) { @@ -189,7 +189,7 @@ function find_package_json_dir(cwd) { return find_root_filename(cwd, Test_literals.bsconfig_json); } -let package_dir = CamlinternalLazy.from_fun(function () { +let package_dir = CamlinternalLazy.from_fun(() => { let cwd$1 = CamlinternalLazy.force(cwd); return find_root_filename(cwd$1, Test_literals.bsconfig_json); }); @@ -264,7 +264,7 @@ function rel_normalized_absolute_path(from, to_) { } let xs = xss.tl; if (!yss) { - return List.fold_left((function (acc, param) { + return List.fold_left(((acc, param) => { return Filename.concat(acc, Ext_string_test.parent_dir_lit); }), Ext_string_test.parent_dir_lit, xs); } @@ -273,7 +273,7 @@ function rel_normalized_absolute_path(from, to_) { _xss = xs; continue; } - let start = List.fold_left((function (acc, param) { + let start = List.fold_left(((acc, param) => { return Filename.concat(acc, Ext_string_test.parent_dir_lit); }), Ext_string_test.parent_dir_lit, xs); return List.fold_left(Filename.concat, start, yss); @@ -281,14 +281,14 @@ function rel_normalized_absolute_path(from, to_) { } function normalize_absolute_path(x) { - let drop_if_exist = function (xs) { + let drop_if_exist = (xs) => { if (xs) { return xs.tl; } else { return /* [] */0; } }; - let normalize_list = function (_acc, _paths) { + let normalize_list = (_acc, _paths) => { while (true) { let paths = _paths; let acc = _acc; @@ -347,7 +347,7 @@ function get_extension(x) { let simple_convert_node_path_to_os_path; if (Sys.unix) { - simple_convert_node_path_to_os_path = (function (x) { + simple_convert_node_path_to_os_path = ((x) => { return x; }); } else if (Sys.win32 || false) { diff --git a/jscomp/test/ext_list_test.js b/jscomp/test/ext_list_test.js index 34f7d88f783..14edc5bf682 100644 --- a/jscomp/test/ext_list_test.js +++ b/jscomp/test/ext_list_test.js @@ -29,7 +29,7 @@ function excludes(p, l) { let excluded = { contents: false }; - let aux = function (_accu, _x) { + let aux = (_accu, _x) => { while (true) { let x = _x; let accu = _accu; @@ -69,7 +69,7 @@ function exclude_with_fact(p, l) { let excluded = { contents: undefined }; - let aux = function (_accu, _x) { + let aux = (_accu, _x) => { while (true) { let x = _x; let accu = _accu; @@ -105,7 +105,7 @@ function exclude_with_fact2(p1, p2, l) { let excluded2 = { contents: undefined }; - let aux = function (_accu, _x) { + let aux = (_accu, _x) => { while (true) { let x = _x; let accu = _accu; @@ -161,7 +161,7 @@ function same_length(_xs, _ys) { } function filter_mapi(f, xs) { - let aux = function (_i, _xs) { + let aux = (_i, _xs) => { while (true) { let xs = _xs; let i = _i; @@ -223,7 +223,7 @@ function filter_map2(f, _xs, _ys) { } function filter_map2i(f, xs, ys) { - let aux = function (_i, _xs, _ys) { + let aux = (_i, _xs, _ys) => { while (true) { let ys = _ys; let xs = _xs; @@ -648,7 +648,7 @@ function for_all_opt(p, _x) { } function fold(f, l, init) { - return List.fold_left((function (acc, i) { + return List.fold_left(((acc, i) => { return f(i, init); }), init, l); } @@ -774,7 +774,7 @@ function split_map(f, xs) { function reduce_from_right(fn, lst) { let match = List.rev(lst); if (match) { - return List.fold_left((function (x, y) { + return List.fold_left(((x, y) => { return fn(y, x); }), match.hd, match.tl); } diff --git a/jscomp/test/ext_string_test.js b/jscomp/test/ext_string_test.js index c73d6f37a09..a5321cf0c0a 100644 --- a/jscomp/test/ext_string_test.js +++ b/jscomp/test/ext_string_test.js @@ -54,7 +54,7 @@ function split_by(keep_emptyOpt, is_delim, str) { function trim(s) { let i = 0; let j = s.length; - while ((function () { + while ((() => { let tmp = false; if (i < j) { let u = s.codePointAt(i); @@ -65,7 +65,7 @@ function trim(s) { i = i + 1 | 0; }; let k = j - 1 | 0; - while ((function () { + while ((() => { let tmp = false; if (k >= i) { let u = s.codePointAt(k); @@ -82,14 +82,14 @@ function split(keep_empty, str, on) { if (str === "") { return /* [] */0; } else { - return split_by(keep_empty, (function (x) { + return split_by(keep_empty, ((x) => { return x === on; }), str); } } function quick_split_by_ws(str) { - return split_by(false, (function (x) { + return split_by(false, ((x) => { if (x === /* '\t' */9 || x === /* '\n' */10) { return true; } else { @@ -147,7 +147,7 @@ function ends_with_then_chop(s, beg) { } function check_any_suffix_case(s, suffixes) { - return List.exists((function (x) { + return List.exists(((x) => { return ends_with(s, x); }), suffixes); } @@ -169,7 +169,7 @@ function check_any_suffix_case_then_chop(s, suffixes) { } function escaped(s) { - let needs_escape = function (_i) { + let needs_escape = (_i) => { while (true) { let i = _i; if (i >= s.length) { @@ -449,7 +449,7 @@ function is_valid_module_file(s) { } else if (match < 65) { return false; } - return unsafe_for_all_range(s, 1, len - 1 | 0, (function (x) { + return unsafe_for_all_range(s, 1, len - 1 | 0, ((x) => { if (x >= 65) { if (x > 96 || x < 91) { return x < 123; @@ -481,7 +481,7 @@ function is_valid_npm_package_name(s) { } else if (match !== 64) { return false; } - return unsafe_for_all_range(s, 1, len - 1 | 0, (function (x) { + return unsafe_for_all_range(s, 1, len - 1 | 0, ((x) => { if (x >= 58) { if (x >= 97) { return x < 123; @@ -575,7 +575,7 @@ function replace_slash_backward(x) { if (unsafe_no_char(x, /* '/' */47, 0, len - 1 | 0)) { return x; } else { - return $$String.map((function (x) { + return $$String.map(((x) => { if (x !== 47) { return x; } else { @@ -590,7 +590,7 @@ function replace_backward_slash(x) { if (unsafe_no_char(x, /* '\\' */92, 0, len - 1 | 0)) { return x; } else { - return $$String.map((function (x) { + return $$String.map(((x) => { if (x !== 92) { return x; } else { diff --git a/jscomp/test/extensible_variant_test.js b/jscomp/test/extensible_variant_test.js index dbebc62d58a..676c9d8d62d 100644 --- a/jscomp/test/extensible_variant_test.js +++ b/jscomp/test/extensible_variant_test.js @@ -38,7 +38,7 @@ function to_int(x) { let suites_0 = [ "test_int", - (function (param) { + ((param) => { return { TAG: "Eq", _0: 3, @@ -54,7 +54,7 @@ let suites_0 = [ let suites_1 = { hd: [ "test_int2", - (function (param) { + ((param) => { return { TAG: "Eq", _0: 0, @@ -69,7 +69,7 @@ let suites_1 = { tl: { hd: [ "test_string", - (function (param) { + ((param) => { return { TAG: "Eq", _0: -1, diff --git a/jscomp/test/ffi_arity_test.js b/jscomp/test/ffi_arity_test.js index eb3eb307603..9b2cce2d160 100644 --- a/jscomp/test/ffi_arity_test.js +++ b/jscomp/test/ffi_arity_test.js @@ -5,11 +5,11 @@ let Mt = require("./mt.js"); function f(v) { if (v % 2 === 0) { - return function (v) { + return (v) => { return Math.imul(v, v); }; } else { - return function (v) { + return (v) => { return v + v | 0; }; } @@ -19,7 +19,7 @@ let v = [ 1, 2, 3 -].map(function (a, b) { +].map((a, b) => { return f(a)(b); }); @@ -27,7 +27,7 @@ let vv = [ 1, 2, 3 -].map(function (a, b) { +].map((a, b) => { return a + b | 0; }); @@ -35,7 +35,7 @@ let hh = [ "1", "2", "3" -].map(function (x) { +].map((x) => { return parseInt(x); }); @@ -70,7 +70,7 @@ fff(); Mt.from_pair_suites("Ffi_arity_test", { hd: [ "File \"ffi_arity_test.res\", line 51, characters 7-14", - (function () { + (() => { return { TAG: "Eq", _0: v, @@ -85,7 +85,7 @@ Mt.from_pair_suites("Ffi_arity_test", { tl: { hd: [ "File \"ffi_arity_test.res\", line 52, characters 7-14", - (function () { + (() => { return { TAG: "Eq", _0: vv, @@ -100,7 +100,7 @@ Mt.from_pair_suites("Ffi_arity_test", { tl: { hd: [ "File \"ffi_arity_test.res\", line 53, characters 7-14", - (function () { + (() => { return { TAG: "Eq", _0: hh, diff --git a/jscomp/test/ffi_array_test.js b/jscomp/test/ffi_array_test.js index 1fa6dbda0f0..9000ef2e800 100644 --- a/jscomp/test/ffi_array_test.js +++ b/jscomp/test/ffi_array_test.js @@ -16,7 +16,7 @@ function eq(loc, x, y) { suites.contents = { hd: [ loc + (" id " + String(test_id.contents)), - (function () { + (() => { return { TAG: "Eq", _0: x, @@ -33,7 +33,7 @@ eq("File \"ffi_array_test.res\", line 11, characters 12-19", [ 2, 3, 4 -].map(function (x) { +].map((x) => { return x + 1 | 0; }), [ 2, diff --git a/jscomp/test/ffi_js_test.js b/jscomp/test/ffi_js_test.js index b97a7f580d9..6aedb7d4216 100644 --- a/jscomp/test/ffi_js_test.js +++ b/jscomp/test/ffi_js_test.js @@ -27,7 +27,7 @@ function eq(loc, param) { suites.contents = { hd: [ loc + (" id " + String(test_id.contents)), - (function () { + (() => { return { TAG: "Eq", _0: x, diff --git a/jscomp/test/ffi_splice_test.js b/jscomp/test/ffi_splice_test.js index 7f52cffcc20..f888b374a27 100644 --- a/jscomp/test/ffi_splice_test.js +++ b/jscomp/test/ffi_splice_test.js @@ -16,7 +16,7 @@ function eq(loc, x, y) { suites.contents = { hd: [ loc + (" id " + String(test_id.contents)), - (function () { + (() => { return { TAG: "Eq", _0: x, diff --git a/jscomp/test/flexible_array_test.js b/jscomp/test/flexible_array_test.js index 8ce92b71c22..139a2008d34 100644 --- a/jscomp/test/flexible_array_test.js +++ b/jscomp/test/flexible_array_test.js @@ -269,10 +269,10 @@ function sort(s) { return s; } let head = get(s, 0); - let larger = sort(filter_from(1, (function (x) { + let larger = sort(filter_from(1, ((x) => { return Caml_obj.greaterthan(x, head); }), s)); - let smaller = sort(filter_from(1, (function (x) { + let smaller = sort(filter_from(1, ((x) => { return Caml_obj.lessequal(x, head); }), s)); return append(smaller, push_front(larger, head)); @@ -335,11 +335,11 @@ if (!$eq$tilde(sort(u), [ }); } -let v = $$Array.init(500, (function (i) { +let v = $$Array.init(500, ((i) => { return 500 - i | 0; })); -$eq$tilde(sort(of_array(v)), $$Array.init(500, (function (i) { +$eq$tilde(sort(of_array(v)), $$Array.init(500, ((i) => { return i + 1 | 0; }))); diff --git a/jscomp/test/float_of_bits_test.js b/jscomp/test/float_of_bits_test.js index 7b6747eae25..1e34c7819d2 100644 --- a/jscomp/test/float_of_bits_test.js +++ b/jscomp/test/float_of_bits_test.js @@ -25,13 +25,13 @@ let int32_pairs = [ ]; function from_pairs(pair) { - return List.concat($$Array.to_list($$Array.mapi((function (i, param) { + return List.concat($$Array.to_list($$Array.mapi(((i, param) => { let f = param[1]; let i32 = param[0]; return { hd: [ "int32_float_of_bits " + i, - (function (param) { + ((param) => { return { TAG: "Eq", _0: Caml_float.int_float_of_bits(i32), @@ -42,7 +42,7 @@ function from_pairs(pair) { tl: { hd: [ "int32_bits_of_float " + i, - (function (param) { + ((param) => { return { TAG: "Eq", _0: Caml_float.int_bits_of_float(f), @@ -59,7 +59,7 @@ function from_pairs(pair) { let suites = Pervasives.$at({ hd: [ "one", - (function () { + (() => { return { TAG: "Eq", _0: Caml_int64.bits_of_float(1.0), @@ -70,7 +70,7 @@ let suites = Pervasives.$at({ tl: { hd: [ "two", - (function () { + (() => { return { TAG: "Eq", _0: Caml_int64.float_of_bits(one_float), diff --git a/jscomp/test/float_test.js b/jscomp/test/float_test.js index 7998fe9d090..cec7b9e76bf 100644 --- a/jscomp/test/float_test.js +++ b/jscomp/test/float_test.js @@ -118,12 +118,12 @@ let results = $$Array.append([ ]); function from_pairs(ps) { - return $$Array.to_list($$Array.mapi((function (i, param) { + return $$Array.to_list($$Array.mapi(((i, param) => { let b = param[1]; let a = param[0]; return [ "pair " + i, - (function (param) { + ((param) => { return { TAG: "Approx", _0: a, @@ -191,7 +191,7 @@ eq("File \"float_test.res\", line 62, characters 4-11", [ true ]); -eq("File \"float_test.res\", line 71, characters 4-11", $$Array.map((function (x) { +eq("File \"float_test.res\", line 71, characters 4-11", $$Array.map(((x) => { if (x > 0) { return 1; } else if (x < 0) { @@ -199,7 +199,7 @@ eq("File \"float_test.res\", line 71, characters 4-11", $$Array.map((function (x } else { return 0; } -}), $$Array.map((function (param) { +}), $$Array.map(((param) => { return Caml.float_compare(param[0], param[1]); }), [ [ @@ -325,7 +325,7 @@ let a = match$4[0]; Mt.from_pair_suites("Float_test", Pervasives.$at({ hd: [ "mod_float", - (function () { + (() => { return { TAG: "Approx", _0: 3.2 % 0.5, @@ -336,7 +336,7 @@ Mt.from_pair_suites("Float_test", Pervasives.$at({ tl: { hd: [ "modf_float1", - (function () { + (() => { return { TAG: "Approx", _0: a, @@ -347,7 +347,7 @@ Mt.from_pair_suites("Float_test", Pervasives.$at({ tl: { hd: [ "modf_float2", - (function () { + (() => { return { TAG: "Approx", _0: b, @@ -358,7 +358,7 @@ Mt.from_pair_suites("Float_test", Pervasives.$at({ tl: { hd: [ "int_of_float", - (function () { + (() => { return { TAG: "Eq", _0: 3, diff --git a/jscomp/test/for_loop_test.js b/jscomp/test/for_loop_test.js index 55b6cf0e270..26000477487 100644 --- a/jscomp/test/for_loop_test.js +++ b/jscomp/test/for_loop_test.js @@ -9,18 +9,18 @@ function for_3(x) { let v = { contents: 0 }; - let arr = $$Array.map((function (param) { - return function () { + let arr = $$Array.map(((param) => { + return () => { }; }), x); for (let i = 0, i_finish = x.length; i < i_finish; ++i) { let j = (i << 1); - Caml_array.set(arr, i, (function () { + Caml_array.set(arr, i, (() => { v.contents = v.contents + j | 0; })); } - $$Array.iter((function (x) { + $$Array.iter(((x) => { x(); }), arr); return v.contents; @@ -30,19 +30,19 @@ function for_4(x) { let v = { contents: 0 }; - let arr = $$Array.map((function (param) { - return function () { + let arr = $$Array.map(((param) => { + return () => { }; }), x); for (let i = 0, i_finish = x.length; i < i_finish; ++i) { let j = (i << 1); let k = (j << 1); - Caml_array.set(arr, i, (function () { + Caml_array.set(arr, i, (() => { v.contents = v.contents + k | 0; })); } - $$Array.iter((function (x) { + $$Array.iter(((x) => { x(); }), arr); return v.contents; @@ -52,18 +52,18 @@ function for_5(x, u) { let v = { contents: 0 }; - let arr = $$Array.map((function (param) { - return function () { + let arr = $$Array.map(((param) => { + return () => { }; }), x); for (let i = 0, i_finish = x.length; i < i_finish; ++i) { let k = Math.imul((u << 1), u); - Caml_array.set(arr, i, (function () { + Caml_array.set(arr, i, (() => { v.contents = v.contents + k | 0; })); } - $$Array.iter((function (x) { + $$Array.iter(((x) => { x(); }), arr); return v.contents; @@ -73,8 +73,8 @@ function for_6(x, u) { let v = { contents: 0 }; - let arr = $$Array.map((function (param) { - return function () { + let arr = $$Array.map(((param) => { + return () => { }; }), x); @@ -95,13 +95,13 @@ function for_6(x, u) { let k = Math.imul((u << 1), u); let h = (v5.contents << 1); v2.contents = v2.contents + 1 | 0; - Caml_array.set(arr, i, (function () { + Caml_array.set(arr, i, (() => { v.contents = (((((v.contents + k | 0) + v2.contents | 0) + v4.contents | 0) + v5.contents | 0) + h | 0) + u | 0; })); } inspect_3 = v2.contents; } - $$Array.iter((function (x) { + $$Array.iter(((x) => { x(); }), arr); return [ @@ -116,17 +116,17 @@ function for_7() { let v = { contents: 0 }; - let arr = Caml_array.make(21, (function () { + let arr = Caml_array.make(21, (() => { })); for (let i = 0; i <= 6; ++i) { for (let j = 0; j <= 2; ++j) { - Caml_array.set(arr, Math.imul(i, 3) + j | 0, (function () { + Caml_array.set(arr, Math.imul(i, 3) + j | 0, (() => { v.contents = (v.contents + i | 0) + j | 0; })); } } - $$Array.iter((function (f) { + $$Array.iter(((f) => { f(); }), arr); return v.contents; @@ -136,19 +136,19 @@ function for_8() { let v = { contents: 0 }; - let arr = Caml_array.make(21, (function () { + let arr = Caml_array.make(21, (() => { })); for (let i = 0; i <= 6; ++i) { let k = (i << 1); for (let j = 0; j <= 2; ++j) { let h = i + j | 0; - Caml_array.set(arr, Math.imul(i, 3) + j | 0, (function () { + Caml_array.set(arr, Math.imul(i, 3) + j | 0, (() => { v.contents = (((v.contents + i | 0) + j | 0) + h | 0) + k | 0; })); } } - $$Array.iter((function (f) { + $$Array.iter(((f) => { f(); }), arr); return v.contents; @@ -158,7 +158,7 @@ function for_9() { let v = { contents: /* [] */0 }; - let collect = function (x) { + let collect = (x) => { v.contents = { hd: x, tl: v.contents @@ -170,10 +170,10 @@ function for_9() { let vv2 = { contents: 0 }; - let arr = Caml_array.make(4, (function () { + let arr = Caml_array.make(4, (() => { })); - let arr2 = Caml_array.make(2, (function () { + let arr2 = Caml_array.make(2, (() => { })); for (let i = 0; i <= 1; ++i) { @@ -184,18 +184,18 @@ function for_9() { for (let j = 0; j <= 1; ++j) { v$1.contents = v$1.contents + 1 | 0; collect(v$1.contents); - Caml_array.set(arr, (i << 1) + j | 0, (function () { + Caml_array.set(arr, (i << 1) + j | 0, (() => { vv.contents = vv.contents + v$1.contents | 0; })); } - Caml_array.set(arr2, i, (function () { + Caml_array.set(arr2, i, (() => { vv2.contents = vv2.contents + v$1.contents | 0; })); } - $$Array.iter((function (f) { + $$Array.iter(((f) => { f(); }), arr); - $$Array.iter((function (f) { + $$Array.iter(((f) => { f(); }), arr2); return [[ @@ -207,7 +207,7 @@ function for_9() { let suites_0 = [ "for_loop_test_3", - (function (param) { + ((param) => { return { TAG: "Eq", _0: 90, @@ -219,7 +219,7 @@ let suites_0 = [ let suites_1 = { hd: [ "for_loop_test_4", - (function (param) { + ((param) => { return { TAG: "Eq", _0: 180, @@ -230,7 +230,7 @@ let suites_1 = { tl: { hd: [ "for_loop_test_5", - (function (param) { + ((param) => { return { TAG: "Eq", _0: 2420, @@ -241,7 +241,7 @@ let suites_1 = { tl: { hd: [ "for_loop_test_6", - (function (param) { + ((param) => { return { TAG: "Eq", _0: [ @@ -257,7 +257,7 @@ let suites_1 = { tl: { hd: [ "for_loop_test_7", - (function (param) { + ((param) => { return { TAG: "Eq", _0: 84, @@ -268,7 +268,7 @@ let suites_1 = { tl: { hd: [ "for_loop_test_8", - (function (param) { + ((param) => { return { TAG: "Eq", _0: 294, @@ -279,7 +279,7 @@ let suites_1 = { tl: { hd: [ "for_loop_test_9", - (function (param) { + ((param) => { return { TAG: "Eq", _0: [[ diff --git a/jscomp/test/for_side_effect_test.js b/jscomp/test/for_side_effect_test.js index ad61a8bb8d8..77a3541244c 100644 --- a/jscomp/test/for_side_effect_test.js +++ b/jscomp/test/for_side_effect_test.js @@ -21,7 +21,7 @@ function test2() { let suites_0 = [ "for_order", - (function (param) { + ((param) => { return { TAG: "Eq", _0: 10, diff --git a/jscomp/test/format_test.js b/jscomp/test/format_test.js index e7dbc96ed5c..16873b760ea 100644 --- a/jscomp/test/format_test.js +++ b/jscomp/test/format_test.js @@ -20,7 +20,7 @@ function eq(loc, x, y) { suites.contents = { hd: [ loc + (" id " + String(test_id.contents)), - (function () { + (() => { return { TAG: "Eq", _0: x, @@ -77,7 +77,7 @@ eq("File \"format_test.res\", line 45, characters 5-12", (1 + 4095 / 4096) * 8, eq("File \"format_test.res\", line 46, characters 5-12", (1 + 65535 / 65536) * 8, 15.9998779296875); function f(loc, ls) { - List.iter((function (param) { + List.iter(((param) => { eq(loc, Caml_format.float_of_string(param[0]), param[1]); }), ls); } @@ -107,7 +107,7 @@ function sl(f) { } function aux_list(loc, ls) { - List.iter((function (param) { + List.iter(((param) => { eq(loc, Caml_format.hexstring_of_float(param[0], -1, /* '-' */45), param[1]); }), ls); } @@ -186,7 +186,7 @@ scan_float("File \"format_test.res\", line 80, characters 13-20", "0x3f.p1", 126 scan_float("File \"format_test.res\", line 81, characters 13-20", "0x1.3333333333333p-2", 0.3); -List.iter((function (param) { +List.iter(((param) => { scan_float("File \"format_test.res\", line 82, characters 35-42", param[1], param[0]); }), literals); diff --git a/jscomp/test/functor_app_test.js b/jscomp/test/functor_app_test.js index 53402b6e292..6b744b7ca3f 100644 --- a/jscomp/test/functor_app_test.js +++ b/jscomp/test/functor_app_test.js @@ -18,7 +18,7 @@ function eq(loc, x, y) { suites.contents = { hd: [ loc + (" id " + String(test_id.contents)), - (function () { + (() => { return { TAG: "Eq", _0: x, diff --git a/jscomp/test/functor_def.js b/jscomp/test/functor_def.js index 8c1046548d5..756262d85a6 100644 --- a/jscomp/test/functor_def.js +++ b/jscomp/test/functor_def.js @@ -16,7 +16,7 @@ function $$return() { } function Make(U) { - let h = function (x, x$1) { + let h = (x, x$1) => { console.log(f(x$1, x$1)); return U.say(x$1, x$1); }; diff --git a/jscomp/test/functor_ffi.js b/jscomp/test/functor_ffi.js index 0d7c442e2e5..a5f95c44a47 100644 --- a/jscomp/test/functor_ffi.js +++ b/jscomp/test/functor_ffi.js @@ -4,7 +4,7 @@ let Caml_option = require("../../lib/js/caml_option.js"); function Make(S) { - let opt_get = function (f, i) { + let opt_get = (f, i) => { return Caml_option.undefined_to_opt(f[i]); }; return { diff --git a/jscomp/test/functors.js b/jscomp/test/functors.js index f56f95b9966..d7a7df9cd9f 100644 --- a/jscomp/test/functors.js +++ b/jscomp/test/functors.js @@ -3,10 +3,10 @@ function O(X) { - let cow = function (x) { + let cow = (x) => { return X.foo(x); }; - let sheep = function (x) { + let sheep = (x) => { return 1 + X.foo(x) | 0; }; return { @@ -16,10 +16,10 @@ function O(X) { } function F(X, Y) { - let cow = function (x) { + let cow = (x) => { return Y.foo(X.foo(x)); }; - let sheep = function (x) { + let sheep = (x) => { return 1 + Y.foo(X.foo(x)) | 0; }; return { @@ -29,7 +29,7 @@ function F(X, Y) { } function F1(X, Y) { - let sheep = function (x) { + let sheep = (x) => { return 1 + Y.foo(X.foo(x)) | 0; }; return { @@ -38,7 +38,7 @@ function F1(X, Y) { } function F2(X, Y) { - let sheep = function (x) { + let sheep = (x) => { return 1 + Y.foo(X.foo(x)) | 0; }; return { @@ -47,8 +47,8 @@ function F2(X, Y) { } let M = { - F: (function (funarg, funarg$1) { - let sheep = function (x) { + F: ((funarg, funarg$1) => { + let sheep = (x) => { return 1 + funarg$1.foo(funarg.foo(x)) | 0; }; return { diff --git a/jscomp/test/genlex_test.js b/jscomp/test/genlex_test.js index 0638104f8c6..6a5c74618a1 100644 --- a/jscomp/test/genlex_test.js +++ b/jscomp/test/genlex_test.js @@ -59,7 +59,7 @@ function to_list(s) { let suites_0 = [ "lexer_stream_genlex", - (function (param) { + ((param) => { return { TAG: "Eq", _0: { diff --git a/jscomp/test/global_exception_regression_test.js b/jscomp/test/global_exception_regression_test.js index 443bf1ee900..e5a5c87f9f8 100644 --- a/jscomp/test/global_exception_regression_test.js +++ b/jscomp/test/global_exception_regression_test.js @@ -17,7 +17,7 @@ let s = { let suites_0 = [ "not_found_equal", - (function (param) { + ((param) => { return { TAG: "Eq", _0: u, @@ -29,7 +29,7 @@ let suites_0 = [ let suites_1 = { hd: [ "not_found_not_equal_end_of_file", - (function (param) { + ((param) => { return { TAG: "Neq", _0: u, diff --git a/jscomp/test/global_module_alias_test.js b/jscomp/test/global_module_alias_test.js index 99890d07ea3..170a91f701c 100644 --- a/jscomp/test/global_module_alias_test.js +++ b/jscomp/test/global_module_alias_test.js @@ -17,7 +17,7 @@ function eq(loc, x, y) { suites.contents = { hd: [ loc + (" id " + String(test_id.contents)), - (function () { + (() => { return { TAG: "Eq", _0: x, diff --git a/jscomp/test/google_closure_test.js b/jscomp/test/google_closure_test.js index 488df56280c..41457ae4f3a 100644 --- a/jscomp/test/google_closure_test.js +++ b/jscomp/test/google_closure_test.js @@ -7,7 +7,7 @@ let Test_google_closure = require("./test_google_closure.js"); Mt.from_pair_suites("Closure", { hd: [ "partial", - (function () { + (() => { return { TAG: "Eq", _0: [ diff --git a/jscomp/test/gpr496_test.js b/jscomp/test/gpr496_test.js index 89eb671d8d5..039f6601733 100644 --- a/jscomp/test/gpr496_test.js +++ b/jscomp/test/gpr496_test.js @@ -17,7 +17,7 @@ function eq(loc, x, y) { suites.contents = { hd: [ loc + (" id " + String(test_id.contents)), - (function () { + (() => { return { TAG: "Eq", _0: x, diff --git a/jscomp/test/gpr_1154_test.js b/jscomp/test/gpr_1154_test.js index b951f6fc97e..bad92814257 100644 --- a/jscomp/test/gpr_1154_test.js +++ b/jscomp/test/gpr_1154_test.js @@ -18,7 +18,7 @@ function eq(loc, x, y) { suites.contents = { hd: [ loc + (" id " + String(test_id.contents)), - (function () { + (() => { return { TAG: "Eq", _0: x, diff --git a/jscomp/test/gpr_1409_test.js b/jscomp/test/gpr_1409_test.js index ec0b717f463..32016b7976f 100644 --- a/jscomp/test/gpr_1409_test.js +++ b/jscomp/test/gpr_1409_test.js @@ -19,7 +19,7 @@ function eq(loc, x, y) { suites.contents = { hd: [ loc + (" id " + String(test_id.contents)), - (function () { + (() => { return { TAG: "Eq", _0: x, @@ -46,7 +46,7 @@ function map(f, x) { function make(foo, param) { let tmp = {}; - let tmp$1 = map((function (prim) { + let tmp$1 = map(((prim) => { return String(prim); }), foo); if (tmp$1 !== undefined) { diff --git a/jscomp/test/gpr_1423_app_test.js b/jscomp/test/gpr_1423_app_test.js index da8edcbc0ed..16eb50ef179 100644 --- a/jscomp/test/gpr_1423_app_test.js +++ b/jscomp/test/gpr_1423_app_test.js @@ -16,7 +16,7 @@ function eq(loc, x, y) { suites.contents = { hd: [ loc + (" id " + String(test_id.contents)), - (function () { + (() => { return { TAG: "Eq", _0: x, @@ -32,7 +32,7 @@ function foo(f) { console.log(f("a1", undefined)); } -foo(function (none, extra) { +foo((none, extra) => { return none + "a2"; }); diff --git a/jscomp/test/gpr_1438.js b/jscomp/test/gpr_1438.js index 9d8750c886e..2b33b505ce6 100644 --- a/jscomp/test/gpr_1438.js +++ b/jscomp/test/gpr_1438.js @@ -16,7 +16,7 @@ function actionKey(key, a, b, c, d, e) { case 118 : return a; } - return function (param) { + return (param) => { }; } diff --git a/jscomp/test/gpr_1503_test.js b/jscomp/test/gpr_1503_test.js index 41af088b96f..d803eb5dd31 100644 --- a/jscomp/test/gpr_1503_test.js +++ b/jscomp/test/gpr_1503_test.js @@ -19,7 +19,7 @@ function eq(loc, x, y) { suites.contents = { hd: [ loc + (" id " + String(test_id.contents)), - (function () { + (() => { return { TAG: "Eq", _0: x, diff --git a/jscomp/test/gpr_1539_test.js b/jscomp/test/gpr_1539_test.js index 3cd77844335..67a95af5756 100644 --- a/jscomp/test/gpr_1539_test.js +++ b/jscomp/test/gpr_1539_test.js @@ -22,7 +22,7 @@ Caml_module.update_mod({ "add" ]] }, Point, { - add: (function (prim0, prim1) { + add: ((prim0, prim1) => { return prim0.add(prim1); }) }); diff --git a/jscomp/test/gpr_1658_test.js b/jscomp/test/gpr_1658_test.js index 22768108a36..4c440accde2 100644 --- a/jscomp/test/gpr_1658_test.js +++ b/jscomp/test/gpr_1658_test.js @@ -17,7 +17,7 @@ function eq(loc, x, y) { suites.contents = { hd: [ loc + (" id " + String(test_id.contents)), - (function () { + (() => { return { TAG: "Eq", _0: x, diff --git a/jscomp/test/gpr_1667_test.js b/jscomp/test/gpr_1667_test.js index a1f9c444939..15519d83e8a 100644 --- a/jscomp/test/gpr_1667_test.js +++ b/jscomp/test/gpr_1667_test.js @@ -16,7 +16,7 @@ function eq(loc, x, y) { suites.contents = { hd: [ loc + (" id " + String(test_id.contents)), - (function () { + (() => { return { TAG: "Eq", _0: x, diff --git a/jscomp/test/gpr_1692_test.js b/jscomp/test/gpr_1692_test.js index 884c49a7dc6..edec96040e7 100644 --- a/jscomp/test/gpr_1692_test.js +++ b/jscomp/test/gpr_1692_test.js @@ -2,7 +2,7 @@ 'use strict'; -((function (f) { +(((f) => { return 0; })("")); diff --git a/jscomp/test/gpr_1701_test.js b/jscomp/test/gpr_1701_test.js index 81226bbfcaa..dbd44e2ca67 100644 --- a/jscomp/test/gpr_1701_test.js +++ b/jscomp/test/gpr_1701_test.js @@ -83,7 +83,7 @@ function read_lines2(inc) { } function read_lines3(inc) { - let loop = function (acc) { + let loop = (acc) => { try { let l = input_line(inc); return loop({ diff --git a/jscomp/test/gpr_1716_test.js b/jscomp/test/gpr_1716_test.js index ae4d1622506..21b7bfe6906 100644 --- a/jscomp/test/gpr_1716_test.js +++ b/jscomp/test/gpr_1716_test.js @@ -17,7 +17,7 @@ function eq(loc, x, y) { suites.contents = { hd: [ loc + (" id " + String(test_id.contents)), - (function () { + (() => { return { TAG: "Eq", _0: x, diff --git a/jscomp/test/gpr_1728_test.js b/jscomp/test/gpr_1728_test.js index 90f5f5fa50e..2d5f21a274a 100644 --- a/jscomp/test/gpr_1728_test.js +++ b/jscomp/test/gpr_1728_test.js @@ -17,7 +17,7 @@ function eq(loc, x, y) { suites.contents = { hd: [ loc + (" id " + String(test_id.contents)), - (function () { + (() => { return { TAG: "Eq", _0: x, diff --git a/jscomp/test/gpr_1749_test.js b/jscomp/test/gpr_1749_test.js index c0df289865f..b876b7424d7 100644 --- a/jscomp/test/gpr_1749_test.js +++ b/jscomp/test/gpr_1749_test.js @@ -16,7 +16,7 @@ function eq(loc, x, y) { suites.contents = { hd: [ loc + (" id " + String(test_id.contents)), - (function () { + (() => { return { TAG: "Eq", _0: x, diff --git a/jscomp/test/gpr_1760_test.js b/jscomp/test/gpr_1760_test.js index 070945f1875..bf26204915f 100644 --- a/jscomp/test/gpr_1760_test.js +++ b/jscomp/test/gpr_1760_test.js @@ -18,7 +18,7 @@ function eq(loc, x, y) { suites.contents = { hd: [ loc + (" id " + String(test_id.contents)), - (function () { + (() => { return { TAG: "Eq", _0: x, diff --git a/jscomp/test/gpr_1762_test.js b/jscomp/test/gpr_1762_test.js index 99d10508f46..df8ce906439 100644 --- a/jscomp/test/gpr_1762_test.js +++ b/jscomp/test/gpr_1762_test.js @@ -16,7 +16,7 @@ function eq(loc, x, y) { suites.contents = { hd: [ loc + (" id " + String(test_id.contents)), - (function () { + (() => { return { TAG: "Eq", _0: x, diff --git a/jscomp/test/gpr_1817_test.js b/jscomp/test/gpr_1817_test.js index f28147a06b5..1c6ac00d41d 100644 --- a/jscomp/test/gpr_1817_test.js +++ b/jscomp/test/gpr_1817_test.js @@ -17,7 +17,7 @@ function eq(loc, x, y) { suites.contents = { hd: [ loc + (" id " + String(test_id.contents)), - (function () { + (() => { return { TAG: "Eq", _0: x, diff --git a/jscomp/test/gpr_1822_test.js b/jscomp/test/gpr_1822_test.js index 73e3a281bbd..fa37e5eb78d 100644 --- a/jscomp/test/gpr_1822_test.js +++ b/jscomp/test/gpr_1822_test.js @@ -16,7 +16,7 @@ function eq(loc, x, y) { suites.contents = { hd: [ loc + (" id " + String(test_id.contents)), - (function () { + (() => { return { TAG: "Eq", _0: x, diff --git a/jscomp/test/gpr_1943_test.js b/jscomp/test/gpr_1943_test.js index 49cadb62cf0..100a1b636e2 100644 --- a/jscomp/test/gpr_1943_test.js +++ b/jscomp/test/gpr_1943_test.js @@ -16,7 +16,7 @@ function eq(loc, x, y) { suites.contents = { hd: [ loc + (" id " + String(test_id.contents)), - (function () { + (() => { return { TAG: "Eq", _0: x, diff --git a/jscomp/test/gpr_2316_test.js b/jscomp/test/gpr_2316_test.js index 9740acfc1a2..618a1a838d5 100644 --- a/jscomp/test/gpr_2316_test.js +++ b/jscomp/test/gpr_2316_test.js @@ -17,7 +17,7 @@ function eq(loc, x, y) { suites.contents = { hd: [ loc + (" id " + String(test_id.contents)), - (function () { + (() => { return { TAG: "Eq", _0: x, diff --git a/jscomp/test/gpr_2487.js b/jscomp/test/gpr_2487.js index 64a188c7609..e5834575b61 100644 --- a/jscomp/test/gpr_2487.js +++ b/jscomp/test/gpr_2487.js @@ -11,7 +11,7 @@ let b = Belt_Array.eq([ 1, 2, 3 -], (function (prim0, prim1) { +], ((prim0, prim1) => { return prim0 === prim1; })); diff --git a/jscomp/test/gpr_2608_test.js b/jscomp/test/gpr_2608_test.js index 3e58451f944..d436f8a5db7 100644 --- a/jscomp/test/gpr_2608_test.js +++ b/jscomp/test/gpr_2608_test.js @@ -24,7 +24,7 @@ let oppHeroes = { let huntGrootCondition = false; if (List.length(/* [] */0) > 0) { - let x = List.filter((function (h) { + let x = List.filter(((h) => { return List.hd(/* [] */0) <= 1000; }), oppHeroes); huntGrootCondition = List.length(x) === 0; @@ -33,7 +33,7 @@ if (List.length(/* [] */0) > 0) { let huntGrootCondition2 = true; if (List.length(/* [] */0) < 0) { - let x$1 = List.filter((function (h) { + let x$1 = List.filter(((h) => { return List.hd(/* [] */0) <= 1000; }), oppHeroes); huntGrootCondition2 = List.length(x$1) === 0; diff --git a/jscomp/test/gpr_2682_test.js b/jscomp/test/gpr_2682_test.js index 9cad19d9453..731d7fac5cc 100644 --- a/jscomp/test/gpr_2682_test.js +++ b/jscomp/test/gpr_2682_test.js @@ -30,14 +30,14 @@ let N = { forIn({ x: 3 -}, (function (x) { +}, ((x) => { console.log(x); })); forIn({ x: 3, y: 3 -}, (function (x) { +}, ((x) => { console.log(x); })); diff --git a/jscomp/test/gpr_3536_test.js b/jscomp/test/gpr_3536_test.js index e07b0156a2a..bb492567191 100644 --- a/jscomp/test/gpr_3536_test.js +++ b/jscomp/test/gpr_3536_test.js @@ -23,11 +23,11 @@ function xx(obj, a0, a1, a2, a3, a4, a5) { eq("File \"gpr_3536_test.res\", line 18, characters 12-19", 5, 5); -eq("File \"gpr_3536_test.res\", line 20, characters 12-19", xx(3, (function (prim0, prim1) { +eq("File \"gpr_3536_test.res\", line 20, characters 12-19", xx(3, ((prim0, prim1) => { return prim0 - prim1 | 0; -}), 2, (function (prim0, prim1) { +}), 2, ((prim0, prim1) => { return prim0 + prim1 | 0; -}), 4, (function (prim0, prim1) { +}), 4, ((prim0, prim1) => { return Math.imul(prim0, prim1); }), 3), 11); diff --git a/jscomp/test/gpr_3566_test.js b/jscomp/test/gpr_3566_test.js index 5604508e536..177d322c4e1 100644 --- a/jscomp/test/gpr_3566_test.js +++ b/jscomp/test/gpr_3566_test.js @@ -75,7 +75,7 @@ function Test4($star) { } function Test5($star) { - let f = function (x) { + let f = (x) => { return Caml_option.some(x); }; let Caml_option$1 = {}; @@ -87,7 +87,7 @@ function Test5($star) { function Test6($star) { let Caml_option$1 = {}; - let f = function (x) { + let f = (x) => { return Caml_option.some(x); }; return { @@ -105,7 +105,7 @@ function Test7($star) { function Test8($star) { let Curry = {}; - let f = function (x) { + let f = (x) => { return x(1); }; return { @@ -115,7 +115,7 @@ function Test8($star) { } function Test9($star) { - let f = function (x) { + let f = (x) => { return x(1); }; let Curry = {}; diff --git a/jscomp/test/gpr_3697_test.js b/jscomp/test/gpr_3697_test.js index 4e52d927dc7..f8194c98d8a 100644 --- a/jscomp/test/gpr_3697_test.js +++ b/jscomp/test/gpr_3697_test.js @@ -6,7 +6,7 @@ let CamlinternalLazy = require("../../lib/js/camlinternalLazy.js"); function fix() { return { TAG: "Fix", - _0: CamlinternalLazy.from_fun(function () { + _0: CamlinternalLazy.from_fun(() => { return fix(); }) }; diff --git a/jscomp/test/gpr_3875_test.js b/jscomp/test/gpr_3875_test.js index 51d9d0db8d9..5e8da892aa5 100644 --- a/jscomp/test/gpr_3875_test.js +++ b/jscomp/test/gpr_3875_test.js @@ -58,7 +58,7 @@ function eq(loc, x, y) { Mt.eq_suites(test_id, suites, loc, x, y); } -compilerBug("x", undefined, true, (function () { +compilerBug("x", undefined, true, (() => { return true; })); diff --git a/jscomp/test/gpr_405_test.js b/jscomp/test/gpr_405_test.js index fc7a5c6494d..3c406084b47 100644 --- a/jscomp/test/gpr_405_test.js +++ b/jscomp/test/gpr_405_test.js @@ -11,7 +11,7 @@ function Make(funarg) { equal: $$let.equal, hash: $$let.hash }); - let find_default = function (htbl, x) { + let find_default = (htbl, x) => { try { return H.find(htbl, x); } catch (raw_exn) { @@ -24,7 +24,7 @@ function Make(funarg) { }); } }; - let min_cutset = function (gr, first_node) { + let min_cutset = (gr, first_node) => { let n_labels = H.create(97); let l_labels = H.create(97); let already_processed = H.create(97); @@ -35,7 +35,7 @@ function Make(funarg) { let counter = { contents: 1 }; - let step2 = function (top, rest_of_stack) { + let step2 = (top, rest_of_stack) => { if (find_default(already_processed, top)) { throw new Error("Assert_failure", { cause: { diff --git a/jscomp/test/gpr_4274_test.js b/jscomp/test/gpr_4274_test.js index 125e98a0082..991848b64f9 100644 --- a/jscomp/test/gpr_4274_test.js +++ b/jscomp/test/gpr_4274_test.js @@ -8,7 +8,7 @@ let N = {}; function f(X, xs) { X.forEach(xs, { - i: (function (x) { + i: ((x) => { console.log(x.x); }) }); @@ -19,7 +19,7 @@ Belt_List.forEach({ x: 3 }, tl: /* [] */0 -}, (function (x) { +}, ((x) => { console.log(x.x); })); @@ -29,7 +29,7 @@ let bar = [{ foo: "bar" }]; -Belt_Array.map(bar, (function (b) { +Belt_Array.map(bar, ((b) => { return b.foo; })); diff --git a/jscomp/test/gpr_459_test.js b/jscomp/test/gpr_459_test.js index 3284e178eec..60968948cd1 100644 --- a/jscomp/test/gpr_459_test.js +++ b/jscomp/test/gpr_459_test.js @@ -16,7 +16,7 @@ function eq(loc, x, y) { suites.contents = { hd: [ loc + (" id " + String(test_id.contents)), - (function () { + (() => { return { TAG: "Eq", _0: x, diff --git a/jscomp/test/gpr_858_unit2_test.js b/jscomp/test/gpr_858_unit2_test.js index ce8f9934efb..c2e7841171e 100644 --- a/jscomp/test/gpr_858_unit2_test.js +++ b/jscomp/test/gpr_858_unit2_test.js @@ -3,16 +3,16 @@ let delayed = { - contents: (function () { + contents: (() => { }) }; for (let i = 1; i <= 2; ++i) { - let f = function (n, x) { + let f = (n, x) => { if (x !== 0) { let prev = delayed.contents; - delayed.contents = (function () { + delayed.contents = (() => { prev(); f(((n + 1 | 0) + i | 0) - i | 0, x - 1 | 0); }); diff --git a/jscomp/test/gpr_904_test.js b/jscomp/test/gpr_904_test.js index f130ac5a279..91fa921cd97 100644 --- a/jscomp/test/gpr_904_test.js +++ b/jscomp/test/gpr_904_test.js @@ -16,7 +16,7 @@ function eq(loc, x, y) { suites.contents = { hd: [ loc + (" id " + String(test_id.contents)), - (function () { + (() => { return { TAG: "Eq", _0: x, diff --git a/jscomp/test/gpr_977_test.js b/jscomp/test/gpr_977_test.js index 46834c894a2..4b8a8b2e5b9 100644 --- a/jscomp/test/gpr_977_test.js +++ b/jscomp/test/gpr_977_test.js @@ -17,7 +17,7 @@ function eq(loc, x, y) { suites.contents = { hd: [ loc + (" id " + String(test_id.contents)), - (function () { + (() => { return { TAG: "Eq", _0: x, diff --git a/jscomp/test/hash_test.js b/jscomp/test/hash_test.js index e16a1f3cc01..ec3c00e0fbb 100644 --- a/jscomp/test/hash_test.js +++ b/jscomp/test/hash_test.js @@ -20,7 +20,7 @@ function eq(f, x, y) { Mt_global.collect_eq(test_id, suites, f, x, y); } -let test_strings = $$Array.init(32, (function (i) { +let test_strings = $$Array.init(32, ((i) => { return Caml_string.make(i, Char.chr(i)); })); diff --git a/jscomp/test/hashtbl_test.js b/jscomp/test/hashtbl_test.js index c772bd678dd..698df837d14 100644 --- a/jscomp/test/hashtbl_test.js +++ b/jscomp/test/hashtbl_test.js @@ -9,7 +9,7 @@ let Hashtbl = require("../../lib/js/hashtbl.js"); let MoreLabels = require("../../lib/js/moreLabels.js"); function to_list(tbl) { - return Hashtbl.fold((function (k, v, acc) { + return Hashtbl.fold(((k, v, acc) => { return { hd: [ k, @@ -25,7 +25,7 @@ function f() { Hashtbl.add(tbl, 1, /* '1' */49); Hashtbl.add(tbl, 2, /* '2' */50); let extra = to_list(tbl); - return List.sort((function (param, param$1) { + return List.sort(((param, param$1) => { return Caml.int_compare(param[0], param$1[0]); }), extra); } @@ -39,14 +39,14 @@ function g(count) { Hashtbl.replace(tbl, (i$1 << 1), String(i$1)); } let v = to_list(tbl); - return $$Array.of_list(List.sort((function (param, param$1) { + return $$Array.of_list(List.sort(((param, param$1) => { return Caml.int_compare(param[0], param$1[0]); }), v)); } let suites_0 = [ "simple", - (function (param) { + ((param) => { return { TAG: "Eq", _0: { @@ -70,10 +70,10 @@ let suites_0 = [ let suites_1 = { hd: [ "more_iterations", - (function (param) { + ((param) => { return { TAG: "Eq", - _0: $$Array.init(1001, (function (i) { + _0: $$Array.init(1001, ((i) => { return [ (i << 1), String(i) @@ -86,7 +86,7 @@ let suites_1 = { tl: { hd: [ "More_labels_regressionfix_374", - (function (param) { + ((param) => { let tbl = MoreLabels.Hashtbl.create(undefined, 30); Hashtbl.add(tbl, 3, 3); return { diff --git a/jscomp/test/ignore_test.js b/jscomp/test/ignore_test.js index a32d149c2b8..64a5035e086 100644 --- a/jscomp/test/ignore_test.js +++ b/jscomp/test/ignore_test.js @@ -16,7 +16,7 @@ function eq(loc, x, y) { suites.contents = { hd: [ loc + (" id " + String(test_id.contents)), - (function () { + (() => { return { TAG: "Eq", _0: x, diff --git a/jscomp/test/import2.js b/jscomp/test/import2.js index 54321a1a752..d97550b9ae0 100644 --- a/jscomp/test/import2.js +++ b/jscomp/test/import2.js @@ -3,7 +3,7 @@ let A = require("a").default; -let a = import("a").then(function (m) { +let a = import("a").then((m) => { return m.default; }); diff --git a/jscomp/test/import_external.js b/jscomp/test/import_external.js index 324766ba4b9..2cb1be2dfa0 100644 --- a/jscomp/test/import_external.js +++ b/jscomp/test/import_external.js @@ -2,7 +2,7 @@ 'use strict'; -let f8 = import("a").then(function (m) { +let f8 = import("a").then((m) => { return m.default; }); diff --git a/jscomp/test/import_side_effect.js b/jscomp/test/import_side_effect.js index a00f681262a..c84ef1af659 100644 --- a/jscomp/test/import_side_effect.js +++ b/jscomp/test/import_side_effect.js @@ -2,7 +2,7 @@ 'use strict'; -let a = import("./side_effect2.js").then(function (m) { +let a = import("./side_effect2.js").then((m) => { return m.a; }); diff --git a/jscomp/test/import_side_effect_free.js b/jscomp/test/import_side_effect_free.js index 918c70f482d..62c0cc1f123 100644 --- a/jscomp/test/import_side_effect_free.js +++ b/jscomp/test/import_side_effect_free.js @@ -2,7 +2,7 @@ 'use strict'; -let a = await import("./side_effect_free.js").then(function (m) { +let a = await import("./side_effect_free.js").then((m) => { return m.a; }); diff --git a/jscomp/test/inline_map2_test.js b/jscomp/test/inline_map2_test.js index 8acb03a28d5..d893be954fa 100644 --- a/jscomp/test/inline_map2_test.js +++ b/jscomp/test/inline_map2_test.js @@ -7,14 +7,14 @@ let List = require("../../lib/js/list.js"); let Caml_option = require("../../lib/js/caml_option.js"); function Make(Ord) { - let height = function (x) { + let height = (x) => { if (typeof x !== "object") { return 0; } else { return x._4; } }; - let create = function (l, x, d, r) { + let create = (l, x, d, r) => { let hl = height(l); let hr = height(r); return { @@ -26,7 +26,7 @@ function Make(Ord) { _4: hl >= hr ? hl + 1 | 0 : hr + 1 | 0 }; }; - let singleton = function (x, d) { + let singleton = (x, d) => { return { TAG: "Node", _0: "Empty", @@ -36,7 +36,7 @@ function Make(Ord) { _4: 1 }; }; - let bal = function (l, x, d, r) { + let bal = (l, x, d, r) => { let hl; hl = typeof l !== "object" ? 0 : l._4; let hr; @@ -102,14 +102,14 @@ function Make(Ord) { } }); }; - let is_empty = function (x) { + let is_empty = (x) => { if (typeof x !== "object") { return true; } else { return false; } }; - let add = function (x, data, x_) { + let add = (x, data, x_) => { if (typeof x_ !== "object") { return { TAG: "Node", @@ -140,7 +140,7 @@ function Make(Ord) { return bal(l, v, d, add(x, data, r)); } }; - let find = function (x, _x_) { + let find = (x, _x_) => { while (true) { let x_ = _x_; if (typeof x_ !== "object") { @@ -158,7 +158,7 @@ function Make(Ord) { continue; }; }; - let mem = function (x, _x_) { + let mem = (x, _x_) => { while (true) { let x_ = _x_; if (typeof x_ !== "object") { @@ -172,7 +172,7 @@ function Make(Ord) { continue; }; }; - let min_binding = function (_x) { + let min_binding = (_x) => { while (true) { let x = _x; if (typeof x !== "object") { @@ -193,7 +193,7 @@ function Make(Ord) { continue; }; }; - let max_binding = function (_x) { + let max_binding = (_x) => { while (true) { let x = _x; if (typeof x !== "object") { @@ -214,7 +214,7 @@ function Make(Ord) { continue; }; }; - let remove_min_binding = function (x) { + let remove_min_binding = (x) => { if (typeof x !== "object") { throw new Error("Invalid_argument", { cause: { @@ -230,7 +230,7 @@ function Make(Ord) { return bal(remove_min_binding(l), x._1, x._2, x._3); } }; - let remove = function (x, x_) { + let remove = (x, x_) => { if (typeof x_ !== "object") { return "Empty"; } @@ -254,7 +254,7 @@ function Make(Ord) { return bal(l, v, d, remove(x, r)); } }; - let iter = function (f, _x) { + let iter = (f, _x) => { while (true) { let x = _x; if (typeof x !== "object") { @@ -266,7 +266,7 @@ function Make(Ord) { continue; }; }; - let map = function (f, x) { + let map = (f, x) => { if (typeof x !== "object") { return "Empty"; } @@ -282,7 +282,7 @@ function Make(Ord) { _4: x._4 }; }; - let mapi = function (f, x) { + let mapi = (f, x) => { if (typeof x !== "object") { return "Empty"; } @@ -299,7 +299,7 @@ function Make(Ord) { _4: x._4 }; }; - let fold = function (f, _m, _accu) { + let fold = (f, _m, _accu) => { while (true) { let accu = _accu; let m = _m; @@ -311,7 +311,7 @@ function Make(Ord) { continue; }; }; - let for_all = function (p, _x) { + let for_all = (p, _x) => { while (true) { let x = _x; if (typeof x !== "object") { @@ -327,7 +327,7 @@ function Make(Ord) { continue; }; }; - let exists = function (p, _x) { + let exists = (p, _x) => { while (true) { let x = _x; if (typeof x !== "object") { @@ -343,21 +343,21 @@ function Make(Ord) { continue; }; }; - let add_min_binding = function (k, v, x) { + let add_min_binding = (k, v, x) => { if (typeof x !== "object") { return singleton(k, v); } else { return bal(add_min_binding(k, v, x._0), x._1, x._2, x._3); } }; - let add_max_binding = function (k, v, x) { + let add_max_binding = (k, v, x) => { if (typeof x !== "object") { return singleton(k, v); } else { return bal(x._0, x._1, x._2, add_max_binding(k, v, x._3)); } }; - let join = function (l, v, d, r) { + let join = (l, v, d, r) => { if (typeof l !== "object") { return add_min_binding(v, d, r); } @@ -374,7 +374,7 @@ function Make(Ord) { return create(l, v, d, r); } }; - let concat = function (t1, t2) { + let concat = (t1, t2) => { if (typeof t1 !== "object") { return t2; } @@ -384,14 +384,14 @@ function Make(Ord) { let match = min_binding(t2); return join(t1, match[0], match[1], remove_min_binding(t2)); }; - let concat_or_join = function (t1, v, d, t2) { + let concat_or_join = (t1, v, d, t2) => { if (d !== undefined) { return join(t1, v, Caml_option.valFromOption(d), t2); } else { return concat(t1, t2); } }; - let split = function (x, x_) { + let split = (x, x_) => { if (typeof x_ !== "object") { return [ "Empty", @@ -426,7 +426,7 @@ function Make(Ord) { match$1[2] ]; }; - let merge = function (f, s1, s2) { + let merge = (f, s1, s2) => { if (typeof s1 !== "object") { if (typeof s2 !== "object") { return "Empty"; @@ -456,7 +456,7 @@ function Make(Ord) { let match$1 = split(v2, s1); return concat_or_join(merge(f, match$1[0], s2._0), v2, f(v2, match$1[1], Caml_option.some(s2._2)), merge(f, match$1[2], s2._3)); }; - let filter = function (p, x) { + let filter = (p, x) => { if (typeof x !== "object") { return "Empty"; } @@ -471,7 +471,7 @@ function Make(Ord) { return concat(l$p, r$p); } }; - let partition = function (p, x) { + let partition = (p, x) => { if (typeof x !== "object") { return [ "Empty", @@ -499,7 +499,7 @@ function Make(Ord) { ]; } }; - let cons_enum = function (_m, _e) { + let cons_enum = (_m, _e) => { while (true) { let e = _e; let m = _m; @@ -517,7 +517,7 @@ function Make(Ord) { continue; }; }; - let compare = function (cmp, m1, m2) { + let compare = (cmp, m1, m2) => { let _e1 = cons_enum(m1, "End"); let _e2 = cons_enum(m2, "End"); while (true) { @@ -546,7 +546,7 @@ function Make(Ord) { continue; }; }; - let equal = function (cmp, m1, m2) { + let equal = (cmp, m1, m2) => { let _e1 = cons_enum(m1, "End"); let _e2 = cons_enum(m2, "End"); while (true) { @@ -573,14 +573,14 @@ function Make(Ord) { continue; }; }; - let cardinal = function (x) { + let cardinal = (x) => { if (typeof x !== "object") { return 0; } else { return (cardinal(x._0) + 1 | 0) + cardinal(x._3) | 0; } }; - let bindings_aux = function (_accu, _x) { + let bindings_aux = (_accu, _x) => { while (true) { let x = _x; let accu = _accu; @@ -598,7 +598,7 @@ function Make(Ord) { continue; }; }; - let bindings = function (s) { + let bindings = (s) => { return bindings_aux(/* [] */0, s); }; return { @@ -1305,7 +1305,7 @@ let IntMap = { choose: min_binding }; -let m = List.fold_left((function (acc, param) { +let m = List.fold_left(((acc, param) => { return add(param[0], param[1], acc); }), "Empty", { hd: [ @@ -1998,7 +1998,7 @@ let SMap = { choose: min_binding$1 }; -let s = List.fold_left((function (acc, param) { +let s = List.fold_left(((acc, param) => { return add$1(param[0], param[1], acc); }), "Empty", { hd: [ @@ -2029,7 +2029,7 @@ let s = List.fold_left((function (acc, param) { Mt.from_pair_suites("Inline_map2_test", { hd: [ "assertion1", - (function () { + (() => { return { TAG: "Eq", _0: find(10, m), @@ -2040,7 +2040,7 @@ Mt.from_pair_suites("Inline_map2_test", { tl: { hd: [ "assertion2", - (function () { + (() => { return { TAG: "Eq", _0: find$1("10", s), diff --git a/jscomp/test/inline_map_demo.js b/jscomp/test/inline_map_demo.js index 842d8a800a9..fd5b21a4195 100644 --- a/jscomp/test/inline_map_demo.js +++ b/jscomp/test/inline_map_demo.js @@ -141,7 +141,7 @@ function add(x, data, tree) { } } -let m = List.fold_left((function (acc, param) { +let m = List.fold_left(((acc, param) => { return add(param[0], param[1], acc); }), "Empty", { hd: [ @@ -191,7 +191,7 @@ function find(px, _x) { Mt.from_pair_suites("Inline_map_demo", { hd: [ "find", - (function () { + (() => { return { TAG: "Eq", _0: find(10, m), diff --git a/jscomp/test/inline_map_test.js b/jscomp/test/inline_map_test.js index 1a2655903fe..880b9274dc6 100644 --- a/jscomp/test/inline_map_test.js +++ b/jscomp/test/inline_map_test.js @@ -144,7 +144,7 @@ function find(x, _x_) { }; } -let m = List.fold_left((function (acc, param) { +let m = List.fold_left(((acc, param) => { return add(param[0], param[1], acc); }), "Empty", { hd: [ @@ -175,7 +175,7 @@ let m = List.fold_left((function (acc, param) { Mt.from_pair_suites("Inline_map_test", { hd: [ "find", - (function () { + (() => { return { TAG: "Eq", _0: find(10, m), diff --git a/jscomp/test/inline_record_test.js b/jscomp/test/inline_record_test.js index 28e795d78f8..c14c78b44e6 100644 --- a/jscomp/test/inline_record_test.js +++ b/jscomp/test/inline_record_test.js @@ -36,11 +36,11 @@ let v1 = { function f(x) { if (x.TAG === "A0") { - return List.fold_left((function (prim0, prim1) { + return List.fold_left(((prim0, prim1) => { return prim0 + prim1 | 0; }), x.lbl, x.more); } else { - return List.fold_left((function (prim0, prim1) { + return List.fold_left(((prim0, prim1) => { return prim0 + prim1 | 0; }), 0, x.more); } diff --git a/jscomp/test/inline_regression_test.js b/jscomp/test/inline_regression_test.js index 2eefed637fb..752940aa32d 100644 --- a/jscomp/test/inline_regression_test.js +++ b/jscomp/test/inline_regression_test.js @@ -38,14 +38,14 @@ function generic_basename(is_dir_sep, current_dir_name, name) { } function basename(extra) { - return generic_basename((function (s, i) { + return generic_basename(((s, i) => { return Caml_string.get(s, i) === /* '/' */47; }), Filename.current_dir_name, extra); } let suites_0 = [ "basename", - (function (param) { + ((param) => { return { TAG: "Eq", _0: basename("b/c/a.b"), diff --git a/jscomp/test/inner_unused.js b/jscomp/test/inner_unused.js index a4d727f7ea3..15ab8e5d6e3 100644 --- a/jscomp/test/inner_unused.js +++ b/jscomp/test/inner_unused.js @@ -7,7 +7,7 @@ function f(x) { } function M(S) { - let f = function (x) { + let f = (x) => { return x; }; return { diff --git a/jscomp/test/installation_test.js b/jscomp/test/installation_test.js index 3f46493c487..11bdd2fd4fe 100644 --- a/jscomp/test/installation_test.js +++ b/jscomp/test/installation_test.js @@ -16,7 +16,7 @@ function eq(loc, x, y) { suites.contents = { hd: [ loc + (" id " + String(test_id.contents)), - (function () { + (() => { return { TAG: "Eq", _0: x, diff --git a/jscomp/test/int32_test.js b/jscomp/test/int32_test.js index a2d0f1710ff..2bf16507970 100644 --- a/jscomp/test/int32_test.js +++ b/jscomp/test/int32_test.js @@ -16,7 +16,7 @@ function f(x) { ]; } -let shift_right_logical_tests_0 = $$Array.map((function (x) { +let shift_right_logical_tests_0 = $$Array.map(((x) => { return (-1 >>> x) | 0; }), Ext_array_test.range(0, 31)); @@ -60,7 +60,7 @@ let shift_right_logical_tests = [ shift_right_logical_tests_1 ]; -let shift_right_tests_0 = $$Array.map((function (x) { +let shift_right_tests_0 = $$Array.map(((x) => { return (Int32.min_int >> x); }), Ext_array_test.range(0, 31)); @@ -104,7 +104,7 @@ let shift_right_tests = [ shift_right_tests_1 ]; -let shift_left_tests_0 = $$Array.map((function (x) { +let shift_left_tests_0 = $$Array.map(((x) => { return (1 << x); }), Ext_array_test.range(0, 31)); @@ -156,7 +156,7 @@ let suites = { contents: Pervasives.$at({ hd: [ "File \"int32_test.res\", line 131, characters 9-16", - (function () { + (() => { return { TAG: "Eq", _0: 1, @@ -167,7 +167,7 @@ let suites = { tl: { hd: [ "File \"int32_test.res\", line 132, characters 9-16", - (function () { + (() => { return { TAG: "Eq", _0: -2147483647, @@ -177,10 +177,10 @@ let suites = { ], tl: /* [] */0 } - }, Pervasives.$at($$Array.to_list(Ext_array_test.map2i((function (i, a, b) { + }, Pervasives.$at($$Array.to_list(Ext_array_test.map2i(((i, a, b) => { return [ "shift_right_logical_cases " + i, - (function () { + (() => { return { TAG: "Eq", _0: a, @@ -188,10 +188,10 @@ let suites = { }; }) ]; - }), shift_right_logical_tests_0, shift_right_logical_tests_1)), Pervasives.$at($$Array.to_list(Ext_array_test.map2i((function (i, a, b) { + }), shift_right_logical_tests_0, shift_right_logical_tests_1)), Pervasives.$at($$Array.to_list(Ext_array_test.map2i(((i, a, b) => { return [ "shift_right_cases " + i, - (function () { + (() => { return { TAG: "Eq", _0: a, @@ -199,10 +199,10 @@ let suites = { }; }) ]; - }), shift_right_tests_0, shift_right_tests_1)), $$Array.to_list(Ext_array_test.map2i((function (i, a, b) { + }), shift_right_tests_0, shift_right_tests_1)), $$Array.to_list(Ext_array_test.map2i(((i, a, b) => { return [ "shift_left_cases " + i, - (function () { + (() => { return { TAG: "Eq", _0: a, diff --git a/jscomp/test/int64_mul_div_test.js b/jscomp/test/int64_mul_div_test.js index 0b3755be19d..362efe81228 100644 --- a/jscomp/test/int64_mul_div_test.js +++ b/jscomp/test/int64_mul_div_test.js @@ -306,13 +306,13 @@ let pairs = [ ]; function from_pairs(prefix, pairs) { - return $$Array.to_list($$Array.mapi((function (i, param) { + return $$Array.to_list($$Array.mapi(((i, param) => { let b = param[2]; let a = param[1]; let result = param[0]; return [ prefix + "_" + i, - (function (param) { + ((param) => { return commutative_mul(result, a, b); }) ]; @@ -1509,14 +1509,14 @@ let simple_divs = [ ]; function from(xs) { - return List.mapi((function (i, param) { + return List.mapi(((i, param) => { let d = param[3]; let c = param[2]; let b = param[1]; let a = param[0]; return [ "small_divs " + i, - (function (param) { + ((param) => { return { TAG: "Eq", _0: [ @@ -1566,13 +1566,13 @@ let int64_compare_tests = [ ]; function from_compare(xs) { - return List.mapi((function (i, param) { + return List.mapi(((i, param) => { let c = param[2]; let b = param[1]; let a = param[0]; return [ "int64_compare " + i, - (function (param) { + ((param) => { return { TAG: "Eq", _0: c, @@ -1584,12 +1584,12 @@ function from_compare(xs) { } function from_to_string(xs) { - return List.mapi((function (i, param) { + return List.mapi(((i, param) => { let str_a = param[1]; let a = param[0]; return [ "to_string " + i, - (function (param) { + ((param) => { return { TAG: "Eq", _0: str_a, @@ -1600,12 +1600,12 @@ function from_to_string(xs) { }), $$Array.to_list(xs)); } -Mt.from_pair_suites("Int64_mul_div_test", Pervasives.$at(from_pairs("random", pairs), Pervasives.$at(from_pairs("small", small_pairs), Pervasives.$at(List.mapi((function (i, param) { +Mt.from_pair_suites("Int64_mul_div_test", Pervasives.$at(from_pairs("random", pairs), Pervasives.$at(from_pairs("small", small_pairs), Pervasives.$at(List.mapi(((i, param) => { let f = param[1]; let i64 = param[0]; return [ "to_float_" + i, - (function () { + (() => { return { TAG: "Eq", _0: Caml_int64.to_float(i64), @@ -1613,12 +1613,12 @@ Mt.from_pair_suites("Int64_mul_div_test", Pervasives.$at(from_pairs("random", pa }; }) ]; -}), $$Array.to_list(to_floats)), Pervasives.$at(List.mapi((function (i, param) { +}), $$Array.to_list(to_floats)), Pervasives.$at(List.mapi(((i, param) => { let i64 = param[1]; let f = param[0]; return [ "of_float_" + i, - (function () { + (() => { return { TAG: "Eq", _0: Caml_int64.of_float(f), @@ -1629,10 +1629,10 @@ Mt.from_pair_suites("Int64_mul_div_test", Pervasives.$at(from_pairs("random", pa }), $$Array.to_list(of_float_pairs)), Pervasives.$at({ hd: [ "compare_check_complete", - (function () { + (() => { return { TAG: "Eq", - _0: $$Array.map((function (param) { + _0: $$Array.map(((param) => { return true; }), check_complete_compare), _1: check_complete_compare @@ -1643,7 +1643,7 @@ Mt.from_pair_suites("Int64_mul_div_test", Pervasives.$at(from_pairs("random", pa }, Pervasives.$at(from(simple_divs), Pervasives.$at(from_compare(int64_compare_tests), { hd: [ "div_rem_0", - (function () { + (() => { return { TAG: "Eq", _0: Caml_int64.zero, @@ -1654,7 +1654,7 @@ Mt.from_pair_suites("Int64_mul_div_test", Pervasives.$at(from_pairs("random", pa tl: { hd: [ "div_rem_1", - (function () { + (() => { return { TAG: "Eq", _0: Caml_int64.neg_one, @@ -1665,7 +1665,7 @@ Mt.from_pair_suites("Int64_mul_div_test", Pervasives.$at(from_pairs("random", pa tl: { hd: [ "File \"int64_mul_div_test.res\", line 263, characters 19-26", - (function () { + (() => { return { TAG: "Eq", _0: Caml_int64.to_float(Int64.max_int), diff --git a/jscomp/test/int64_string_test.js b/jscomp/test/int64_string_test.js index 2d59d31d7d6..fb3db17ce23 100644 --- a/jscomp/test/int64_string_test.js +++ b/jscomp/test/int64_string_test.js @@ -1304,7 +1304,7 @@ let random_data = { } }; -Belt_List.forEach(random_data, (function (u) { +Belt_List.forEach(random_data, ((u) => { if (u) { if (u.tl) { throw new Error("Assert_failure", { diff --git a/jscomp/test/int64_test.js b/jscomp/test/int64_test.js index 1e80a73778e..4906cb2b0bb 100644 --- a/jscomp/test/int64_test.js +++ b/jscomp/test/int64_test.js @@ -35,7 +35,7 @@ function commutative_add(result, a, b) { let generic_compare = Caml_obj.compare; -let shift_left_tests_0 = $$Array.map((function (i) { +let shift_left_tests_0 = $$Array.map(((i) => { return Caml_int64.lsl_(Caml_int64.one, i); }), Ext_array_test.range(0, 63)); @@ -297,7 +297,7 @@ let shift_left_tests = [ shift_left_tests_1 ]; -let shift_right_tests_0 = $$Array.map((function (i) { +let shift_right_tests_0 = $$Array.map(((i) => { return Caml_int64.asr_(Caml_int64.min_int, i); }), Ext_array_test.range(0, 63)); @@ -559,7 +559,7 @@ let shift_right_tests = [ shift_right_tests_1 ]; -let shift_right_logical_suites_0 = $$Array.map((function (i) { +let shift_right_logical_suites_0 = $$Array.map(((i) => { return Caml_int64.lsr_(Caml_int64.min_int, i); }), Ext_array_test.range(0, 63)); @@ -852,7 +852,7 @@ function fac(_n, _acc) { let suites = Pervasives.$at({ hd: [ "add_one", - (function () { + (() => { return { TAG: "Eq", _0: v, @@ -866,7 +866,7 @@ let suites = Pervasives.$at({ tl: { hd: [ "add_2", - (function () { + (() => { return { TAG: "Eq", _0: [ @@ -880,7 +880,7 @@ let suites = Pervasives.$at({ tl: { hd: [ "add_3", - (function () { + (() => { return { TAG: "Eq", _0: Caml_int64.zero, @@ -891,7 +891,7 @@ let suites = Pervasives.$at({ tl: { hd: [ "add_4", - (function () { + (() => { return commutative_add([ -1, 4294967294 @@ -904,7 +904,7 @@ let suites = Pervasives.$at({ tl: { hd: [ "add_5", - (function () { + (() => { return commutative_add([ -1, 4294967293 @@ -917,7 +917,7 @@ let suites = Pervasives.$at({ tl: { hd: [ "add_6", - (function () { + (() => { return commutative_add([ 0, 4 @@ -933,7 +933,7 @@ let suites = Pervasives.$at({ tl: { hd: [ "add_7", - (function () { + (() => { return commutative_add([ 1, 0 @@ -949,7 +949,7 @@ let suites = Pervasives.$at({ tl: { hd: [ "add_8", - (function () { + (() => { return commutative_add([ 1, 0 @@ -962,7 +962,7 @@ let suites = Pervasives.$at({ tl: { hd: [ "add_9", - (function () { + (() => { return commutative_add([ 0, 4294967295 @@ -978,7 +978,7 @@ let suites = Pervasives.$at({ tl: { hd: [ "add_10", - (function () { + (() => { return commutative_add([ 0, 2147483648 @@ -991,7 +991,7 @@ let suites = Pervasives.$at({ tl: { hd: [ "add_11", - (function () { + (() => { return commutative_add([ 0, 4294967295 @@ -1004,7 +1004,7 @@ let suites = Pervasives.$at({ tl: { hd: [ "to_int32", - (function () { + (() => { return { TAG: "Eq", _0: 3, @@ -1018,7 +1018,7 @@ let suites = Pervasives.$at({ tl: { hd: [ "to_int", - (function () { + (() => { return { TAG: "Eq", _0: 3, @@ -1032,7 +1032,7 @@ let suites = Pervasives.$at({ tl: { hd: [ "of_int", - (function () { + (() => { return { TAG: "Eq", _0: [ @@ -1049,7 +1049,7 @@ let suites = Pervasives.$at({ tl: { hd: [ "lognot", - (function () { + (() => { return { TAG: "Eq", _0: [ @@ -1066,7 +1066,7 @@ let suites = Pervasives.$at({ tl: { hd: [ "neg", - (function () { + (() => { return { TAG: "Eq", _0: [ @@ -1083,7 +1083,7 @@ let suites = Pervasives.$at({ tl: { hd: [ "File \"int64_test.res\", line 277, characters 7-14", - (function () { + (() => { return { TAG: "Eq", _0: Int64.min_int, @@ -1094,7 +1094,7 @@ let suites = Pervasives.$at({ tl: { hd: [ "File \"int64_test.res\", line 279, characters 8-15", - (function () { + (() => { return { TAG: "Eq", _0: Int64.max_int, @@ -1105,7 +1105,7 @@ let suites = Pervasives.$at({ tl: { hd: [ "sub1", - (function () { + (() => { return { TAG: "Eq", _0: [ @@ -1122,7 +1122,7 @@ let suites = Pervasives.$at({ tl: { hd: [ "xor1", - (function () { + (() => { return { TAG: "Eq", _0: [ @@ -1151,7 +1151,7 @@ let suites = Pervasives.$at({ tl: { hd: [ "or", - (function () { + (() => { return { TAG: "Eq", _0: [ @@ -1168,7 +1168,7 @@ let suites = Pervasives.$at({ tl: { hd: [ "and", - (function () { + (() => { return { TAG: "Eq", _0: [ @@ -1185,12 +1185,12 @@ let suites = Pervasives.$at({ tl: { hd: [ "lsl", - (function () { + (() => { return { TAG: "Eq", - _0: $$Array.map((function (x) { + _0: $$Array.map(((x) => { return Caml_int64.lsl_(Caml_int64.one, x); - }), $$Array.init(64, (function (i) { + }), $$Array.init(64, ((i) => { return i; }))), _1: [ @@ -1451,12 +1451,12 @@ let suites = Pervasives.$at({ tl: { hd: [ "lsr", - (function () { + (() => { return { TAG: "Eq", - _0: $$Array.map((function (x) { + _0: $$Array.map(((x) => { return Caml_int64.lsr_(Caml_int64.neg_one, x); - }), $$Array.init(64, (function (i) { + }), $$Array.init(64, ((i) => { return i; }))), _1: [ @@ -1714,12 +1714,12 @@ let suites = Pervasives.$at({ tl: { hd: [ "asr", - (function () { + (() => { return { TAG: "Eq", - _0: $$Array.map((function (x) { + _0: $$Array.map(((x) => { return Caml_int64.asr_(Caml_int64.neg_one, x); - }), $$Array.init(64, (function (i) { + }), $$Array.init(64, ((i) => { return i; }))), _1: [ @@ -1794,7 +1794,7 @@ let suites = Pervasives.$at({ tl: { hd: [ "mul simple", - (function () { + (() => { return { TAG: "Eq", _0: [ @@ -1811,7 +1811,7 @@ let suites = Pervasives.$at({ tl: { hd: [ "of_int32", - (function () { + (() => { return { TAG: "Eq", _0: $$Array.map(Caml_int64.of_int32, [ @@ -1831,7 +1831,7 @@ let suites = Pervasives.$at({ tl: { hd: [ "of_int32_singleton", - (function () { + (() => { return { TAG: "Eq", _0: [ @@ -1848,7 +1848,7 @@ let suites = Pervasives.$at({ tl: { hd: [ "File \"int64_test.res\", line 526, characters 7-14", - (function () { + (() => { return { TAG: "Eq", _0: [ @@ -1865,7 +1865,7 @@ let suites = Pervasives.$at({ tl: { hd: [ "to_int32", - (function () { + (() => { return { TAG: "Eq", _0: $$Array.map(Caml_int64.to_int32, [ @@ -1885,7 +1885,7 @@ let suites = Pervasives.$at({ tl: { hd: [ "discard_sign", - (function () { + (() => { return { TAG: "Eq", _0: Caml_int64.discard_sign(Caml_int64.neg_one), @@ -1896,7 +1896,7 @@ let suites = Pervasives.$at({ tl: { hd: [ "div_mod", - (function () { + (() => { return { TAG: "Eq", _0: Caml_int64.div_mod([ @@ -1919,7 +1919,7 @@ let suites = Pervasives.$at({ tl: { hd: [ "to_hex", - (function () { + (() => { return { TAG: "Eq", _0: Caml_int64.to_hex(Caml_int64.neg_one), @@ -1930,7 +1930,7 @@ let suites = Pervasives.$at({ tl: { hd: [ "generic_compare", - (function () { + (() => { return { TAG: "Eq", _0: Caml_obj.compare([ @@ -1944,7 +1944,7 @@ let suites = Pervasives.$at({ tl: { hd: [ "test_compier_literal", - (function () { + (() => { return { TAG: "Eq", _0: [ @@ -1961,7 +1961,7 @@ let suites = Pervasives.$at({ tl: { hd: [ "generic_compare2", - (function () { + (() => { return { TAG: "Eq", _0: Caml_obj.compare([ @@ -1975,7 +1975,7 @@ let suites = Pervasives.$at({ tl: { hd: [ "shift_left", - (function () { + (() => { return { TAG: "Eq", _0: [ @@ -1992,7 +1992,7 @@ let suites = Pervasives.$at({ tl: { hd: [ "fib_int64", - (function () { + (() => { return { TAG: "Eq", _0: fib(1000, Caml_int64.one, [ @@ -2009,7 +2009,7 @@ let suites = Pervasives.$at({ tl: { hd: [ "fac_int64", - (function () { + (() => { return { TAG: "Eq", _0: fac(30, Caml_int64.one), @@ -2023,7 +2023,7 @@ let suites = Pervasives.$at({ tl: { hd: [ "File \"int64_test.res\", line 553, characters 8-15", - (function () { + (() => { return { TAG: "Eq", _0: Caml_int64.add(Int64.max_int, Int64.max_int), @@ -2037,7 +2037,7 @@ let suites = Pervasives.$at({ tl: { hd: [ "File \"int64_test.res\", line 563, characters 8-15", - (function () { + (() => { return { TAG: "Eq", _0: Caml_int64.add(Int64.min_int, Int64.min_int), @@ -2048,7 +2048,7 @@ let suites = Pervasives.$at({ tl: { hd: [ "File \"int64_test.res\", line 573, characters 8-15", - (function () { + (() => { return { TAG: "Eq", _0: Caml_int64.neg_one, @@ -2098,10 +2098,10 @@ let suites = Pervasives.$at({ } } } -}, Pervasives.$at($$Array.to_list(Ext_array_test.map2i((function (i, a, b) { +}, Pervasives.$at($$Array.to_list(Ext_array_test.map2i(((i, a, b) => { return [ "shift_left_cases " + i, - (function () { + (() => { return { TAG: "Eq", _0: a, @@ -2109,10 +2109,10 @@ let suites = Pervasives.$at({ }; }) ]; -}), shift_left_tests_0, shift_left_tests_1)), Pervasives.$at($$Array.to_list(Ext_array_test.map2i((function (i, a, b) { +}), shift_left_tests_0, shift_left_tests_1)), Pervasives.$at($$Array.to_list(Ext_array_test.map2i(((i, a, b) => { return [ "shift_right_cases " + i, - (function () { + (() => { return { TAG: "Eq", _0: a, @@ -2120,10 +2120,10 @@ let suites = Pervasives.$at({ }; }) ]; -}), shift_right_tests_0, shift_right_tests_1)), $$Array.to_list(Ext_array_test.map2i((function (i, a, b) { +}), shift_right_tests_0, shift_right_tests_1)), $$Array.to_list(Ext_array_test.map2i(((i, a, b) => { return [ "shift_right_logical_cases " + i, - (function () { + (() => { return { TAG: "Eq", _0: a, diff --git a/jscomp/test/int_hashtbl_test.js b/jscomp/test/int_hashtbl_test.js index 837abb13692..10f6558f7a5 100644 --- a/jscomp/test/int_hashtbl_test.js +++ b/jscomp/test/int_hashtbl_test.js @@ -11,7 +11,7 @@ function f(H) { let tbl = H.create(17); H.add(tbl, 1, /* '1' */49); H.add(tbl, 2, /* '2' */50); - let extra = H.fold((function (k, v, acc) { + let extra = H.fold(((k, v, acc) => { return { hd: [ k, @@ -20,7 +20,7 @@ function f(H) { tl: acc }; }), tbl, /* [] */0); - return List.sort((function (param, param$1) { + return List.sort(((param, param$1) => { return Caml.int_compare(param[0], param$1[0]); }), extra); } @@ -33,7 +33,7 @@ function g(H, count) { for (let i$1 = 0; i$1 <= count; ++i$1) { H.replace(tbl, (i$1 << 1), String(i$1)); } - let v = H.fold((function (k, v, acc) { + let v = H.fold(((k, v, acc) => { return { hd: [ k, @@ -42,7 +42,7 @@ function g(H, count) { tl: acc }; }), tbl, /* [] */0); - return $$Array.of_list(List.sort((function (param, param$1) { + return $$Array.of_list(List.sort(((param, param$1) => { return Caml.int_compare(param[0], param$1[0]); }), v)); } @@ -60,7 +60,7 @@ let Int_hash = Hashtbl.Make({ let suites_0 = [ "simple", - (function (param) { + ((param) => { return { TAG: "Eq", _0: { @@ -84,10 +84,10 @@ let suites_0 = [ let suites_1 = { hd: [ "more_iterations", - (function (param) { + ((param) => { return { TAG: "Eq", - _0: $$Array.init(1001, (function (i) { + _0: $$Array.init(1001, ((i) => { return [ (i << 1), String(i) diff --git a/jscomp/test/int_overflow_test.js b/jscomp/test/int_overflow_test.js index e8c7c42ceea..cab24280bbf 100644 --- a/jscomp/test/int_overflow_test.js +++ b/jscomp/test/int_overflow_test.js @@ -41,7 +41,7 @@ function fib(x) { Mt.from_pair_suites("Int_overflow_test", { hd: [ "plus_overflow", - (function () { + (() => { return { TAG: "Eq", _0: true, @@ -52,7 +52,7 @@ Mt.from_pair_suites("Int_overflow_test", { tl: { hd: [ "minus_overflow", - (function () { + (() => { return { TAG: "Eq", _0: true, @@ -63,7 +63,7 @@ Mt.from_pair_suites("Int_overflow_test", { tl: { hd: [ "flow_again", - (function () { + (() => { return { TAG: "Eq", _0: 2147483646, @@ -74,7 +74,7 @@ Mt.from_pair_suites("Int_overflow_test", { tl: { hd: [ "flow_again", - (function () { + (() => { return { TAG: "Eq", _0: -2, @@ -85,7 +85,7 @@ Mt.from_pair_suites("Int_overflow_test", { tl: { hd: [ "hash_test", - (function () { + (() => { return { TAG: "Eq", _0: hash_variant("xxyyzzuuxxzzyy00112233"), @@ -96,7 +96,7 @@ Mt.from_pair_suites("Int_overflow_test", { tl: { hd: [ "hash_test2", - (function () { + (() => { return { TAG: "Eq", _0: hash_variant("xxyyzxzzyy"), @@ -107,7 +107,7 @@ Mt.from_pair_suites("Int_overflow_test", { tl: { hd: [ "File \"int_overflow_test.res\", line 88, characters 5-12", - (function () { + (() => { return { TAG: "Eq", _0: hash_variant2("xxyyzzuuxxzzyy00112233"), @@ -118,7 +118,7 @@ Mt.from_pair_suites("Int_overflow_test", { tl: { hd: [ "File \"int_overflow_test.res\", line 89, characters 5-12", - (function () { + (() => { return { TAG: "Eq", _0: hash_variant2("xxyyzxzzyy"), @@ -129,7 +129,7 @@ Mt.from_pair_suites("Int_overflow_test", { tl: { hd: [ "int_literal_flow", - (function () { + (() => { return { TAG: "Eq", _0: -1, @@ -140,7 +140,7 @@ Mt.from_pair_suites("Int_overflow_test", { tl: { hd: [ "int_literal_flow2", - (function () { + (() => { return { TAG: "Eq", _0: -1, @@ -151,7 +151,7 @@ Mt.from_pair_suites("Int_overflow_test", { tl: { hd: [ "int_literal_flow3", - (function () { + (() => { return { TAG: "Eq", _0: -1, @@ -162,7 +162,7 @@ Mt.from_pair_suites("Int_overflow_test", { tl: { hd: [ "int32_mul", - (function () { + (() => { return { TAG: "Eq", _0: -33554431, @@ -173,7 +173,7 @@ Mt.from_pair_suites("Int_overflow_test", { tl: { hd: [ "File \"int_overflow_test.res\", line 94, characters 5-12", - (function () { + (() => { return { TAG: "Eq", _0: Number("3") | 0, @@ -184,7 +184,7 @@ Mt.from_pair_suites("Int_overflow_test", { tl: { hd: [ "File \"int_overflow_test.res\", line 96, characters 5-12", - (function () { + (() => { return { TAG: "Eq", _0: Number("3.2") | 0, diff --git a/jscomp/test/int_switch_test.js b/jscomp/test/int_switch_test.js index 2a0e0e9b344..f888521b2c5 100644 --- a/jscomp/test/int_switch_test.js +++ b/jscomp/test/int_switch_test.js @@ -61,23 +61,23 @@ function f33(x) { } } -eq("File \"int_switch_test.res\", line 32, characters 3-10", f(function () { +eq("File \"int_switch_test.res\", line 32, characters 3-10", f(() => { return 1; }), /* 'a' */97); -eq("File \"int_switch_test.res\", line 33, characters 3-10", f(function () { +eq("File \"int_switch_test.res\", line 33, characters 3-10", f(() => { return 2; }), /* 'b' */98); -eq("File \"int_switch_test.res\", line 34, characters 3-10", f(function () { +eq("File \"int_switch_test.res\", line 34, characters 3-10", f(() => { return 3; }), /* 'c' */99); -eq("File \"int_switch_test.res\", line 35, characters 3-10", f(function () { +eq("File \"int_switch_test.res\", line 35, characters 3-10", f(() => { return 0; }), /* 'x' */120); -eq("File \"int_switch_test.res\", line 36, characters 3-10", f(function () { +eq("File \"int_switch_test.res\", line 36, characters 3-10", f(() => { return -1; }), /* 'x' */120); diff --git a/jscomp/test/js_array_test.js b/jscomp/test/js_array_test.js index 926b5447828..05f2a9b632d 100644 --- a/jscomp/test/js_array_test.js +++ b/jscomp/test/js_array_test.js @@ -6,7 +6,7 @@ let Caml_option = require("../../lib/js/caml_option.js"); let suites_0 = [ "isArray_array", - (function (param) { + ((param) => { return { TAG: "Eq", _0: true, @@ -18,7 +18,7 @@ let suites_0 = [ let suites_1 = { hd: [ "isArray_int", - (function (param) { + ((param) => { return { TAG: "Eq", _0: false, @@ -29,7 +29,7 @@ let suites_1 = { tl: { hd: [ "length", - (function (param) { + ((param) => { return { TAG: "Eq", _0: 3, @@ -44,7 +44,7 @@ let suites_1 = { tl: { hd: [ "copyWithin", - (function (param) { + ((param) => { return { TAG: "Eq", _0: [ @@ -67,7 +67,7 @@ let suites_1 = { tl: { hd: [ "copyWithinFrom", - (function (param) { + ((param) => { return { TAG: "Eq", _0: [ @@ -90,7 +90,7 @@ let suites_1 = { tl: { hd: [ "copyWithinFromRange", - (function (param) { + ((param) => { return { TAG: "Eq", _0: [ @@ -113,7 +113,7 @@ let suites_1 = { tl: { hd: [ "fillInPlace", - (function (param) { + ((param) => { return { TAG: "Eq", _0: [ @@ -132,7 +132,7 @@ let suites_1 = { tl: { hd: [ "fillFromInPlace", - (function (param) { + ((param) => { return { TAG: "Eq", _0: [ @@ -151,7 +151,7 @@ let suites_1 = { tl: { hd: [ "fillRangeInPlace", - (function (param) { + ((param) => { return { TAG: "Eq", _0: [ @@ -170,7 +170,7 @@ let suites_1 = { tl: { hd: [ "pop", - (function (param) { + ((param) => { return { TAG: "Eq", _0: 3, @@ -185,7 +185,7 @@ let suites_1 = { tl: { hd: [ "pop - empty array", - (function (param) { + ((param) => { return { TAG: "Eq", _0: undefined, @@ -196,7 +196,7 @@ let suites_1 = { tl: { hd: [ "push", - (function (param) { + ((param) => { return { TAG: "Eq", _0: 4, @@ -211,7 +211,7 @@ let suites_1 = { tl: { hd: [ "pushMany", - (function (param) { + ((param) => { return { TAG: "Eq", _0: 5, @@ -226,7 +226,7 @@ let suites_1 = { tl: { hd: [ "reverseInPlace", - (function (param) { + ((param) => { return { TAG: "Eq", _0: [ @@ -245,7 +245,7 @@ let suites_1 = { tl: { hd: [ "shift", - (function (param) { + ((param) => { return { TAG: "Eq", _0: 1, @@ -260,7 +260,7 @@ let suites_1 = { tl: { hd: [ "shift - empty array", - (function (param) { + ((param) => { return { TAG: "Eq", _0: undefined, @@ -271,7 +271,7 @@ let suites_1 = { tl: { hd: [ "sortInPlace", - (function (param) { + ((param) => { return { TAG: "Eq", _0: [ @@ -290,7 +290,7 @@ let suites_1 = { tl: { hd: [ "sortInPlaceWith", - (function (param) { + ((param) => { return { TAG: "Eq", _0: [ @@ -302,7 +302,7 @@ let suites_1 = { 3, 1, 2 - ].sort(function (a, b) { + ].sort((a, b) => { return b - a | 0; }) }; @@ -311,7 +311,7 @@ let suites_1 = { tl: { hd: [ "spliceInPlace", - (function (param) { + ((param) => { let arr = [ 1, 2, @@ -341,7 +341,7 @@ let suites_1 = { tl: { hd: [ "removeFromInPlace", - (function (param) { + ((param) => { let arr = [ 1, 2, @@ -371,7 +371,7 @@ let suites_1 = { tl: { hd: [ "removeCountInPlace", - (function (param) { + ((param) => { let arr = [ 1, 2, @@ -399,7 +399,7 @@ let suites_1 = { tl: { hd: [ "unshift", - (function (param) { + ((param) => { return { TAG: "Eq", _0: 4, @@ -414,7 +414,7 @@ let suites_1 = { tl: { hd: [ "unshiftMany", - (function (param) { + ((param) => { return { TAG: "Eq", _0: 5, @@ -429,7 +429,7 @@ let suites_1 = { tl: { hd: [ "append", - (function (param) { + ((param) => { return { TAG: "Eq", _0: [ @@ -449,7 +449,7 @@ let suites_1 = { tl: { hd: [ "concat", - (function (param) { + ((param) => { return { TAG: "Eq", _0: [ @@ -473,7 +473,7 @@ let suites_1 = { tl: { hd: [ "concatMany", - (function (param) { + ((param) => { return { TAG: "Eq", _0: [ @@ -502,7 +502,7 @@ let suites_1 = { tl: { hd: [ "includes", - (function (param) { + ((param) => { return { TAG: "Eq", _0: true, @@ -517,7 +517,7 @@ let suites_1 = { tl: { hd: [ "indexOf", - (function (param) { + ((param) => { return { TAG: "Eq", _0: 1, @@ -532,7 +532,7 @@ let suites_1 = { tl: { hd: [ "indexOfFrom", - (function (param) { + ((param) => { return { TAG: "Eq", _0: 3, @@ -548,7 +548,7 @@ let suites_1 = { tl: { hd: [ "join", - (function (param) { + ((param) => { return { TAG: "Eq", _0: "1,2,3", @@ -563,7 +563,7 @@ let suites_1 = { tl: { hd: [ "joinWith", - (function (param) { + ((param) => { return { TAG: "Eq", _0: "1;2;3", @@ -578,7 +578,7 @@ let suites_1 = { tl: { hd: [ "lastIndexOf", - (function (param) { + ((param) => { return { TAG: "Eq", _0: 1, @@ -593,7 +593,7 @@ let suites_1 = { tl: { hd: [ "lastIndexOfFrom", - (function (param) { + ((param) => { return { TAG: "Eq", _0: 1, @@ -609,7 +609,7 @@ let suites_1 = { tl: { hd: [ "slice", - (function (param) { + ((param) => { return { TAG: "Eq", _0: [ @@ -629,7 +629,7 @@ let suites_1 = { tl: { hd: [ "copy", - (function (param) { + ((param) => { return { TAG: "Eq", _0: [ @@ -652,7 +652,7 @@ let suites_1 = { tl: { hd: [ "sliceFrom", - (function (param) { + ((param) => { return { TAG: "Eq", _0: [ @@ -673,7 +673,7 @@ let suites_1 = { tl: { hd: [ "toString", - (function (param) { + ((param) => { return { TAG: "Eq", _0: "1,2,3", @@ -688,7 +688,7 @@ let suites_1 = { tl: { hd: [ "toLocaleString", - (function (param) { + ((param) => { return { TAG: "Eq", _0: "1,2,3", @@ -703,7 +703,7 @@ let suites_1 = { tl: { hd: [ "every", - (function (param) { + ((param) => { return { TAG: "Eq", _0: true, @@ -711,7 +711,7 @@ let suites_1 = { 1, 2, 3 - ].every(function (n) { + ].every((n) => { return n > 0; }) }; @@ -720,7 +720,7 @@ let suites_1 = { tl: { hd: [ "everyi", - (function (param) { + ((param) => { return { TAG: "Eq", _0: false, @@ -728,7 +728,7 @@ let suites_1 = { 1, 2, 3 - ].every(function (param, i) { + ].every((param, i) => { return i > 0; }) }; @@ -737,7 +737,7 @@ let suites_1 = { tl: { hd: [ "filter", - (function (param) { + ((param) => { return { TAG: "Eq", _0: [ @@ -749,7 +749,7 @@ let suites_1 = { 2, 3, 4 - ].filter(function (n) { + ].filter((n) => { return n % 2 === 0; }) }; @@ -758,7 +758,7 @@ let suites_1 = { tl: { hd: [ "filteri", - (function (param) { + ((param) => { return { TAG: "Eq", _0: [ @@ -770,7 +770,7 @@ let suites_1 = { 2, 3, 4 - ].filter(function (param, i) { + ].filter((param, i) => { return i % 2 === 0; }) }; @@ -779,7 +779,7 @@ let suites_1 = { tl: { hd: [ "find", - (function (param) { + ((param) => { return { TAG: "Eq", _0: 2, @@ -788,7 +788,7 @@ let suites_1 = { 2, 3, 4 - ].find(function (n) { + ].find((n) => { return n % 2 === 0; })) }; @@ -797,7 +797,7 @@ let suites_1 = { tl: { hd: [ "find - no match", - (function (param) { + ((param) => { return { TAG: "Eq", _0: undefined, @@ -806,7 +806,7 @@ let suites_1 = { 2, 3, 4 - ].find(function (n) { + ].find((n) => { return n % 2 === 5; })) }; @@ -815,7 +815,7 @@ let suites_1 = { tl: { hd: [ "findi", - (function (param) { + ((param) => { return { TAG: "Eq", _0: 1, @@ -824,7 +824,7 @@ let suites_1 = { 2, 3, 4 - ].find(function (param, i) { + ].find((param, i) => { return i % 2 === 0; })) }; @@ -833,7 +833,7 @@ let suites_1 = { tl: { hd: [ "findi - no match", - (function (param) { + ((param) => { return { TAG: "Eq", _0: undefined, @@ -842,7 +842,7 @@ let suites_1 = { 2, 3, 4 - ].find(function (param, i) { + ].find((param, i) => { return i % 2 === 5; })) }; @@ -851,7 +851,7 @@ let suites_1 = { tl: { hd: [ "findIndex", - (function (param) { + ((param) => { return { TAG: "Eq", _0: 1, @@ -860,7 +860,7 @@ let suites_1 = { 2, 3, 4 - ].findIndex(function (n) { + ].findIndex((n) => { return n % 2 === 0; }) }; @@ -869,7 +869,7 @@ let suites_1 = { tl: { hd: [ "findIndexi", - (function (param) { + ((param) => { return { TAG: "Eq", _0: 0, @@ -878,7 +878,7 @@ let suites_1 = { 2, 3, 4 - ].findIndex(function (param, i) { + ].findIndex((param, i) => { return i % 2 === 0; }) }; @@ -887,7 +887,7 @@ let suites_1 = { tl: { hd: [ "forEach", - (function (param) { + ((param) => { let sum = { contents: 0 }; @@ -895,7 +895,7 @@ let suites_1 = { 1, 2, 3 - ].forEach(function (n) { + ].forEach((n) => { sum.contents = sum.contents + n | 0; }); return { @@ -908,7 +908,7 @@ let suites_1 = { tl: { hd: [ "forEachi", - (function (param) { + ((param) => { let sum = { contents: 0 }; @@ -916,7 +916,7 @@ let suites_1 = { 1, 2, 3 - ].forEach(function (param, i) { + ].forEach((param, i) => { sum.contents = sum.contents + i | 0; }); return { @@ -929,7 +929,7 @@ let suites_1 = { tl: { hd: [ "map", - (function (param) { + ((param) => { return { TAG: "Eq", _0: [ @@ -943,7 +943,7 @@ let suites_1 = { 2, 3, 4 - ].map(function (n) { + ].map((n) => { return (n << 1); }) }; @@ -952,7 +952,7 @@ let suites_1 = { tl: { hd: [ "map", - (function (param) { + ((param) => { return { TAG: "Eq", _0: [ @@ -966,7 +966,7 @@ let suites_1 = { 2, 3, 4 - ].map(function (param, i) { + ].map((param, i) => { return (i << 1); }) }; @@ -975,7 +975,7 @@ let suites_1 = { tl: { hd: [ "reduce", - (function (param) { + ((param) => { return { TAG: "Eq", _0: -10, @@ -984,7 +984,7 @@ let suites_1 = { 2, 3, 4 - ].reduce((function (acc, n) { + ].reduce(((acc, n) => { return acc - n | 0; }), 0) }; @@ -993,7 +993,7 @@ let suites_1 = { tl: { hd: [ "reducei", - (function (param) { + ((param) => { return { TAG: "Eq", _0: -6, @@ -1002,7 +1002,7 @@ let suites_1 = { 2, 3, 4 - ].reduce((function (acc, param, i) { + ].reduce(((acc, param, i) => { return acc - i | 0; }), 0) }; @@ -1011,7 +1011,7 @@ let suites_1 = { tl: { hd: [ "reduceRight", - (function (param) { + ((param) => { return { TAG: "Eq", _0: -10, @@ -1020,7 +1020,7 @@ let suites_1 = { 2, 3, 4 - ].reduceRight((function (acc, n) { + ].reduceRight(((acc, n) => { return acc - n | 0; }), 0) }; @@ -1029,7 +1029,7 @@ let suites_1 = { tl: { hd: [ "reduceRighti", - (function (param) { + ((param) => { return { TAG: "Eq", _0: -6, @@ -1038,7 +1038,7 @@ let suites_1 = { 2, 3, 4 - ].reduceRight((function (acc, param, i) { + ].reduceRight(((acc, param, i) => { return acc - i | 0; }), 0) }; @@ -1047,7 +1047,7 @@ let suites_1 = { tl: { hd: [ "some", - (function (param) { + ((param) => { return { TAG: "Eq", _0: false, @@ -1056,7 +1056,7 @@ let suites_1 = { 2, 3, 4 - ].some(function (n) { + ].some((n) => { return n <= 0; }) }; @@ -1065,7 +1065,7 @@ let suites_1 = { tl: { hd: [ "somei", - (function (param) { + ((param) => { return { TAG: "Eq", _0: true, @@ -1074,7 +1074,7 @@ let suites_1 = { 2, 3, 4 - ].some(function (param, i) { + ].some((param, i) => { return i <= 0; }) }; diff --git a/jscomp/test/js_bool_test.js b/jscomp/test/js_bool_test.js index 1c1f6bd5fe8..2d4a6aeaa3e 100644 --- a/jscomp/test/js_bool_test.js +++ b/jscomp/test/js_bool_test.js @@ -33,7 +33,7 @@ let v = true; let suites_0 = [ "?bool_eq_caml_bool", - (function (param) { + ((param) => { return { TAG: "Eq", _0: u, @@ -45,7 +45,7 @@ let suites_0 = [ let suites_1 = { hd: [ "js_bool_eq_js_bool", - (function (param) { + ((param) => { return { TAG: "Eq", _0: v, @@ -56,7 +56,7 @@ let suites_1 = { tl: { hd: [ "js_bool_neq_acml_bool", - (function (param) { + ((param) => { return { TAG: "Eq", _0: true, diff --git a/jscomp/test/js_cast_test.js b/jscomp/test/js_cast_test.js index ba86ae998fe..87489a9d5d6 100644 --- a/jscomp/test/js_cast_test.js +++ b/jscomp/test/js_cast_test.js @@ -24,7 +24,7 @@ function add_test(loc, test) { } function eq(loc, x, y) { - add_test(loc, (function () { + add_test(loc, (() => { return { TAG: "Eq", _0: x, diff --git a/jscomp/test/js_date_test.js b/jscomp/test/js_date_test.js index ae4924ef818..76524bf36fc 100644 --- a/jscomp/test/js_date_test.js +++ b/jscomp/test/js_date_test.js @@ -10,7 +10,7 @@ function date() { let suites_0 = [ "valueOf", - (function (param) { + ((param) => { return { TAG: "Eq", _0: 195131516789, @@ -22,7 +22,7 @@ let suites_0 = [ let suites_1 = { hd: [ "make", - (function (param) { + ((param) => { return { TAG: "Ok", _0: new Date().getTime() > 1487223505382 @@ -32,7 +32,7 @@ let suites_1 = { tl: { hd: [ "parseAsFloat", - (function (param) { + ((param) => { return { TAG: "Eq", _0: Date.parse("1976-03-08T12:34:56.789+01:23"), @@ -43,7 +43,7 @@ let suites_1 = { tl: { hd: [ "parseAsFloat_invalid", - (function (param) { + ((param) => { return { TAG: "Ok", _0: Number.isNaN(Date.parse("gibberish")) @@ -53,7 +53,7 @@ let suites_1 = { tl: { hd: [ "fromFloat", - (function (param) { + ((param) => { return { TAG: "Eq", _0: "1976-03-08T11:11:56.789Z", @@ -64,7 +64,7 @@ let suites_1 = { tl: { hd: [ "fromString_valid", - (function (param) { + ((param) => { return { TAG: "Eq", _0: 195131516789, @@ -75,7 +75,7 @@ let suites_1 = { tl: { hd: [ "fromString_invalid", - (function (param) { + ((param) => { return { TAG: "Ok", _0: Number.isNaN(new Date("gibberish").getTime()) @@ -85,7 +85,7 @@ let suites_1 = { tl: { hd: [ "makeWithYM", - (function (param) { + ((param) => { let d = new Date(1984, 4); return { TAG: "Eq", @@ -103,7 +103,7 @@ let suites_1 = { tl: { hd: [ "makeWithYMD", - (function (param) { + ((param) => { let d = new Date(1984, 4, 6); return { TAG: "Eq", @@ -123,7 +123,7 @@ let suites_1 = { tl: { hd: [ "makeWithYMDH", - (function (param) { + ((param) => { let d = new Date(1984, 4, 6, 3); return { TAG: "Eq", @@ -145,7 +145,7 @@ let suites_1 = { tl: { hd: [ "makeWithYMDHM", - (function (param) { + ((param) => { let d = new Date(1984, 4, 6, 3, 59); return { TAG: "Eq", @@ -169,7 +169,7 @@ let suites_1 = { tl: { hd: [ "makeWithYMDHMS", - (function (param) { + ((param) => { let d = new Date(1984, 4, 6, 3, 59, 27); return { TAG: "Eq", @@ -195,7 +195,7 @@ let suites_1 = { tl: { hd: [ "utcWithYM", - (function (param) { + ((param) => { let d = Date.UTC(1984, 4); let d$1 = new Date(d); return { @@ -214,7 +214,7 @@ let suites_1 = { tl: { hd: [ "utcWithYMD", - (function (param) { + ((param) => { let d = Date.UTC(1984, 4, 6); let d$1 = new Date(d); return { @@ -235,7 +235,7 @@ let suites_1 = { tl: { hd: [ "utcWithYMDH", - (function (param) { + ((param) => { let d = Date.UTC(1984, 4, 6, 3); let d$1 = new Date(d); return { @@ -258,7 +258,7 @@ let suites_1 = { tl: { hd: [ "utcWithYMDHM", - (function (param) { + ((param) => { let d = Date.UTC(1984, 4, 6, 3, 59); let d$1 = new Date(d); return { @@ -283,7 +283,7 @@ let suites_1 = { tl: { hd: [ "utcWithYMDHMS", - (function (param) { + ((param) => { let d = Date.UTC(1984, 4, 6, 3, 59, 27); let d$1 = new Date(d); return { @@ -310,7 +310,7 @@ let suites_1 = { tl: { hd: [ "getFullYear", - (function (param) { + ((param) => { return { TAG: "Eq", _0: 1976, @@ -321,7 +321,7 @@ let suites_1 = { tl: { hd: [ "getMilliseconds", - (function (param) { + ((param) => { return { TAG: "Eq", _0: 789, @@ -332,7 +332,7 @@ let suites_1 = { tl: { hd: [ "getSeconds", - (function (param) { + ((param) => { return { TAG: "Eq", _0: 56, @@ -343,7 +343,7 @@ let suites_1 = { tl: { hd: [ "getTime", - (function (param) { + ((param) => { return { TAG: "Eq", _0: 195131516789, @@ -354,7 +354,7 @@ let suites_1 = { tl: { hd: [ "getUTCDate", - (function (param) { + ((param) => { return { TAG: "Eq", _0: 8, @@ -365,7 +365,7 @@ let suites_1 = { tl: { hd: [ "getUTCDay", - (function (param) { + ((param) => { return { TAG: "Eq", _0: 1, @@ -376,7 +376,7 @@ let suites_1 = { tl: { hd: [ "getUTCFUllYear", - (function (param) { + ((param) => { return { TAG: "Eq", _0: 1976, @@ -387,7 +387,7 @@ let suites_1 = { tl: { hd: [ "getUTCHours", - (function (param) { + ((param) => { return { TAG: "Eq", _0: 11, @@ -398,7 +398,7 @@ let suites_1 = { tl: { hd: [ "getUTCMilliseconds", - (function (param) { + ((param) => { return { TAG: "Eq", _0: 789, @@ -409,7 +409,7 @@ let suites_1 = { tl: { hd: [ "getUTCMinutes", - (function (param) { + ((param) => { return { TAG: "Eq", _0: 11, @@ -420,7 +420,7 @@ let suites_1 = { tl: { hd: [ "getUTCMonth", - (function (param) { + ((param) => { return { TAG: "Eq", _0: 2, @@ -431,7 +431,7 @@ let suites_1 = { tl: { hd: [ "getUTCSeconds", - (function (param) { + ((param) => { return { TAG: "Eq", _0: 56, @@ -442,7 +442,7 @@ let suites_1 = { tl: { hd: [ "getYear", - (function (param) { + ((param) => { return { TAG: "Eq", _0: 1976, @@ -453,7 +453,7 @@ let suites_1 = { tl: { hd: [ "setDate", - (function (param) { + ((param) => { let d = new Date("1976-03-08T12:34:56.789+01:23"); d.setDate(12); return { @@ -466,7 +466,7 @@ let suites_1 = { tl: { hd: [ "setFullYear", - (function (param) { + ((param) => { let d = new Date("1976-03-08T12:34:56.789+01:23"); d.setFullYear(1986); return { @@ -479,7 +479,7 @@ let suites_1 = { tl: { hd: [ "setFullYearM", - (function (param) { + ((param) => { let d = new Date("1976-03-08T12:34:56.789+01:23"); d.setFullYear(1986, 7); return { @@ -498,7 +498,7 @@ let suites_1 = { tl: { hd: [ "setFullYearMD", - (function (param) { + ((param) => { let d = new Date("1976-03-08T12:34:56.789+01:23"); d.setFullYear(1986, 7, 23); return { @@ -519,7 +519,7 @@ let suites_1 = { tl: { hd: [ "setHours", - (function (param) { + ((param) => { let d = new Date("1976-03-08T12:34:56.789+01:23"); d.setHours(22); return { @@ -532,7 +532,7 @@ let suites_1 = { tl: { hd: [ "setHoursM", - (function (param) { + ((param) => { let d = new Date("1976-03-08T12:34:56.789+01:23"); d.setHours(22, 48); return { @@ -551,7 +551,7 @@ let suites_1 = { tl: { hd: [ "setHoursMS", - (function (param) { + ((param) => { let d = new Date("1976-03-08T12:34:56.789+01:23"); d.setHours(22, 48, 54); return { @@ -572,7 +572,7 @@ let suites_1 = { tl: { hd: [ "setMilliseconds", - (function (param) { + ((param) => { let d = new Date("1976-03-08T12:34:56.789+01:23"); d.setMilliseconds(543); return { @@ -585,7 +585,7 @@ let suites_1 = { tl: { hd: [ "setMinutes", - (function (param) { + ((param) => { let d = new Date("1976-03-08T12:34:56.789+01:23"); d.setMinutes(18); return { @@ -598,7 +598,7 @@ let suites_1 = { tl: { hd: [ "setMinutesS", - (function (param) { + ((param) => { let d = new Date("1976-03-08T12:34:56.789+01:23"); d.setMinutes(18, 42); return { @@ -617,7 +617,7 @@ let suites_1 = { tl: { hd: [ "setMinutesSMs", - (function (param) { + ((param) => { let d = new Date("1976-03-08T12:34:56.789+01:23"); d.setMinutes(18, 42, 311); return { @@ -638,7 +638,7 @@ let suites_1 = { tl: { hd: [ "setMonth", - (function (param) { + ((param) => { let d = new Date("1976-03-08T12:34:56.789+01:23"); d.setMonth(10); return { @@ -651,7 +651,7 @@ let suites_1 = { tl: { hd: [ "setMonthD", - (function (param) { + ((param) => { let d = new Date("1976-03-08T12:34:56.789+01:23"); d.setMonth(10, 14); return { @@ -670,7 +670,7 @@ let suites_1 = { tl: { hd: [ "setSeconds", - (function (param) { + ((param) => { let d = new Date("1976-03-08T12:34:56.789+01:23"); d.setSeconds(36); return { @@ -683,7 +683,7 @@ let suites_1 = { tl: { hd: [ "setSecondsMs", - (function (param) { + ((param) => { let d = new Date("1976-03-08T12:34:56.789+01:23"); d.setSeconds(36, 420); return { @@ -702,7 +702,7 @@ let suites_1 = { tl: { hd: [ "setUTCDate", - (function (param) { + ((param) => { let d = new Date("1976-03-08T12:34:56.789+01:23"); d.setUTCDate(12); return { @@ -715,7 +715,7 @@ let suites_1 = { tl: { hd: [ "setUTCFullYear", - (function (param) { + ((param) => { let d = new Date("1976-03-08T12:34:56.789+01:23"); d.setUTCFullYear(1986); return { @@ -728,7 +728,7 @@ let suites_1 = { tl: { hd: [ "setUTCFullYearM", - (function (param) { + ((param) => { let d = new Date("1976-03-08T12:34:56.789+01:23"); d.setUTCFullYear(1986, 7); return { @@ -747,7 +747,7 @@ let suites_1 = { tl: { hd: [ "setUTCFullYearMD", - (function (param) { + ((param) => { let d = new Date("1976-03-08T12:34:56.789+01:23"); d.setUTCFullYear(1986, 7, 23); return { @@ -768,7 +768,7 @@ let suites_1 = { tl: { hd: [ "setUTCHours", - (function (param) { + ((param) => { let d = new Date("1976-03-08T12:34:56.789+01:23"); d.setUTCHours(22); return { @@ -781,7 +781,7 @@ let suites_1 = { tl: { hd: [ "setUTCHoursM", - (function (param) { + ((param) => { let d = new Date("1976-03-08T12:34:56.789+01:23"); d.setUTCHours(22, 48); return { @@ -800,7 +800,7 @@ let suites_1 = { tl: { hd: [ "setUTCHoursMS", - (function (param) { + ((param) => { let d = new Date("1976-03-08T12:34:56.789+01:23"); d.setUTCHours(22, 48, 54); return { @@ -821,7 +821,7 @@ let suites_1 = { tl: { hd: [ "setUTCMilliseconds", - (function (param) { + ((param) => { let d = new Date("1976-03-08T12:34:56.789+01:23"); d.setUTCMilliseconds(543); return { @@ -834,7 +834,7 @@ let suites_1 = { tl: { hd: [ "setUTCMinutes", - (function (param) { + ((param) => { let d = new Date("1976-03-08T12:34:56.789+01:23"); d.setUTCMinutes(18); return { @@ -847,7 +847,7 @@ let suites_1 = { tl: { hd: [ "setUTCMinutesS", - (function (param) { + ((param) => { let d = new Date("1976-03-08T12:34:56.789+01:23"); d.setUTCMinutes(18, 42); return { @@ -866,7 +866,7 @@ let suites_1 = { tl: { hd: [ "setUTCMinutesSMs", - (function (param) { + ((param) => { let d = new Date("1976-03-08T12:34:56.789+01:23"); d.setUTCMinutes(18, 42, 311); return { @@ -887,7 +887,7 @@ let suites_1 = { tl: { hd: [ "setUTCMonth", - (function (param) { + ((param) => { let d = new Date("1976-03-08T12:34:56.789+01:23"); d.setUTCMonth(10); return { @@ -900,7 +900,7 @@ let suites_1 = { tl: { hd: [ "setUTCMonthD", - (function (param) { + ((param) => { let d = new Date("1976-03-08T12:34:56.789+01:23"); d.setUTCMonth(10, 14); return { @@ -919,7 +919,7 @@ let suites_1 = { tl: { hd: [ "setUTCSeconds", - (function (param) { + ((param) => { let d = new Date("1976-03-08T12:34:56.789+01:23"); d.setUTCSeconds(36); return { @@ -932,7 +932,7 @@ let suites_1 = { tl: { hd: [ "setUTCSecondsMs", - (function (param) { + ((param) => { let d = new Date("1976-03-08T12:34:56.789+01:23"); d.setUTCSeconds(36, 420); return { @@ -951,7 +951,7 @@ let suites_1 = { tl: { hd: [ "toDateString", - (function (param) { + ((param) => { return { TAG: "Eq", _0: "Mon Mar 08 1976", @@ -962,7 +962,7 @@ let suites_1 = { tl: { hd: [ "toGMTString", - (function (param) { + ((param) => { return { TAG: "Eq", _0: "Mon, 08 Mar 1976 11:11:56 GMT", @@ -973,7 +973,7 @@ let suites_1 = { tl: { hd: [ "toISOString", - (function (param) { + ((param) => { return { TAG: "Eq", _0: "1976-03-08T11:11:56.789Z", @@ -984,7 +984,7 @@ let suites_1 = { tl: { hd: [ "toJSON", - (function (param) { + ((param) => { return { TAG: "Eq", _0: "1976-03-08T11:11:56.789Z", @@ -995,7 +995,7 @@ let suites_1 = { tl: { hd: [ "toJSONUnsafe", - (function (param) { + ((param) => { return { TAG: "Eq", _0: "1976-03-08T11:11:56.789Z", @@ -1006,7 +1006,7 @@ let suites_1 = { tl: { hd: [ "toUTCString", - (function (param) { + ((param) => { return { TAG: "Eq", _0: "Mon, 08 Mar 1976 11:11:56 GMT", @@ -1017,7 +1017,7 @@ let suites_1 = { tl: { hd: [ "eq", - (function (param) { + ((param) => { let a = new Date("2013-03-01T01:10:00"); let b = new Date("2013-03-01T01:10:00"); let c = new Date("2013-03-01T01:10:01"); diff --git a/jscomp/test/js_dict_test.js b/jscomp/test/js_dict_test.js index e9085c3ca61..498aed60c50 100644 --- a/jscomp/test/js_dict_test.js +++ b/jscomp/test/js_dict_test.js @@ -13,7 +13,7 @@ function obj() { let suites_0 = [ "empty", - (function (param) { + ((param) => { return { TAG: "Eq", _0: [], @@ -25,7 +25,7 @@ let suites_0 = [ let suites_1 = { hd: [ "get", - (function (param) { + ((param) => { return { TAG: "Eq", _0: 43, @@ -39,7 +39,7 @@ let suites_1 = { tl: { hd: [ "get - property not in object", - (function (param) { + ((param) => { return { TAG: "Eq", _0: undefined, @@ -53,7 +53,7 @@ let suites_1 = { tl: { hd: [ "unsafe_get", - (function (param) { + ((param) => { return { TAG: "Eq", _0: 43, @@ -67,7 +67,7 @@ let suites_1 = { tl: { hd: [ "set", - (function (param) { + ((param) => { let o = { foo: 43, bar: 86 @@ -83,7 +83,7 @@ let suites_1 = { tl: { hd: [ "keys", - (function (param) { + ((param) => { return { TAG: "Eq", _0: [ @@ -100,7 +100,7 @@ let suites_1 = { tl: { hd: [ "entries", - (function (param) { + ((param) => { return { TAG: "Eq", _0: [ @@ -123,7 +123,7 @@ let suites_1 = { tl: { hd: [ "values", - (function (param) { + ((param) => { return { TAG: "Eq", _0: [ @@ -140,7 +140,7 @@ let suites_1 = { tl: { hd: [ "fromList - []", - (function (param) { + ((param) => { return { TAG: "Eq", _0: {}, @@ -151,7 +151,7 @@ let suites_1 = { tl: { hd: [ "fromList", - (function (param) { + ((param) => { return { TAG: "Eq", _0: [ @@ -183,7 +183,7 @@ let suites_1 = { tl: { hd: [ "fromArray - []", - (function (param) { + ((param) => { return { TAG: "Eq", _0: {}, @@ -194,7 +194,7 @@ let suites_1 = { tl: { hd: [ "fromArray", - (function (param) { + ((param) => { return { TAG: "Eq", _0: [ @@ -223,14 +223,14 @@ let suites_1 = { tl: { hd: [ "map", - (function (param) { + ((param) => { return { TAG: "Eq", _0: { foo: "43", bar: "86" }, - _1: Js_dict.map((function (i) { + _1: Js_dict.map(((i) => { return String(i); }), { foo: 43, diff --git a/jscomp/test/js_exception_catch_test.js b/jscomp/test/js_exception_catch_test.js index 4f0fa303d20..c39777779df 100644 --- a/jscomp/test/js_exception_catch_test.js +++ b/jscomp/test/js_exception_catch_test.js @@ -27,7 +27,7 @@ function add_test(loc, test) { } function eq(loc, x, y) { - add_test(loc, (function () { + add_test(loc, (() => { return { TAG: "Eq", _0: x, @@ -37,7 +37,7 @@ function eq(loc, x, y) { } function false_(loc) { - add_test(loc, (function () { + add_test(loc, (() => { return { TAG: "Ok", _0: false @@ -46,7 +46,7 @@ function false_(loc) { } function true_(loc) { - add_test(loc, (function () { + add_test(loc, (() => { return { TAG: "Ok", _0: true @@ -64,7 +64,7 @@ try { } catch (raw_x) { let x = Caml_js_exceptions.internalToOCamlException(raw_x); if (x.RE_EXN_ID === Js_exn.$$Error) { - add_test("File \"js_exception_catch_test.res\", line 18, characters 37-44", (function () { + add_test("File \"js_exception_catch_test.res\", line 18, characters 37-44", (() => { return { TAG: "Ok", _0: true @@ -78,7 +78,7 @@ try { } if (exit === 1) { - add_test("File \"js_exception_catch_test.res\", line 19, characters 14-21", (function () { + add_test("File \"js_exception_catch_test.res\", line 19, characters 14-21", (() => { return { TAG: "Ok", _0: false @@ -128,11 +128,11 @@ function test(f) { } } -eq("File \"js_exception_catch_test.res\", line 44, characters 5-12", test(function () { +eq("File \"js_exception_catch_test.res\", line 44, characters 5-12", test(() => { }), "No_error"); -eq("File \"js_exception_catch_test.res\", line 45, characters 5-12", test(function () { +eq("File \"js_exception_catch_test.res\", line 45, characters 5-12", test(() => { throw new Error("Not_found", { cause: { RE_EXN_ID: "Not_found" @@ -140,7 +140,7 @@ eq("File \"js_exception_catch_test.res\", line 45, characters 5-12", test(functi }); }), "Not_found"); -eq("File \"js_exception_catch_test.res\", line 46, characters 5-12", test(function () { +eq("File \"js_exception_catch_test.res\", line 46, characters 5-12", test(() => { throw new Error("Invalid_argument", { cause: { RE_EXN_ID: "Invalid_argument", @@ -149,7 +149,7 @@ eq("File \"js_exception_catch_test.res\", line 46, characters 5-12", test(functi }); }), "Invalid_argument"); -eq("File \"js_exception_catch_test.res\", line 47, characters 5-12", test(function () { +eq("File \"js_exception_catch_test.res\", line 47, characters 5-12", test(() => { throw new Error("Invalid_argument", { cause: { RE_EXN_ID: "Invalid_argument", @@ -158,7 +158,7 @@ eq("File \"js_exception_catch_test.res\", line 47, characters 5-12", test(functi }); }), "Invalid_any"); -eq("File \"js_exception_catch_test.res\", line 48, characters 5-12", test(function () { +eq("File \"js_exception_catch_test.res\", line 48, characters 5-12", test(() => { throw new Error(A, { cause: { RE_EXN_ID: A, @@ -167,7 +167,7 @@ eq("File \"js_exception_catch_test.res\", line 48, characters 5-12", test(functi }); }), "A2"); -eq("File \"js_exception_catch_test.res\", line 49, characters 5-12", test(function () { +eq("File \"js_exception_catch_test.res\", line 49, characters 5-12", test(() => { throw new Error(A, { cause: { RE_EXN_ID: A, @@ -176,7 +176,7 @@ eq("File \"js_exception_catch_test.res\", line 49, characters 5-12", test(functi }); }), "A_any"); -eq("File \"js_exception_catch_test.res\", line 50, characters 5-12", test(function () { +eq("File \"js_exception_catch_test.res\", line 50, characters 5-12", test(() => { throw new Error(B, { cause: { RE_EXN_ID: B @@ -184,7 +184,7 @@ eq("File \"js_exception_catch_test.res\", line 50, characters 5-12", test(functi }); }), "B"); -eq("File \"js_exception_catch_test.res\", line 51, characters 5-12", test(function () { +eq("File \"js_exception_catch_test.res\", line 51, characters 5-12", test(() => { throw new Error(C, { cause: { RE_EXN_ID: C, @@ -194,7 +194,7 @@ eq("File \"js_exception_catch_test.res\", line 51, characters 5-12", test(functi }); }), "C"); -eq("File \"js_exception_catch_test.res\", line 52, characters 5-12", test(function () { +eq("File \"js_exception_catch_test.res\", line 52, characters 5-12", test(() => { throw new Error(C, { cause: { RE_EXN_ID: C, @@ -204,13 +204,13 @@ eq("File \"js_exception_catch_test.res\", line 52, characters 5-12", test(functi }); }), "C_any"); -eq("File \"js_exception_catch_test.res\", line 53, characters 5-12", test(function () { +eq("File \"js_exception_catch_test.res\", line 53, characters 5-12", test(() => { throw new Error(new Error("x").RE_EXN_ID, { cause: new Error("x") }); }), "Js_error"); -eq("File \"js_exception_catch_test.res\", line 54, characters 5-12", test(function () { +eq("File \"js_exception_catch_test.res\", line 54, characters 5-12", test(() => { throw new Error("Failure", { cause: { RE_EXN_ID: "Failure", diff --git a/jscomp/test/js_float_test.js b/jscomp/test/js_float_test.js index 28a31f0f7ab..5c4f990759e 100644 --- a/jscomp/test/js_float_test.js +++ b/jscomp/test/js_float_test.js @@ -6,7 +6,7 @@ let Pervasives = require("../../lib/js/pervasives.js"); let suites_0 = [ "_NaN <> _NaN", - (function (param) { + ((param) => { return { TAG: "Eq", _0: false, @@ -18,7 +18,7 @@ let suites_0 = [ let suites_1 = { hd: [ "isNaN - _NaN", - (function (param) { + ((param) => { return { TAG: "Eq", _0: true, @@ -29,7 +29,7 @@ let suites_1 = { tl: { hd: [ "isNaN - 0.", - (function (param) { + ((param) => { return { TAG: "Eq", _0: false, @@ -40,7 +40,7 @@ let suites_1 = { tl: { hd: [ "isFinite - infinity", - (function (param) { + ((param) => { return { TAG: "Eq", _0: false, @@ -51,7 +51,7 @@ let suites_1 = { tl: { hd: [ "isFinite - neg_infinity", - (function (param) { + ((param) => { return { TAG: "Eq", _0: false, @@ -62,7 +62,7 @@ let suites_1 = { tl: { hd: [ "isFinite - _NaN", - (function (param) { + ((param) => { return { TAG: "Eq", _0: false, @@ -73,7 +73,7 @@ let suites_1 = { tl: { hd: [ "isFinite - 0.", - (function (param) { + ((param) => { return { TAG: "Eq", _0: true, @@ -84,7 +84,7 @@ let suites_1 = { tl: { hd: [ "toExponential", - (function (param) { + ((param) => { return { TAG: "Eq", _0: "1.23456e+2", @@ -95,7 +95,7 @@ let suites_1 = { tl: { hd: [ "toExponential - large number", - (function (param) { + ((param) => { return { TAG: "Eq", _0: "1.2e+21", @@ -106,7 +106,7 @@ let suites_1 = { tl: { hd: [ "toExponentialWithPrecision - digits:2", - (function (param) { + ((param) => { return { TAG: "Eq", _0: "1.23e+2", @@ -117,7 +117,7 @@ let suites_1 = { tl: { hd: [ "toExponentialWithPrecision - digits:4", - (function (param) { + ((param) => { return { TAG: "Eq", _0: "1.2346e+2", @@ -128,7 +128,7 @@ let suites_1 = { tl: { hd: [ "toExponentialWithPrecision - digits:20", - (function (param) { + ((param) => { return { TAG: "Eq", _0: "0.00000000000000000000e+0", @@ -139,10 +139,10 @@ let suites_1 = { tl: { hd: [ "File \"js_float_test.res\", line 27, characters 5-12", - (function (param) { + ((param) => { return { TAG: "ThrowAny", - _0: (function () { + _0: (() => { (0).toExponential(101); }) }; @@ -151,10 +151,10 @@ let suites_1 = { tl: { hd: [ "toExponentialWithPrecision - digits:-1", - (function (param) { + ((param) => { return { TAG: "ThrowAny", - _0: (function () { + _0: (() => { (0).toExponential(-1); }) }; @@ -163,7 +163,7 @@ let suites_1 = { tl: { hd: [ "toFixed", - (function (param) { + ((param) => { return { TAG: "Eq", _0: "123", @@ -174,7 +174,7 @@ let suites_1 = { tl: { hd: [ "toFixed - large number", - (function (param) { + ((param) => { return { TAG: "Eq", _0: "1.2e+21", @@ -185,7 +185,7 @@ let suites_1 = { tl: { hd: [ "toFixedWithPrecision - digits:2", - (function (param) { + ((param) => { return { TAG: "Eq", _0: "123.46", @@ -196,7 +196,7 @@ let suites_1 = { tl: { hd: [ "toFixedWithPrecision - digits:4", - (function (param) { + ((param) => { return { TAG: "Eq", _0: "123.4560", @@ -207,7 +207,7 @@ let suites_1 = { tl: { hd: [ "toFixedWithPrecision - digits:20", - (function (param) { + ((param) => { return { TAG: "Eq", _0: "0.00000000000000000000", @@ -218,10 +218,10 @@ let suites_1 = { tl: { hd: [ "toFixedWithPrecision - digits:101", - (function (param) { + ((param) => { return { TAG: "ThrowAny", - _0: (function () { + _0: (() => { (0).toFixed(101); }) }; @@ -230,10 +230,10 @@ let suites_1 = { tl: { hd: [ "toFixedWithPrecision - digits:-1", - (function (param) { + ((param) => { return { TAG: "ThrowAny", - _0: (function () { + _0: (() => { (0).toFixed(-1); }) }; @@ -242,7 +242,7 @@ let suites_1 = { tl: { hd: [ "toPrecision", - (function (param) { + ((param) => { return { TAG: "Eq", _0: "123.456", @@ -253,7 +253,7 @@ let suites_1 = { tl: { hd: [ "toPrecision - large number", - (function (param) { + ((param) => { return { TAG: "Eq", _0: "1.2e+21", @@ -264,7 +264,7 @@ let suites_1 = { tl: { hd: [ "toPrecisionWithPrecision - digits:2", - (function (param) { + ((param) => { return { TAG: "Eq", _0: "1.2e+2", @@ -275,7 +275,7 @@ let suites_1 = { tl: { hd: [ "toPrecisionWithPrecision - digits:4", - (function (param) { + ((param) => { return { TAG: "Eq", _0: "123.5", @@ -286,7 +286,7 @@ let suites_1 = { tl: { hd: [ "toPrecisionWithPrecision - digits:20", - (function (param) { + ((param) => { return { TAG: "Eq", _0: "0.0000000000000000000", @@ -297,10 +297,10 @@ let suites_1 = { tl: { hd: [ "File \"js_float_test.res\", line 68, characters 5-12", - (function (param) { + ((param) => { return { TAG: "ThrowAny", - _0: (function () { + _0: (() => { (0).toPrecision(101); }) }; @@ -309,10 +309,10 @@ let suites_1 = { tl: { hd: [ "toPrecisionWithPrecision - digits:-1", - (function (param) { + ((param) => { return { TAG: "ThrowAny", - _0: (function () { + _0: (() => { (0).toPrecision(-1); }) }; @@ -321,7 +321,7 @@ let suites_1 = { tl: { hd: [ "toString", - (function (param) { + ((param) => { return { TAG: "Eq", _0: "1.23", @@ -332,7 +332,7 @@ let suites_1 = { tl: { hd: [ "toString - large number", - (function (param) { + ((param) => { return { TAG: "Eq", _0: "1.2e+21", @@ -343,7 +343,7 @@ let suites_1 = { tl: { hd: [ "toStringWithRadix - radix:2", - (function (param) { + ((param) => { return { TAG: "Eq", _0: "1111011.0111010010111100011010100111111011111001110111", @@ -354,7 +354,7 @@ let suites_1 = { tl: { hd: [ "toStringWithRadix - radix:16", - (function (param) { + ((param) => { return { TAG: "Eq", _0: "7b.74bc6a7ef9dc", @@ -365,7 +365,7 @@ let suites_1 = { tl: { hd: [ "toStringWithRadix - radix:36", - (function (param) { + ((param) => { return { TAG: "Eq", _0: "3f", @@ -376,10 +376,10 @@ let suites_1 = { tl: { hd: [ "toStringWithRadix - radix:37", - (function (param) { + ((param) => { return { TAG: "ThrowAny", - _0: (function () { + _0: (() => { (0).toString(37); }) }; @@ -388,10 +388,10 @@ let suites_1 = { tl: { hd: [ "toStringWithRadix - radix:1", - (function (param) { + ((param) => { return { TAG: "ThrowAny", - _0: (function () { + _0: (() => { (0).toString(1); }) }; @@ -400,10 +400,10 @@ let suites_1 = { tl: { hd: [ "toStringWithRadix - radix:-1", - (function (param) { + ((param) => { return { TAG: "ThrowAny", - _0: (function () { + _0: (() => { (0).toString(-1); }) }; @@ -412,7 +412,7 @@ let suites_1 = { tl: { hd: [ "fromString - 123", - (function (param) { + ((param) => { return { TAG: "Eq", _0: 123, @@ -423,7 +423,7 @@ let suites_1 = { tl: { hd: [ "fromString - 12.3", - (function (param) { + ((param) => { return { TAG: "Eq", _0: 12.3, @@ -434,7 +434,7 @@ let suites_1 = { tl: { hd: [ "fromString - empty string", - (function (param) { + ((param) => { return { TAG: "Eq", _0: 0, @@ -445,7 +445,7 @@ let suites_1 = { tl: { hd: [ "fromString - 0x11", - (function (param) { + ((param) => { return { TAG: "Eq", _0: 17, @@ -456,7 +456,7 @@ let suites_1 = { tl: { hd: [ "fromString - 0b11", - (function (param) { + ((param) => { return { TAG: "Eq", _0: 3, @@ -467,7 +467,7 @@ let suites_1 = { tl: { hd: [ "fromString - 0o11", - (function (param) { + ((param) => { return { TAG: "Eq", _0: 9, @@ -478,7 +478,7 @@ let suites_1 = { tl: { hd: [ "fromString - invalid string", - (function (param) { + ((param) => { return { TAG: "Eq", _0: true, diff --git a/jscomp/test/js_global_test.js b/jscomp/test/js_global_test.js index 298af9a7c60..1a50c98f7b4 100644 --- a/jscomp/test/js_global_test.js +++ b/jscomp/test/js_global_test.js @@ -5,8 +5,8 @@ let Mt = require("./mt.js"); let suites_0 = [ "setTimeout/clearTimeout sanity check", - (function (param) { - let handle = setTimeout((function () { + ((param) => { + let handle = setTimeout((() => { }), 0); clearTimeout(handle); @@ -20,8 +20,8 @@ let suites_0 = [ let suites_1 = { hd: [ "setInerval/clearInterval sanity check", - (function (param) { - let handle = setInterval((function () { + ((param) => { + let handle = setInterval((() => { }), 0); clearInterval(handle); @@ -34,7 +34,7 @@ let suites_1 = { tl: { hd: [ "encodeURI", - (function (param) { + ((param) => { return { TAG: "Eq", _0: encodeURI("[-=-]"), @@ -45,7 +45,7 @@ let suites_1 = { tl: { hd: [ "decodeURI", - (function (param) { + ((param) => { return { TAG: "Eq", _0: decodeURI("%5B-=-%5D"), @@ -56,7 +56,7 @@ let suites_1 = { tl: { hd: [ "encodeURIComponent", - (function (param) { + ((param) => { return { TAG: "Eq", _0: encodeURIComponent("[-=-]"), @@ -67,7 +67,7 @@ let suites_1 = { tl: { hd: [ "decodeURIComponent", - (function (param) { + ((param) => { return { TAG: "Eq", _0: decodeURIComponent("%5B-%3D-%5D"), diff --git a/jscomp/test/js_int_test.js b/jscomp/test/js_int_test.js index bb6fb5d6991..a9dbf5ab7d8 100644 --- a/jscomp/test/js_int_test.js +++ b/jscomp/test/js_int_test.js @@ -5,7 +5,7 @@ let Mt = require("./mt.js"); let suites_0 = [ "toExponential", - (function (param) { + ((param) => { return { TAG: "Eq", _0: "1.23456e+5", @@ -17,7 +17,7 @@ let suites_0 = [ let suites_1 = { hd: [ "toExponentialWithPrecision - digits:2", - (function (param) { + ((param) => { return { TAG: "Eq", _0: "1.23e+5", @@ -28,7 +28,7 @@ let suites_1 = { tl: { hd: [ "toExponentialWithPrecision - digits:4", - (function (param) { + ((param) => { return { TAG: "Eq", _0: "1.2346e+5", @@ -39,7 +39,7 @@ let suites_1 = { tl: { hd: [ "toExponentialWithPrecision - digits:20", - (function (param) { + ((param) => { return { TAG: "Eq", _0: "0.00000000000000000000e+0", @@ -50,10 +50,10 @@ let suites_1 = { tl: { hd: [ "File \"js_int_test.res\", line 19, characters 5-12", - (function (param) { + ((param) => { return { TAG: "ThrowAny", - _0: (function () { + _0: (() => { (0).toExponential(101); }) }; @@ -62,10 +62,10 @@ let suites_1 = { tl: { hd: [ "toExponentialWithPrecision - digits:-1", - (function (param) { + ((param) => { return { TAG: "ThrowAny", - _0: (function () { + _0: (() => { (0).toExponential(-1); }) }; @@ -74,7 +74,7 @@ let suites_1 = { tl: { hd: [ "toPrecision", - (function (param) { + ((param) => { return { TAG: "Eq", _0: "123456", @@ -85,7 +85,7 @@ let suites_1 = { tl: { hd: [ "toPrecisionWithPrecision - digits:2", - (function (param) { + ((param) => { return { TAG: "Eq", _0: "1.2e+5", @@ -96,7 +96,7 @@ let suites_1 = { tl: { hd: [ "toPrecisionWithPrecision - digits:4", - (function (param) { + ((param) => { return { TAG: "Eq", _0: "1.235e+5", @@ -107,7 +107,7 @@ let suites_1 = { tl: { hd: [ "toPrecisionWithPrecision - digits:20", - (function (param) { + ((param) => { return { TAG: "Eq", _0: "0.0000000000000000000", @@ -118,10 +118,10 @@ let suites_1 = { tl: { hd: [ "File \"js_int_test.res\", line 37, characters 5-12", - (function (param) { + ((param) => { return { TAG: "ThrowAny", - _0: (function () { + _0: (() => { (0).toPrecision(101); }) }; @@ -130,10 +130,10 @@ let suites_1 = { tl: { hd: [ "toPrecisionWithPrecision - digits:-1", - (function (param) { + ((param) => { return { TAG: "ThrowAny", - _0: (function () { + _0: (() => { (0).toPrecision(-1); }) }; @@ -142,7 +142,7 @@ let suites_1 = { tl: { hd: [ "toString", - (function (param) { + ((param) => { return { TAG: "Eq", _0: "123", @@ -153,7 +153,7 @@ let suites_1 = { tl: { hd: [ "toStringWithRadix - radix:2", - (function (param) { + ((param) => { return { TAG: "Eq", _0: "11110001001000000", @@ -164,7 +164,7 @@ let suites_1 = { tl: { hd: [ "toStringWithRadix - radix:16", - (function (param) { + ((param) => { return { TAG: "Eq", _0: "1e240", @@ -175,7 +175,7 @@ let suites_1 = { tl: { hd: [ "toStringWithRadix - radix:36", - (function (param) { + ((param) => { return { TAG: "Eq", _0: "2n9c", @@ -186,10 +186,10 @@ let suites_1 = { tl: { hd: [ "toStringWithRadix - radix:37", - (function (param) { + ((param) => { return { TAG: "ThrowAny", - _0: (function () { + _0: (() => { (0).toString(37); }) }; @@ -198,10 +198,10 @@ let suites_1 = { tl: { hd: [ "toStringWithRadix - radix:1", - (function (param) { + ((param) => { return { TAG: "ThrowAny", - _0: (function () { + _0: (() => { (0).toString(1); }) }; @@ -210,10 +210,10 @@ let suites_1 = { tl: { hd: [ "toStringWithRadix - radix:-1", - (function (param) { + ((param) => { return { TAG: "ThrowAny", - _0: (function () { + _0: (() => { (0).toString(-1); }) }; diff --git a/jscomp/test/js_json_test.js b/jscomp/test/js_json_test.js index 98d00e15965..cc7da85689e 100644 --- a/jscomp/test/js_json_test.js +++ b/jscomp/test/js_json_test.js @@ -31,7 +31,7 @@ function add_test(loc, test) { } function eq(loc, x, y) { - add_test(loc, (function () { + add_test(loc, (() => { return { TAG: "Eq", _0: x, @@ -41,7 +41,7 @@ function eq(loc, x, y) { } function false_(loc) { - add_test(loc, (function () { + add_test(loc, (() => { return { TAG: "Ok", _0: false @@ -50,7 +50,7 @@ function false_(loc) { } function true_(loc) { - add_test(loc, (function () { + add_test(loc, (() => { return { TAG: "Ok", _0: true @@ -60,7 +60,7 @@ function true_(loc) { let v = JSON.parse(" { \"x\" : [1, 2, 3 ] } "); -add_test("File \"js_json_test.res\", line 22, characters 11-18", (function () { +add_test("File \"js_json_test.res\", line 22, characters 11-18", (() => { let ty = Js_json.classify(v); if (typeof ty !== "object") { return { @@ -94,7 +94,7 @@ add_test("File \"js_json_test.res\", line 22, characters 11-18", (function () { _0: false }; } - ty2._0.forEach(function (x) { + ty2._0.forEach((x) => { let ty3 = Js_json.classify(x); if (typeof ty3 !== "object") { throw new Error("Assert_failure", { @@ -136,7 +136,7 @@ let ty = Js_json.classify(json); if (typeof ty !== "object") { if (ty === "JSONNull") { - add_test("File \"js_json_test.res\", line 55, characters 24-31", (function () { + add_test("File \"js_json_test.res\", line 55, characters 24-31", (() => { return { TAG: "Ok", _0: true @@ -144,7 +144,7 @@ if (typeof ty !== "object") { })); } else { console.log(ty); - add_test("File \"js_json_test.res\", line 58, characters 11-18", (function () { + add_test("File \"js_json_test.res\", line 58, characters 11-18", (() => { return { TAG: "Ok", _0: false @@ -153,7 +153,7 @@ if (typeof ty !== "object") { } } else { console.log(ty); - add_test("File \"js_json_test.res\", line 58, characters 11-18", (function () { + add_test("File \"js_json_test.res\", line 58, characters 11-18", (() => { return { TAG: "Ok", _0: false @@ -166,7 +166,7 @@ let json$1 = JSON.parse(JSON.stringify("test string")); let ty$1 = Js_json.classify(json$1); if (typeof ty$1 !== "object") { - add_test("File \"js_json_test.res\", line 68, characters 16-23", (function () { + add_test("File \"js_json_test.res\", line 68, characters 16-23", (() => { return { TAG: "Ok", _0: false @@ -175,7 +175,7 @@ if (typeof ty$1 !== "object") { } else if (ty$1.TAG === "JSONString") { eq("File \"js_json_test.res\", line 67, characters 26-33", ty$1._0, "test string"); } else { - add_test("File \"js_json_test.res\", line 68, characters 16-23", (function () { + add_test("File \"js_json_test.res\", line 68, characters 16-23", (() => { return { TAG: "Ok", _0: false @@ -196,7 +196,7 @@ if (typeof ty$2 !== "object" || ty$2.TAG !== "JSONNumber") { } if (exit === 1) { - add_test("File \"js_json_test.res\", line 78, characters 18-25", (function () { + add_test("File \"js_json_test.res\", line 78, characters 18-25", (() => { return { TAG: "Ok", _0: false @@ -217,7 +217,7 @@ if (typeof ty$3 !== "object" || ty$3.TAG !== "JSONNumber") { } if (exit$1 === 1) { - add_test("File \"js_json_test.res\", line 88, characters 18-25", (function () { + add_test("File \"js_json_test.res\", line 88, characters 18-25", (() => { return { TAG: "Ok", _0: false @@ -229,7 +229,7 @@ function test(v) { let json = JSON.parse(JSON.stringify(v)); let ty = Js_json.classify(json); if (typeof ty === "object") { - return add_test("File \"js_json_test.res\", line 100, characters 18-25", (function () { + return add_test("File \"js_json_test.res\", line 100, characters 18-25", (() => { return { TAG: "Ok", _0: false @@ -242,7 +242,7 @@ function test(v) { case "JSONTrue" : return eq("File \"js_json_test.res\", line 98, characters 23-30", true, v); default: - return add_test("File \"js_json_test.res\", line 100, characters 18-25", (function () { + return add_test("File \"js_json_test.res\", line 100, characters 18-25", (() => { return { TAG: "Ok", _0: false @@ -282,7 +282,7 @@ let json$4 = JSON.parse(JSON.stringify(dict)); let ty$4 = Js_json.classify(json$4); if (typeof ty$4 !== "object") { - add_test("File \"js_json_test.res\", line 142, characters 16-23", (function () { + add_test("File \"js_json_test.res\", line 142, characters 16-23", (() => { return { TAG: "Ok", _0: false @@ -292,7 +292,7 @@ if (typeof ty$4 !== "object") { let x = ty$4._0; let ta = Js_json.classify(option_get(Js_dict.get(x, "a"))); if (typeof ta !== "object") { - add_test("File \"js_json_test.res\", line 140, characters 18-25", (function () { + add_test("File \"js_json_test.res\", line 140, characters 18-25", (() => { return { TAG: "Ok", _0: false @@ -300,7 +300,7 @@ if (typeof ty$4 !== "object") { })); } else if (ta.TAG === "JSONString") { if (ta._0 !== "test string") { - add_test("File \"js_json_test.res\", line 131, characters 15-22", (function () { + add_test("File \"js_json_test.res\", line 131, characters 15-22", (() => { return { TAG: "Ok", _0: false @@ -309,7 +309,7 @@ if (typeof ty$4 !== "object") { } else { let ty$5 = Js_json.classify(option_get(Js_dict.get(x, "b"))); if (typeof ty$5 !== "object") { - add_test("File \"js_json_test.res\", line 137, characters 22-29", (function () { + add_test("File \"js_json_test.res\", line 137, characters 22-29", (() => { return { TAG: "Ok", _0: false @@ -317,7 +317,7 @@ if (typeof ty$4 !== "object") { })); } else if (ty$5.TAG === "JSONNumber") { let b = ty$5._0; - add_test("File \"js_json_test.res\", line 136, characters 38-45", (function () { + add_test("File \"js_json_test.res\", line 136, characters 38-45", (() => { return { TAG: "Approx", _0: 123.0, @@ -325,7 +325,7 @@ if (typeof ty$4 !== "object") { }; })); } else { - add_test("File \"js_json_test.res\", line 137, characters 22-29", (function () { + add_test("File \"js_json_test.res\", line 137, characters 22-29", (() => { return { TAG: "Ok", _0: false @@ -334,7 +334,7 @@ if (typeof ty$4 !== "object") { } } } else { - add_test("File \"js_json_test.res\", line 140, characters 18-25", (function () { + add_test("File \"js_json_test.res\", line 140, characters 18-25", (() => { return { TAG: "Ok", _0: false @@ -342,7 +342,7 @@ if (typeof ty$4 !== "object") { })); } } else { - add_test("File \"js_json_test.res\", line 142, characters 16-23", (function () { + add_test("File \"js_json_test.res\", line 142, characters 16-23", (() => { return { TAG: "Ok", _0: false @@ -353,7 +353,7 @@ if (typeof ty$4 !== "object") { function eq_at_i(loc, json, i, kind, expected) { let ty = Js_json.classify(json); if (typeof ty !== "object") { - return add_test(loc, (function () { + return add_test(loc, (() => { return { TAG: "Ok", _0: false @@ -361,7 +361,7 @@ function eq_at_i(loc, json, i, kind, expected) { })); } if (ty.TAG !== "JSONArray") { - return add_test(loc, (function () { + return add_test(loc, (() => { return { TAG: "Ok", _0: false @@ -372,7 +372,7 @@ function eq_at_i(loc, json, i, kind, expected) { switch (kind) { case "String" : if (typeof ty$1 !== "object") { - return add_test(loc, (function () { + return add_test(loc, (() => { return { TAG: "Ok", _0: false @@ -381,7 +381,7 @@ function eq_at_i(loc, json, i, kind, expected) { } else if (ty$1.TAG === "JSONString") { return eq(loc, ty$1._0, expected); } else { - return add_test(loc, (function () { + return add_test(loc, (() => { return { TAG: "Ok", _0: false @@ -390,7 +390,7 @@ function eq_at_i(loc, json, i, kind, expected) { } case "Number" : if (typeof ty$1 !== "object") { - return add_test(loc, (function () { + return add_test(loc, (() => { return { TAG: "Ok", _0: false @@ -399,7 +399,7 @@ function eq_at_i(loc, json, i, kind, expected) { } else if (ty$1.TAG === "JSONNumber") { return eq(loc, ty$1._0, expected); } else { - return add_test(loc, (function () { + return add_test(loc, (() => { return { TAG: "Ok", _0: false @@ -408,7 +408,7 @@ function eq_at_i(loc, json, i, kind, expected) { } case "Object" : if (typeof ty$1 !== "object") { - return add_test(loc, (function () { + return add_test(loc, (() => { return { TAG: "Ok", _0: false @@ -417,7 +417,7 @@ function eq_at_i(loc, json, i, kind, expected) { } else if (ty$1.TAG === "JSONObject") { return eq(loc, ty$1._0, expected); } else { - return add_test(loc, (function () { + return add_test(loc, (() => { return { TAG: "Ok", _0: false @@ -426,7 +426,7 @@ function eq_at_i(loc, json, i, kind, expected) { } case "Array" : if (typeof ty$1 !== "object") { - return add_test(loc, (function () { + return add_test(loc, (() => { return { TAG: "Ok", _0: false @@ -435,7 +435,7 @@ function eq_at_i(loc, json, i, kind, expected) { } else if (ty$1.TAG === "JSONArray") { return eq(loc, ty$1._0, expected); } else { - return add_test(loc, (function () { + return add_test(loc, (() => { return { TAG: "Ok", _0: false @@ -444,7 +444,7 @@ function eq_at_i(loc, json, i, kind, expected) { } case "Boolean" : if (typeof ty$1 === "object") { - return add_test(loc, (function () { + return add_test(loc, (() => { return { TAG: "Ok", _0: false @@ -457,7 +457,7 @@ function eq_at_i(loc, json, i, kind, expected) { case "JSONTrue" : return eq(loc, true, expected); default: - return add_test(loc, (function () { + return add_test(loc, (() => { return { TAG: "Ok", _0: false @@ -467,14 +467,14 @@ function eq_at_i(loc, json, i, kind, expected) { case "Null" : if (typeof ty$1 !== "object") { if (ty$1 === "JSONNull") { - return add_test(loc, (function () { + return add_test(loc, (() => { return { TAG: "Ok", _0: true }; })); } else { - return add_test(loc, (function () { + return add_test(loc, (() => { return { TAG: "Ok", _0: false @@ -482,7 +482,7 @@ function eq_at_i(loc, json, i, kind, expected) { })); } } else { - return add_test(loc, (function () { + return add_test(loc, (() => { return { TAG: "Ok", _0: false @@ -492,7 +492,7 @@ function eq_at_i(loc, json, i, kind, expected) { } } -let json$5 = JSON.parse(JSON.stringify($$Array.map((function (prim) { +let json$5 = JSON.parse(JSON.stringify($$Array.map(((prim) => { return prim; }), [ "string 0", @@ -538,7 +538,7 @@ let a$1 = [ -268391749 ]; -let json$8 = JSON.parse(JSON.stringify($$Array.map((function (prim) { +let json$8 = JSON.parse(JSON.stringify($$Array.map(((prim) => { return prim; }), a$1))); @@ -579,7 +579,7 @@ let json$10 = JSON.parse(JSON.stringify(a$3)); let ty$6 = Js_json.classify(json$10); if (typeof ty$6 !== "object") { - add_test("File \"js_json_test.res\", line 271, characters 16-23", (function () { + add_test("File \"js_json_test.res\", line 271, characters 16-23", (() => { return { TAG: "Ok", _0: false @@ -588,7 +588,7 @@ if (typeof ty$6 !== "object") { } else if (ty$6.TAG === "JSONArray") { let ty$7 = Js_json.classify(Caml_array.get(ty$6._0, 1)); if (typeof ty$7 !== "object") { - add_test("File \"js_json_test.res\", line 269, characters 18-25", (function () { + add_test("File \"js_json_test.res\", line 269, characters 18-25", (() => { return { TAG: "Ok", _0: false @@ -597,7 +597,7 @@ if (typeof ty$6 !== "object") { } else if (ty$7.TAG === "JSONObject") { let ty$8 = Js_json.classify(option_get(Js_dict.get(ty$7._0, "a"))); if (typeof ty$8 !== "object") { - add_test("File \"js_json_test.res\", line 267, characters 20-27", (function () { + add_test("File \"js_json_test.res\", line 267, characters 20-27", (() => { return { TAG: "Ok", _0: false @@ -606,7 +606,7 @@ if (typeof ty$6 !== "object") { } else if (ty$8.TAG === "JSONString") { eq("File \"js_json_test.res\", line 266, characters 35-42", ty$8._0, "bbb"); } else { - add_test("File \"js_json_test.res\", line 267, characters 20-27", (function () { + add_test("File \"js_json_test.res\", line 267, characters 20-27", (() => { return { TAG: "Ok", _0: false @@ -614,7 +614,7 @@ if (typeof ty$6 !== "object") { })); } } else { - add_test("File \"js_json_test.res\", line 269, characters 18-25", (function () { + add_test("File \"js_json_test.res\", line 269, characters 18-25", (() => { return { TAG: "Ok", _0: false @@ -622,7 +622,7 @@ if (typeof ty$6 !== "object") { })); } } else { - add_test("File \"js_json_test.res\", line 271, characters 16-23", (function () { + add_test("File \"js_json_test.res\", line 271, characters 16-23", (() => { return { TAG: "Ok", _0: false @@ -632,14 +632,14 @@ if (typeof ty$6 !== "object") { try { JSON.parse("{{ A}"); - add_test("File \"js_json_test.res\", line 279, characters 11-18", (function () { + add_test("File \"js_json_test.res\", line 279, characters 11-18", (() => { return { TAG: "Ok", _0: false }; })); } catch (exn) { - add_test("File \"js_json_test.res\", line 281, characters 17-24", (function () { + add_test("File \"js_json_test.res\", line 281, characters 17-24", (() => { return { TAG: "Ok", _0: true @@ -756,7 +756,7 @@ idtest({ tl: /* [] */0 }); -idtest(Belt_List.makeBy(500, (function (i) { +idtest(Belt_List.makeBy(500, ((i) => { if (i % 2 === 0) { return; } else { @@ -764,7 +764,7 @@ idtest(Belt_List.makeBy(500, (function (i) { } }))); -idtest(Belt_Array.makeBy(500, (function (i) { +idtest(Belt_Array.makeBy(500, ((i) => { if (i % 2 === 0) { return; } else { diff --git a/jscomp/test/js_math_test.js b/jscomp/test/js_math_test.js index 1d1ab94d30f..cbaa2c34651 100644 --- a/jscomp/test/js_math_test.js +++ b/jscomp/test/js_math_test.js @@ -6,7 +6,7 @@ let Js_math = require("../../lib/js/js_math.js"); let suites_0 = [ "_E", - (function (param) { + ((param) => { return { TAG: "ApproxThreshold", _0: 0.001, @@ -19,7 +19,7 @@ let suites_0 = [ let suites_1 = { hd: [ "_LN2", - (function (param) { + ((param) => { return { TAG: "ApproxThreshold", _0: 0.001, @@ -31,7 +31,7 @@ let suites_1 = { tl: { hd: [ "_LN10", - (function (param) { + ((param) => { return { TAG: "ApproxThreshold", _0: 0.001, @@ -43,7 +43,7 @@ let suites_1 = { tl: { hd: [ "_LOG2E", - (function (param) { + ((param) => { return { TAG: "ApproxThreshold", _0: 0.001, @@ -55,7 +55,7 @@ let suites_1 = { tl: { hd: [ "_LOG10E", - (function (param) { + ((param) => { return { TAG: "ApproxThreshold", _0: 0.001, @@ -67,7 +67,7 @@ let suites_1 = { tl: { hd: [ "_PI", - (function (param) { + ((param) => { return { TAG: "ApproxThreshold", _0: 0.00001, @@ -79,7 +79,7 @@ let suites_1 = { tl: { hd: [ "_SQRT1_2", - (function (param) { + ((param) => { return { TAG: "ApproxThreshold", _0: 0.001, @@ -91,7 +91,7 @@ let suites_1 = { tl: { hd: [ "_SQRT2", - (function (param) { + ((param) => { return { TAG: "ApproxThreshold", _0: 0.001, @@ -103,7 +103,7 @@ let suites_1 = { tl: { hd: [ "abs_int", - (function (param) { + ((param) => { return { TAG: "Eq", _0: 4, @@ -114,7 +114,7 @@ let suites_1 = { tl: { hd: [ "abs_float", - (function (param) { + ((param) => { return { TAG: "Eq", _0: 1.2, @@ -125,7 +125,7 @@ let suites_1 = { tl: { hd: [ "acos", - (function (param) { + ((param) => { return { TAG: "ApproxThreshold", _0: 0.001, @@ -137,7 +137,7 @@ let suites_1 = { tl: { hd: [ "acosh", - (function (param) { + ((param) => { return { TAG: "ApproxThreshold", _0: 0.001, @@ -149,7 +149,7 @@ let suites_1 = { tl: { hd: [ "asin", - (function (param) { + ((param) => { return { TAG: "ApproxThreshold", _0: 0.001, @@ -161,7 +161,7 @@ let suites_1 = { tl: { hd: [ "asinh", - (function (param) { + ((param) => { return { TAG: "ApproxThreshold", _0: 0.001, @@ -173,7 +173,7 @@ let suites_1 = { tl: { hd: [ "atan", - (function (param) { + ((param) => { return { TAG: "ApproxThreshold", _0: 0.001, @@ -185,7 +185,7 @@ let suites_1 = { tl: { hd: [ "atanh", - (function (param) { + ((param) => { return { TAG: "ApproxThreshold", _0: 0.001, @@ -197,7 +197,7 @@ let suites_1 = { tl: { hd: [ "atan2", - (function (param) { + ((param) => { return { TAG: "ApproxThreshold", _0: 0.001, @@ -209,7 +209,7 @@ let suites_1 = { tl: { hd: [ "cbrt", - (function (param) { + ((param) => { return { TAG: "Eq", _0: 2, @@ -220,7 +220,7 @@ let suites_1 = { tl: { hd: [ "unsafe_ceil_int", - (function (param) { + ((param) => { return { TAG: "Eq", _0: 4, @@ -231,7 +231,7 @@ let suites_1 = { tl: { hd: [ "ceil_int", - (function (param) { + ((param) => { return { TAG: "Eq", _0: 4, @@ -242,7 +242,7 @@ let suites_1 = { tl: { hd: [ "ceil_float", - (function (param) { + ((param) => { return { TAG: "Eq", _0: 4, @@ -253,7 +253,7 @@ let suites_1 = { tl: { hd: [ "cos", - (function (param) { + ((param) => { return { TAG: "ApproxThreshold", _0: 0.001, @@ -265,7 +265,7 @@ let suites_1 = { tl: { hd: [ "cosh", - (function (param) { + ((param) => { return { TAG: "ApproxThreshold", _0: 0.001, @@ -277,7 +277,7 @@ let suites_1 = { tl: { hd: [ "exp", - (function (param) { + ((param) => { return { TAG: "ApproxThreshold", _0: 0.001, @@ -289,7 +289,7 @@ let suites_1 = { tl: { hd: [ "expm1", - (function (param) { + ((param) => { return { TAG: "ApproxThreshold", _0: 0.001, @@ -301,7 +301,7 @@ let suites_1 = { tl: { hd: [ "unsafe_floor_int", - (function (param) { + ((param) => { return { TAG: "Eq", _0: 3, @@ -312,7 +312,7 @@ let suites_1 = { tl: { hd: [ "floor_int", - (function (param) { + ((param) => { return { TAG: "Eq", _0: 3, @@ -323,7 +323,7 @@ let suites_1 = { tl: { hd: [ "floor_float", - (function (param) { + ((param) => { return { TAG: "Eq", _0: 3, @@ -334,7 +334,7 @@ let suites_1 = { tl: { hd: [ "fround", - (function (param) { + ((param) => { return { TAG: "Approx", _0: 3.2, @@ -345,7 +345,7 @@ let suites_1 = { tl: { hd: [ "hypot", - (function (param) { + ((param) => { return { TAG: "ApproxThreshold", _0: 0.001, @@ -357,7 +357,7 @@ let suites_1 = { tl: { hd: [ "hypotMany", - (function (param) { + ((param) => { return { TAG: "ApproxThreshold", _0: 0.001, @@ -369,7 +369,7 @@ let suites_1 = { tl: { hd: [ "imul", - (function (param) { + ((param) => { return { TAG: "Eq", _0: 8, @@ -380,7 +380,7 @@ let suites_1 = { tl: { hd: [ "log", - (function (param) { + ((param) => { return { TAG: "ApproxThreshold", _0: 0.001, @@ -392,7 +392,7 @@ let suites_1 = { tl: { hd: [ "log1p", - (function (param) { + ((param) => { return { TAG: "ApproxThreshold", _0: 0.001, @@ -404,7 +404,7 @@ let suites_1 = { tl: { hd: [ "log10", - (function (param) { + ((param) => { return { TAG: "ApproxThreshold", _0: 0.001, @@ -416,7 +416,7 @@ let suites_1 = { tl: { hd: [ "log2", - (function (param) { + ((param) => { return { TAG: "ApproxThreshold", _0: 0.001, @@ -428,7 +428,7 @@ let suites_1 = { tl: { hd: [ "max_int", - (function (param) { + ((param) => { return { TAG: "Eq", _0: 4, @@ -439,7 +439,7 @@ let suites_1 = { tl: { hd: [ "maxMany_int", - (function (param) { + ((param) => { return { TAG: "Eq", _0: 4, @@ -450,7 +450,7 @@ let suites_1 = { tl: { hd: [ "max_float", - (function (param) { + ((param) => { return { TAG: "Eq", _0: 4.2, @@ -461,7 +461,7 @@ let suites_1 = { tl: { hd: [ "maxMany_float", - (function (param) { + ((param) => { return { TAG: "Eq", _0: 4.2, @@ -472,7 +472,7 @@ let suites_1 = { tl: { hd: [ "min_int", - (function (param) { + ((param) => { return { TAG: "Eq", _0: 2, @@ -483,7 +483,7 @@ let suites_1 = { tl: { hd: [ "minMany_int", - (function (param) { + ((param) => { return { TAG: "Eq", _0: 2, @@ -494,7 +494,7 @@ let suites_1 = { tl: { hd: [ "min_float", - (function (param) { + ((param) => { return { TAG: "Eq", _0: 2.7, @@ -505,7 +505,7 @@ let suites_1 = { tl: { hd: [ "minMany_float", - (function (param) { + ((param) => { return { TAG: "Eq", _0: 2.7, @@ -516,7 +516,7 @@ let suites_1 = { tl: { hd: [ "random", - (function (param) { + ((param) => { let a = Math.random(); return { TAG: "Ok", @@ -527,7 +527,7 @@ let suites_1 = { tl: { hd: [ "random_int", - (function (param) { + ((param) => { let a = Js_math.random_int(1, 3); return { TAG: "Ok", @@ -538,7 +538,7 @@ let suites_1 = { tl: { hd: [ "unsafe_round", - (function (param) { + ((param) => { return { TAG: "Eq", _0: 3, @@ -549,7 +549,7 @@ let suites_1 = { tl: { hd: [ "round", - (function (param) { + ((param) => { return { TAG: "Eq", _0: 3, @@ -560,7 +560,7 @@ let suites_1 = { tl: { hd: [ "sign_int", - (function (param) { + ((param) => { return { TAG: "Eq", _0: -1, @@ -571,7 +571,7 @@ let suites_1 = { tl: { hd: [ "sign_float", - (function (param) { + ((param) => { return { TAG: "Eq", _0: -1, @@ -582,7 +582,7 @@ let suites_1 = { tl: { hd: [ "sign_float -0", - (function (param) { + ((param) => { return { TAG: "Eq", _0: -0, @@ -593,7 +593,7 @@ let suites_1 = { tl: { hd: [ "sin", - (function (param) { + ((param) => { return { TAG: "ApproxThreshold", _0: 0.001, @@ -605,7 +605,7 @@ let suites_1 = { tl: { hd: [ "sinh", - (function (param) { + ((param) => { return { TAG: "ApproxThreshold", _0: 0.001, @@ -617,7 +617,7 @@ let suites_1 = { tl: { hd: [ "sqrt", - (function (param) { + ((param) => { return { TAG: "ApproxThreshold", _0: 0.001, @@ -629,7 +629,7 @@ let suites_1 = { tl: { hd: [ "tan", - (function (param) { + ((param) => { return { TAG: "ApproxThreshold", _0: 0.001, @@ -641,7 +641,7 @@ let suites_1 = { tl: { hd: [ "tanh", - (function (param) { + ((param) => { return { TAG: "ApproxThreshold", _0: 0.001, @@ -653,7 +653,7 @@ let suites_1 = { tl: { hd: [ "unsafe_trunc", - (function (param) { + ((param) => { return { TAG: "Eq", _0: 4, @@ -664,7 +664,7 @@ let suites_1 = { tl: { hd: [ "trunc", - (function (param) { + ((param) => { return { TAG: "Eq", _0: 4, diff --git a/jscomp/test/js_null_test.js b/jscomp/test/js_null_test.js index 1e3b56e403c..bb4b0332856 100644 --- a/jscomp/test/js_null_test.js +++ b/jscomp/test/js_null_test.js @@ -7,7 +7,7 @@ let Caml_option = require("../../lib/js/caml_option.js"); let suites_0 = [ "toOption - empty", - (function (param) { + ((param) => { return { TAG: "Eq", _0: undefined, @@ -19,7 +19,7 @@ let suites_0 = [ let suites_1 = { hd: [ "toOption - 'a", - (function (param) { + ((param) => { return { TAG: "Eq", _0: Caml_option.some(undefined), @@ -30,7 +30,7 @@ let suites_1 = { tl: { hd: [ "return", - (function (param) { + ((param) => { return { TAG: "Eq", _0: "something", @@ -41,7 +41,7 @@ let suites_1 = { tl: { hd: [ "test - empty", - (function (param) { + ((param) => { return { TAG: "Eq", _0: true, @@ -52,7 +52,7 @@ let suites_1 = { tl: { hd: [ "test - 'a", - (function (param) { + ((param) => { return { TAG: "Eq", _0: false, @@ -63,11 +63,11 @@ let suites_1 = { tl: { hd: [ "bind - empty", - (function (param) { + ((param) => { return { TAG: "StrictEq", _0: null, - _1: Js_null.bind(null, (function (v) { + _1: Js_null.bind(null, ((v) => { return v; })) }; @@ -76,11 +76,11 @@ let suites_1 = { tl: { hd: [ "bind - 'a", - (function (param) { + ((param) => { return { TAG: "StrictEq", _0: 4, - _1: Js_null.bind(2, (function (n) { + _1: Js_null.bind(2, ((n) => { return (n << 1); })) }; @@ -89,11 +89,11 @@ let suites_1 = { tl: { hd: [ "iter - empty", - (function (param) { + ((param) => { let hit = { contents: false }; - Js_null.iter(null, (function (param) { + Js_null.iter(null, ((param) => { hit.contents = true; })); return { @@ -106,11 +106,11 @@ let suites_1 = { tl: { hd: [ "iter - 'a", - (function (param) { + ((param) => { let hit = { contents: 0 }; - Js_null.iter(2, (function (v) { + Js_null.iter(2, ((v) => { hit.contents = v; })); return { @@ -123,7 +123,7 @@ let suites_1 = { tl: { hd: [ "fromOption - None", - (function (param) { + ((param) => { return { TAG: "Eq", _0: null, @@ -134,7 +134,7 @@ let suites_1 = { tl: { hd: [ "fromOption - Some", - (function (param) { + ((param) => { return { TAG: "Eq", _0: 2, diff --git a/jscomp/test/js_null_undefined_test.js b/jscomp/test/js_null_undefined_test.js index 74c496f7d87..3147a503f7e 100644 --- a/jscomp/test/js_null_undefined_test.js +++ b/jscomp/test/js_null_undefined_test.js @@ -7,7 +7,7 @@ let Js_null_undefined = require("../../lib/js/js_null_undefined.js"); let suites_0 = [ "toOption - null", - (function (param) { + ((param) => { return { TAG: "Eq", _0: undefined, @@ -19,7 +19,7 @@ let suites_0 = [ let suites_1 = { hd: [ "toOption - undefined", - (function (param) { + ((param) => { return { TAG: "Eq", _0: undefined, @@ -30,7 +30,7 @@ let suites_1 = { tl: { hd: [ "toOption - empty", - (function (param) { + ((param) => { return { TAG: "Eq", _0: undefined, @@ -41,7 +41,7 @@ let suites_1 = { tl: { hd: [ "File \"js_null_undefined_test.res\", line 9, characters 5-12", - (function (param) { + ((param) => { return { TAG: "Eq", _0: "foo", @@ -52,7 +52,7 @@ let suites_1 = { tl: { hd: [ "return", - (function (param) { + ((param) => { return { TAG: "Eq", _0: "something", @@ -63,7 +63,7 @@ let suites_1 = { tl: { hd: [ "test - null", - (function (param) { + ((param) => { return { TAG: "Eq", _0: true, @@ -74,7 +74,7 @@ let suites_1 = { tl: { hd: [ "test - undefined", - (function (param) { + ((param) => { return { TAG: "Eq", _0: true, @@ -85,7 +85,7 @@ let suites_1 = { tl: { hd: [ "test - empty", - (function (param) { + ((param) => { return { TAG: "Eq", _0: true, @@ -96,7 +96,7 @@ let suites_1 = { tl: { hd: [ "File \"js_null_undefined_test.res\", line 14, characters 5-12", - (function (param) { + ((param) => { return { TAG: "Eq", _0: true, @@ -107,11 +107,11 @@ let suites_1 = { tl: { hd: [ "bind - null", - (function (param) { + ((param) => { return { TAG: "StrictEq", _0: null, - _1: Js_null_undefined.bind(null, (function (v) { + _1: Js_null_undefined.bind(null, ((v) => { return v; })) }; @@ -120,11 +120,11 @@ let suites_1 = { tl: { hd: [ "bind - undefined", - (function (param) { + ((param) => { return { TAG: "StrictEq", _0: undefined, - _1: Js_null_undefined.bind(undefined, (function (v) { + _1: Js_null_undefined.bind(undefined, ((v) => { return v; })) }; @@ -133,11 +133,11 @@ let suites_1 = { tl: { hd: [ "bind - empty", - (function (param) { + ((param) => { return { TAG: "StrictEq", _0: undefined, - _1: Js_null_undefined.bind(undefined, (function (v) { + _1: Js_null_undefined.bind(undefined, ((v) => { return v; })) }; @@ -146,11 +146,11 @@ let suites_1 = { tl: { hd: [ "bind - 'a", - (function (param) { + ((param) => { return { TAG: "Eq", _0: 4, - _1: Js_null_undefined.bind(2, (function (n) { + _1: Js_null_undefined.bind(2, ((n) => { return (n << 1); })) }; @@ -159,11 +159,11 @@ let suites_1 = { tl: { hd: [ "iter - null", - (function (param) { + ((param) => { let hit = { contents: false }; - Js_null_undefined.iter(null, (function (param) { + Js_null_undefined.iter(null, ((param) => { hit.contents = true; })); return { @@ -176,11 +176,11 @@ let suites_1 = { tl: { hd: [ "iter - undefined", - (function (param) { + ((param) => { let hit = { contents: false }; - Js_null_undefined.iter(undefined, (function (param) { + Js_null_undefined.iter(undefined, ((param) => { hit.contents = true; })); return { @@ -193,11 +193,11 @@ let suites_1 = { tl: { hd: [ "iter - empty", - (function (param) { + ((param) => { let hit = { contents: false }; - Js_null_undefined.iter(undefined, (function (param) { + Js_null_undefined.iter(undefined, ((param) => { hit.contents = true; })); return { @@ -210,11 +210,11 @@ let suites_1 = { tl: { hd: [ "iter - 'a", - (function (param) { + ((param) => { let hit = { contents: 0 }; - Js_null_undefined.iter(2, (function (v) { + Js_null_undefined.iter(2, ((v) => { hit.contents = v; })); return { @@ -227,7 +227,7 @@ let suites_1 = { tl: { hd: [ "fromOption - None", - (function (param) { + ((param) => { return { TAG: "Eq", _0: undefined, @@ -238,7 +238,7 @@ let suites_1 = { tl: { hd: [ "fromOption - Some", - (function (param) { + ((param) => { return { TAG: "Eq", _0: 2, @@ -249,7 +249,7 @@ let suites_1 = { tl: { hd: [ "null <> undefined", - (function (param) { + ((param) => { return { TAG: "Ok", _0: true @@ -259,7 +259,7 @@ let suites_1 = { tl: { hd: [ "null <> empty", - (function (param) { + ((param) => { return { TAG: "Ok", _0: true @@ -269,7 +269,7 @@ let suites_1 = { tl: { hd: [ "undefined = empty", - (function (param) { + ((param) => { return { TAG: "Ok", _0: true @@ -279,7 +279,7 @@ let suites_1 = { tl: { hd: [ "File \"js_null_undefined_test.res\", line 57, characters 6-13", - (function (param) { + ((param) => { return { TAG: "Ok", _0: true diff --git a/jscomp/test/js_nullable_test.js b/jscomp/test/js_nullable_test.js index ba64e5e9389..2b67f1e240b 100644 --- a/jscomp/test/js_nullable_test.js +++ b/jscomp/test/js_nullable_test.js @@ -16,7 +16,7 @@ function eq(loc, x, y) { suites.contents = { hd: [ loc + (" id " + String(test_id.contents)), - (function () { + (() => { return { TAG: "Eq", _0: x, diff --git a/jscomp/test/js_obj_test.js b/jscomp/test/js_obj_test.js index 8b535ae7a5e..8819c681ca5 100644 --- a/jscomp/test/js_obj_test.js +++ b/jscomp/test/js_obj_test.js @@ -5,7 +5,7 @@ let Mt = require("./mt.js"); let suites_0 = [ "empty", - (function (param) { + ((param) => { return { TAG: "Eq", _0: 0, @@ -17,7 +17,7 @@ let suites_0 = [ let suites_1 = { hd: [ "assign", - (function (param) { + ((param) => { return { TAG: "Eq", _0: { diff --git a/jscomp/test/js_option_test.js b/jscomp/test/js_option_test.js index 1159c4c2fd2..c28f0198799 100644 --- a/jscomp/test/js_option_test.js +++ b/jscomp/test/js_option_test.js @@ -10,7 +10,7 @@ function simpleEq(a, b) { let option_suites_0 = [ "option_isSome_Some", - (function (param) { + ((param) => { return { TAG: "Eq", _0: true, @@ -22,7 +22,7 @@ let option_suites_0 = [ let option_suites_1 = { hd: [ "option_isSome_None", - (function (param) { + ((param) => { return { TAG: "Eq", _0: false, @@ -33,7 +33,7 @@ let option_suites_1 = { tl: { hd: [ "option_isNone_Some", - (function (param) { + ((param) => { return { TAG: "Eq", _0: false, @@ -44,7 +44,7 @@ let option_suites_1 = { tl: { hd: [ "option_isNone_None", - (function (param) { + ((param) => { return { TAG: "Eq", _0: true, @@ -55,7 +55,7 @@ let option_suites_1 = { tl: { hd: [ "option_isSomeValue_Eq", - (function (param) { + ((param) => { return { TAG: "Eq", _0: true, @@ -66,7 +66,7 @@ let option_suites_1 = { tl: { hd: [ "option_isSomeValue_Diff", - (function (param) { + ((param) => { return { TAG: "Eq", _0: false, @@ -77,7 +77,7 @@ let option_suites_1 = { tl: { hd: [ "option_isSomeValue_DiffNone", - (function (param) { + ((param) => { return { TAG: "Eq", _0: false, @@ -88,7 +88,7 @@ let option_suites_1 = { tl: { hd: [ "option_getExn_Some", - (function (param) { + ((param) => { return { TAG: "Eq", _0: 2, @@ -99,7 +99,7 @@ let option_suites_1 = { tl: { hd: [ "option_equal_Eq", - (function (param) { + ((param) => { return { TAG: "Eq", _0: true, @@ -110,7 +110,7 @@ let option_suites_1 = { tl: { hd: [ "option_equal_Diff", - (function (param) { + ((param) => { return { TAG: "Eq", _0: false, @@ -121,7 +121,7 @@ let option_suites_1 = { tl: { hd: [ "option_equal_DiffNone", - (function (param) { + ((param) => { return { TAG: "Eq", _0: false, @@ -132,11 +132,11 @@ let option_suites_1 = { tl: { hd: [ "option_andThen_SomeSome", - (function (param) { + ((param) => { return { TAG: "Eq", _0: true, - _1: Js_option.isSomeValue(simpleEq, 3, Js_option.andThen((function (a) { + _1: Js_option.isSomeValue(simpleEq, 3, Js_option.andThen(((a) => { return a + 1 | 0; }), 2)) }; @@ -145,11 +145,11 @@ let option_suites_1 = { tl: { hd: [ "option_andThen_SomeNone", - (function (param) { + ((param) => { return { TAG: "Eq", _0: false, - _1: Js_option.isSomeValue(simpleEq, 3, Js_option.andThen((function (param) { + _1: Js_option.isSomeValue(simpleEq, 3, Js_option.andThen(((param) => { }), 2)) }; @@ -158,11 +158,11 @@ let option_suites_1 = { tl: { hd: [ "option_map_Some", - (function (param) { + ((param) => { return { TAG: "Eq", _0: true, - _1: Js_option.isSomeValue(simpleEq, 3, Js_option.map((function (a) { + _1: Js_option.isSomeValue(simpleEq, 3, Js_option.map(((a) => { return a + 1 | 0; }), 2)) }; @@ -171,11 +171,11 @@ let option_suites_1 = { tl: { hd: [ "option_map_None", - (function (param) { + ((param) => { return { TAG: "Eq", _0: undefined, - _1: Js_option.map((function (a) { + _1: Js_option.map(((a) => { return a + 1 | 0; }), undefined) }; @@ -184,7 +184,7 @@ let option_suites_1 = { tl: { hd: [ "option_default_Some", - (function (param) { + ((param) => { return { TAG: "Eq", _0: 2, @@ -195,7 +195,7 @@ let option_suites_1 = { tl: { hd: [ "option_default_None", - (function (param) { + ((param) => { return { TAG: "Eq", _0: 3, @@ -206,11 +206,11 @@ let option_suites_1 = { tl: { hd: [ "option_filter_Pass", - (function (param) { + ((param) => { return { TAG: "Eq", _0: true, - _1: Js_option.isSomeValue(simpleEq, 2, Js_option.filter((function (a) { + _1: Js_option.isSomeValue(simpleEq, 2, Js_option.filter(((a) => { return a % 2 === 0; }), 2)) }; @@ -219,11 +219,11 @@ let option_suites_1 = { tl: { hd: [ "option_filter_Reject", - (function (param) { + ((param) => { return { TAG: "Eq", _0: undefined, - _1: Js_option.filter((function (a) { + _1: Js_option.filter(((a) => { return a % 3 === 0; }), 2) }; @@ -232,11 +232,11 @@ let option_suites_1 = { tl: { hd: [ "option_filter_None", - (function (param) { + ((param) => { return { TAG: "Eq", _0: undefined, - _1: Js_option.filter((function (a) { + _1: Js_option.filter(((a) => { return a % 3 === 0; }), undefined) }; @@ -245,7 +245,7 @@ let option_suites_1 = { tl: { hd: [ "option_firstSome_First", - (function (param) { + ((param) => { return { TAG: "Eq", _0: true, @@ -256,7 +256,7 @@ let option_suites_1 = { tl: { hd: [ "option_firstSome_First", - (function (param) { + ((param) => { return { TAG: "Eq", _0: true, @@ -267,7 +267,7 @@ let option_suites_1 = { tl: { hd: [ "option_firstSome_None", - (function (param) { + ((param) => { return { TAG: "Eq", _0: undefined, diff --git a/jscomp/test/js_re_test.js b/jscomp/test/js_re_test.js index 32dab9fbaf3..ff3d0bdeaaa 100644 --- a/jscomp/test/js_re_test.js +++ b/jscomp/test/js_re_test.js @@ -7,7 +7,7 @@ let Caml_option = require("../../lib/js/caml_option.js"); let suites_0 = [ "captures", - (function (param) { + ((param) => { let re = /(\d+)-(?:(\d+))?/g; let result = re.exec("3-"); if (result === null) { @@ -35,8 +35,8 @@ let suites_0 = [ let suites_1 = { hd: [ "fromString", - (function (param) { - let contentOf = function (tag, xmlString) { + ((param) => { + let contentOf = (tag, xmlString) => { let x = Caml_option.null_to_opt(new RegExp("<" + (tag + (">(.*?)<\\/" + (tag + ">")))).exec(xmlString)); if (x !== undefined) { return Caml_option.nullable_to_opt(Caml_array.get(Caml_option.valFromOption(x), 1)); @@ -53,7 +53,7 @@ let suites_1 = { tl: { hd: [ "exec_literal", - (function (param) { + ((param) => { let res = /[^.]+/.exec("http://xxx.domain.com"); if (res !== null) { return { @@ -72,7 +72,7 @@ let suites_1 = { tl: { hd: [ "exec_no_match", - (function (param) { + ((param) => { let match = /https:\/\/(.*)/.exec("http://xxx.domain.com"); if (match !== null) { return { @@ -90,7 +90,7 @@ let suites_1 = { tl: { hd: [ "test_str", - (function (param) { + ((param) => { let res = new RegExp("foo").test("#foo#"); return { TAG: "Eq", @@ -102,7 +102,7 @@ let suites_1 = { tl: { hd: [ "fromStringWithFlags", - (function (param) { + ((param) => { let res = new RegExp("foo", "g"); return { TAG: "Eq", @@ -114,7 +114,7 @@ let suites_1 = { tl: { hd: [ "result_index", - (function (param) { + ((param) => { let res = new RegExp("zbar").exec("foobarbazbar"); if (res !== null) { return { @@ -133,7 +133,7 @@ let suites_1 = { tl: { hd: [ "result_input", - (function (param) { + ((param) => { let input = "foobar"; let res = /foo/g.exec(input); if (res !== null) { @@ -153,7 +153,7 @@ let suites_1 = { tl: { hd: [ "t_flags", - (function (param) { + ((param) => { return { TAG: "Eq", _0: "gi", @@ -164,7 +164,7 @@ let suites_1 = { tl: { hd: [ "t_global", - (function (param) { + ((param) => { return { TAG: "Eq", _0: true, @@ -175,7 +175,7 @@ let suites_1 = { tl: { hd: [ "t_ignoreCase", - (function (param) { + ((param) => { return { TAG: "Eq", _0: true, @@ -186,7 +186,7 @@ let suites_1 = { tl: { hd: [ "t_lastIndex", - (function (param) { + ((param) => { let re = /na/g; re.exec("banana"); return { @@ -199,7 +199,7 @@ let suites_1 = { tl: { hd: [ "t_setLastIndex", - (function (param) { + ((param) => { let re = /na/g; let before = re.lastIndex; re.lastIndex = 42; @@ -220,7 +220,7 @@ let suites_1 = { tl: { hd: [ "t_multiline", - (function (param) { + ((param) => { return { TAG: "Eq", _0: false, @@ -231,7 +231,7 @@ let suites_1 = { tl: { hd: [ "t_source", - (function (param) { + ((param) => { return { TAG: "Eq", _0: "f.+o", @@ -242,7 +242,7 @@ let suites_1 = { tl: { hd: [ "t_sticky", - (function (param) { + ((param) => { return { TAG: "Eq", _0: true, @@ -253,7 +253,7 @@ let suites_1 = { tl: { hd: [ "t_unicode", - (function (param) { + ((param) => { return { TAG: "Eq", _0: false, diff --git a/jscomp/test/js_string_test.js b/jscomp/test/js_string_test.js index 5531abd586f..cc808fc1df0 100644 --- a/jscomp/test/js_string_test.js +++ b/jscomp/test/js_string_test.js @@ -7,7 +7,7 @@ let Caml_option = require("../../lib/js/caml_option.js"); let suites_0 = [ "make", - (function (param) { + ((param) => { return { TAG: "Eq", _0: "null", @@ -19,7 +19,7 @@ let suites_0 = [ let suites_1 = { hd: [ "fromCharCode", - (function (param) { + ((param) => { return { TAG: "Eq", _0: "a", @@ -30,7 +30,7 @@ let suites_1 = { tl: { hd: [ "fromCharCodeMany", - (function (param) { + ((param) => { return { TAG: "Eq", _0: "az", @@ -41,7 +41,7 @@ let suites_1 = { tl: { hd: [ "fromCodePoint", - (function (param) { + ((param) => { return { TAG: "Eq", _0: "a", @@ -52,7 +52,7 @@ let suites_1 = { tl: { hd: [ "fromCodePointMany", - (function (param) { + ((param) => { return { TAG: "Eq", _0: "az", @@ -63,7 +63,7 @@ let suites_1 = { tl: { hd: [ "length", - (function (param) { + ((param) => { return { TAG: "Eq", _0: 3, @@ -74,7 +74,7 @@ let suites_1 = { tl: { hd: [ "get", - (function (param) { + ((param) => { return { TAG: "Eq", _0: "a", @@ -85,7 +85,7 @@ let suites_1 = { tl: { hd: [ "charAt", - (function (param) { + ((param) => { return { TAG: "Eq", _0: "a", @@ -96,7 +96,7 @@ let suites_1 = { tl: { hd: [ "charCodeAt", - (function (param) { + ((param) => { return { TAG: "Eq", _0: 97, @@ -107,7 +107,7 @@ let suites_1 = { tl: { hd: [ "codePointAt", - (function (param) { + ((param) => { return { TAG: "Eq", _0: 97, @@ -118,7 +118,7 @@ let suites_1 = { tl: { hd: [ "codePointAt - out of bounds", - (function (param) { + ((param) => { return { TAG: "Eq", _0: undefined, @@ -129,7 +129,7 @@ let suites_1 = { tl: { hd: [ "concat", - (function (param) { + ((param) => { return { TAG: "Eq", _0: "foobar", @@ -140,7 +140,7 @@ let suites_1 = { tl: { hd: [ "concatMany", - (function (param) { + ((param) => { return { TAG: "Eq", _0: "foobarbaz", @@ -151,7 +151,7 @@ let suites_1 = { tl: { hd: [ "endsWith", - (function (param) { + ((param) => { return { TAG: "Eq", _0: true, @@ -162,7 +162,7 @@ let suites_1 = { tl: { hd: [ "endsWithFrom", - (function (param) { + ((param) => { return { TAG: "Eq", _0: false, @@ -173,7 +173,7 @@ let suites_1 = { tl: { hd: [ "includes", - (function (param) { + ((param) => { return { TAG: "Eq", _0: true, @@ -184,7 +184,7 @@ let suites_1 = { tl: { hd: [ "includesFrom", - (function (param) { + ((param) => { return { TAG: "Eq", _0: false, @@ -195,7 +195,7 @@ let suites_1 = { tl: { hd: [ "indexOf", - (function (param) { + ((param) => { return { TAG: "Eq", _0: 3, @@ -206,7 +206,7 @@ let suites_1 = { tl: { hd: [ "indexOfFrom", - (function (param) { + ((param) => { return { TAG: "Eq", _0: -1, @@ -217,7 +217,7 @@ let suites_1 = { tl: { hd: [ "lastIndexOf", - (function (param) { + ((param) => { return { TAG: "Eq", _0: 3, @@ -228,7 +228,7 @@ let suites_1 = { tl: { hd: [ "lastIndexOfFrom", - (function (param) { + ((param) => { return { TAG: "Eq", _0: 3, @@ -239,7 +239,7 @@ let suites_1 = { tl: { hd: [ "localeCompare", - (function (param) { + ((param) => { return { TAG: "Eq", _0: 0, @@ -250,7 +250,7 @@ let suites_1 = { tl: { hd: [ "match", - (function (param) { + ((param) => { return { TAG: "Eq", _0: [ @@ -264,7 +264,7 @@ let suites_1 = { tl: { hd: [ "match - no match", - (function (param) { + ((param) => { return { TAG: "Eq", _0: undefined, @@ -275,14 +275,14 @@ let suites_1 = { tl: { hd: [ "match - not found capture groups", - (function (param) { + ((param) => { return { TAG: "Eq", _0: [ "hello ", undefined ], - _1: Belt_Option.map(Caml_option.null_to_opt("hello word".match(/hello (world)?/)), (function (prim) { + _1: Belt_Option.map(Caml_option.null_to_opt("hello word".match(/hello (world)?/)), ((prim) => { return prim.slice(); })) }; @@ -291,7 +291,7 @@ let suites_1 = { tl: { hd: [ "normalize", - (function (param) { + ((param) => { return { TAG: "Eq", _0: "foo", @@ -302,7 +302,7 @@ let suites_1 = { tl: { hd: [ "normalizeByForm", - (function (param) { + ((param) => { return { TAG: "Eq", _0: "foo", @@ -313,7 +313,7 @@ let suites_1 = { tl: { hd: [ "repeat", - (function (param) { + ((param) => { return { TAG: "Eq", _0: "foofoofoo", @@ -324,7 +324,7 @@ let suites_1 = { tl: { hd: [ "replace", - (function (param) { + ((param) => { return { TAG: "Eq", _0: "fooBORKbaz", @@ -335,7 +335,7 @@ let suites_1 = { tl: { hd: [ "replaceByRe", - (function (param) { + ((param) => { return { TAG: "Eq", _0: "fooBORKBORK", @@ -346,8 +346,8 @@ let suites_1 = { tl: { hd: [ "unsafeReplaceBy0", - (function (param) { - let replace = function (whole, offset, s) { + ((param) => { + let replace = (whole, offset, s) => { if (whole === "bar") { return "BORK"; } else { @@ -364,8 +364,8 @@ let suites_1 = { tl: { hd: [ "unsafeReplaceBy1", - (function (param) { - let replace = function (whole, p1, offset, s) { + ((param) => { + let replace = (whole, p1, offset, s) => { if (whole === "bar") { return "BORK"; } else { @@ -382,8 +382,8 @@ let suites_1 = { tl: { hd: [ "unsafeReplaceBy2", - (function (param) { - let replace = function (whole, p1, p2, offset, s) { + ((param) => { + let replace = (whole, p1, p2, offset, s) => { if (whole === "bar") { return "BORK"; } else { @@ -400,8 +400,8 @@ let suites_1 = { tl: { hd: [ "unsafeReplaceBy3", - (function (param) { - let replace = function (whole, p1, p2, p3, offset, s) { + ((param) => { + let replace = (whole, p1, p2, p3, offset, s) => { if (whole === "bar") { return "BORK"; } else { @@ -418,7 +418,7 @@ let suites_1 = { tl: { hd: [ "search", - (function (param) { + ((param) => { return { TAG: "Eq", _0: 3, @@ -429,7 +429,7 @@ let suites_1 = { tl: { hd: [ "slice", - (function (param) { + ((param) => { return { TAG: "Eq", _0: "bar", @@ -440,7 +440,7 @@ let suites_1 = { tl: { hd: [ "sliceToEnd", - (function (param) { + ((param) => { return { TAG: "Eq", _0: "barbaz", @@ -451,7 +451,7 @@ let suites_1 = { tl: { hd: [ "split", - (function (param) { + ((param) => { return { TAG: "Eq", _0: [ @@ -466,7 +466,7 @@ let suites_1 = { tl: { hd: [ "splitAtMost", - (function (param) { + ((param) => { return { TAG: "Eq", _0: [ @@ -480,7 +480,7 @@ let suites_1 = { tl: { hd: [ "splitByRe", - (function (param) { + ((param) => { return { TAG: "Eq", _0: [ @@ -499,7 +499,7 @@ let suites_1 = { tl: { hd: [ "splitByReAtMost", - (function (param) { + ((param) => { return { TAG: "Eq", _0: [ @@ -514,7 +514,7 @@ let suites_1 = { tl: { hd: [ "startsWith", - (function (param) { + ((param) => { return { TAG: "Eq", _0: true, @@ -525,7 +525,7 @@ let suites_1 = { tl: { hd: [ "startsWithFrom", - (function (param) { + ((param) => { return { TAG: "Eq", _0: false, @@ -536,7 +536,7 @@ let suites_1 = { tl: { hd: [ "substr", - (function (param) { + ((param) => { return { TAG: "Eq", _0: "barbaz", @@ -547,7 +547,7 @@ let suites_1 = { tl: { hd: [ "substrAtMost", - (function (param) { + ((param) => { return { TAG: "Eq", _0: "bar", @@ -558,7 +558,7 @@ let suites_1 = { tl: { hd: [ "substring", - (function (param) { + ((param) => { return { TAG: "Eq", _0: "bar", @@ -569,7 +569,7 @@ let suites_1 = { tl: { hd: [ "substringToEnd", - (function (param) { + ((param) => { return { TAG: "Eq", _0: "barbaz", @@ -580,7 +580,7 @@ let suites_1 = { tl: { hd: [ "toLowerCase", - (function (param) { + ((param) => { return { TAG: "Eq", _0: "bork", @@ -591,7 +591,7 @@ let suites_1 = { tl: { hd: [ "toLocaleLowerCase", - (function (param) { + ((param) => { return { TAG: "Eq", _0: "bork", @@ -602,7 +602,7 @@ let suites_1 = { tl: { hd: [ "toUpperCase", - (function (param) { + ((param) => { return { TAG: "Eq", _0: "FUBAR", @@ -613,7 +613,7 @@ let suites_1 = { tl: { hd: [ "toLocaleUpperCase", - (function (param) { + ((param) => { return { TAG: "Eq", _0: "FUBAR", @@ -624,7 +624,7 @@ let suites_1 = { tl: { hd: [ "trim", - (function (param) { + ((param) => { return { TAG: "Eq", _0: "foo", @@ -635,7 +635,7 @@ let suites_1 = { tl: { hd: [ "anchor", - (function (param) { + ((param) => { return { TAG: "Eq", _0: "foo", @@ -646,7 +646,7 @@ let suites_1 = { tl: { hd: [ "link", - (function (param) { + ((param) => { return { TAG: "Eq", _0: "foo", @@ -657,7 +657,7 @@ let suites_1 = { tl: { hd: [ "File \"js_string_test.res\", line 138, characters 5-12", - (function (param) { + ((param) => { return { TAG: "Ok", _0: "ab".includes("a") diff --git a/jscomp/test/js_undefined_test.js b/jscomp/test/js_undefined_test.js index 317c5604b6f..364b8b106e7 100644 --- a/jscomp/test/js_undefined_test.js +++ b/jscomp/test/js_undefined_test.js @@ -7,7 +7,7 @@ let Js_undefined = require("../../lib/js/js_undefined.js"); let suites_0 = [ "toOption - empty", - (function (param) { + ((param) => { return { TAG: "Eq", _0: undefined, @@ -19,7 +19,7 @@ let suites_0 = [ let suites_1 = { hd: [ "File \"js_undefined_test.res\", line 7, characters 5-12", - (function (param) { + ((param) => { return { TAG: "Eq", _0: undefined, @@ -30,7 +30,7 @@ let suites_1 = { tl: { hd: [ "return", - (function (param) { + ((param) => { return { TAG: "Eq", _0: "something", @@ -41,7 +41,7 @@ let suites_1 = { tl: { hd: [ "test - empty", - (function (param) { + ((param) => { return { TAG: "Eq", _0: true, @@ -52,7 +52,7 @@ let suites_1 = { tl: { hd: [ "File \"js_undefined_test.res\", line 10, characters 5-12", - (function (param) { + ((param) => { return { TAG: "Eq", _0: true, @@ -63,11 +63,11 @@ let suites_1 = { tl: { hd: [ "bind - empty", - (function (param) { + ((param) => { return { TAG: "Eq", _0: undefined, - _1: Js_undefined.bind(undefined, (function (v) { + _1: Js_undefined.bind(undefined, ((v) => { return v; })) }; @@ -76,11 +76,11 @@ let suites_1 = { tl: { hd: [ "bind - 'a", - (function (param) { + ((param) => { return { TAG: "Eq", _0: 4, - _1: Js_undefined.bind(2, (function (n) { + _1: Js_undefined.bind(2, ((n) => { return (n << 1); })) }; @@ -89,11 +89,11 @@ let suites_1 = { tl: { hd: [ "iter - empty", - (function (param) { + ((param) => { let hit = { contents: false }; - Js_undefined.iter(undefined, (function (param) { + Js_undefined.iter(undefined, ((param) => { hit.contents = true; })); return { @@ -106,11 +106,11 @@ let suites_1 = { tl: { hd: [ "iter - 'a", - (function (param) { + ((param) => { let hit = { contents: 0 }; - Js_undefined.iter(2, (function (v) { + Js_undefined.iter(2, ((v) => { hit.contents = v; })); return { @@ -123,7 +123,7 @@ let suites_1 = { tl: { hd: [ "fromOption - None", - (function (param) { + ((param) => { return { TAG: "Eq", _0: undefined, @@ -134,7 +134,7 @@ let suites_1 = { tl: { hd: [ "fromOption - Some", - (function (param) { + ((param) => { return { TAG: "Eq", _0: 2, diff --git a/jscomp/test/jsoo_400_test.js b/jscomp/test/jsoo_400_test.js index 378d6d338c9..1a87368d185 100644 --- a/jscomp/test/jsoo_400_test.js +++ b/jscomp/test/jsoo_400_test.js @@ -17,10 +17,10 @@ function u() { Mt.from_pair_suites("Jsoo_400_test", { hd: [ "File \"jsoo_400_test.res\", line 7, characters 38-45", - (function () { + (() => { return { TAG: "ThrowAny", - _0: (function () { + _0: (() => { u(); }) }; diff --git a/jscomp/test/key_word_property_plus_test.js b/jscomp/test/key_word_property_plus_test.js index e8ab212a112..ee0bb4c307c 100644 --- a/jscomp/test/key_word_property_plus_test.js +++ b/jscomp/test/key_word_property_plus_test.js @@ -17,7 +17,7 @@ function eq(loc, x, y) { suites.contents = { hd: [ loc + (" id " + String(test_id.contents)), - (function () { + (() => { return { TAG: "Eq", _0: x, @@ -34,7 +34,7 @@ eq("File \"key_word_property_plus_test.res\", line 10, characters 2-9", [ 2, 3, 4 -].reduce((function (prim0, prim1) { +].reduce(((prim0, prim1) => { return prim0 + prim1 | 0; }), 0), ((Global_mangles.$$__dirname + Global_mangles.$$__filename | 0) + Global_mangles.$$exports | 0) + Global_mangles.$$require | 0); diff --git a/jscomp/test/lazy_demo.js b/jscomp/test/lazy_demo.js index 1d4fa284668..356c5123243 100644 --- a/jscomp/test/lazy_demo.js +++ b/jscomp/test/lazy_demo.js @@ -3,12 +3,12 @@ let CamlinternalLazy = require("../../lib/js/camlinternalLazy.js"); -let lazy1 = CamlinternalLazy.from_fun(function () { +let lazy1 = CamlinternalLazy.from_fun(() => { console.log("Hello, lazy"); return 1; }); -let lazy2 = CamlinternalLazy.from_fun(function () { +let lazy2 = CamlinternalLazy.from_fun(() => { return 3; }); diff --git a/jscomp/test/lazy_test.js b/jscomp/test/lazy_test.js index 7d56dbcdeb3..fa7dbee45b7 100644 --- a/jscomp/test/lazy_test.js +++ b/jscomp/test/lazy_test.js @@ -9,7 +9,7 @@ let u = { contents: 3 }; -let v = CamlinternalLazy.from_fun(function () { +let v = CamlinternalLazy.from_fun(() => { u.contents = 32; }); @@ -27,7 +27,7 @@ let u_v = { contents: 0 }; -let u$1 = CamlinternalLazy.from_fun(function () { +let u$1 = CamlinternalLazy.from_fun(() => { u_v.contents = 2; }); @@ -35,7 +35,7 @@ CamlinternalLazy.force(u$1); let exotic = CamlinternalLazy.force; -let l_from_fun = CamlinternalLazy.from_fun(function () { +let l_from_fun = CamlinternalLazy.from_fun(() => { return 3; }); @@ -45,21 +45,21 @@ function f() { return u; } -let forward_test = CamlinternalLazy.from_fun(function () { +let forward_test = CamlinternalLazy.from_fun(() => { return f(); }); -let f005 = CamlinternalLazy.from_fun(function () { +let f005 = CamlinternalLazy.from_fun(() => { return 6; }); -let f006 = CamlinternalLazy.from_fun(function () { - return function () { +let f006 = CamlinternalLazy.from_fun(() => { + return () => { return 3; }; }); -let f007 = CamlinternalLazy.from_fun(function () { +let f007 = CamlinternalLazy.from_fun(() => { throw new Error("Not_found", { cause: { RE_EXN_ID: "Not_found" @@ -76,7 +76,7 @@ function f$1() { }); } -let f008 = CamlinternalLazy.from_fun(function () { +let f008 = CamlinternalLazy.from_fun(() => { return f$1(); }); @@ -97,7 +97,7 @@ let a8 = CamlinternalLazy.force(a6); Mt.from_pair_suites("Lazy_test", { hd: [ "simple", - (function () { + (() => { return { TAG: "Eq", _0: lazy_test(), @@ -111,7 +111,7 @@ Mt.from_pair_suites("Lazy_test", { tl: { hd: [ "lazy_force", - (function () { + (() => { return { TAG: "Eq", _0: u_v.contents, @@ -122,7 +122,7 @@ Mt.from_pair_suites("Lazy_test", { tl: { hd: [ "lazy_from_fun", - (function () { + (() => { return { TAG: "Eq", _0: CamlinternalLazy.force(l_from_fun), @@ -133,7 +133,7 @@ Mt.from_pair_suites("Lazy_test", { tl: { hd: [ "lazy_from_val", - (function () { + (() => { return { TAG: "Eq", _0: CamlinternalLazy.force(CamlinternalLazy.from_val(3)), @@ -144,10 +144,10 @@ Mt.from_pair_suites("Lazy_test", { tl: { hd: [ "lazy_from_val2", - (function () { + (() => { return { TAG: "Eq", - _0: CamlinternalLazy.force(CamlinternalLazy.force(CamlinternalLazy.from_val(CamlinternalLazy.from_fun(function () { + _0: CamlinternalLazy.force(CamlinternalLazy.force(CamlinternalLazy.from_val(CamlinternalLazy.from_fun(() => { return 3; })))), _1: 3 @@ -157,7 +157,7 @@ Mt.from_pair_suites("Lazy_test", { tl: { hd: [ "lazy_from_val3", - (function () { + (() => { debugger; return { TAG: "Eq", @@ -169,7 +169,7 @@ Mt.from_pair_suites("Lazy_test", { tl: { hd: [ "lazy_test.res", - (function () { + (() => { return { TAG: "Eq", _0: a3, @@ -180,7 +180,7 @@ Mt.from_pair_suites("Lazy_test", { tl: { hd: [ "lazy_test.res", - (function () { + (() => { return { TAG: "Eq", _0: a7, @@ -191,7 +191,7 @@ Mt.from_pair_suites("Lazy_test", { tl: { hd: [ "lazy_test.res", - (function () { + (() => { return { TAG: "Eq", _0: a8, @@ -202,7 +202,7 @@ Mt.from_pair_suites("Lazy_test", { tl: { hd: [ "File \"lazy_test.res\", line 95, characters 7-14", - (function () { + (() => { return { TAG: "Ok", _0: Lazy.is_val(CamlinternalLazy.from_val(3)) @@ -212,10 +212,10 @@ Mt.from_pair_suites("Lazy_test", { tl: { hd: [ "File \"lazy_test.res\", line 96, characters 7-14", - (function () { + (() => { return { TAG: "Ok", - _0: !Lazy.is_val(CamlinternalLazy.from_fun(function () { + _0: !Lazy.is_val(CamlinternalLazy.from_fun(() => { throw new Error("Not_found", { cause: { RE_EXN_ID: "Not_found" diff --git a/jscomp/test/lib_js_test.js b/jscomp/test/lib_js_test.js index b392b3d7c45..02848f68d76 100644 --- a/jscomp/test/lib_js_test.js +++ b/jscomp/test/lib_js_test.js @@ -18,7 +18,7 @@ console.log("hey"); let suites_0 = [ "anything_to_string", - (function (param) { + ((param) => { return { TAG: "Eq", _0: "3", diff --git a/jscomp/test/libarg_test.js b/jscomp/test/libarg_test.js index 9a26d502502..42a1457b86b 100644 --- a/jscomp/test/libarg_test.js +++ b/jscomp/test/libarg_test.js @@ -365,7 +365,7 @@ function test(argv) { } }; if (Caml_obj.notequal(result, reference)) { - let f = function (x, y) { + let f = (x, y) => { console.log(x, y); }; List.iter2(f, result, reference); diff --git a/jscomp/test/libqueue_test.js b/jscomp/test/libqueue_test.js index d3db327772b..ecc17c708ef 100644 --- a/jscomp/test/libqueue_test.js +++ b/jscomp/test/libqueue_test.js @@ -7,7 +7,7 @@ let Caml_obj = require("../../lib/js/caml_obj.js"); let Caml_js_exceptions = require("../../lib/js/caml_js_exceptions.js"); function to_list(q) { - return List.rev(Queue.fold((function (l, x) { + return List.rev(Queue.fold(((l, x) => { return { hd: x, tl: l @@ -865,7 +865,7 @@ let i$7 = { contents: 1 }; -Queue.iter((function (j) { +Queue.iter(((j) => { if (i$7.contents !== j) { throw new Error("Assert_failure", { cause: { diff --git a/jscomp/test/limits_test.js b/jscomp/test/limits_test.js index bdf6c1e70db..e23425dc558 100644 --- a/jscomp/test/limits_test.js +++ b/jscomp/test/limits_test.js @@ -18,7 +18,7 @@ function eq(loc, x, y) { suites.contents = { hd: [ loc + (" id " + String(test_id.contents)), - (function () { + (() => { return { TAG: "Eq", _0: x, diff --git a/jscomp/test/list_stack.js b/jscomp/test/list_stack.js index 33c026664a5..174acc8ee5c 100644 --- a/jscomp/test/list_stack.js +++ b/jscomp/test/list_stack.js @@ -3,7 +3,7 @@ let List = require("../../lib/js/list.js"); -List.find((function (x) { +List.find(((x) => { return x > 3; }), /* [] */0); diff --git a/jscomp/test/list_test.js b/jscomp/test/list_test.js index fb69b118b67..fa78ef49784 100644 --- a/jscomp/test/list_test.js +++ b/jscomp/test/list_test.js @@ -8,7 +8,7 @@ let $$Array = require("../../lib/js/array.js"); let list_suites_0 = [ "length", - (function (param) { + ((param) => { return { TAG: "Eq", _0: 1, @@ -29,7 +29,7 @@ let list_suites_0 = [ let list_suites_1 = { hd: [ "length2", - (function (param) { + ((param) => { return { TAG: "Eq", _0: 5, @@ -55,11 +55,11 @@ let list_suites_1 = { tl: { hd: [ "long_length", - (function (param) { + ((param) => { return { TAG: "Eq", _0: 30000, - _1: List.length($$Array.to_list($$Array.init(30000, (function (param) { + _1: List.length($$Array.to_list($$Array.init(30000, ((param) => { return 0; })))) }; @@ -68,7 +68,7 @@ let list_suites_1 = { tl: { hd: [ "sort", - (function (param) { + ((param) => { return { TAG: "Eq", _0: List.sort(Caml.int_compare, { @@ -103,7 +103,7 @@ let list_suites_1 = { tl: { hd: [ "File \"list_test.res\", line 20, characters 5-12", - (function (param) { + ((param) => { return { TAG: "Eq", _0: true, @@ -123,7 +123,7 @@ let list_suites_1 = { tl: { hd: [ "File \"list_test.res\", line 21, characters 5-12", - (function (param) { + ((param) => { return { TAG: "Eq", _0: false, @@ -143,7 +143,7 @@ let list_suites_1 = { tl: { hd: [ "File \"list_test.res\", line 22, characters 5-12", - (function (param) { + ((param) => { return { TAG: "Eq", _0: 9, diff --git a/jscomp/test/loop_regression_test.js b/jscomp/test/loop_regression_test.js index a539680a85b..0f73c388d82 100644 --- a/jscomp/test/loop_regression_test.js +++ b/jscomp/test/loop_regression_test.js @@ -23,7 +23,7 @@ function f() { let suites_0 = [ "sum", - (function (param) { + ((param) => { return { TAG: "Eq", _0: 55, diff --git a/jscomp/test/map_find_test.js b/jscomp/test/map_find_test.js index c070c6c5212..b192424ea8d 100644 --- a/jscomp/test/map_find_test.js +++ b/jscomp/test/map_find_test.js @@ -158,7 +158,7 @@ function find(x, _param) { }; } -let m = List.fold_left((function (acc, param) { +let m = List.fold_left(((acc, param) => { return add(param[0], param[1], acc); }), "Empty", { hd: [ @@ -339,7 +339,7 @@ function find$1(x, _param) { }; } -let s = List.fold_left((function (acc, param) { +let s = List.fold_left(((acc, param) => { return add$1(param[0], param[1], acc); }), "Empty", { hd: [ @@ -370,7 +370,7 @@ let s = List.fold_left((function (acc, param) { Mt.from_pair_suites("Map_find_test", { hd: [ "int", - (function () { + (() => { return { TAG: "Eq", _0: find(10, m), @@ -381,7 +381,7 @@ Mt.from_pair_suites("Map_find_test", { tl: { hd: [ "string", - (function () { + (() => { return { TAG: "Eq", _0: find$1("10", s), diff --git a/jscomp/test/map_test.js b/jscomp/test/map_test.js index defd198b77e..2b7569617d3 100644 --- a/jscomp/test/map_test.js +++ b/jscomp/test/map_test.js @@ -2001,14 +2001,14 @@ let String_map = { }; function of_list(kvs) { - return List.fold_left((function (acc, param) { + return List.fold_left(((acc, param) => { return add(param[0], param[1], acc); }), "Empty", kvs); } let int_map_suites_0 = [ "add", - (function (param) { + ((param) => { let v = of_list({ hd: [ 1, @@ -2039,7 +2039,7 @@ let int_map_suites_0 = [ let int_map_suites_1 = { hd: [ "equal", - (function (param) { + ((param) => { let v = of_list({ hd: [ 1, @@ -2088,7 +2088,7 @@ let int_map_suites_1 = { tl: { hd: [ "equal2", - (function (param) { + ((param) => { let v = of_list({ hd: [ 1, @@ -2130,7 +2130,7 @@ let int_map_suites_1 = { return { TAG: "Eq", _0: true, - _1: equal((function (x, y) { + _1: equal(((x, y) => { return x === y; }), u, v) }; @@ -2139,7 +2139,7 @@ let int_map_suites_1 = { tl: { hd: [ "iteration", - (function (param) { + ((param) => { let m = "Empty"; for (let i = 0; i <= 10000; ++i) { m = add$1(String(i), String(i), m); diff --git a/jscomp/test/mario_game.js b/jscomp/test/mario_game.js index 38059f98713..d09ae71238c 100644 --- a/jscomp/test/mario_game.js +++ b/jscomp/test/mario_game.js @@ -948,7 +948,7 @@ function update_player(player, keys, context) { let prev_jumping = player.jumping; let prev_dir = player.dir; let prev_vx = Math.abs(player.vel.x); - List.iter((function (extra) { + List.iter(((extra) => { let lr_acc = player.vel.x * 0.2; switch (extra) { case "CLeft" : @@ -2085,7 +2085,7 @@ function process_collision(dir, c1, c2, state) { function broad_phase(collid, all_collids, state) { let obj = collid._2; - return List.filter((function (c) { + return List.filter(((c) => { if (in_viewport(state.vpt, obj.pos) || is_player(collid)) { return true; } else { @@ -2205,7 +2205,7 @@ function translate_keys() { hd: ctrls_0, tl: ctrls_1 }; - return List.fold_left((function (a, x) { + return List.fold_left(((a, x) => { if (x[0]) { return { hd: x[1], @@ -2273,7 +2273,7 @@ function update_loop(canvas, param, map_dim) { game_over: false }; state.ctx.scale(1, 1); - let update_helper = function (time, state, player, objs, parts) { + let update_helper = (time, state, player, objs, parts) => { if (state.game_over === true) { return game_win(state.ctx); } @@ -2299,10 +2299,10 @@ function update_loop(canvas, param, map_dim) { multiplier: state.multiplier, game_over: state.game_over }; - List.iter((function (obj) { + List.iter(((obj) => { run_update_collid(state$1, obj, objs); }), objs); - List.iter((function (part) { + List.iter(((part) => { process(part); let x = part.pos.x - state$1.vpt.pos.x; let y = part.pos.y - state$1.vpt.pos.y; @@ -2321,7 +2321,7 @@ function update_loop(canvas, param, map_dim) { }), parts); fps(canvas, fps$1); hud(canvas, state$1.score, state$1.coins); - requestAnimationFrame(function (t) { + requestAnimationFrame((t) => { update_helper(t, state$1, player$1, collid_objs.contents, particles.contents); }); }; @@ -3308,11 +3308,11 @@ function inc_counter(param) { } function preload(param) { - return List.map((function (img_src) { + return List.map(((img_src) => { let img_src$1 = "sprites/" + img_src; let img = document.createElement("img"); img.src = img_src$1; - img.addEventListener("load", (function (ev) { + img.addEventListener("load", ((ev) => { inc_counter(); return true; }), true); @@ -3331,7 +3331,7 @@ function preload(param) { }); } -window.onload = (function (param) { +window.onload = ((param) => { preload(); return true; }); diff --git a/jscomp/test/method_name_test.js b/jscomp/test/method_name_test.js index 3c0e9a5a9d7..98649f7af65 100644 --- a/jscomp/test/method_name_test.js +++ b/jscomp/test/method_name_test.js @@ -16,7 +16,7 @@ function eq(loc, x, y) { suites.contents = { hd: [ loc + (" id " + String(test_id.contents)), - (function () { + (() => { return { TAG: "Eq", _0: x, diff --git a/jscomp/test/mock_mt.js b/jscomp/test/mock_mt.js index e2d271f81b3..f70d5a2cef2 100644 --- a/jscomp/test/mock_mt.js +++ b/jscomp/test/mock_mt.js @@ -8,7 +8,7 @@ function from_pair_suites(name, suites) { name, "testing" ]); - List.iter((function (param) { + List.iter(((param) => { let name = param[0]; let fn = param[1](); switch (fn.TAG) { diff --git a/jscomp/test/module_alias_test.js b/jscomp/test/module_alias_test.js index ad1d061bc71..eb8e82994c6 100644 --- a/jscomp/test/module_alias_test.js +++ b/jscomp/test/module_alias_test.js @@ -17,7 +17,7 @@ function eq(loc, x, y) { suites.contents = { hd: [ loc + (" id " + String(test_id.contents)), - (function () { + (() => { return { TAG: "Eq", _0: x, diff --git a/jscomp/test/module_parameter_test.js b/jscomp/test/module_parameter_test.js index d4d7c5e1221..604562402bc 100644 --- a/jscomp/test/module_parameter_test.js +++ b/jscomp/test/module_parameter_test.js @@ -22,7 +22,7 @@ function v(x) { let suites_0 = [ "const", - (function (param) { + ((param) => { return { TAG: "Eq", _0: 1, @@ -34,7 +34,7 @@ let suites_0 = [ let suites_1 = { hd: [ "other", - (function (param) { + ((param) => { return { TAG: "Eq", _0: 3, diff --git a/jscomp/test/module_splice_test.js b/jscomp/test/module_splice_test.js index 1aafc543dc7..43d58cc59e4 100644 --- a/jscomp/test/module_splice_test.js +++ b/jscomp/test/module_splice_test.js @@ -20,7 +20,7 @@ function eq(loc, param) { suites.contents = { hd: [ loc + (" id " + String(test_id.contents)), - (function () { + (() => { return { TAG: "Eq", _0: x, diff --git a/jscomp/test/more_poly_variant_test.js b/jscomp/test/more_poly_variant_test.js index 7e9057076a5..44367dd1c68 100644 --- a/jscomp/test/more_poly_variant_test.js +++ b/jscomp/test/more_poly_variant_test.js @@ -3,7 +3,7 @@ function map(f) { - return function (x) { + return (x) => { if (typeof x !== "object") { return "Nil"; } diff --git a/jscomp/test/mpr_6033_test.js b/jscomp/test/mpr_6033_test.js index 9c1d14ef497..d8777d916bb 100644 --- a/jscomp/test/mpr_6033_test.js +++ b/jscomp/test/mpr_6033_test.js @@ -17,7 +17,7 @@ function eq(loc, x, y) { suites.contents = { hd: [ loc + (" id " + String(test_id.contents)), - (function () { + (() => { return { TAG: "Eq", _0: x, @@ -33,7 +33,7 @@ function f(x) { return CamlinternalLazy.force(x) + "abc"; } -let x = CamlinternalLazy.from_fun(function () { +let x = CamlinternalLazy.from_fun(() => { return "def"; }); diff --git a/jscomp/test/mt.js b/jscomp/test/mt.js index 8f4c47e25f1..bc239586f78 100644 --- a/jscomp/test/mt.js +++ b/jscomp/test/mt.js @@ -220,11 +220,11 @@ function old_from_promise_suites_donotuse(name, suites) { let match = $$Array.to_list(Process.argv); if (match) { if (is_mocha()) { - describe(name, (function () { - List.iter((function (param) { + describe(name, (() => { + List.iter(((param) => { let code = param[1]; - it(param[0], (function () { - return code.then(function (x) { + it(param[0], (() => { + return code.then((x) => { handleCode(x); return val_unit; }); @@ -244,7 +244,7 @@ function eq_suites(test_id, suites, loc, x, y) { suites.contents = { hd: [ loc + (" id " + String(test_id.contents)), - (function (param) { + ((param) => { return { TAG: "Eq", _0: x, @@ -261,7 +261,7 @@ function bool_suites(test_id, suites, loc, x) { suites.contents = { hd: [ loc + (" id " + String(test_id.contents)), - (function (param) { + ((param) => { return { TAG: "Ok", _0: x @@ -277,7 +277,7 @@ function throw_suites(test_id, suites, loc, x) { suites.contents = { hd: [ loc + (" id " + String(test_id.contents)), - (function (param) { + ((param) => { return { TAG: "ThrowAny", _0: x diff --git a/jscomp/test/mt_global.js b/jscomp/test/mt_global.js index 7c2e5f1a68e..a23d9f49e3c 100644 --- a/jscomp/test/mt_global.js +++ b/jscomp/test/mt_global.js @@ -7,7 +7,7 @@ function collect_eq(test_id, suites, loc, x, y) { suites.contents = { hd: [ loc + (" id " + String(test_id.contents)), - (function (param) { + ((param) => { return { TAG: "Eq", _0: x, @@ -24,7 +24,7 @@ function collect_neq(test_id, suites, loc, x, y) { suites.contents = { hd: [ loc + (" id " + String(test_id.contents)), - (function (param) { + ((param) => { return { TAG: "Neq", _0: x, @@ -41,7 +41,7 @@ function collect_approx(test_id, suites, loc, x, y) { suites.contents = { hd: [ loc + (" id " + String(test_id.contents)), - (function (param) { + ((param) => { return { TAG: "Approx", _0: x, diff --git a/jscomp/test/mutable_obj_test.js b/jscomp/test/mutable_obj_test.js index d8a88054550..3ac60c3d19a 100644 --- a/jscomp/test/mutable_obj_test.js +++ b/jscomp/test/mutable_obj_test.js @@ -3,7 +3,7 @@ function f(x) { - x.dec = (function (x) { + x.dec = ((x) => { return { x: x, y: x diff --git a/jscomp/test/mutable_uncurry_test.js b/jscomp/test/mutable_uncurry_test.js index c5d12b79b5b..6a48656f5a0 100644 --- a/jscomp/test/mutable_uncurry_test.js +++ b/jscomp/test/mutable_uncurry_test.js @@ -64,9 +64,9 @@ function t3(param, param$1, param$2) { function ut4(param, param$1, param$2, param$3) { let x0 = param.contents; let x1 = param$1.contents; - return (function (param) { + return ((param) => { let x2 = param.contents; - return function (param) { + return (param) => { let x3 = param.contents; return [ x0, @@ -81,9 +81,9 @@ function ut4(param, param$1, param$2, param$3) { function t4(param, param$1, param$2, param$3) { let x0 = param.contents; let x1 = param$1.contents; - return (function (param) { + return ((param) => { let x2 = param.contents; - return function (param) { + return (param) => { let x3 = param.contents; return [ x0, @@ -98,11 +98,11 @@ function t4(param, param$1, param$2, param$3) { function ut5(param, param$1, param$2, param$3, param$4) { let x0 = param.contents; let x1 = param$1.contents; - return (function (param) { + return ((param) => { let x2 = param.contents; - return function (param) { + return (param) => { let x3 = param.contents; - return function (param) { + return (param) => { let x4 = param.contents; return [ x0, @@ -119,11 +119,11 @@ function ut5(param, param$1, param$2, param$3, param$4) { function t5(param, param$1, param$2, param$3, param$4) { let x0 = param.contents; let x1 = param$1.contents; - return (function (param) { + return ((param) => { let x2 = param.contents; - return function (param) { + return (param) => { let x3 = param.contents; - return function (param) { + return (param) => { let x4 = param.contents; return [ x0, @@ -142,7 +142,7 @@ function nested0(param, param$1, param$2) { let x1 = param$1.contents; let x2 = param$2.contents; let a = (x0 + x1 | 0) + x2 | 0; - return function (param, param$1, param$2) { + return (param, param$1, param$2) => { let x0 = param.contents; let x1 = param$1.contents; let x2 = param$2.contents; @@ -155,7 +155,7 @@ function nested1(param, param$1, param$2) { let x1 = param$1.contents; let x2 = param$2.contents; let a = (x0 + x1 | 0) + x2 | 0; - return function (param, param$1, param$2) { + return (param, param$1, param$2) => { let x0 = param.contents; let x1 = param$1.contents; let x2 = param$2.contents; diff --git a/jscomp/test/name_mangle_test.js b/jscomp/test/name_mangle_test.js index 23d9221ab0c..7d16f2ad4fd 100644 --- a/jscomp/test/name_mangle_test.js +++ b/jscomp/test/name_mangle_test.js @@ -16,7 +16,7 @@ function eq(loc, x, y) { suites.contents = { hd: [ loc + (" id " + String(test_id.contents)), - (function () { + (() => { return { TAG: "Eq", _0: x, diff --git a/jscomp/test/obj_literal_ppx.js b/jscomp/test/obj_literal_ppx.js index c04893eba39..e818d5dce49 100644 --- a/jscomp/test/obj_literal_ppx.js +++ b/jscomp/test/obj_literal_ppx.js @@ -11,7 +11,7 @@ let b = { x: 3, y: [1], z: 3, - u: (function (x, y) { + u: ((x, y) => { return x + y | 0; }) }; diff --git a/jscomp/test/obj_magic_test.js b/jscomp/test/obj_magic_test.js index 1f4ad65e35d..013342df3e9 100644 --- a/jscomp/test/obj_magic_test.js +++ b/jscomp/test/obj_magic_test.js @@ -9,7 +9,7 @@ function is_block(x) { let suites_0 = [ "is_block_test1", - (function (param) { + ((param) => { return { TAG: "Eq", _0: false, @@ -21,7 +21,7 @@ let suites_0 = [ let suites_1 = { hd: [ "is_block_test2", - (function (param) { + ((param) => { return { TAG: "Eq", _0: true, @@ -35,7 +35,7 @@ let suites_1 = { tl: { hd: [ "is_block_test3", - (function (param) { + ((param) => { return { TAG: "Eq", _0: true, @@ -46,7 +46,7 @@ let suites_1 = { tl: { hd: [ "is_block_test4", - (function (param) { + ((param) => { return { TAG: "Eq", _0: false, diff --git a/jscomp/test/ocaml_re_test.js b/jscomp/test/ocaml_re_test.js index 7bf28c6f0b5..996335e46d9 100644 --- a/jscomp/test/ocaml_re_test.js +++ b/jscomp/test/ocaml_re_test.js @@ -31,7 +31,7 @@ function eq(loc, x, y) { suites.contents = { hd: [ loc + (" id " + String(test_id.contents)), - (function () { + (() => { return { TAG: "Eq", _0: x, @@ -790,7 +790,7 @@ function rename(ids, x) { case "Alt" : return mk_expr(ids, { TAG: "Alt", - _0: List.map((function (extra) { + _0: List.map(((extra) => { return rename(ids, extra); }), l._0) }); @@ -1001,8 +1001,8 @@ function reset_table(a) { } function mark_used_indices(tbl) { - return function (extra) { - return List.iter((function (x) { + return (extra) => { + return List.iter(((x) => { switch (x.TAG) { case "TSeq" : return mark_used_indices(tbl)(x._0); @@ -1010,7 +1010,7 @@ function mark_used_indices(tbl) { case "TMatch" : break; } - List.iter((function (param) { + List.iter(((param) => { let i = param[1]; if (i >= 0) { return Caml_array.set(tbl, i, true); @@ -1045,7 +1045,7 @@ function free_index(tbl_ref, l) { } function remove_matches(extra) { - return List.filter((function (x) { + return List.filter(((x) => { switch (x.TAG) { case "TSeq" : case "TExp" : @@ -1198,7 +1198,7 @@ function set_idx(idx, x) { function filter_marks(b, e, marks) { return { - marks: List.filter((function (param) { + marks: List.filter(((param) => { let i = param[0]; if (i < b) { return true; @@ -1243,7 +1243,7 @@ function delta_1(marks, c, next_cat, prev_cat, x, rem) { case "Rep" : let kind = s._1; let y$p$1 = delta_1(marks, c, next_cat, prev_cat, s._2, /* [] */0); - let marks$p = first((function (x) { + let marks$p = first(((x) => { switch (x.TAG) { case "TSeq" : case "TExp" : @@ -1356,7 +1356,7 @@ function delta_2(marks, c, next_cat, prev_cat, l, rem) { } function delta_seq(c, next_cat, prev_cat, kind, y, z, rem) { - let marks = first((function (x) { + let marks = first(((x) => { switch (x.TAG) { case "TSeq" : case "TExp" : @@ -1409,11 +1409,11 @@ function delta(tbl_ref, next_cat, char, st) { } function flatten_match(m) { - let ma = List.fold_left((function (ma, param) { + let ma = List.fold_left(((ma, param) => { return Caml.int_max(ma, param[0]); }), -1, m); let res = Caml_array.make(ma + 1 | 0, -1); - List.iter((function (param) { + List.iter(((param) => { Caml_array.set(res, param[0], param[1]); }), m); return res; @@ -1747,7 +1747,7 @@ function trans_set(cache, cm, s) { } catch (raw_exn) { let exn = Caml_js_exceptions.internalToOCamlException(raw_exn); if (exn.RE_EXN_ID === "Not_found") { - let l = List.fold_right((function (param, l) { + let l = List.fold_right(((param, l) => { return union(seq(Caml_bytes.get(cm, param[0]), Caml_bytes.get(cm, param[1])), l); }), s, /* [] */0); cache.contents = add(v, l, cache.contents); @@ -1795,7 +1795,7 @@ function is_charset(_x) { function split(s, cm) { let _t = s; - let f = function (i, j) { + let f = (i, j) => { Caml_bytes.set(cm, i, /* '\001' */1); Caml_bytes.set(cm, j + 1 | 0, /* '\001' */1); }; @@ -1848,7 +1848,7 @@ function colorize(c, regexp) { let lnl = { contents: false }; - let colorize$1 = function (_regexp) { + let colorize$1 = (_regexp) => { while (true) { let regexp = _regexp; if (typeof regexp !== "object") { @@ -2408,7 +2408,7 @@ function translate(ids, kind, _ign_group, ign_case, _greedy, pos, cache, c, _x) ]; } return [ - alt(ids, List.map((function (r$p) { + alt(ids, List.map(((r$p) => { let match = translate(ids, kind, ign_group, ign_case, greedy, pos, cache, c, r$p); return enforce_kind(ids, kind, match[1], match[0]); }), merged_sequences)), @@ -2422,7 +2422,7 @@ function translate(ids, kind, _ign_group, ign_case, _greedy, pos, cache, c, _x) let cr = match$1[0]; let rem; if (j !== undefined) { - let f = greedy === "Non_greedy" ? (function (rem) { + let f = greedy === "Non_greedy" ? ((rem) => { return alt(ids, { hd: mk_expr(ids, "Eps"), tl: { @@ -2430,7 +2430,7 @@ function translate(ids, kind, _ign_group, ign_case, _greedy, pos, cache, c, _x) tl: /* [] */0 } }); - }) : (function (rem) { + }) : ((rem) => { return alt(ids, { hd: seq$1(ids, kind$p, rename(ids, cr), rem), tl: { @@ -2444,7 +2444,7 @@ function translate(ids, kind, _ign_group, ign_case, _greedy, pos, cache, c, _x) rem = rep(ids, greedy, kind$p, cr); } return [ - iter(i, (function (rem) { + iter(i, ((rem) => { return seq$1(ids, kind$p, rename(ids, cr), rem); }), rem), kind @@ -2596,12 +2596,12 @@ function handle_case(_ign_case, _x) { case "Sequence" : return { TAG: "Sequence", - _0: List.map((function (extra) { + _0: List.map(((extra) => { return handle_case(ign_case, extra); }), x._0) }; case "Alternative" : - let l$p = List.map((function (extra) { + let l$p = List.map(((extra) => { return handle_case(ign_case, extra); }), x._0); if (is_charset({ @@ -2610,7 +2610,7 @@ function handle_case(_ign_case, _x) { })) { return { TAG: "Set", - _0: List.fold_left((function (s, r) { + _0: List.fold_left(((s, r) => { return union(s, as_set(r)); }), /* [] */0, l$p) }; @@ -2683,22 +2683,22 @@ function handle_case(_ign_case, _x) { _ign_case = true; continue; case "Intersection" : - let l$p$1 = List.map((function (r) { + let l$p$1 = List.map(((r) => { return handle_case(ign_case, r); }), x._0); return { TAG: "Set", - _0: List.fold_left((function (s, r) { + _0: List.fold_left(((s, r) => { return inter(s, as_set(r)); }), cany, l$p$1) }; case "Complement" : - let l$p$2 = List.map((function (r) { + let l$p$2 = List.map(((r) => { return handle_case(ign_case, r); }), x._0); return { TAG: "Set", - _0: diff(cany, List.fold_left((function (s, r) { + _0: diff(cany, List.fold_left(((s, r) => { return union(s, as_set(r)); }), /* [] */0, l$p$2)) }; @@ -3332,21 +3332,21 @@ function parse(multiline, dollar_endonly, dotall, ungreedy, s) { contents: 0 }; let l = s.length; - let test = function (c) { + let test = (c) => { if (i.contents !== l) { return Caml_string.get(s, i.contents) === c; } else { return false; } }; - let accept = function (c) { + let accept = (c) => { let r = test(c); if (r) { i.contents = i.contents + 1 | 0; } return r; }; - let accept_s = function (s$p) { + let accept_s = (s$p) => { let len = s$p.length; try { for (let j = 0; j < len; ++j) { @@ -3379,12 +3379,12 @@ function parse(multiline, dollar_endonly, dotall, ungreedy, s) { }); } }; - let get = function () { + let get = () => { let r = Caml_string.get(s, i.contents); i.contents = i.contents + 1 | 0; return r; }; - let greedy_mod = function (r) { + let greedy_mod = (r) => { let gr = accept(/* '?' */63); let gr$1 = ungreedy ? !gr : gr; if (gr$1) { @@ -3401,7 +3401,7 @@ function parse(multiline, dollar_endonly, dotall, ungreedy, s) { }; } }; - let regexp$p = function (_left) { + let regexp$p = (_left) => { while (true) { let left = _left; if (!accept(/* '|' */124)) { @@ -3417,7 +3417,7 @@ function parse(multiline, dollar_endonly, dotall, ungreedy, s) { continue; }; }; - let branch$p = function (_left) { + let branch$p = (_left) => { while (true) { let left = _left; if (i.contents === l || test(/* '|' */124) || test(/* ')' */41)) { @@ -3430,7 +3430,7 @@ function parse(multiline, dollar_endonly, dotall, ungreedy, s) { continue; }; }; - let atom = function () { + let atom = () => { if (accept(/* '.' */46)) { if (dotall) { return any; @@ -3693,7 +3693,7 @@ function parse(multiline, dollar_endonly, dotall, ungreedy, s) { }; } }; - let integer = function () { + let integer = () => { if (i.contents === l) { return; } @@ -3726,7 +3726,7 @@ function parse(multiline, dollar_endonly, dotall, ungreedy, s) { }; } }; - let piece = function () { + let piece = () => { let r = atom(); if (accept(/* '*' */42)) { return greedy_mod(repn(r, 0, undefined)); @@ -3762,7 +3762,7 @@ function parse(multiline, dollar_endonly, dotall, ungreedy, s) { i.contents = i.contents - 1 | 0; return r; }; - let char = function () { + let char = () => { if (i.contents === l) { throw new Error(Parse_error, { cause: { @@ -4066,7 +4066,7 @@ function parse(multiline, dollar_endonly, dotall, ungreedy, s) { }; } }; - let bracket = function (_s) { + let bracket = (_s) => { while (true) { let s = _s; if (s !== /* [] */0 && accept(/* ']' */93)) { @@ -4147,10 +4147,10 @@ function parse(multiline, dollar_endonly, dotall, ungreedy, s) { continue; }; }; - let branch = function () { + let branch = () => { return branch$p(/* [] */0); }; - let comment = function () { + let comment = () => { while (true) { if (accept(/* ')' */41)) { return epsilon; @@ -4172,7 +4172,7 @@ function parse(multiline, dollar_endonly, dotall, ungreedy, s) { function re(flagsOpt, pat) { let flags = flagsOpt !== undefined ? flagsOpt : /* [] */0; - let opts = List.map((function (x) { + let opts = List.map(((x) => { if (x === "CASELESS") { return "Caseless"; } else if (x === "ANCHORED") { diff --git a/jscomp/test/of_string_test.js b/jscomp/test/of_string_test.js index fffd6400b2d..12147c44c6a 100644 --- a/jscomp/test/of_string_test.js +++ b/jscomp/test/of_string_test.js @@ -6,7 +6,7 @@ let Pervasives = require("../../lib/js/pervasives.js"); let suites_0 = [ "string_of_float_1", - (function (param) { + ((param) => { return { TAG: "Eq", _0: "10.", @@ -18,7 +18,7 @@ let suites_0 = [ let suites_1 = { hd: [ "string_of_int", - (function (param) { + ((param) => { return { TAG: "Eq", _0: "10", @@ -29,7 +29,7 @@ let suites_1 = { tl: { hd: [ "valid_float_lexem", - (function (param) { + ((param) => { return { TAG: "Eq", _0: "10.", diff --git a/jscomp/test/offset.js b/jscomp/test/offset.js index 07958cb021e..478ed2bf19d 100644 --- a/jscomp/test/offset.js +++ b/jscomp/test/offset.js @@ -865,7 +865,7 @@ function of_list(l) { if (match$3) { if (match$3.tl) { let l$1 = List.sort_uniq($$String.compare, l); - let sub = function (n, l) { + let sub = (n, l) => { switch (n) { case 0 : return [ diff --git a/jscomp/test/option_repr_test.js b/jscomp/test/option_repr_test.js index d11f4a8f4b0..a35d25a0633 100644 --- a/jscomp/test/option_repr_test.js +++ b/jscomp/test/option_repr_test.js @@ -104,11 +104,11 @@ function f12(x) { return x; } -let length_8_id = Belt_List.makeBy(8, (function (x) { +let length_8_id = Belt_List.makeBy(8, ((x) => { return x; })); -let length_10_id = Belt_List.makeBy(10, (function (x) { +let length_10_id = Belt_List.makeBy(10, ((x) => { return x; })); @@ -170,7 +170,7 @@ function neqx(a, b) { } function all_true(xs) { - return Belt_List.every(xs, (function (x) { + return Belt_List.every(xs, ((x) => { return x; })); } @@ -182,7 +182,7 @@ let xs = { tl: /* [] */0 }; -b("File \"option_repr_test.res\", line 125, characters 8-15", Belt_List.every(xs, (function (x) { +b("File \"option_repr_test.res\", line 125, characters 8-15", Belt_List.every(xs, ((x) => { return x; }))); @@ -205,7 +205,7 @@ let xs_1 = { tl: { hd: ltx(undefined, null), tl: { - hd: ltx(undefined, (function (x) { + hd: ltx(undefined, ((x) => { return x; })), tl: { @@ -227,7 +227,7 @@ let xs$1 = { tl: xs_1 }; -b("File \"option_repr_test.res\", line 128, characters 4-11", Belt_List.every(xs$1, (function (x) { +b("File \"option_repr_test.res\", line 128, characters 4-11", Belt_List.every(xs$1, ((x) => { return x; }))); @@ -252,7 +252,7 @@ let xs$2 = { tl: xs_1$1 }; -b("File \"option_repr_test.res\", line 145, characters 4-11", Belt_List.every(xs$2, (function (x) { +b("File \"option_repr_test.res\", line 145, characters 4-11", Belt_List.every(xs$2, ((x) => { return x; }))); diff --git a/jscomp/test/optional_ffi_test.js b/jscomp/test/optional_ffi_test.js index ee8af830939..1dfdfd3a3c9 100644 --- a/jscomp/test/optional_ffi_test.js +++ b/jscomp/test/optional_ffi_test.js @@ -19,7 +19,7 @@ function eq(loc, param) { suites.contents = { hd: [ loc + (" id " + String(test_id.contents)), - (function () { + (() => { return { TAG: "Eq", _0: x, diff --git a/jscomp/test/pipe_send_readline.js b/jscomp/test/pipe_send_readline.js index 0e1ec13fd6c..68be9839113 100644 --- a/jscomp/test/pipe_send_readline.js +++ b/jscomp/test/pipe_send_readline.js @@ -3,9 +3,9 @@ function u(rl) { - return rl.on("line", (function (x) { + return rl.on("line", ((x) => { console.log(x); - })).on("close", (function () { + })).on("close", (() => { console.log("finished"); })); } diff --git a/jscomp/test/poly_variant_test.js b/jscomp/test/poly_variant_test.js index be1b53951cb..927d594d255 100644 --- a/jscomp/test/poly_variant_test.js +++ b/jscomp/test/poly_variant_test.js @@ -16,7 +16,7 @@ function eq(loc, x, y) { suites.contents = { hd: [ loc + (" id " + String(test_id.contents)), - (function () { + (() => { return { TAG: "Eq", _0: x, diff --git a/jscomp/test/polymorphic_raw_test.js b/jscomp/test/polymorphic_raw_test.js index 47e63d1f485..38420875431 100644 --- a/jscomp/test/polymorphic_raw_test.js +++ b/jscomp/test/polymorphic_raw_test.js @@ -16,7 +16,7 @@ function eq(loc, x, y) { suites.contents = { hd: [ loc + (" id " + String(test_id.contents)), - (function () { + (() => { return { TAG: "Eq", _0: x, diff --git a/jscomp/test/ppx_apply_test.js b/jscomp/test/ppx_apply_test.js index c8d27383cee..85111049837 100644 --- a/jscomp/test/ppx_apply_test.js +++ b/jscomp/test/ppx_apply_test.js @@ -16,7 +16,7 @@ function eq(loc, x, y) { suites.contents = { hd: [ loc + (" id " + String(test_id.contents)), - (function () { + (() => { return { TAG: "Eq", _0: x, diff --git a/jscomp/test/prepend_data_ffi.js b/jscomp/test/prepend_data_ffi.js index 3da0ea93e75..0f1fcac8fe2 100644 --- a/jscomp/test/prepend_data_ffi.js +++ b/jscomp/test/prepend_data_ffi.js @@ -12,19 +12,19 @@ let v2 = { v: 2 }; -process.on("exit", (function (exit_code) { +process.on("exit", ((exit_code) => { return String(exit_code); })); -process.on(1, (function (param) { +process.on(1, ((param) => { })); -process.on((function (i) { +process.on(((i) => { return String(i); }), "exit"); -process.on((function (i) { +process.on(((i) => { return String(i); }), 1); @@ -46,12 +46,12 @@ function f(x) { x.xx(76, 3, true, false, "你好", ["你好",1,2,3] , [{ "arr" : ["你好",1,2,3], "encoding" : "utf8"}] , [{ "arr" : ["你好",1,2,3], "encoding" : "utf8"}] , "xxx", 0, "yyy", "b", 1, 2, 3, 4, 5); } -process.on("exit", (function (exit_code) { +process.on("exit", ((exit_code) => { console.log("error code: " + String(exit_code)); })); function register(p) { - p.on("exit", (function (i) { + p.on("exit", ((i) => { console.log(i); })); } diff --git a/jscomp/test/print_alpha_test.js b/jscomp/test/print_alpha_test.js index e9f3efb8442..065ef49aa08 100644 --- a/jscomp/test/print_alpha_test.js +++ b/jscomp/test/print_alpha_test.js @@ -5,7 +5,7 @@ let Mt = require("./mt.js"); function f(h, param) { console.log(3); - return function (x, y) { + return (x, y) => { return h(x, y); }; } @@ -13,10 +13,10 @@ function f(h, param) { Mt.from_pair_suites("Print_alpha_test", { hd: [ "File \"print_alpha_test.res\", line 16, characters 10-17", - (function () { + (() => { return { TAG: "Eq", - _0: f((function (prim0, prim1) { + _0: f(((prim0, prim1) => { return prim0 + prim1 | 0; }), undefined)(1, 2), _1: 3 diff --git a/jscomp/test/queue_402.js b/jscomp/test/queue_402.js index 2e37b1eba67..c40c62a0f9a 100644 --- a/jscomp/test/queue_402.js +++ b/jscomp/test/queue_402.js @@ -81,7 +81,7 @@ function copy(q) { content: tail.content, next: tail$p }); - let copy$1 = function (_prev, _cell) { + let copy$1 = (_prev, _cell) => { while (true) { let cell = _cell; let prev = _prev; diff --git a/jscomp/test/queue_test.js b/jscomp/test/queue_test.js index a13947853a6..2578c1f8821 100644 --- a/jscomp/test/queue_test.js +++ b/jscomp/test/queue_test.js @@ -8,17 +8,17 @@ let Queue_402 = require("./queue_402.js"); let Caml_array = require("../../lib/js/caml_array.js"); function Test(Queue) { - let to_array = function (q) { + let to_array = (q) => { let v = Caml_array.make(Queue.length(q), 0); - Queue.fold((function (i, e) { + Queue.fold(((i, e) => { Caml_array.set(v, i, e); return i + 1 | 0; }), 0, q); return v; }; - let queue_1 = function (x) { + let queue_1 = (x) => { let q = Queue.create(); - $$Array.iter((function (x) { + $$Array.iter(((x) => { Queue.add(x, q); }), x); return to_array(q); @@ -31,7 +31,7 @@ function Test(Queue) { function to_array(q) { let v = Caml_array.make(q.length, 0); - Queue.fold((function (i, e) { + Queue.fold(((i, e) => { Caml_array.set(v, i, e); return i + 1 | 0; }), 0, q); @@ -44,7 +44,7 @@ function queue_1(x) { first: "Nil", last: "Nil" }; - $$Array.iter((function (x) { + $$Array.iter(((x) => { Queue.add(x, q); }), x); return to_array(q); @@ -57,7 +57,7 @@ let T1 = { function to_array$1(q) { let v = Caml_array.make(q.length, 0); - Queue_402.fold((function (i, e) { + Queue_402.fold(((i, e) => { Caml_array.set(v, i, e); return i + 1 | 0; }), 0, q); @@ -69,7 +69,7 @@ function queue_1$1(x) { length: 0, tail: undefined }; - $$Array.iter((function (x) { + $$Array.iter(((x) => { Queue_402.add(x, q); }), x); return to_array$1(q); @@ -82,7 +82,7 @@ let T2 = { let suites_0 = [ "File \"queue_test.res\", line 34, characters 6-13", - (function (param) { + ((param) => { let x = [ 3, 4, @@ -100,7 +100,7 @@ let suites_0 = [ let suites_1 = { hd: [ "File \"queue_test.res\", line 41, characters 6-13", - (function (param) { + ((param) => { let x = [ 3, 4, diff --git a/jscomp/test/random_test.js b/jscomp/test/random_test.js index f1460f1e598..90f285c7255 100644 --- a/jscomp/test/random_test.js +++ b/jscomp/test/random_test.js @@ -16,19 +16,19 @@ let suites = { }; function eq(f) { - return function (extra, extra$1) { + return (extra, extra$1) => { return Mt_global.collect_eq(id, suites, f, extra, extra$1); }; } function neq(f) { - return function (extra, extra$1) { + return (extra, extra$1) => { return Mt_global.collect_neq(id, suites, f, extra, extra$1); }; } function approx(f) { - return function (extra, extra$1) { + return (extra, extra$1) => { return Mt_global.collect_approx(id, suites, f, extra, extra$1); }; } diff --git a/jscomp/test/reactTestUtils.js b/jscomp/test/reactTestUtils.js index 05a3759b7c9..dc7cacf0ce7 100644 --- a/jscomp/test/reactTestUtils.js +++ b/jscomp/test/reactTestUtils.js @@ -7,14 +7,14 @@ let Caml_option = require("../../lib/js/caml_option.js"); let TestUtils = require("react-dom/test-utils"); function act(func) { - let reactFunc = function () { + let reactFunc = () => { func(); }; TestUtils.act(reactFunc); } function actAsync(func) { - return TestUtils.act(function () { + return TestUtils.act(() => { return func(); }); } @@ -51,13 +51,13 @@ function findByAllSelector(element, selector) { } function findBySelectorAndTextContent(element, selector, content) { - return Belt_Array.getBy(Array.from(element.querySelectorAll(selector)), (function (node) { + return Belt_Array.getBy(Array.from(element.querySelectorAll(selector)), ((node) => { return node.textContent === content; })); } function findBySelectorAndPartialTextContent(element, selector, content) { - return Belt_Array.getBy(Array.from(element.querySelectorAll(selector)), (function (node) { + return Belt_Array.getBy(Array.from(element.querySelectorAll(selector)), ((node) => { return node.textContent.includes(content); })); } @@ -71,14 +71,14 @@ let DOM = { function prepareContainer(container, param) { let containerElement = document.createElement("div"); - Belt_Option.map(document.body, (function (body) { + Belt_Option.map(document.body, ((body) => { return body.appendChild(containerElement); })); container.contents = Caml_option.some(containerElement); } function cleanupContainer(container, param) { - Belt_Option.map(container.contents, (function (prim) { + Belt_Option.map(container.contents, ((prim) => { prim.remove(); })); container.contents = undefined; diff --git a/jscomp/test/reasonReact.js b/jscomp/test/reasonReact.js index 49bd1161a10..b9463618919 100644 --- a/jscomp/test/reasonReact.js +++ b/jscomp/test/reasonReact.js @@ -84,7 +84,7 @@ function element(keyOpt, refOpt, component) { } function wrapReasonForJs(component, jsPropsToReason) { - let uncurriedJsPropsToReason = function (jsProps) { + let uncurriedJsPropsToReason = (jsProps) => { return jsPropsToReason(jsProps); }; component.reactClassInternal.prototype.jsPropsToReason = uncurriedJsPropsToReason; @@ -94,7 +94,7 @@ function wrapReasonForJs(component, jsPropsToReason) { let dummyInteropComponent = basicComponent("interop"); function wrapJsForReason(reactClass, props, children) { - let jsElementWrapped = (function (extra, extra$1) { + let jsElementWrapped = ((extra, extra$1) => { let props$1 = Object.assign(Object.assign({}, props), { ref: extra$1, key: extra diff --git a/jscomp/test/reasonReactRouter.js b/jscomp/test/reasonReactRouter.js index bc95545c7de..ca888ae6011 100644 --- a/jscomp/test/reasonReactRouter.js +++ b/jscomp/test/reasonReactRouter.js @@ -138,11 +138,11 @@ function url() { function watchUrl(callback) { let window = globalThis.window; if (window === undefined) { - return function () { + return () => { }; } - let watcherID = function () { + let watcherID = () => { callback(url()); }; Caml_option.valFromOption(window).addEventListener("popstate", watcherID); @@ -159,7 +159,7 @@ function unwatchUrl(watcherID) { } function useUrl(serverUrl, param) { - let match = React.useState(function () { + let match = React.useState(() => { if (serverUrl !== undefined) { return serverUrl; } else { @@ -168,19 +168,19 @@ function useUrl(serverUrl, param) { }); let setUrl = match[1]; let url$1 = match[0]; - React.useEffect((function () { - let watcherId = watchUrl(function (url) { - setUrl(function (param) { + React.useEffect((() => { + let watcherId = watchUrl((url) => { + setUrl((param) => { return url; }); }); let newUrl = url(); if (urlNotEqual(newUrl, url$1)) { - setUrl(function (param) { + setUrl((param) => { return newUrl; }); } - return (function () { + return (() => { unwatchUrl(watcherId); }); }), []); diff --git a/jscomp/test/rec_fun_test.js b/jscomp/test/rec_fun_test.js index 43b6b529037..e18ed50860b 100644 --- a/jscomp/test/rec_fun_test.js +++ b/jscomp/test/rec_fun_test.js @@ -17,7 +17,7 @@ function eq(loc, x, y) { suites.contents = { hd: [ loc + (" id " + String(test_id.contents)), - (function () { + (() => { return { TAG: "Eq", _0: x, @@ -35,7 +35,7 @@ let called = { function g() { let v = {}; - let next = function (i, b) { + let next = (i, b) => { called.contents = called.contents + 1 | 0; if (b) { v.contents(i, false); diff --git a/jscomp/test/rec_module_test.js b/jscomp/test/rec_module_test.js index 44fec3d4c3f..bc72dc0fdf8 100644 --- a/jscomp/test/rec_module_test.js +++ b/jscomp/test/rec_module_test.js @@ -1044,7 +1044,7 @@ function of_list(l) { if (match$3) { if (match$3.tl) { let l$1 = List.sort_uniq(AAA.compare, l); - let sub = function (n, l) { + let sub = (n, l) => { switch (n) { case 0 : return [ @@ -1218,7 +1218,7 @@ Caml_module.update_mod({ let suites_0 = [ "test1", - (function (param) { + ((param) => { return { TAG: "Eq", _0: [ @@ -1240,7 +1240,7 @@ let suites_0 = [ let suites_1 = { hd: [ "test2", - (function (param) { + ((param) => { return { TAG: "Eq", _0: BB.y(), @@ -1251,7 +1251,7 @@ let suites_1 = { tl: { hd: [ "test3", - (function (param) { + ((param) => { return { TAG: "Eq", _0: AA.x(), @@ -1262,7 +1262,7 @@ let suites_1 = { tl: { hd: [ "test4", - (function (param) { + ((param) => { return { TAG: "Eq", _0: true, @@ -1273,7 +1273,7 @@ let suites_1 = { tl: { hd: [ "test4", - (function (param) { + ((param) => { return { TAG: "Eq", _0: true, @@ -1284,7 +1284,7 @@ let suites_1 = { tl: { hd: [ "test5", - (function (param) { + ((param) => { return { TAG: "Eq", _0: false, @@ -1295,7 +1295,7 @@ let suites_1 = { tl: { hd: [ "test6", - (function (param) { + ((param) => { return { TAG: "Eq", _0: 2, diff --git a/jscomp/test/recmodule.js b/jscomp/test/recmodule.js index c1dd92c6ed6..9c40e35c1eb 100644 --- a/jscomp/test/recmodule.js +++ b/jscomp/test/recmodule.js @@ -6,7 +6,7 @@ let Caml_module = require("../../lib/js/caml_module.js"); let Entity = {}; function MakeLayer(Deps) { - let getLight = function (id) { + let getLight = (id) => { return Deps.presentLight({ id: id, name: "Light 1" @@ -22,10 +22,10 @@ let UseCase = { }; function MakeLayer$1(Deps, UC) { - let presentLight = function (light) { + let presentLight = (light) => { return Deps.presentJson(light, 200); }; - let handleGetLight = function (req) { + let handleGetLight = (req) => { return UC.getLight(req.params.id); }; return { @@ -39,7 +39,7 @@ let Adapter = { }; function MakeLayer$2(Deps) { - let presentJson = function (json, status) { + let presentJson = (json, status) => { throw new Error("Assert_failure", { cause: { RE_EXN_ID: "Assert_failure", @@ -51,7 +51,7 @@ function MakeLayer$2(Deps) { } }); }; - let routes = function () { + let routes = () => { return [[ "/lights", Deps.handleGetLight diff --git a/jscomp/test/record_with_test.js b/jscomp/test/record_with_test.js index 045fc38e5ba..0fc3fd6c903 100644 --- a/jscomp/test/record_with_test.js +++ b/jscomp/test/record_with_test.js @@ -38,7 +38,7 @@ function f(g, h) { let suites_0 = [ "eq_with", - (function (param) { + ((param) => { return { TAG: "Eq", _0: v, diff --git a/jscomp/test/recursive_module.js b/jscomp/test/recursive_module.js index e3c0df58856..520fdc8f5f6 100644 --- a/jscomp/test/recursive_module.js +++ b/jscomp/test/recursive_module.js @@ -20,7 +20,7 @@ function eq(loc, x, y) { } let Xx = { - f: (function (prim0, prim1) { + f: ((prim0, prim1) => { return hfiehi(prim0, prim1); }) }; @@ -69,7 +69,7 @@ let Intb = Caml_module.init_mod([ ]] }); -let a = CamlinternalLazy.from_fun(function () { +let a = CamlinternalLazy.from_fun(() => { return CamlinternalLazy.force(Intb.a); }); @@ -83,7 +83,7 @@ Caml_module.update_mod({ a: a }); -let a$1 = CamlinternalLazy.from_fun(function () { +let a$1 = CamlinternalLazy.from_fun(() => { return CamlinternalLazy.force(Inta.a) + 1 | 0; }); @@ -138,7 +138,7 @@ let Intb$1 = Caml_module.init_mod([ ]] }); -let a$2 = CamlinternalLazy.from_fun(function () { +let a$2 = CamlinternalLazy.from_fun(() => { return CamlinternalLazy.force(Intb$1.a) + 1 | 0; }); @@ -152,7 +152,7 @@ Caml_module.update_mod({ a: a$2 }); -let a$3 = CamlinternalLazy.from_fun(function () { +let a$3 = CamlinternalLazy.from_fun(() => { return 2; }); diff --git a/jscomp/test/recursive_module_test.js b/jscomp/test/recursive_module_test.js index 6edee60332b..ac1b0d2d8f0 100644 --- a/jscomp/test/recursive_module_test.js +++ b/jscomp/test/recursive_module_test.js @@ -17,7 +17,7 @@ function eq(loc, x, y) { suites.contents = { hd: [ loc + (" id " + String(test_id.contents)), - (function () { + (() => { return { TAG: "Eq", _0: x, @@ -97,10 +97,10 @@ eq("File \"recursive_module_test.res\", line 29, characters 12-19", 120, fact$1( add([ "File \"recursive_module_test.res\", line 31, characters 14-21", - (function () { + (() => { return { TAG: "ThrowAny", - _0: (function () { + _0: (() => { Int3.u(3); }) }; diff --git a/jscomp/test/recursive_unbound_module_test.js b/jscomp/test/recursive_unbound_module_test.js index 380e3aa4089..07a59a41376 100644 --- a/jscomp/test/recursive_unbound_module_test.js +++ b/jscomp/test/recursive_unbound_module_test.js @@ -4,7 +4,7 @@ let Caml_module = require("../../lib/js/caml_module.js"); function Make(X) { - let f = function () { + let f = () => { }; let M = { diff --git a/jscomp/test/res_debug.js b/jscomp/test/res_debug.js index da1289ce182..e95f982bb5d 100644 --- a/jscomp/test/res_debug.js +++ b/jscomp/test/res_debug.js @@ -33,7 +33,7 @@ function optionMap(x, f) { } -let ok_name = optionMap(undefined, (function (x) { +let ok_name = optionMap(undefined, ((x) => { return x; })); @@ -41,7 +41,7 @@ let ok = { name: ok_name }; -let bad_name = optionMap(undefined, (function (x) { +let bad_name = optionMap(undefined, ((x) => { return x; })); diff --git a/jscomp/test/return_check.js b/jscomp/test/return_check.js index 06b689c1209..ab7805940a2 100644 --- a/jscomp/test/return_check.js +++ b/jscomp/test/return_check.js @@ -42,7 +42,7 @@ function f_escaped_not(xs, i) { function f_escaped_1(xs, i) { let x = xs[i]; - return function () { + return () => { if (x !== undefined) { return x; } else { diff --git a/jscomp/test/set_gen.js b/jscomp/test/set_gen.js index 56131cc7bb0..856955f92bf 100644 --- a/jscomp/test/set_gen.js +++ b/jscomp/test/set_gen.js @@ -448,7 +448,7 @@ function partition(p, x) { } function of_sorted_list(l) { - let sub = function (n, l) { + let sub = (n, l) => { switch (n) { case 0 : return [ @@ -553,7 +553,7 @@ function of_sorted_list(l) { } function of_sorted_array(l) { - let sub = function (start, n, l) { + let sub = (start, n, l) => { if (n === 0) { return "Empty"; } @@ -619,7 +619,7 @@ function of_sorted_array(l) { } function is_ordered(cmp, tree) { - let is_ordered_min_max = function (tree) { + let is_ordered_min_max = (tree) => { if (typeof tree !== "object") { return "Empty"; } diff --git a/jscomp/test/sexp.js b/jscomp/test/sexp.js index 6f1601514fc..23d7a61a9e4 100644 --- a/jscomp/test/sexp.js +++ b/jscomp/test/sexp.js @@ -136,7 +136,7 @@ function of_field(name, t) { function of_record(l) { return { NAME: "List", - VAL: List.map((function (param) { + VAL: List.map(((param) => { return of_field(param[0], param[1]); }), l) }; @@ -253,7 +253,7 @@ function to_float(e) { } function to_string(e) { - return _try_atom(e, (function (x) { + return _try_atom(e, ((x) => { return x; })); } @@ -280,11 +280,11 @@ function to_pair(e) { } function to_pair_with(f1, f2) { - return function (e) { - return $great$great$eq(to_pair(e), (function (param) { + return (e) => { + return $great$great$eq(to_pair(e), ((param) => { let y = param[1]; - return $great$great$eq(f1(param[0]), (function (x) { - return $great$great$eq(f2(y), (function (y) { + return $great$great$eq(f1(param[0]), ((x) => { + return $great$great$eq(f2(y), ((y) => { return [ x, y @@ -322,13 +322,13 @@ function to_triple(e) { } function to_triple_with(f1, f2, f3) { - return function (e) { - return $great$great$eq(to_triple(e), (function (param) { + return (e) => { + return $great$great$eq(to_triple(e), ((param) => { let z = param[2]; let y = param[1]; - return $great$great$eq(f1(param[0]), (function (x) { - return $great$great$eq(f2(y), (function (y) { - return $great$great$eq(f3(z), (function (z) { + return $great$great$eq(f1(param[0]), ((x) => { + return $great$great$eq(f2(y), ((y) => { + return $great$great$eq(f3(z), ((z) => { return [ x, y, @@ -349,7 +349,7 @@ function to_list(e) { } function to_list_with(f) { - return function (e) { + return (e) => { if (e.NAME === "List") { return map_opt(f, e.VAL); } @@ -358,7 +358,7 @@ function to_list_with(f) { } function get_field(name) { - return function (e) { + return (e) => { if (e.NAME === "List") { let _l = e.VAL; while (true) { @@ -410,7 +410,7 @@ function get_field(name) { } function field(name, f) { - return function (e) { + return (e) => { return $great$great$eq(get_field(name)(e), f); }; } @@ -453,7 +453,7 @@ function _get_field_list(name, _l) { } function field_list(name, f) { - return function (e) { + return (e) => { if (e.NAME === "List") { return $great$great$eq(_get_field_list(name, e.VAL), f); } @@ -477,7 +477,7 @@ function _get_variant(s, args, _l) { } function get_variant(l) { - return function (e) { + return (e) => { if (e.NAME !== "List") { return _get_variant(e.VAL, /* [] */0, l); } diff --git a/jscomp/test/sexpm.js b/jscomp/test/sexpm.js index bf9221f37e3..1c38161cd0e 100644 --- a/jscomp/test/sexpm.js +++ b/jscomp/test/sexpm.js @@ -96,7 +96,7 @@ function to_buf(b, t) { if (l) { if (l.tl) { Buffer.add_char(b, /* '(' */40); - List.iteri((function (i, t$p) { + List.iteri(((i, t$p) => { if (i > 0) { Buffer.add_char(b, /* ' ' */32); } @@ -203,7 +203,7 @@ function _error_eof(t) { function expr(k, t) { while (true) { if (t.i === t.len) { - return _refill(t, (function (extra) { + return _refill(t, ((extra) => { return expr(k, extra); }), _error_eof); } @@ -224,7 +224,7 @@ function expr(k, t) { function expr_starting_with(c, k, t) { if (c >= 42) { if (c === 59) { - return skip_comment((function (param, param$1) { + return skip_comment(((param, param$1) => { return expr(k, t); }), t); } @@ -281,7 +281,7 @@ function expr_starting_with(c, k, t) { function expr_list(acc, k, t) { while (true) { if (t.i === t.len) { - return _refill(t, (function (extra) { + return _refill(t, ((extra) => { return expr_list(acc, k, extra); }), _error_eof); } @@ -297,7 +297,7 @@ function expr_list(acc, k, t) { } else if (c > 31 || c < 11) { continue; } - return expr_starting_with(c, (function (last, e) { + return expr_starting_with(c, ((last, e) => { if (last !== undefined) { if (last !== 40) { if (last !== 41) { @@ -315,7 +315,7 @@ function expr_list(acc, k, t) { }); } } else { - return expr_list(/* [] */0, (function (param, l) { + return expr_list(/* [] */0, ((param, l) => { return expr_list({ hd: l, tl: acc @@ -344,9 +344,9 @@ function _return_atom(last, k, t) { function atom(k, t) { while (true) { if (t.i === t.len) { - return _refill(t, (function (extra) { + return _refill(t, ((extra) => { return atom(k, extra); - }), (function (extra) { + }), ((extra) => { return _return_atom(undefined, k, extra); })); } @@ -392,7 +392,7 @@ function atom(k, t) { function quoted(k, t) { while (true) { if (t.i === t.len) { - return _refill(t, (function (extra) { + return _refill(t, ((extra) => { return quoted(k, extra); }), _error_eof); } @@ -401,7 +401,7 @@ function quoted(k, t) { return _return_atom(undefined, k, t); } if (c === 92) { - return escaped((function (c) { + return escaped(((c) => { Buffer.add_char(t.atom, c); return quoted(k, t); }), t); @@ -413,7 +413,7 @@ function quoted(k, t) { function escaped(k, t) { if (t.i === t.len) { - return _refill(t, (function (extra) { + return _refill(t, ((extra) => { return escaped(k, extra); }), _error_eof); } @@ -459,7 +459,7 @@ function escaped(k, t) { return k(/* '"' */34); } if (_is_digit(c)) { - return read2int(c - /* '0' */48 | 0, (function (n) { + return read2int(c - /* '0' */48 | 0, ((n) => { return k(Char.chr(n)); }), t); } else { @@ -469,7 +469,7 @@ function escaped(k, t) { function read2int(i, k, t) { if (t.i === t.len) { - return _refill(t, (function (extra) { + return _refill(t, ((extra) => { return read2int(i, k, extra); }), _error_eof); } @@ -483,7 +483,7 @@ function read2int(i, k, t) { function read1int(i, k, t) { if (t.i === t.len) { - return _refill(t, (function (extra) { + return _refill(t, ((extra) => { return read1int(i, k, extra); }), _error_eof); } @@ -498,7 +498,7 @@ function read1int(i, k, t) { function skip_comment(k, t) { while (true) { if (t.i === t.len) { - return _refill(t, (function (extra) { + return _refill(t, ((extra) => { return skip_comment(k, extra); }), _error_eof); } @@ -513,9 +513,9 @@ function skip_comment(k, t) { function expr_or_end(k, t) { while (true) { if (t.i === t.len) { - return _refill(t, (function (extra) { + return _refill(t, ((extra) => { return expr_or_end(k, extra); - }), (function (param) { + }), ((param) => { return "End"; })); } @@ -534,7 +534,7 @@ function expr_or_end(k, t) { } function next(t) { - return expr_or_end((function (param, x) { + return expr_or_end(((param, x) => { return { NAME: "Ok", VAL: x @@ -547,7 +547,7 @@ function parse_string(s) { let stop = { contents: false }; - let refill = function (bytes, i, _len) { + let refill = (bytes, i, _len) => { if (stop.contents) { return 0; } else { diff --git a/jscomp/test/sexpm_test.js b/jscomp/test/sexpm_test.js index 2183f46fb31..b7fe2e9a45b 100644 --- a/jscomp/test/sexpm_test.js +++ b/jscomp/test/sexpm_test.js @@ -19,7 +19,7 @@ function eq(loc, param) { suites.contents = { hd: [ loc + (" id " + String(test_id.contents)), - (function () { + (() => { return { TAG: "Eq", _0: x, diff --git a/jscomp/test/side_effect2.js b/jscomp/test/side_effect2.js index cfedadb3f9e..45b7ead1443 100644 --- a/jscomp/test/side_effect2.js +++ b/jscomp/test/side_effect2.js @@ -3,7 +3,7 @@ let Belt_Array = require("../../lib/js/belt_Array.js"); -let a = Belt_Array.map([1], (function (x) { +let a = Belt_Array.map([1], ((x) => { return x; })); diff --git a/jscomp/test/stack_comp_test.js b/jscomp/test/stack_comp_test.js index 915fafeb4c8..e00017aac12 100644 --- a/jscomp/test/stack_comp_test.js +++ b/jscomp/test/stack_comp_test.js @@ -31,7 +31,7 @@ function to_list(s) { let l = { contents: /* [] */0 }; - List.iter((function (x) { + List.iter(((x) => { l.contents = { hd: x, tl: l.contents @@ -358,7 +358,7 @@ let i$7 = { contents: 1 }; -List.iter((function (j) { +List.iter(((j) => { assert_("File \"stack_comp_test.res\", line 143, characters 12-19", i$7.contents === j); i$7.contents = i$7.contents + 1 | 0; }), s$5.c); diff --git a/jscomp/test/stack_test.js b/jscomp/test/stack_test.js index d6368ae6c83..1943d1f2cb6 100644 --- a/jscomp/test/stack_test.js +++ b/jscomp/test/stack_test.js @@ -29,7 +29,7 @@ function v() { let suites_0 = [ "push_test", - (function (param) { + ((param) => { return { TAG: "Eq", _0: { diff --git a/jscomp/test/stream_parser_test.js b/jscomp/test/stream_parser_test.js index c79f09df727..5999af969ed 100644 --- a/jscomp/test/stream_parser_test.js +++ b/jscomp/test/stream_parser_test.js @@ -16,7 +16,7 @@ function parse(token) { first: "Nil", last: "Nil" }; - let token$1 = function () { + let token$1 = () => { if (look_ahead.length !== 0) { return Queue.pop(look_ahead); } @@ -29,7 +29,7 @@ function parse(token) { }; } }; - let parse_atom = function () { + let parse_atom = () => { let n = token$1(); switch (n.TAG) { case "Kwd" : @@ -73,10 +73,10 @@ function parse(token) { }); } }; - let parse_term = function () { + let parse_term = () => { return parse_term_aux(parse_atom()); }; - let parse_expr_aux = function (e1) { + let parse_expr_aux = (e1) => { let e = token$1(); if (e.TAG === "Kwd") { switch (e._0) { @@ -93,7 +93,7 @@ function parse(token) { return e1; } }; - let parse_term_aux = function (e1) { + let parse_term_aux = (e1) => { let e = token$1(); if (e.TAG === "Kwd") { switch (e._0) { @@ -113,7 +113,7 @@ function parse(token) { let r = parse_expr_aux(parse_term()); return [ r, - Queue.fold((function (acc, x) { + Queue.fold(((acc, x) => { return { hd: x, tl: acc @@ -144,7 +144,7 @@ let lexer = Genlex.make_lexer({ function token(chars) { let strm = lexer(chars); - return function () { + return () => { return Stream.next(strm); }; } @@ -155,7 +155,7 @@ function l_parse(token) { first: "Nil", last: "Nil" }; - let token$1 = function () { + let token$1 = () => { if (look_ahead.length !== 0) { return Queue.pop(look_ahead); } @@ -168,7 +168,7 @@ function l_parse(token) { }; } }; - let parse_f = function () { + let parse_f = () => { let i = token$1(); switch (i.TAG) { case "Kwd" : @@ -210,7 +210,7 @@ function l_parse(token) { }); } }; - let parse_f_aux = function (_a) { + let parse_f_aux = (_a) => { while (true) { let a = _a; let t = token$1(); @@ -232,7 +232,7 @@ function l_parse(token) { } }; }; - let parse_t_aux = function (_a) { + let parse_t_aux = (_a) => { while (true) { let a = _a; let t = token$1(); @@ -254,13 +254,13 @@ function l_parse(token) { } }; }; - let parse_t = function () { + let parse_t = () => { return parse_f_aux(parse_f()); }; let r = parse_t_aux(parse_t()); return [ r, - Queue.fold((function (acc, x) { + Queue.fold(((acc, x) => { return { hd: x, tl: acc @@ -282,7 +282,7 @@ function eq(loc, x, y) { suites.contents = { hd: [ loc + (" id " + String(test_id.contents)), - (function () { + (() => { return { TAG: "Eq", _0: x, diff --git a/jscomp/test/string_get_set_test.js b/jscomp/test/string_get_set_test.js index c2281c71938..9276cb6f214 100644 --- a/jscomp/test/string_get_set_test.js +++ b/jscomp/test/string_get_set_test.js @@ -7,7 +7,7 @@ let Caml_string = require("../../lib/js/caml_string.js"); Mt.from_pair_suites("string_get_set_test.res", { hd: [ "File \"string_get_set_test.res\", line 4, characters 36-43", - (function () { + (() => { return { TAG: "Eq", _0: Caml_string.get("h", 0), diff --git a/jscomp/test/string_runtime_test.js b/jscomp/test/string_runtime_test.js index f63935b8953..d9dc85471c1 100644 --- a/jscomp/test/string_runtime_test.js +++ b/jscomp/test/string_runtime_test.js @@ -9,7 +9,7 @@ let Caml_bytes = require("../../lib/js/caml_bytes.js"); let suites_0 = [ "?is_printable", - (function (param) { + ((param) => { return { TAG: "Eq", _0: Test_char.caml_is_printable(/* 'a' */97), @@ -21,13 +21,13 @@ let suites_0 = [ let suites_1 = { hd: [ "?string_of_bytes", - (function (param) { - let match = List.split(List.map((function (x) { + ((param) => { + let match = List.split(List.map(((x) => { let b = Caml_bytes.create(x); Bytes.fill(b, 0, x, /* 'c' */99); return [ Bytes.to_string(b), - Bytes.unsafe_to_string(Bytes.init(x, (function (param) { + Bytes.unsafe_to_string(Bytes.init(x, ((param) => { return /* 'c' */99; }))) ]; diff --git a/jscomp/test/string_set.js b/jscomp/test/string_set.js index 437b01483ce..8544f564dfe 100644 --- a/jscomp/test/string_set.js +++ b/jscomp/test/string_set.js @@ -272,7 +272,7 @@ function of_list(l) { } function of_array(l) { - return $$Array.fold_left((function (acc, x) { + return $$Array.fold_left(((acc, x) => { return add(x, acc); }), "Empty", l); } diff --git a/jscomp/test/string_set_test.js b/jscomp/test/string_set_test.js index b4c2594891b..053a989154a 100644 --- a/jscomp/test/string_set_test.js +++ b/jscomp/test/string_set_test.js @@ -17,7 +17,7 @@ function eq(loc, x, y) { suites.contents = { hd: [ loc + (" id " + String(test_id.contents)), - (function () { + (() => { return { TAG: "Eq", _0: x, diff --git a/jscomp/test/string_test.js b/jscomp/test/string_test.js index 7d8042cada9..52d5c0116e0 100644 --- a/jscomp/test/string_test.js +++ b/jscomp/test/string_test.js @@ -56,7 +56,7 @@ function gg(x) { } function rev_split_by_char(c, s) { - let loop = function (i, l) { + let loop = (i, l) => { try { let i$p = $$String.index_from(s, i, c); let s$p = $$String.sub(s, i, i$p - i | 0); @@ -125,7 +125,7 @@ function xsplit(delim, s) { } function string_of_chars(x) { - let xs = List.map((function (prim) { + let xs = List.map(((prim) => { return String.fromCharCode(prim); }), x); return $$Array.of_list(xs).join(""); @@ -134,7 +134,7 @@ function string_of_chars(x) { Mt.from_pair_suites("String_test", { hd: [ "mutliple switch", - (function () { + (() => { return { TAG: "Eq", _0: 9, @@ -145,7 +145,7 @@ Mt.from_pair_suites("String_test", { tl: { hd: [ "int switch", - (function () { + (() => { return { TAG: "Eq", _0: 9, @@ -156,7 +156,7 @@ Mt.from_pair_suites("String_test", { tl: { hd: [ "escape_normal", - (function () { + (() => { return { TAG: "Eq", _0: "haha", @@ -167,7 +167,7 @@ Mt.from_pair_suites("String_test", { tl: { hd: [ "escape_bytes", - (function () { + (() => { return { TAG: "Eq", _0: Bytes.of_string("haha"), @@ -178,7 +178,7 @@ Mt.from_pair_suites("String_test", { tl: { hd: [ "escape_quote", - (function () { + (() => { return { TAG: "Eq", _0: "\\\"\\\"", @@ -189,7 +189,7 @@ Mt.from_pair_suites("String_test", { tl: { hd: [ "rev_split_by_char", - (function () { + (() => { return { TAG: "Eq", _0: { @@ -209,7 +209,7 @@ Mt.from_pair_suites("String_test", { tl: { hd: [ "File \"string_test.res\", line 86, characters 5-12", - (function () { + (() => { return { TAG: "Eq", _0: { @@ -223,7 +223,7 @@ Mt.from_pair_suites("String_test", { tl: { hd: [ "xsplit", - (function () { + (() => { return { TAG: "Eq", _0: { @@ -243,7 +243,7 @@ Mt.from_pair_suites("String_test", { tl: { hd: [ "split_empty", - (function () { + (() => { return { TAG: "Eq", _0: /* [] */0, @@ -254,7 +254,7 @@ Mt.from_pair_suites("String_test", { tl: { hd: [ "split_empty2", - (function () { + (() => { return { TAG: "Eq", _0: { @@ -268,7 +268,7 @@ Mt.from_pair_suites("String_test", { tl: { hd: [ "rfind", - (function () { + (() => { return { TAG: "Eq", _0: 7, @@ -279,7 +279,7 @@ Mt.from_pair_suites("String_test", { tl: { hd: [ "rfind_2", - (function () { + (() => { return { TAG: "Eq", _0: 0, @@ -290,7 +290,7 @@ Mt.from_pair_suites("String_test", { tl: { hd: [ "rfind_3", - (function () { + (() => { return { TAG: "Eq", _0: -1, @@ -301,7 +301,7 @@ Mt.from_pair_suites("String_test", { tl: { hd: [ "find", - (function () { + (() => { return { TAG: "Eq", _0: 0, @@ -312,7 +312,7 @@ Mt.from_pair_suites("String_test", { tl: { hd: [ "find_2", - (function () { + (() => { return { TAG: "Eq", _0: 6, @@ -323,7 +323,7 @@ Mt.from_pair_suites("String_test", { tl: { hd: [ "find_3", - (function () { + (() => { return { TAG: "Eq", _0: -1, @@ -334,7 +334,7 @@ Mt.from_pair_suites("String_test", { tl: { hd: [ "of_char", - (function () { + (() => { return { TAG: "Eq", _0: String.fromCharCode(/* '0' */48), @@ -345,7 +345,7 @@ Mt.from_pair_suites("String_test", { tl: { hd: [ "of_chars", - (function () { + (() => { return { TAG: "Eq", _0: string_of_chars({ diff --git a/jscomp/test/string_unicode_test.js b/jscomp/test/string_unicode_test.js index aadbe7c0f74..a39d67f38cf 100644 --- a/jscomp/test/string_unicode_test.js +++ b/jscomp/test/string_unicode_test.js @@ -16,7 +16,7 @@ function eq(loc, x, y) { suites.contents = { hd: [ loc + (" id " + String(test_id.contents)), - (function () { + (() => { return { TAG: "Eq", _0: x, diff --git a/jscomp/test/switch_case_test.js b/jscomp/test/switch_case_test.js index 6990bc227c5..0d7cbfa6ac3 100644 --- a/jscomp/test/switch_case_test.js +++ b/jscomp/test/switch_case_test.js @@ -16,7 +16,7 @@ function eq(loc, x, y) { suites.contents = { hd: [ loc + (" id " + String(test_id.contents)), - (function () { + (() => { return { TAG: "Eq", _0: x, diff --git a/jscomp/test/tagged_template_test.js b/jscomp/test/tagged_template_test.js index 9fc3b9c2f46..3079326d5cd 100644 --- a/jscomp/test/tagged_template_test.js +++ b/jscomp/test/tagged_template_test.js @@ -44,7 +44,7 @@ let res = foo([ Mt.from_pair_suites("tagged templates", { hd: [ "with externals, it should return a string with the correct interpolations", - (function () { + (() => { return { TAG: "Eq", _0: query, @@ -55,7 +55,7 @@ Mt.from_pair_suites("tagged templates", { tl: { hd: [ "with module scoped externals, it should also return a string with the correct interpolations", - (function () { + (() => { return { TAG: "Eq", _0: queryWithModule, @@ -66,7 +66,7 @@ Mt.from_pair_suites("tagged templates", { tl: { hd: [ "with externals, it should return the result of the function", - (function () { + (() => { return { TAG: "Eq", _0: length, @@ -77,7 +77,7 @@ Mt.from_pair_suites("tagged templates", { tl: { hd: [ "with rescript function, it should return a string with the correct encoding and interpolations", - (function () { + (() => { return { TAG: "Eq", _0: res, @@ -88,7 +88,7 @@ Mt.from_pair_suites("tagged templates", { tl: { hd: [ "a template literal tagged with json should generate a regular string interpolation for now", - (function () { + (() => { return { TAG: "Eq", _0: "some random " + "string", @@ -99,7 +99,7 @@ Mt.from_pair_suites("tagged templates", { tl: { hd: [ "a regular string interpolation should continue working", - (function () { + (() => { return { TAG: "Eq", _0: "some random string interpolation", diff --git a/jscomp/test/tailcall_inline_test.js b/jscomp/test/tailcall_inline_test.js index c419a6d6b1e..54f68ecde8f 100644 --- a/jscomp/test/tailcall_inline_test.js +++ b/jscomp/test/tailcall_inline_test.js @@ -6,7 +6,7 @@ let $$Array = require("../../lib/js/array.js"); let Caml_array = require("../../lib/js/caml_array.js"); function f() { - let f$1 = function (_acc, _n) { + let f$1 = (_acc, _n) => { while (true) { let n = _n; let acc = _acc; @@ -27,7 +27,7 @@ function f() { let suites_0 = [ "acc", - (function (param) { + ((param) => { return { TAG: "Eq", _0: f(), @@ -50,7 +50,7 @@ let suites_0 = [ let suites_1 = { hd: [ "array_to_list", - (function (param) { + ((param) => { return { TAG: "Eq", _0: { diff --git a/jscomp/test/test_closure.js b/jscomp/test/test_closure.js index ebef4942f90..b7edefb7414 100644 --- a/jscomp/test/test_closure.js +++ b/jscomp/test/test_closure.js @@ -9,11 +9,11 @@ let v = { }; function f() { - let arr = Caml_array.make(10, (function (param) { + let arr = Caml_array.make(10, ((param) => { })); for (let i = 0; i <= 9; ++i) { - Caml_array.set(arr, i, (function (param) { + Caml_array.set(arr, i, ((param) => { v.contents = v.contents + i | 0; })); } @@ -22,7 +22,7 @@ function f() { let u = f(); -$$Array.iter((function (x) { +$$Array.iter(((x) => { x(); }), u); diff --git a/jscomp/test/test_cps.js b/jscomp/test/test_cps.js index 351f2d4edd0..f2642f8db3d 100644 --- a/jscomp/test/test_cps.js +++ b/jscomp/test/test_cps.js @@ -10,7 +10,7 @@ function f(_n, _acc) { if (n === 0) { return acc(); } - _acc = (function () { + _acc = (() => { console.log(String(n)); return acc(); }); @@ -20,18 +20,18 @@ function f(_n, _acc) { } function test_closure() { - let arr = Caml_array.make(6, (function (x) { + let arr = Caml_array.make(6, ((x) => { return x; })); for (let i = 0; i <= 6; ++i) { - Caml_array.set(arr, i, (function (param) { + Caml_array.set(arr, i, ((param) => { return i; })); } return arr; } -f(10, (function () { +f(10, (() => { })); diff --git a/jscomp/test/test_demo.js b/jscomp/test/test_demo.js index 4fb912cfb38..56b15dc7fd9 100644 --- a/jscomp/test/test_demo.js +++ b/jscomp/test/test_demo.js @@ -45,14 +45,14 @@ function f(x, y, z) { function g(x, y) { let u = x + y | 0; - return function (z) { + return (z) => { return u + z | 0; }; } function g1(x, y) { let u = x + y | 0; - return function (xx, yy) { + return (xx, yy) => { return (xx + yy | 0) + u | 0; }; } diff --git a/jscomp/test/test_for_loop.js b/jscomp/test/test_for_loop.js index 23a212f7188..ad4e670917f 100644 --- a/jscomp/test/test_for_loop.js +++ b/jscomp/test/test_for_loop.js @@ -20,18 +20,18 @@ function for_3(x) { let v = { contents: 0 }; - let arr = $$Array.map((function (param) { - return function () { + let arr = $$Array.map(((param) => { + return () => { }; }), x); for (let i = 0, i_finish = x.length; i <= i_finish; ++i) { let j = (i << 1); - Caml_array.set(arr, i, (function () { + Caml_array.set(arr, i, (() => { v.contents = v.contents + j | 0; })); } - $$Array.iter((function (x) { + $$Array.iter(((x) => { x(); }), arr); return v.contents; @@ -41,19 +41,19 @@ function for_4(x) { let v = { contents: 0 }; - let arr = $$Array.map((function (param) { - return function () { + let arr = $$Array.map(((param) => { + return () => { }; }), x); for (let i = 0, i_finish = x.length; i <= i_finish; ++i) { let j = (i << 1); let k = (j << 1); - Caml_array.set(arr, i, (function () { + Caml_array.set(arr, i, (() => { v.contents = v.contents + k | 0; })); } - $$Array.iter((function (x) { + $$Array.iter(((x) => { x(); }), arr); return v.contents; @@ -63,18 +63,18 @@ function for_5(x, u) { let v = { contents: 0 }; - let arr = $$Array.map((function (param) { - return function () { + let arr = $$Array.map(((param) => { + return () => { }; }), x); for (let i = 0, i_finish = x.length; i <= i_finish; ++i) { let k = Math.imul((u << 1), u); - Caml_array.set(arr, i, (function () { + Caml_array.set(arr, i, (() => { v.contents = v.contents + k | 0; })); } - $$Array.iter((function (x) { + $$Array.iter(((x) => { x(); }), arr); return v.contents; @@ -84,8 +84,8 @@ function for_6(x, u) { let v = { contents: 0 }; - let arr = $$Array.map((function (param) { - return function () { + let arr = $$Array.map(((param) => { + return () => { }; }), x); @@ -105,12 +105,12 @@ function for_6(x, u) { let k = Math.imul((u << 1), u); let h = (v5.contents << 1); v2.contents = v2.contents + 1 | 0; - Caml_array.set(arr, i, (function () { + Caml_array.set(arr, i, (() => { v.contents = (((((v.contents + k | 0) + v2.contents | 0) + u | 0) + v4.contents | 0) + v5.contents | 0) + h | 0; })); } } - $$Array.iter((function (x) { + $$Array.iter(((x) => { x(); }), arr); return v.contents; diff --git a/jscomp/test/test_google_closure.js b/jscomp/test/test_google_closure.js index 55fd61de0ff..8078ee555d1 100644 --- a/jscomp/test/test_google_closure.js +++ b/jscomp/test/test_google_closure.js @@ -9,7 +9,7 @@ function f(a, b, param) { } function f2(a) { - return function (extra) { + return (extra) => { return a + 1 | 0; }; } @@ -22,12 +22,12 @@ function f3(extra) { let b = f3(2); -let arr = $$Array.init(2, (function (param) { +let arr = $$Array.init(2, ((param) => { return 0; })); for (let i = 0; i <= 1; ++i) { - let f3$1 = function (extra) { + let f3$1 = (extra) => { return i + 1 | 0; }; Caml_array.set(arr, i, f3$1(2)); diff --git a/jscomp/test/test_int_map_find.js b/jscomp/test/test_int_map_find.js index b5de86fa277..c535c747601 100644 --- a/jscomp/test/test_int_map_find.js +++ b/jscomp/test/test_int_map_find.js @@ -138,7 +138,7 @@ function add(x, data, param) { } } -List.fold_left((function (acc, param) { +List.fold_left(((acc, param) => { return add(param[0], param[1], acc); }), "Empty", { hd: [ diff --git a/jscomp/test/test_list.js b/jscomp/test/test_list.js index 3f5818641fe..af80e575588 100644 --- a/jscomp/test/test_list.js +++ b/jscomp/test/test_list.js @@ -584,7 +584,7 @@ function find(p, _x) { } function find_all(p) { - return function (__x) { + return (__x) => { let _accu = /* [] */0; let _x = __x; while (true) { @@ -740,7 +740,7 @@ function chop(_k, _l) { } function stable_sort(cmp, l) { - let sort = function (n, l) { + let sort = (n, l) => { if (n !== 2) { if (n === 3 && l) { let match = l.tl; @@ -886,7 +886,7 @@ function stable_sort(cmp, l) { continue; }; }; - let rev_sort = function (n, l) { + let rev_sort = (n, l) => { if (n !== 2) { if (n === 3 && l) { let match = l.tl; @@ -1041,7 +1041,7 @@ function stable_sort(cmp, l) { } function sort_uniq(cmp, l) { - let sort = function (n, l) { + let sort = (n, l) => { if (n !== 2) { if (n === 3 && l) { let match = l.tl; @@ -1272,7 +1272,7 @@ function sort_uniq(cmp, l) { continue; }; }; - let rev_sort = function (n, l) { + let rev_sort = (n, l) => { if (n !== 2) { if (n === 3 && l) { let match = l.tl; diff --git a/jscomp/test/test_react.js b/jscomp/test/test_react.js index 445d1d00ab7..4d77a56a6a6 100644 --- a/jscomp/test/test_react.js +++ b/jscomp/test/test_react.js @@ -11,7 +11,7 @@ let ReactDom = require("react-dom"); console.log(32); ReactDom.render(React.createClass({ - render: (function () { + render: (() => { return React.DOM.div({ alt: "pic" }, React.DOM.h1(undefined, "hello react"), React.DOM.h2(undefined, "type safe!"), React.DOM.h3(undefined, "type safe!")); diff --git a/jscomp/test/test_set.js b/jscomp/test/test_set.js index a8fbcc1f3f9..81761c08b2a 100644 --- a/jscomp/test/test_set.js +++ b/jscomp/test/test_set.js @@ -4,14 +4,14 @@ let List = require("../../lib/js/list.js"); function Make(Ord) { - let height = function (x) { + let height = (x) => { if (typeof x !== "object") { return 0; } else { return x._3; } }; - let create = function (l, v, r) { + let create = (l, v, r) => { let hl; hl = typeof l !== "object" ? 0 : l._3; let hr; @@ -24,7 +24,7 @@ function Make(Ord) { _3: hl >= hr ? hl + 1 | 0 : hr + 1 | 0 }; }; - let bal = function (l, v, r) { + let bal = (l, v, r) => { let hl; hl = typeof l !== "object" ? 0 : l._3; let hr; @@ -87,7 +87,7 @@ function Make(Ord) { } }); }; - let add = function (x, x_) { + let add = (x, x_) => { if (typeof x_ !== "object") { return { TAG: "Node", @@ -109,7 +109,7 @@ function Make(Ord) { return bal(l, v, add(x, r)); } }; - let singleton = function (x) { + let singleton = (x) => { return { TAG: "Node", _0: "Empty", @@ -118,21 +118,21 @@ function Make(Ord) { _3: 1 }; }; - let add_min_element = function (v, x) { + let add_min_element = (v, x) => { if (typeof x !== "object") { return singleton(v); } else { return bal(add_min_element(v, x._0), x._1, x._2); } }; - let add_max_element = function (v, x) { + let add_max_element = (v, x) => { if (typeof x !== "object") { return singleton(v); } else { return bal(x._0, x._1, add_max_element(v, x._2)); } }; - let join = function (l, v, r) { + let join = (l, v, r) => { if (typeof l !== "object") { return add_min_element(v, r); } @@ -149,7 +149,7 @@ function Make(Ord) { return create(l, v, r); } }; - let min_elt = function (_x) { + let min_elt = (_x) => { while (true) { let x = _x; if (typeof x !== "object") { @@ -167,7 +167,7 @@ function Make(Ord) { continue; }; }; - let max_elt = function (_x) { + let max_elt = (_x) => { while (true) { let x = _x; if (typeof x !== "object") { @@ -185,7 +185,7 @@ function Make(Ord) { continue; }; }; - let remove_min_elt = function (x) { + let remove_min_elt = (x) => { if (typeof x !== "object") { throw new Error("Invalid_argument", { cause: { @@ -201,7 +201,7 @@ function Make(Ord) { return bal(remove_min_elt(l), x._1, x._2); } }; - let merge = function (t1, t2) { + let merge = (t1, t2) => { if (typeof t1 !== "object") { return t2; } else if (typeof t2 !== "object") { @@ -210,7 +210,7 @@ function Make(Ord) { return bal(t1, min_elt(t2), remove_min_elt(t2)); } }; - let concat = function (t1, t2) { + let concat = (t1, t2) => { if (typeof t1 !== "object") { return t2; } else if (typeof t2 !== "object") { @@ -219,7 +219,7 @@ function Make(Ord) { return join(t1, min_elt(t2), remove_min_elt(t2)); } }; - let split = function (x, x_) { + let split = (x, x_) => { if (typeof x_ !== "object") { return [ "Empty", @@ -253,14 +253,14 @@ function Make(Ord) { match$1[2] ]; }; - let is_empty = function (x) { + let is_empty = (x) => { if (typeof x !== "object") { return true; } else { return false; } }; - let mem = function (x, _x_) { + let mem = (x, _x_) => { while (true) { let x_ = _x_; if (typeof x_ !== "object") { @@ -274,7 +274,7 @@ function Make(Ord) { continue; }; }; - let remove = function (x, x_) { + let remove = (x, x_) => { if (typeof x_ !== "object") { return "Empty"; } @@ -290,7 +290,7 @@ function Make(Ord) { return bal(l, v, remove(x, r)); } }; - let union = function (s1, s2) { + let union = (s1, s2) => { if (typeof s1 !== "object") { return s2; } @@ -314,7 +314,7 @@ function Make(Ord) { let match$1 = split(v2, s1); return join(union(match$1[0], s2._0), v2, union(match$1[2], s2._2)); }; - let inter = function (s1, s2) { + let inter = (s1, s2) => { if (typeof s1 !== "object") { return "Empty"; } @@ -332,7 +332,7 @@ function Make(Ord) { return concat(inter(l1, l2), inter(r1, match[2])); } }; - let diff = function (s1, s2) { + let diff = (s1, s2) => { if (typeof s1 !== "object") { return "Empty"; } @@ -350,7 +350,7 @@ function Make(Ord) { return join(diff(l1, l2), v1, diff(r1, match[2])); } }; - let cons_enum = function (_s, _e) { + let cons_enum = (_s, _e) => { while (true) { let e = _e; let s = _s; @@ -367,7 +367,7 @@ function Make(Ord) { continue; }; }; - let compare_aux = function (_e1, _e2) { + let compare_aux = (_e1, _e2) => { while (true) { let e2 = _e2; let e1 = _e1; @@ -390,13 +390,13 @@ function Make(Ord) { continue; }; }; - let compare = function (s1, s2) { + let compare = (s1, s2) => { return compare_aux(cons_enum(s1, "End"), cons_enum(s2, "End")); }; - let equal = function (s1, s2) { + let equal = (s1, s2) => { return compare(s1, s2) === 0; }; - let subset = function (_s1, _s2) { + let subset = (_s1, _s2) => { while (true) { let s2 = _s2; let s1 = _s1; @@ -446,7 +446,7 @@ function Make(Ord) { continue; }; }; - let iter = function (f, _x_) { + let iter = (f, _x_) => { while (true) { let x_ = _x_; if (typeof x_ !== "object") { @@ -458,7 +458,7 @@ function Make(Ord) { continue; }; }; - let fold = function (f, _s, _accu) { + let fold = (f, _s, _accu) => { while (true) { let accu = _accu; let s = _s; @@ -470,7 +470,7 @@ function Make(Ord) { continue; }; }; - let for_all = function (p, _x) { + let for_all = (p, _x) => { while (true) { let x = _x; if (typeof x !== "object") { @@ -486,7 +486,7 @@ function Make(Ord) { continue; }; }; - let exists = function (p, _x) { + let exists = (p, _x) => { while (true) { let x = _x; if (typeof x !== "object") { @@ -502,7 +502,7 @@ function Make(Ord) { continue; }; }; - let filter = function (p, x) { + let filter = (p, x) => { if (typeof x !== "object") { return "Empty"; } @@ -516,7 +516,7 @@ function Make(Ord) { return concat(l$p, r$p); } }; - let partition = function (p, x) { + let partition = (p, x) => { if (typeof x !== "object") { return [ "Empty", @@ -543,14 +543,14 @@ function Make(Ord) { ]; } }; - let cardinal = function (x) { + let cardinal = (x) => { if (typeof x !== "object") { return 0; } else { return (cardinal(x._0) + 1 | 0) + cardinal(x._2) | 0; } }; - let elements_aux = function (_accu, _x) { + let elements_aux = (_accu, _x) => { while (true) { let x = _x; let accu = _accu; @@ -565,10 +565,10 @@ function Make(Ord) { continue; }; }; - let elements = function (s) { + let elements = (s) => { return elements_aux(/* [] */0, s); }; - let find = function (x, _x_) { + let find = (x, _x_) => { while (true) { let x_ = _x_; if (typeof x_ !== "object") { @@ -587,8 +587,8 @@ function Make(Ord) { continue; }; }; - let of_sorted_list = function (l) { - let sub = function (n, l) { + let of_sorted_list = (l) => { + let sub = (n, l) => { switch (n) { case 0 : return [ @@ -691,7 +691,7 @@ function Make(Ord) { }; return sub(List.length(l), l)[0]; }; - let of_list = function (l) { + let of_list = (l) => { if (!l) { return "Empty"; } diff --git a/jscomp/test/test_string_map.js b/jscomp/test/test_string_map.js index b8bc888cf38..34f0af33a02 100644 --- a/jscomp/test/test_string_map.js +++ b/jscomp/test/test_string_map.js @@ -166,12 +166,12 @@ function assertion_test() { let m = { contents: "Empty" }; - timing("building", (function () { + timing("building", (() => { for (let i = 0; i <= 1000000; ++i) { m.contents = add(String(i), String(i), m.contents); } })); - timing("querying", (function () { + timing("querying", (() => { for (let i = 0; i <= 1000000; ++i) { find(String(i), m.contents); } diff --git a/jscomp/test/test_while_closure.js b/jscomp/test/test_while_closure.js index 1378a7ded19..6b66ae1202e 100644 --- a/jscomp/test/test_while_closure.js +++ b/jscomp/test/test_while_closure.js @@ -8,7 +8,7 @@ let v = { contents: 0 }; -let arr = Caml_array.make(10, (function () { +let arr = Caml_array.make(10, (() => { })); @@ -16,7 +16,7 @@ function f() { let n = 0; while (n < 10) { let j = n; - Caml_array.set(arr, j, (function () { + Caml_array.set(arr, j, (() => { v.contents = v.contents + j | 0; })); n = n + 1 | 0; @@ -25,7 +25,7 @@ function f() { f(); -$$Array.iter((function (x) { +$$Array.iter(((x) => { x(); }), arr); diff --git a/jscomp/test/test_while_side_effect.js b/jscomp/test/test_while_side_effect.js index 10dcf195797..abea782887c 100644 --- a/jscomp/test/test_while_side_effect.js +++ b/jscomp/test/test_while_side_effect.js @@ -22,7 +22,7 @@ let x = { contents: 3 }; -while ((function () { +while ((() => { let y = 3; console.log(String(x.contents)); y = y + 1 | 0; diff --git a/jscomp/test/test_zero_nullable.js b/jscomp/test/test_zero_nullable.js index 72737d80b03..e5e03244a06 100644 --- a/jscomp/test/test_zero_nullable.js +++ b/jscomp/test/test_zero_nullable.js @@ -17,7 +17,7 @@ function eq(loc, x, y) { suites.contents = { hd: [ loc + (" id " + String(test_id.contents)), - (function () { + (() => { return { TAG: "Eq", _0: x, diff --git a/jscomp/test/ticker.js b/jscomp/test/ticker.js index adb9217fd21..d3043e34f50 100644 --- a/jscomp/test/ticker.js +++ b/jscomp/test/ticker.js @@ -80,13 +80,13 @@ function string_of_rank(x) { } function find_ticker_by_name(all_tickers, ticker) { - return List.find((function (param) { + return List.find(((param) => { return param.ticker_name === ticker; }), all_tickers); } function print_all_composite(all_tickers) { - List.iter((function (x) { + List.iter(((x) => { let tmp = x.type_; if (typeof tmp !== "object") { return; @@ -1090,8 +1090,8 @@ let Ticker_map = { }; function compute_update_sequences(all_tickers) { - List.fold_left((function (counter, ticker) { - let loop = function (counter, ticker) { + List.fold_left(((counter, ticker) => { + let loop = (counter, ticker) => { let rank = ticker.rank; if (typeof rank === "object") { return counter; @@ -1121,7 +1121,7 @@ function compute_update_sequences(all_tickers) { }; return loop(counter, ticker); }), 0, all_tickers); - let map = List.fold_left((function (map, ticker) { + let map = List.fold_left(((map, ticker) => { let tmp = ticker.type_; if (typeof tmp !== "object") { return add(ticker.ticker_name, { @@ -1129,7 +1129,7 @@ function compute_update_sequences(all_tickers) { tl: /* [] */0 }, map); } - let loop = function (_up, _map, _ticker) { + let loop = (_up, _map, _ticker) => { while (true) { let ticker = _ticker; let map = _map; @@ -1156,8 +1156,8 @@ function compute_update_sequences(all_tickers) { }; return loop(/* [] */0, map, ticker); }), "Empty", List.rev(all_tickers)); - return fold((function (k, l, map) { - let l$1 = List.sort_uniq((function (lhs, rhs) { + return fold(((k, l, map) => { + let l$1 = List.sort_uniq(((lhs, rhs) => { let x = lhs.rank; if (typeof x !== "object") { if (x === "Uninitialized") { @@ -1201,7 +1201,7 @@ function compute_update_sequences(all_tickers) { function process_quote(ticker_map, new_ticker, new_value) { let update_sequence = find(new_ticker, ticker_map); - List.iter((function (ticker) { + List.iter(((ticker) => { let match = ticker.type_; if (typeof match !== "object") { if (ticker.ticker_name === new_ticker) { @@ -1226,7 +1226,7 @@ function process_quote(ticker_map, new_ticker, new_value) { } function process_input_line(ticker_map, all_tickers, line) { - let make_binary_op = function (ticker_name, lhs, rhs, op) { + let make_binary_op = (ticker_name, lhs, rhs, op) => { let lhs$1 = find_ticker_by_name(all_tickers, lhs); let rhs$1 = find_ticker_by_name(all_tickers, rhs); return { diff --git a/jscomp/test/to_string_test.js b/jscomp/test/to_string_test.js index 1e2099db17e..f7b21692b88 100644 --- a/jscomp/test/to_string_test.js +++ b/jscomp/test/to_string_test.js @@ -13,7 +13,7 @@ function f(v) { Mt.from_pair_suites("To_string_test", { hd: [ "File \"to_string_test.res\", line 6, characters 8-15", - (function () { + (() => { return { TAG: "Eq", _0: Pervasives.string_of_float(Pervasives.infinity), @@ -24,7 +24,7 @@ Mt.from_pair_suites("To_string_test", { tl: { hd: [ "File \"to_string_test.res\", line 6, characters 49-56", - (function () { + (() => { return { TAG: "Eq", _0: Pervasives.string_of_float(Pervasives.neg_infinity), diff --git a/jscomp/test/topsort_test.js b/jscomp/test/topsort_test.js index c1af12c84ec..859890a559d 100644 --- a/jscomp/test/topsort_test.js +++ b/jscomp/test/topsort_test.js @@ -61,7 +61,7 @@ let graph = { }; function nexts(x, g) { - return List.fold_left((function (acc, param) { + return List.fold_left(((acc, param) => { if (param[0] === x) { return { hd: param[1], @@ -173,7 +173,7 @@ if (!Caml_obj.equal(dfs1({ } function dfs2(nodes, graph, visited) { - let aux = function (_nodes, graph, _visited) { + let aux = (_nodes, graph, _visited) => { while (true) { let visited = _visited; let nodes = _nodes; @@ -275,19 +275,19 @@ function dfs3(nodes, graph) { let visited = { contents: /* [] */0 }; - let aux = function (node, graph) { + let aux = (node, graph) => { if (!List.mem(node, visited.contents)) { visited.contents = { hd: node, tl: visited.contents }; - return List.iter((function (x) { + return List.iter(((x) => { aux(x, graph); }), nexts(node, graph)); } }; - List.iter((function (node) { + List.iter(((node) => { aux(node, graph); }), nodes); return List.rev(visited.contents); @@ -409,7 +409,7 @@ function unsafe_topsort(graph) { let visited = { contents: /* [] */0 }; - let sort_node = function (node) { + let sort_node = (node) => { if (List.mem(node, visited.contents)) { return; } @@ -420,7 +420,7 @@ function unsafe_topsort(graph) { tl: visited.contents }; }; - List.iter((function (param) { + List.iter(((param) => { sort_node(param[0]); }), graph); return visited.contents; @@ -1316,7 +1316,7 @@ function of_list(l) { if (match$3) { if (match$3.tl) { let l$1 = List.sort_uniq($$String.compare, l); - let sub = function (n, l) { + let sub = (n, l) => { switch (n) { case 0 : return [ @@ -1474,7 +1474,7 @@ function pathsort(graph) { "Empty", /* [] */0 ]; - let $plus$great = function (node, param) { + let $plus$great = (node, param) => { let stack = param[1]; let set = param[0]; if (mem(node, set)) { @@ -1496,12 +1496,12 @@ function pathsort(graph) { } ]; }; - let sort_nodes = function (path, nodes) { - List.iter((function (node) { + let sort_nodes = (path, nodes) => { + List.iter(((node) => { sort_node(path, node); }), nodes); }; - let sort_node = function (path, node) { + let sort_node = (path, node) => { if (!List.mem(node, visited.contents)) { sort_nodes($plus$great(node, path), nexts(node, graph)); visited.contents = { @@ -1512,7 +1512,7 @@ function pathsort(graph) { } }; - List.iter((function (param) { + List.iter(((param) => { sort_node(empty_path, param[0]); }), graph); return visited.contents; diff --git a/jscomp/test/tramp_fib.js b/jscomp/test/tramp_fib.js index 1f9cd58ab4b..fdba4313c1d 100644 --- a/jscomp/test/tramp_fib.js +++ b/jscomp/test/tramp_fib.js @@ -21,9 +21,9 @@ function fib(n, k) { } else { return { TAG: "Suspend", - _0: (function () { - return fib(n - 1 | 0, (function (v0) { - return fib(n - 2 | 0, (function (v1) { + _0: (() => { + return fib(n - 1 | 0, ((v0) => { + return fib(n - 2 | 0, ((v1) => { return k(v0 + v1 | 0); })); })); @@ -32,7 +32,7 @@ function fib(n, k) { } } -let u = fib(10, (function (x) { +let u = fib(10, ((x) => { return { TAG: "Continue", _0: x @@ -55,7 +55,7 @@ function isEven(n) { if (n !== 1) { return { TAG: "Suspend", - _0: (function () { + _0: (() => { return isOdd(n - 1 | 0); }) }; diff --git a/jscomp/test/tuple_alloc.js b/jscomp/test/tuple_alloc.js index 412bddc78b1..6acb1c2e706 100644 --- a/jscomp/test/tuple_alloc.js +++ b/jscomp/test/tuple_alloc.js @@ -39,7 +39,7 @@ function kf(cb, v) { } function ikf(v) { - return kf((function (prim) { + return kf(((prim) => { }), v); } diff --git a/jscomp/test/typeof_test.js b/jscomp/test/typeof_test.js index ea671ac58b7..3d0add055c3 100644 --- a/jscomp/test/typeof_test.js +++ b/jscomp/test/typeof_test.js @@ -33,7 +33,7 @@ function string_or_number(x) { let suites_0 = [ "int_type", - (function (param) { + ((param) => { return { TAG: "Eq", _0: "number", @@ -45,7 +45,7 @@ let suites_0 = [ let suites_1 = { hd: [ "string_type", - (function (param) { + ((param) => { return { TAG: "Eq", _0: "string", @@ -56,7 +56,7 @@ let suites_1 = { tl: { hd: [ "number_gadt_test", - (function (param) { + ((param) => { return { TAG: "Eq", _0: Js_types.test(3, "Number"), @@ -67,7 +67,7 @@ let suites_1 = { tl: { hd: [ "boolean_gadt_test", - (function (param) { + ((param) => { return { TAG: "Eq", _0: Js_types.test(true, "Boolean"), @@ -78,7 +78,7 @@ let suites_1 = { tl: { hd: [ "undefined_gadt_test", - (function (param) { + ((param) => { return { TAG: "Eq", _0: Js_types.test(undefined, "Undefined"), @@ -89,7 +89,7 @@ let suites_1 = { tl: { hd: [ "string_on_number1", - (function (param) { + ((param) => { return { TAG: "Eq", _0: string_or_number("xx"), @@ -100,7 +100,7 @@ let suites_1 = { tl: { hd: [ "string_on_number2", - (function (param) { + ((param) => { return { TAG: "Eq", _0: string_or_number(3.02), @@ -111,10 +111,10 @@ let suites_1 = { tl: { hd: [ "string_on_number3", - (function (param) { + ((param) => { return { TAG: "Eq", - _0: string_or_number(function (x) { + _0: string_or_number((x) => { return x; }), _1: false @@ -124,7 +124,7 @@ let suites_1 = { tl: { hd: [ "string_gadt_test", - (function (param) { + ((param) => { return { TAG: "Eq", _0: Js_types.test("3", "String"), @@ -135,7 +135,7 @@ let suites_1 = { tl: { hd: [ "string_gadt_test_neg", - (function (param) { + ((param) => { return { TAG: "Eq", _0: Js_types.test(3, "String"), @@ -146,10 +146,10 @@ let suites_1 = { tl: { hd: [ "function_gadt_test", - (function (param) { + ((param) => { return { TAG: "Eq", - _0: Js_types.test((function (x) { + _0: Js_types.test(((x) => { return x; }), "Function"), _1: true @@ -159,7 +159,7 @@ let suites_1 = { tl: { hd: [ "object_gadt_test", - (function (param) { + ((param) => { return { TAG: "Eq", _0: Js_types.test({ diff --git a/jscomp/test/uncurried_cast.js b/jscomp/test/uncurried_cast.js index 7eff9f3f974..2698aec3807 100644 --- a/jscomp/test/uncurried_cast.js +++ b/jscomp/test/uncurried_cast.js @@ -37,7 +37,7 @@ let l = Belt_List.map({ hd: 2, tl: /* [] */0 } -}, (function (x) { +}, ((x) => { return x + 1 | 0; })); @@ -51,7 +51,7 @@ function partial(x) { }, x); } -let ll = partial(function (x) { +let ll = partial((x) => { return x + 1 | 0; }); @@ -83,7 +83,7 @@ let l$1 = Belt_List.map({ hd: 2, tl: /* [] */0 } -}, (function (x) { +}, ((x) => { return x + 1 | 0; })); @@ -97,7 +97,7 @@ function partial$1(extra) { }, extra); } -let ll$1 = partial$1(function (x) { +let ll$1 = partial$1((x) => { return x + 1 | 0; }); diff --git a/jscomp/test/uncurried_default.args.js b/jscomp/test/uncurried_default.args.js index 21822c00fee..3cf995aa9b5 100644 --- a/jscomp/test/uncurried_default.args.js +++ b/jscomp/test/uncurried_default.args.js @@ -4,7 +4,7 @@ function withOpt(xOpt, y) { let x = xOpt !== undefined ? xOpt : 1; - return function (zOpt, w) { + return (zOpt, w) => { let z = zOpt !== undefined ? zOpt : 1; return ((x + y | 0) + z | 0) + w | 0; }; @@ -56,7 +56,7 @@ let StandardNotation = { function withOpt$1(xOpt, y) { let x = xOpt !== undefined ? xOpt : 1; - return function (zOpt, w) { + return (zOpt, w) => { let z = zOpt !== undefined ? zOpt : 1; return ((x + y | 0) + z | 0) + w | 0; }; diff --git a/jscomp/test/uncurry_external_test.js b/jscomp/test/uncurry_external_test.js index 85094358a6d..aff84062be4 100644 --- a/jscomp/test/uncurry_external_test.js +++ b/jscomp/test/uncurry_external_test.js @@ -16,7 +16,7 @@ function eq(loc, x, y) { suites.contents = { hd: [ loc + (" id " + String(test_id.contents)), - (function () { + (() => { return { TAG: "Eq", _0: x, diff --git a/jscomp/test/unit_undefined_test.js b/jscomp/test/unit_undefined_test.js index 255d5ff4c1f..f2148eb310e 100644 --- a/jscomp/test/unit_undefined_test.js +++ b/jscomp/test/unit_undefined_test.js @@ -17,7 +17,7 @@ function eq(loc, x, y) { } function f_01() { - return hi(function (x) { + return hi((x) => { if (x === undefined) { console.log("x"); return; diff --git a/jscomp/test/unsafe_ppx_test.js b/jscomp/test/unsafe_ppx_test.js index f0e9d4a747d..0efa0739fdc 100644 --- a/jscomp/test/unsafe_ppx_test.js +++ b/jscomp/test/unsafe_ppx_test.js @@ -26,7 +26,7 @@ function g(a) { regression(a, Pervasives.failwith); regression2(3, 2); regression3(3, 2); - regression4(3, (function (x) { + regression4(3, ((x) => { return x; })); } @@ -54,7 +54,7 @@ let v = $$test(1, 2); Mt.from_pair_suites("Unsafe_ppx_test", { hd: [ "unsafe_max", - (function () { + (() => { return { TAG: "Eq", _0: 2, @@ -65,7 +65,7 @@ Mt.from_pair_suites("Unsafe_ppx_test", { tl: { hd: [ "unsafe_test", - (function () { + (() => { return { TAG: "Eq", _0: 3, @@ -76,7 +76,7 @@ Mt.from_pair_suites("Unsafe_ppx_test", { tl: { hd: [ "unsafe_max2", - (function () { + (() => { return { TAG: "Eq", _0: 2, @@ -87,7 +87,7 @@ Mt.from_pair_suites("Unsafe_ppx_test", { tl: { hd: [ "ffi_keys", - (function () { + (() => { return { TAG: "Eq", _0: ["a"], diff --git a/jscomp/test/update_record_test.js b/jscomp/test/update_record_test.js index c81dfc91d6d..e5b00c5971b 100644 --- a/jscomp/test/update_record_test.js +++ b/jscomp/test/update_record_test.js @@ -21,7 +21,7 @@ function eq(loc, x, y) { suites.contents = { hd: [ loc + (" id " + String(test_id.contents)), - (function () { + (() => { return { TAG: "Eq", _0: x, diff --git a/jscomp/test/variant.js b/jscomp/test/variant.js index d288abaca61..a1e9ce0be3c 100644 --- a/jscomp/test/variant.js +++ b/jscomp/test/variant.js @@ -63,7 +63,7 @@ let Path = { }; function Make(M) { - let find = function (x) { + let find = (x) => { }; return { diff --git a/jscomp/test/webpack_config.js b/jscomp/test/webpack_config.js index 132cb378354..ca165da21ae 100644 --- a/jscomp/test/webpack_config.js +++ b/jscomp/test/webpack_config.js @@ -39,16 +39,16 @@ let B = {}; function f() { return [ - (function (prim) { + ((prim) => { List$3.ff(); }), - (function (prim) { + ((prim) => { List$3.ff2(); }), - (function (prim) { + ((prim) => { List$2.ff(); }), - (function (prim) { + ((prim) => { List$2.ff2(); }) ]; diff --git a/lib/es6/arg.js b/lib/es6/arg.js index bd24d4e8e7f..485274c88a5 100644 --- a/lib/es6/arg.js +++ b/lib/es6/arg.js @@ -50,7 +50,7 @@ function split(s) { function make_symlist(prefix, sep, suffix, l) { if (l) { - return List.fold_left((function (x, y) { + return List.fold_left(((x, y) => { return x + (sep + y); }), prefix + l.hd, l.tl) + suffix; } else { @@ -124,7 +124,7 @@ function add_help(speclist) { function usage_b(buf, speclist, errmsg) { Buffer.add_string(buf, errmsg + "\n"); - List.iter((function (x) { + List.iter(((x) => { let doc = x[2]; if (doc.length === 0) { return; @@ -197,7 +197,7 @@ function float_of_string_opt(x) { function parse_and_expand_argv_dynamic_aux(allow_expand, current, argv, speclist, anonfun, errmsg) { let initpos = current.contents; - let convert_error = function (error) { + let convert_error = (error) => { let b = Buffer.create(200); let progname = initpos < argv.contents.length ? Caml_array.get(argv.contents, initpos) : "(?)"; switch (error.TAG) { @@ -284,7 +284,7 @@ function parse_and_expand_argv_dynamic_aux(allow_expand, current, argv, speclist } } let follow = match[1]; - let no_arg = function () { + let no_arg = () => { if (follow === undefined) { return; } @@ -300,7 +300,7 @@ function parse_and_expand_argv_dynamic_aux(allow_expand, current, argv, speclist } }); }; - let get_arg = function () { + let get_arg = () => { if (follow !== undefined) { return follow; } @@ -317,7 +317,7 @@ function parse_and_expand_argv_dynamic_aux(allow_expand, current, argv, speclist } }); }; - let consume_arg = function () { + let consume_arg = () => { if (follow !== undefined) { return; } else { @@ -325,7 +325,7 @@ function parse_and_expand_argv_dynamic_aux(allow_expand, current, argv, speclist return; } }; - let treat_action = function (f) { + let treat_action = (f) => { switch (f.TAG) { case "Unit" : return f._0(); @@ -609,7 +609,7 @@ function parse_expand(l, f, msg) { function second_word(s) { let len = s.length; - let loop = function (_n) { + let loop = (_n) => { while (true) { let n = _n; if (n >= len) { @@ -668,7 +668,7 @@ function replace_leading_tab(s) { let seen = { contents: false }; - return $$String.map((function (c) { + return $$String.map(((c) => { if (c !== 9 || seen.contents) { return c; } else { @@ -683,7 +683,7 @@ function align(limitOpt, speclist) { let completed = add_help(speclist); let len = List.fold_left(max_arg_len, 0, completed); let len$1 = len < limit ? len : limit; - return List.map((function (x) { + return List.map(((x) => { let spec = x[1]; let kwd = x[0]; if (x[2] === "") { diff --git a/lib/es6/array.js b/lib/es6/array.js index badec4a0e57..e53c2c06d2d 100644 --- a/lib/es6/array.js +++ b/lib/es6/array.js @@ -299,7 +299,7 @@ function memq(x, a) { let Bottom = /* @__PURE__ */Caml_exceptions.create("Array.Bottom"); function sort(cmp, a) { - let maxson = function (l, i) { + let maxson = (l, i) => { let i31 = ((i + i | 0) + i | 0) + 1 | 0; let x = i31; if ((i31 + 2 | 0) < l) { @@ -324,7 +324,7 @@ function sort(cmp, a) { } }); }; - let trickle = function (l, i, e) { + let trickle = (l, i, e) => { try { let _i = i; while (true) { @@ -347,7 +347,7 @@ function sort(cmp, a) { }); } }; - let bubble = function (l, i) { + let bubble = (l, i) => { try { let _i = i; while (true) { @@ -367,7 +367,7 @@ function sort(cmp, a) { }); } }; - let trickleup = function (_i, e) { + let trickleup = (_i, e) => { while (true) { let i = _i; let father = (i - 1 | 0) / 3 | 0; @@ -412,7 +412,7 @@ function sort(cmp, a) { } function stable_sort(cmp, a) { - let merge = function (src1ofs, src1len, src2, src2ofs, src2len, dst, dstofs) { + let merge = (src1ofs, src1len, src2, src2ofs, src2len, dst, dstofs) => { let src1r = src1ofs + src1len | 0; let src2r = src2ofs + src2len | 0; let _i1 = src1ofs; @@ -448,7 +448,7 @@ function stable_sort(cmp, a) { continue; }; }; - let isortto = function (srcofs, dst, dstofs, len) { + let isortto = (srcofs, dst, dstofs, len) => { for (let i = 0; i < len; ++i) { let e = Caml_array.get(a, srcofs + i | 0); let j = (dstofs + i | 0) - 1 | 0; @@ -459,7 +459,7 @@ function stable_sort(cmp, a) { Caml_array.set(dst, j + 1 | 0, e); } }; - let sortto = function (srcofs, dst, dstofs, len) { + let sortto = (srcofs, dst, dstofs, len) => { if (len <= 5) { return isortto(srcofs, dst, dstofs, len); } diff --git a/lib/es6/arrayLabels.js b/lib/es6/arrayLabels.js index db8c5e22db1..4952c602c53 100644 --- a/lib/es6/arrayLabels.js +++ b/lib/es6/arrayLabels.js @@ -299,7 +299,7 @@ function memq(x, a) { let Bottom = /* @__PURE__ */Caml_exceptions.create("ArrayLabels.Bottom"); function sort(cmp, a) { - let maxson = function (l, i) { + let maxson = (l, i) => { let i31 = ((i + i | 0) + i | 0) + 1 | 0; let x = i31; if ((i31 + 2 | 0) < l) { @@ -324,7 +324,7 @@ function sort(cmp, a) { } }); }; - let trickle = function (l, i, e) { + let trickle = (l, i, e) => { try { let _i = i; while (true) { @@ -347,7 +347,7 @@ function sort(cmp, a) { }); } }; - let bubble = function (l, i) { + let bubble = (l, i) => { try { let _i = i; while (true) { @@ -367,7 +367,7 @@ function sort(cmp, a) { }); } }; - let trickleup = function (_i, e) { + let trickleup = (_i, e) => { while (true) { let i = _i; let father = (i - 1 | 0) / 3 | 0; @@ -412,7 +412,7 @@ function sort(cmp, a) { } function stable_sort(cmp, a) { - let merge = function (src1ofs, src1len, src2, src2ofs, src2len, dst, dstofs) { + let merge = (src1ofs, src1len, src2, src2ofs, src2len, dst, dstofs) => { let src1r = src1ofs + src1len | 0; let src2r = src2ofs + src2len | 0; let _i1 = src1ofs; @@ -448,7 +448,7 @@ function stable_sort(cmp, a) { continue; }; }; - let isortto = function (srcofs, dst, dstofs, len) { + let isortto = (srcofs, dst, dstofs, len) => { for (let i = 0; i < len; ++i) { let e = Caml_array.get(a, srcofs + i | 0); let j = (dstofs + i | 0) - 1 | 0; @@ -459,7 +459,7 @@ function stable_sort(cmp, a) { Caml_array.set(dst, j + 1 | 0, e); } }; - let sortto = function (srcofs, dst, dstofs, len) { + let sortto = (srcofs, dst, dstofs, len) => { if (len <= 5) { return isortto(srcofs, dst, dstofs, len); } diff --git a/lib/es6/belt_Array.js b/lib/es6/belt_Array.js index 2f6861be874..02adc733df1 100644 --- a/lib/es6/belt_Array.js +++ b/lib/es6/belt_Array.js @@ -59,7 +59,7 @@ function swapUnsafe(xs, i, j) { function shuffleInPlace(xs) { let len = xs.length; - let random_int = function (min, max) { + let random_int = (min, max) => { return Math.floor(Math.random() * (max - min | 0)) + min | 0; }; for (let i = 0; i < len; ++i) { diff --git a/lib/es6/belt_MapDict.js b/lib/es6/belt_MapDict.js index 13f4eee8d03..d091d6f4021 100644 --- a/lib/es6/belt_MapDict.js +++ b/lib/es6/belt_MapDict.js @@ -196,7 +196,7 @@ function split(n, x, cmp) { function merge(s1, s2, f, cmp) { if (s1 === undefined) { if (s2 !== undefined) { - return Belt_internalAVLtree.keepMap(s2, (function (k, v) { + return Belt_internalAVLtree.keepMap(s2, ((k, v) => { return f(k, undefined, Caml_option.some(v)); })); } else { @@ -204,7 +204,7 @@ function merge(s1, s2, f, cmp) { } } if (s2 === undefined) { - return Belt_internalAVLtree.keepMap(s1, (function (k, v) { + return Belt_internalAVLtree.keepMap(s1, ((k, v) => { return f(k, Caml_option.some(v), undefined); })); } diff --git a/lib/es6/belt_internalAVLset.js b/lib/es6/belt_internalAVLset.js index 94c81e95e7d..af5ff2f2254 100644 --- a/lib/es6/belt_internalAVLset.js +++ b/lib/es6/belt_internalAVLset.js @@ -827,7 +827,7 @@ function fromArray(xs, cmp) { if (len === 0) { return; } - let next = Belt_SortArray.strictlySortedLength(xs, (function (x, y) { + let next = Belt_SortArray.strictlySortedLength(xs, ((x, y) => { return cmp(x, y) < 0; })); let result; diff --git a/lib/es6/belt_internalAVLtree.js b/lib/es6/belt_internalAVLtree.js index 190a8d150c1..b1b434fe8fd 100644 --- a/lib/es6/belt_internalAVLtree.js +++ b/lib/es6/belt_internalAVLtree.js @@ -1001,7 +1001,7 @@ function fromArray(xs, cmp) { if (len === 0) { return; } - let next = Belt_SortArray.strictlySortedLength(xs, (function (param, param$1) { + let next = Belt_SortArray.strictlySortedLength(xs, ((param, param$1) => { return cmp(param[0], param$1[0]) < 0; })); let result; diff --git a/lib/es6/belt_internalBuckets.js b/lib/es6/belt_internalBuckets.js index bc3aaf29c37..ba1c789f1cf 100644 --- a/lib/es6/belt_internalBuckets.js +++ b/lib/es6/belt_internalBuckets.js @@ -108,7 +108,7 @@ function reduce(h, init, f) { } function getMaxBucketLength(h) { - return Belt_Array.reduce(h.buckets, 0, (function (m, b) { + return Belt_Array.reduce(h.buckets, 0, ((m, b) => { let len = bucketLength(0, b); if (m > len) { return m; @@ -120,10 +120,10 @@ function getMaxBucketLength(h) { function getBucketHistogram(h) { let mbl = getMaxBucketLength(h); - let histo = Belt_Array.makeBy(mbl + 1 | 0, (function (param) { + let histo = Belt_Array.makeBy(mbl + 1 | 0, ((param) => { return 0; })); - Belt_Array.forEach(h.buckets, (function (b) { + Belt_Array.forEach(h.buckets, ((b) => { let l = bucketLength(0, b); histo[l] = histo[l] + 1 | 0; })); @@ -233,19 +233,19 @@ function linear(h, f) { } function keysToArray(h) { - return linear(h, (function (x) { + return linear(h, ((x) => { return x.key; })); } function valuesToArray(h) { - return linear(h, (function (x) { + return linear(h, ((x) => { return x.value; })); } function toArray(h) { - return linear(h, (function (x) { + return linear(h, ((x) => { return [ x.key, x.value diff --git a/lib/es6/belt_internalMapInt.js b/lib/es6/belt_internalMapInt.js index 54b4477a663..05211ebed51 100644 --- a/lib/es6/belt_internalMapInt.js +++ b/lib/es6/belt_internalMapInt.js @@ -303,7 +303,7 @@ function fromArray(xs) { if (len === 0) { return; } - let next = Belt_SortArray.strictlySortedLength(xs, (function (param, param$1) { + let next = Belt_SortArray.strictlySortedLength(xs, ((param, param$1) => { return param[0] < param$1[0]; })); let result; diff --git a/lib/es6/belt_internalMapString.js b/lib/es6/belt_internalMapString.js index 0529dbd1fac..474ebdc131e 100644 --- a/lib/es6/belt_internalMapString.js +++ b/lib/es6/belt_internalMapString.js @@ -303,7 +303,7 @@ function fromArray(xs) { if (len === 0) { return; } - let next = Belt_SortArray.strictlySortedLength(xs, (function (param, param$1) { + let next = Belt_SortArray.strictlySortedLength(xs, ((param, param$1) => { return param[0] < param$1[0]; })); let result; diff --git a/lib/es6/belt_internalSetBuckets.js b/lib/es6/belt_internalSetBuckets.js index 8a6100c2d52..61787bdc7da 100644 --- a/lib/es6/belt_internalSetBuckets.js +++ b/lib/es6/belt_internalSetBuckets.js @@ -134,7 +134,7 @@ function reduce(h, init, f) { } function getMaxBucketLength(h) { - return Belt_Array.reduce(h.buckets, 0, (function (m, b) { + return Belt_Array.reduce(h.buckets, 0, ((m, b) => { let len = bucketLength(0, b); if (m > len) { return m; @@ -146,10 +146,10 @@ function getMaxBucketLength(h) { function getBucketHistogram(h) { let mbl = getMaxBucketLength(h); - let histo = Belt_Array.makeBy(mbl + 1 | 0, (function (param) { + let histo = Belt_Array.makeBy(mbl + 1 | 0, ((param) => { return 0; })); - Belt_Array.forEach(h.buckets, (function (b) { + Belt_Array.forEach(h.buckets, ((b) => { let l = bucketLength(0, b); histo[l] = histo[l] + 1 | 0; })); diff --git a/lib/es6/caml_format.js b/lib/es6/caml_format.js index debf240abf9..e0441baf86c 100644 --- a/lib/es6/caml_format.js +++ b/lib/es6/caml_format.js @@ -136,7 +136,7 @@ function int_of_string(s) { } }); } - let aux = function (_acc, _k) { + let aux = (_acc, _k) => { while (true) { let k = _k; let acc = _acc; @@ -225,7 +225,7 @@ function int64_of_string(s) { } }); } - let aux = function (_acc, _k) { + let aux = (_acc, _k) => { while (true) { let k = _k; let acc = _acc; @@ -404,7 +404,7 @@ function parse_format(fmt) { case 46 : f.prec = 0; let j = i + 1 | 0; - while ((function () { + while ((() => { let w = fmt.codePointAt(j) - 48 | 0; return w >= 0 && w <= 9; })()) { @@ -443,7 +443,7 @@ function parse_format(fmt) { case 3 : f.width = 0; let j$1 = i; - while ((function () { + while ((() => { let w = fmt.codePointAt(j$1) - 48 | 0; return w >= 0 && w <= 9; })()) { @@ -676,7 +676,7 @@ function format_float(fmt, x) { p = p - (exp + 1 | 0) | 0; s = x$1.toFixed(p); } else { - while ((function () { + while ((() => { s = x$1.toFixed(p); return s.length > (prec$1 + 1 | 0); })()) { diff --git a/lib/es6/caml_hash.js b/lib/es6/caml_hash.js index 054d8216301..4bcb78d750a 100644 --- a/lib/es6/caml_hash.js +++ b/lib/es6/caml_hash.js @@ -84,7 +84,7 @@ function hash(count, _limit, seed, obj) { ++ size } return size - })(obj$1, (function (v) { + })(obj$1, ((v) => { push_back(queue, v); })); s = Caml_hash_primitive.hash_mix_int(s, (size$1 << 10) | 0); diff --git a/lib/es6/caml_int64.js b/lib/es6/caml_int64.js index 14bae1175a0..c4a9d0e0a2f 100644 --- a/lib/es6/caml_int64.js +++ b/lib/es6/caml_int64.js @@ -527,7 +527,7 @@ function to_int32(x) { function to_hex(x) { let x_lo = x[1]; let x_hi = x[0]; - let aux = function (v) { + let aux = (v) => { return (v >>> 0).toString(16); }; if (x_hi === 0 && x_lo === 0) { diff --git a/lib/es6/caml_module.js b/lib/es6/caml_module.js index 55a5dc88d50..6f579153d99 100644 --- a/lib/es6/caml_module.js +++ b/lib/es6/caml_module.js @@ -3,7 +3,7 @@ import * as Caml_obj from "./caml_obj.js"; function init_mod(loc, shape) { - let undef_module = function (param) { + let undef_module = (param) => { throw new Error("Undefined_recursive_module", { cause: { RE_EXN_ID: "Undefined_recursive_module", @@ -11,7 +11,7 @@ function init_mod(loc, shape) { } }); }; - let loop = function (shape, struct_, idx) { + let loop = (shape, struct_, idx) => { if (typeof shape !== "object") { switch (shape) { case "Function" : @@ -50,7 +50,7 @@ function init_mod(loc, shape) { } function update_mod(shape, o, n) { - let aux = function (shape, o, n, parent, i) { + let aux = (shape, o, n, parent, i) => { if (typeof shape !== "object") { switch (shape) { case "Function" : diff --git a/lib/es6/caml_obj.js b/lib/es6/caml_obj.js index 8fc4b043204..8888a3b97ae 100644 --- a/lib/es6/caml_obj.js +++ b/lib/es6/caml_obj.js @@ -211,7 +211,7 @@ function aux_obj_compare(a, b) { let min_key_rhs = { contents: undefined }; - let do_key = function (param, key) { + let do_key = (param, key) => { let min_key = param[2]; let b = param[1]; if (!(!Object.prototype.hasOwnProperty.call(b, key) || compare(param[0][key], b[key]) > 0)) { @@ -225,14 +225,14 @@ function aux_obj_compare(a, b) { return; } }; - let do_key_a = function (key) { + let do_key_a = (key) => { do_key([ a, b, min_key_rhs ], key); }; - let do_key_b = function (key) { + let do_key_b = (key) => { do_key([ b, a, @@ -314,14 +314,14 @@ function equal(a, b) { let result = { contents: true }; - let do_key_a = function (key) { + let do_key_a = (key) => { if (!Object.prototype.hasOwnProperty.call(b, key)) { result.contents = false; return; } }; - let do_key_b = function (key) { + let do_key_b = (key) => { if (!Object.prototype.hasOwnProperty.call(a, key) || !equal(b[key], a[key])) { result.contents = false; return; diff --git a/lib/es6/camlinternalLazy.js b/lib/es6/camlinternalLazy.js index 4e8978398a6..a1b4ebe8afb 100644 --- a/lib/es6/camlinternalLazy.js +++ b/lib/es6/camlinternalLazy.js @@ -32,7 +32,7 @@ function force(lzv) { try { return forward_with_closure(lzv, closure); } catch (e) { - lzv.VAL = (function () { + lzv.VAL = (() => { throw new Error(e.RE_EXN_ID, { cause: e }); diff --git a/lib/es6/curry.js b/lib/es6/curry.js index 00af2a55d56..d5b7e9b9e85 100644 --- a/lib/es6/curry.js +++ b/lib/es6/curry.js @@ -14,7 +14,7 @@ function app(_f, _args) { return f.apply(null, args); } if (d >= 0) { - return function (x) { + return (x) => { return app(f, args.concat([x])); }; } @@ -33,27 +33,27 @@ function _1(o, a0) { case 1 : return o(a0); case 2 : - return function (param) { + return (param) => { return o(a0, param); }; case 3 : - return function (param, param$1) { + return (param, param$1) => { return o(a0, param, param$1); }; case 4 : - return function (param, param$1, param$2) { + return (param, param$1, param$2) => { return o(a0, param, param$1, param$2); }; case 5 : - return function (param, param$1, param$2, param$3) { + return (param, param$1, param$2, param$3) => { return o(a0, param, param$1, param$2, param$3); }; case 6 : - return function (param, param$1, param$2, param$3, param$4) { + return (param, param$1, param$2, param$3, param$4) => { return o(a0, param, param$1, param$2, param$3, param$4); }; case 7 : - return function (param, param$1, param$2, param$3, param$4, param$5) { + return (param, param$1, param$2, param$3, param$4, param$5) => { return o(a0, param, param$1, param$2, param$3, param$4, param$5); }; default: @@ -67,7 +67,7 @@ function __1(o) { if (arity === 1) { return o; } else { - return function (a0) { + return (a0) => { return _1(o, a0); }; } @@ -84,23 +84,23 @@ function _2(o, a0, a1) { case 2 : return o(a0, a1); case 3 : - return function (param) { + return (param) => { return o(a0, a1, param); }; case 4 : - return function (param, param$1) { + return (param, param$1) => { return o(a0, a1, param, param$1); }; case 5 : - return function (param, param$1, param$2) { + return (param, param$1, param$2) => { return o(a0, a1, param, param$1, param$2); }; case 6 : - return function (param, param$1, param$2, param$3) { + return (param, param$1, param$2, param$3) => { return o(a0, a1, param, param$1, param$2, param$3); }; case 7 : - return function (param, param$1, param$2, param$3, param$4) { + return (param, param$1, param$2, param$3, param$4) => { return o(a0, a1, param, param$1, param$2, param$3, param$4); }; default: @@ -117,7 +117,7 @@ function __2(o) { if (arity === 2) { return o; } else { - return function (a0, a1) { + return (a0, a1) => { return _2(o, a0, a1); }; } @@ -139,19 +139,19 @@ function _3(o, a0, a1, a2) { case 3 : return o(a0, a1, a2); case 4 : - return function (param) { + return (param) => { return o(a0, a1, a2, param); }; case 5 : - return function (param, param$1) { + return (param, param$1) => { return o(a0, a1, a2, param, param$1); }; case 6 : - return function (param, param$1, param$2) { + return (param, param$1, param$2) => { return o(a0, a1, a2, param, param$1, param$2); }; case 7 : - return function (param, param$1, param$2, param$3) { + return (param, param$1, param$2, param$3) => { return o(a0, a1, a2, param, param$1, param$2, param$3); }; default: @@ -169,7 +169,7 @@ function __3(o) { if (arity === 3) { return o; } else { - return function (a0, a1, a2) { + return (a0, a1, a2) => { return _3(o, a0, a1, a2); }; } @@ -197,15 +197,15 @@ function _4(o, a0, a1, a2, a3) { case 4 : return o(a0, a1, a2, a3); case 5 : - return function (param) { + return (param) => { return o(a0, a1, a2, a3, param); }; case 6 : - return function (param, param$1) { + return (param, param$1) => { return o(a0, a1, a2, a3, param, param$1); }; case 7 : - return function (param, param$1, param$2) { + return (param, param$1, param$2) => { return o(a0, a1, a2, a3, param, param$1, param$2); }; default: @@ -224,7 +224,7 @@ function __4(o) { if (arity === 4) { return o; } else { - return function (a0, a1, a2, a3) { + return (a0, a1, a2, a3) => { return _4(o, a0, a1, a2, a3); }; } @@ -259,11 +259,11 @@ function _5(o, a0, a1, a2, a3, a4) { case 5 : return o(a0, a1, a2, a3, a4); case 6 : - return function (param) { + return (param) => { return o(a0, a1, a2, a3, a4, param); }; case 7 : - return function (param, param$1) { + return (param, param$1) => { return o(a0, a1, a2, a3, a4, param, param$1); }; default: @@ -283,7 +283,7 @@ function __5(o) { if (arity === 5) { return o; } else { - return function (a0, a1, a2, a3, a4) { + return (a0, a1, a2, a3, a4) => { return _5(o, a0, a1, a2, a3, a4); }; } @@ -326,7 +326,7 @@ function _6(o, a0, a1, a2, a3, a4, a5) { case 6 : return o(a0, a1, a2, a3, a4, a5); case 7 : - return function (param) { + return (param) => { return o(a0, a1, a2, a3, a4, a5, param); }; default: @@ -347,7 +347,7 @@ function __6(o) { if (arity === 6) { return o; } else { - return function (a0, a1, a2, a3, a4, a5) { + return (a0, a1, a2, a3, a4, a5) => { return _6(o, a0, a1, a2, a3, a4, a5); }; } @@ -417,7 +417,7 @@ function __7(o) { if (arity === 7) { return o; } else { - return function (a0, a1, a2, a3, a4, a5, a6) { + return (a0, a1, a2, a3, a4, a5, a6) => { return _7(o, a0, a1, a2, a3, a4, a5, a6); }; } @@ -496,7 +496,7 @@ function __8(o) { if (arity === 8) { return o; } else { - return function (a0, a1, a2, a3, a4, a5, a6, a7) { + return (a0, a1, a2, a3, a4, a5, a6, a7) => { return _8(o, a0, a1, a2, a3, a4, a5, a6, a7); }; } diff --git a/lib/es6/digest.js b/lib/es6/digest.js index b5a203d3d85..20cc571fb3a 100644 --- a/lib/es6/digest.js +++ b/lib/es6/digest.js @@ -64,7 +64,7 @@ function from_hex(s) { } }); } - let digit = function (c) { + let digit = (c) => { if (c >= 65) { if (c >= 97) { if (c >= 103) { @@ -97,7 +97,7 @@ function from_hex(s) { } return c - /* '0' */48 | 0; }; - let byte = function (i) { + let byte = (i) => { return (digit(Caml_string.get(s, i)) << 4) + digit(Caml_string.get(s, i + 1 | 0)) | 0; }; let result = Caml_bytes.create(16); diff --git a/lib/es6/filename.js b/lib/es6/filename.js index 7eff32f9f33..050f322f7f8 100644 --- a/lib/es6/filename.js +++ b/lib/es6/filename.js @@ -215,7 +215,7 @@ function quote$1(s) { let l = s.length; let b = Buffer.create(l + 20 | 0); Buffer.add_char(b, /* '"' */34); - let loop = function (_i) { + let loop = (_i) => { while (true) { let i = _i; if (i === l) { @@ -233,7 +233,7 @@ function quote$1(s) { continue; }; }; - let loop_bs = function (_n, _i) { + let loop_bs = (_n, _i) => { while (true) { let i = _i; let n = _n; @@ -256,7 +256,7 @@ function quote$1(s) { return loop(i + 1 | 0); }; }; - let add_bs = function (n) { + let add_bs = (n) => { for (let _j = 1; _j <= n; ++_j) { Buffer.add_char(b, /* '\\' */92); } @@ -266,7 +266,7 @@ function quote$1(s) { } function has_drive(s) { - let is_letter = function (param) { + let is_letter = (param) => { if (param >= 91) { return !(param > 122 || param < 97); } else { diff --git a/lib/es6/genlex.js b/lib/es6/genlex.js index 9e2005ad19d..f95ed73cdec 100644 --- a/lib/es6/genlex.js +++ b/lib/es6/genlex.js @@ -43,13 +43,13 @@ function get_string() { function make_lexer(keywords) { let kwd_table = Hashtbl.create(undefined, 17); - List.iter((function (s) { + List.iter(((s) => { Hashtbl.add(kwd_table, s, { TAG: "Kwd", _0: s }); }), keywords); - let ident_or_keyword = function (id) { + let ident_or_keyword = (id) => { try { return Hashtbl.find(kwd_table, id); } catch (raw_exn) { @@ -65,7 +65,7 @@ function make_lexer(keywords) { }); } }; - let keyword_or_error = function (c) { + let keyword_or_error = (c) => { let s = Caml_string.make(1, c); try { return Hashtbl.find(kwd_table, s); @@ -84,7 +84,7 @@ function make_lexer(keywords) { }); } }; - let next_token = function (strm__) { + let next_token = (strm__) => { while (true) { let c = Stream.peek(strm__); if (c === undefined) { @@ -310,7 +310,7 @@ function make_lexer(keywords) { } }; }; - let ident2 = function (strm__) { + let ident2 = (strm__) => { while (true) { let c = Stream.peek(strm__); if (c === undefined) { @@ -377,7 +377,7 @@ function make_lexer(keywords) { continue; }; }; - let number = function (strm__) { + let number = (strm__) => { while (true) { let c = Stream.peek(strm__); if (c !== undefined) { @@ -428,7 +428,7 @@ function make_lexer(keywords) { }; }; }; - let exponent_part = function (strm__) { + let exponent_part = (strm__) => { let c = Stream.peek(strm__); if (c !== undefined && !(c !== 43 && c !== 45)) { Stream.junk(strm__); @@ -438,7 +438,7 @@ function make_lexer(keywords) { return end_exponent_part(strm__); } }; - let end_exponent_part = function (strm__) { + let end_exponent_part = (strm__) => { while (true) { let c = Stream.peek(strm__); if (c === undefined) { @@ -458,7 +458,7 @@ function make_lexer(keywords) { continue; }; }; - let string = function (strm__) { + let string = (strm__) => { while (true) { let c = Stream.peek(strm__); if (c !== undefined) { @@ -499,7 +499,7 @@ function make_lexer(keywords) { }); }; }; - let char = function (strm__) { + let char = (strm__) => { let c = Stream.peek(strm__); if (c !== undefined) { if (c !== 92) { @@ -531,7 +531,7 @@ function make_lexer(keywords) { }); } }; - let escape = function (strm__) { + let escape = (strm__) => { let c1 = Stream.peek(strm__); if (c1 !== undefined) { if (c1 >= 58) { @@ -601,7 +601,7 @@ function make_lexer(keywords) { }); } }; - let comment = function (strm__) { + let comment = (strm__) => { while (true) { let match = Stream.peek(strm__); if (match !== undefined) { @@ -659,8 +659,8 @@ function make_lexer(keywords) { } }; }; - return function (input) { - return Stream.from(function (_count) { + return (input) => { + return Stream.from((_count) => { return next_token(input); }); }; diff --git a/lib/es6/hashtbl.js b/lib/es6/hashtbl.js index 6a8a0e8b924..cbe38382933 100644 --- a/lib/es6/hashtbl.js +++ b/lib/es6/hashtbl.js @@ -38,7 +38,7 @@ function is_randomized() { return randomized.contents; } -let prng = CamlinternalLazy.from_fun(function () { +let prng = CamlinternalLazy.from_fun(() => { return Random.State.make_self_init(); }); @@ -94,7 +94,7 @@ function copy_bucketlist(param) { let key = param.key; let data = param.data; let next = param.next; - let loop = function (_prec, _param) { + let loop = (_prec, _param) => { while (true) { let param = _param; let prec = _prec; @@ -162,7 +162,7 @@ function resize(indexfun, h) { let ndata_tail = Caml_array.make(nsize, "Empty"); let inplace = h.initial_size >= 0; h.data = ndata; - let insert_bucket = function (_param) { + let insert_bucket = (_param) => { while (true) { let param = _param; if (typeof param !== "object") { @@ -362,7 +362,7 @@ function find_opt(h, key) { } function find_all(h, key) { - let find_in_bucket = function (_param) { + let find_in_bucket = (_param) => { while (true) { let param = _param; if (typeof param !== "object") { @@ -440,7 +440,7 @@ function mem(h, key) { } function iter(f, h) { - let do_bucket = function (_param) { + let do_bucket = (_param) => { while (true) { let param = _param; if (typeof param !== "object") { @@ -539,7 +539,7 @@ function filter_map_inplace(f, h) { } function fold(f, h, init) { - let do_bucket = function (_b, _accu) { + let do_bucket = (_b, _accu) => { while (true) { let accu = _accu; let b = _b; @@ -596,11 +596,11 @@ function bucket_length(_accu, _param) { } function stats(h) { - let mbl = $$Array.fold_left((function (m, b) { + let mbl = $$Array.fold_left(((m, b) => { return Caml.int_max(m, bucket_length(0, b)); }), 0, h.data); let histo = Caml_array.make(mbl + 1 | 0, 0); - $$Array.iter((function (b) { + $$Array.iter(((b) => { let l = bucket_length(0, b); Caml_array.set(histo, l, Caml_array.get(histo, l) + 1 | 0); }), h.data); @@ -613,10 +613,10 @@ function stats(h) { } function MakeSeeded(H) { - let key_index = function (h, key) { + let key_index = (h, key) => { return H.hash(h.seed, key) & (h.data.length - 1 | 0); }; - let add = function (h, key, data) { + let add = (h, key, data) => { let i = key_index(h, key); let bucket = { TAG: "Cons", @@ -631,7 +631,7 @@ function MakeSeeded(H) { } }; - let remove = function (h, key) { + let remove = (h, key) => { let i = key_index(h, key); let _prec = "Empty"; let _param = Caml_array.get(h.data, i); @@ -657,7 +657,7 @@ function MakeSeeded(H) { continue; }; }; - let find = function (h, key) { + let find = (h, key) => { let match = Caml_array.get(h.data, key_index(h, key)); if (typeof match !== "object") { throw new Error("Not_found", { @@ -719,7 +719,7 @@ function MakeSeeded(H) { }; } }; - let find_opt = function (h, key) { + let find_opt = (h, key) => { let match = Caml_array.get(h.data, key_index(h, key)); if (typeof match !== "object") { return; @@ -765,8 +765,8 @@ function MakeSeeded(H) { }; } }; - let find_all = function (h, key) { - let find_in_bucket = function (_param) { + let find_all = (h, key) => { + let find_in_bucket = (_param) => { while (true) { let param = _param; if (typeof param !== "object") { @@ -787,7 +787,7 @@ function MakeSeeded(H) { }; return find_in_bucket(Caml_array.get(h.data, key_index(h, key))); }; - let replace_bucket = function (key, data, _param) { + let replace_bucket = (key, data, _param) => { while (true) { let param = _param; if (typeof param !== "object") { @@ -804,7 +804,7 @@ function MakeSeeded(H) { continue; }; }; - let replace = function (h, key, data) { + let replace = (h, key, data) => { let i = key_index(h, key); let l = Caml_array.get(h.data, i); if (replace_bucket(key, data, l)) { @@ -823,7 +823,7 @@ function MakeSeeded(H) { } }; - let mem = function (h, key) { + let mem = (h, key) => { let _param = Caml_array.get(h.data, key_index(h, key)); while (true) { let param = _param; @@ -861,10 +861,10 @@ function MakeSeeded(H) { function Make(H) { let equal = H.equal; - let key_index = function (h, key) { + let key_index = (h, key) => { return H.hash(key) & (h.data.length - 1 | 0); }; - let add = function (h, key, data) { + let add = (h, key, data) => { let i = key_index(h, key); let bucket = { TAG: "Cons", @@ -879,7 +879,7 @@ function Make(H) { } }; - let remove = function (h, key) { + let remove = (h, key) => { let i = key_index(h, key); let _prec = "Empty"; let _param = Caml_array.get(h.data, i); @@ -905,7 +905,7 @@ function Make(H) { continue; }; }; - let find = function (h, key) { + let find = (h, key) => { let match = Caml_array.get(h.data, key_index(h, key)); if (typeof match !== "object") { throw new Error("Not_found", { @@ -967,7 +967,7 @@ function Make(H) { }; } }; - let find_opt = function (h, key) { + let find_opt = (h, key) => { let match = Caml_array.get(h.data, key_index(h, key)); if (typeof match !== "object") { return; @@ -1013,8 +1013,8 @@ function Make(H) { }; } }; - let find_all = function (h, key) { - let find_in_bucket = function (_param) { + let find_all = (h, key) => { + let find_in_bucket = (_param) => { while (true) { let param = _param; if (typeof param !== "object") { @@ -1035,7 +1035,7 @@ function Make(H) { }; return find_in_bucket(Caml_array.get(h.data, key_index(h, key))); }; - let replace_bucket = function (key, data, _param) { + let replace_bucket = (key, data, _param) => { while (true) { let param = _param; if (typeof param !== "object") { @@ -1052,7 +1052,7 @@ function Make(H) { continue; }; }; - let replace = function (h, key, data) { + let replace = (h, key, data) => { let i = key_index(h, key); let l = Caml_array.get(h.data, i); if (replace_bucket(key, data, l)) { @@ -1071,7 +1071,7 @@ function Make(H) { } }; - let mem = function (h, key) { + let mem = (h, key) => { let _param = Caml_array.get(h.data, key_index(h, key)); while (true) { let param = _param; @@ -1087,7 +1087,7 @@ function Make(H) { continue; }; }; - let create$1 = function (sz) { + let create$1 = (sz) => { return create(false, sz); }; return { diff --git a/lib/es6/hashtblLabels.js b/lib/es6/hashtblLabels.js index 7c623f72743..1d3b1c360e9 100644 --- a/lib/es6/hashtblLabels.js +++ b/lib/es6/hashtblLabels.js @@ -11,19 +11,19 @@ function replace(tbl, key, data) { } function iter(f, tbl) { - Hashtbl.iter((function (key, data) { + Hashtbl.iter(((key, data) => { f(key, data); }), tbl); } function filter_map_inplace(f, tbl) { - Hashtbl.filter_map_inplace((function (key, data) { + Hashtbl.filter_map_inplace(((key, data) => { return f(key, data); }), tbl); } function fold(f, tbl, init) { - return Hashtbl.fold((function (key, data, acc) { + return Hashtbl.fold(((key, data, acc) => { return f(key, data, acc); }), tbl, init); } @@ -35,24 +35,24 @@ function MakeSeeded(H) { let iter = include.iter; let filter_map_inplace = include.filter_map_inplace; let fold = include.fold; - let add$1 = function (tbl, key, data) { + let add$1 = (tbl, key, data) => { add(tbl, key, data); }; - let replace$1 = function (tbl, key, data) { + let replace$1 = (tbl, key, data) => { replace(tbl, key, data); }; - let iter$1 = function (f, tbl) { - iter((function (key, data) { + let iter$1 = (f, tbl) => { + iter(((key, data) => { f(key, data); }), tbl); }; - let filter_map_inplace$1 = function (f, tbl) { - filter_map_inplace((function (key, data) { + let filter_map_inplace$1 = (f, tbl) => { + filter_map_inplace(((key, data) => { return f(key, data); }), tbl); }; - let fold$1 = function (f, tbl, init) { - return fold((function (key, data, acc) { + let fold$1 = (f, tbl, init) => { + return fold(((key, data, acc) => { return f(key, data, acc); }), tbl, init); }; @@ -77,7 +77,7 @@ function MakeSeeded(H) { } function Make(H) { - let hash = function (_seed, x) { + let hash = (_seed, x) => { return H.hash(x); }; let H_equal = H.equal; @@ -92,28 +92,28 @@ function Make(H) { let iter = include.iter; let filter_map_inplace = include.filter_map_inplace; let fold = include.fold; - let add$1 = function (tbl, key, data) { + let add$1 = (tbl, key, data) => { add(tbl, key, data); }; - let replace$1 = function (tbl, key, data) { + let replace$1 = (tbl, key, data) => { replace(tbl, key, data); }; - let iter$1 = function (f, tbl) { - iter((function (key, data) { + let iter$1 = (f, tbl) => { + iter(((key, data) => { f(key, data); }), tbl); }; - let filter_map_inplace$1 = function (f, tbl) { - filter_map_inplace((function (key, data) { + let filter_map_inplace$1 = (f, tbl) => { + filter_map_inplace(((key, data) => { return f(key, data); }), tbl); }; - let fold$1 = function (f, tbl, init) { - return fold((function (key, data, acc) { + let fold$1 = (f, tbl, init) => { + return fold(((key, data, acc) => { return f(key, data, acc); }), tbl, init); }; - let create$1 = function (sz) { + let create$1 = (sz) => { return create(false, sz); }; return { diff --git a/lib/es6/lazy.js b/lib/es6/lazy.js index 14e2ebd88b3..4ff76a62bd5 100644 --- a/lib/es6/lazy.js +++ b/lib/es6/lazy.js @@ -3,7 +3,7 @@ import * as CamlinternalLazy from "./camlinternalLazy.js"; function from_fun(f) { - return CamlinternalLazy.from_fun(function () { + return CamlinternalLazy.from_fun(() => { return f(); }); } diff --git a/lib/es6/lexing.js b/lib/es6/lexing.js index ab69f5bfac1..e654ef26b68 100644 --- a/lib/es6/lexing.js +++ b/lib/es6/lexing.js @@ -44,7 +44,7 @@ let zero_pos = { function from_function(f) { return { - refill_buff: (function (x) { + refill_buff: ((x) => { let aux_buffer = Caml_bytes.create(512); let read = f(aux_buffer, aux_buffer.length); let n = read > 0 ? read : (x.lex_eof_reached = true, 0); @@ -99,7 +99,7 @@ function from_function(f) { function from_string(s) { return { - refill_buff: (function (lexbuf) { + refill_buff: ((lexbuf) => { lexbuf.lex_eof_reached = true; }), lex_buffer: Bytes.of_string(s), diff --git a/lib/es6/list.js b/lib/es6/list.js index 27207c1d45b..09ebf99bde4 100644 --- a/lib/es6/list.js +++ b/lib/es6/list.js @@ -856,7 +856,7 @@ function chop(_k, _l) { } function stable_sort(cmp, l) { - let sort = function (n, l) { + let sort = (n, l) => { if (n !== 2) { if (n === 3 && l) { let match = l.tl; @@ -1002,7 +1002,7 @@ function stable_sort(cmp, l) { continue; }; }; - let rev_sort = function (n, l) { + let rev_sort = (n, l) => { if (n !== 2) { if (n === 3 && l) { let match = l.tl; @@ -1157,7 +1157,7 @@ function stable_sort(cmp, l) { } function sort_uniq(cmp, l) { - let sort = function (n, l) { + let sort = (n, l) => { if (n !== 2) { if (n === 3 && l) { let match = l.tl; @@ -1388,7 +1388,7 @@ function sort_uniq(cmp, l) { continue; }; }; - let rev_sort = function (n, l) { + let rev_sort = (n, l) => { if (n !== 2) { if (n === 3 && l) { let match = l.tl; diff --git a/lib/es6/listLabels.js b/lib/es6/listLabels.js index 46744d700a7..b614cbfc27a 100644 --- a/lib/es6/listLabels.js +++ b/lib/es6/listLabels.js @@ -856,7 +856,7 @@ function chop(_k, _l) { } function stable_sort(cmp, l) { - let sort = function (n, l) { + let sort = (n, l) => { if (n !== 2) { if (n === 3 && l) { let match = l.tl; @@ -1002,7 +1002,7 @@ function stable_sort(cmp, l) { continue; }; }; - let rev_sort = function (n, l) { + let rev_sort = (n, l) => { if (n !== 2) { if (n === 3 && l) { let match = l.tl; @@ -1157,7 +1157,7 @@ function stable_sort(cmp, l) { } function sort_uniq(cmp, l) { - let sort = function (n, l) { + let sort = (n, l) => { if (n !== 2) { if (n === 3 && l) { let match = l.tl; @@ -1388,7 +1388,7 @@ function sort_uniq(cmp, l) { continue; }; }; - let rev_sort = function (n, l) { + let rev_sort = (n, l) => { if (n !== 2) { if (n === 3 && l) { let match = l.tl; diff --git a/lib/es6/map.js b/lib/es6/map.js index 1204bf60256..f7de0c79654 100644 --- a/lib/es6/map.js +++ b/lib/es6/map.js @@ -3,14 +3,14 @@ import * as Caml_option from "./caml_option.js"; function Make(funarg) { - let height = function (param) { + let height = (param) => { if (typeof param !== "object") { return 0; } else { return param.h; } }; - let create = function (l, x, d, r) { + let create = (l, x, d, r) => { let hl = height(l); let hr = height(r); return { @@ -22,7 +22,7 @@ function Make(funarg) { h: hl >= hr ? hl + 1 | 0 : hr + 1 | 0 }; }; - let singleton = function (x, d) { + let singleton = (x, d) => { return { TAG: "Node", l: "Empty", @@ -32,7 +32,7 @@ function Make(funarg) { h: 1 }; }; - let bal = function (l, x, d, r) { + let bal = (l, x, d, r) => { let hl; hl = typeof l !== "object" ? 0 : l.h; let hr; @@ -98,14 +98,14 @@ function Make(funarg) { } }); }; - let is_empty = function (param) { + let is_empty = (param) => { if (typeof param !== "object") { return true; } else { return false; } }; - let add = function (x, data, param) { + let add = (x, data, param) => { if (typeof param !== "object") { return { TAG: "Node", @@ -150,7 +150,7 @@ function Make(funarg) { return bal(l, v, d, rr); } }; - let find = function (x, _param) { + let find = (x, _param) => { while (true) { let param = _param; if (typeof param !== "object") { @@ -168,7 +168,7 @@ function Make(funarg) { continue; }; }; - let find_first = function (f, _param) { + let find_first = (f, _param) => { while (true) { let param = _param; if (typeof param !== "object") { @@ -208,7 +208,7 @@ function Make(funarg) { continue; }; }; - let find_first_opt = function (f, _param) { + let find_first_opt = (f, _param) => { while (true) { let param = _param; if (typeof param !== "object") { @@ -244,7 +244,7 @@ function Make(funarg) { continue; }; }; - let find_last = function (f, _param) { + let find_last = (f, _param) => { while (true) { let param = _param; if (typeof param !== "object") { @@ -284,7 +284,7 @@ function Make(funarg) { continue; }; }; - let find_last_opt = function (f, _param) { + let find_last_opt = (f, _param) => { while (true) { let param = _param; if (typeof param !== "object") { @@ -320,7 +320,7 @@ function Make(funarg) { continue; }; }; - let find_opt = function (x, _param) { + let find_opt = (x, _param) => { while (true) { let param = _param; if (typeof param !== "object") { @@ -334,7 +334,7 @@ function Make(funarg) { continue; }; }; - let mem = function (x, _param) { + let mem = (x, _param) => { while (true) { let param = _param; if (typeof param !== "object") { @@ -348,7 +348,7 @@ function Make(funarg) { continue; }; }; - let min_binding = function (_param) { + let min_binding = (_param) => { while (true) { let param = _param; if (typeof param !== "object") { @@ -369,7 +369,7 @@ function Make(funarg) { continue; }; }; - let min_binding_opt = function (_param) { + let min_binding_opt = (_param) => { while (true) { let param = _param; if (typeof param !== "object") { @@ -386,7 +386,7 @@ function Make(funarg) { continue; }; }; - let max_binding = function (_param) { + let max_binding = (_param) => { while (true) { let param = _param; if (typeof param !== "object") { @@ -407,7 +407,7 @@ function Make(funarg) { continue; }; }; - let max_binding_opt = function (_param) { + let max_binding_opt = (_param) => { while (true) { let param = _param; if (typeof param !== "object") { @@ -424,7 +424,7 @@ function Make(funarg) { continue; }; }; - let remove_min_binding = function (param) { + let remove_min_binding = (param) => { if (typeof param !== "object") { throw new Error("Invalid_argument", { cause: { @@ -440,7 +440,7 @@ function Make(funarg) { return bal(remove_min_binding(l), param.v, param.d, param.r); } }; - let merge = function (t1, t2) { + let merge = (t1, t2) => { if (typeof t1 !== "object") { return t2; } @@ -450,7 +450,7 @@ function Make(funarg) { let match = min_binding(t2); return bal(t1, match[0], match[1], remove_min_binding(t2)); }; - let remove = function (x, param) { + let remove = (x, param) => { if (typeof param !== "object") { return "Empty"; } @@ -477,7 +477,7 @@ function Make(funarg) { return bal(l, v, d, rr); } }; - let update = function (x, f, param) { + let update = (x, f, param) => { if (typeof param !== "object") { let data = f(undefined); if (data !== undefined) { @@ -532,7 +532,7 @@ function Make(funarg) { return bal(l, v, d, rr); } }; - let iter = function (f, _param) { + let iter = (f, _param) => { while (true) { let param = _param; if (typeof param !== "object") { @@ -544,7 +544,7 @@ function Make(funarg) { continue; }; }; - let map = function (f, param) { + let map = (f, param) => { if (typeof param !== "object") { return "Empty"; } @@ -560,7 +560,7 @@ function Make(funarg) { h: param.h }; }; - let mapi = function (f, param) { + let mapi = (f, param) => { if (typeof param !== "object") { return "Empty"; } @@ -577,7 +577,7 @@ function Make(funarg) { h: param.h }; }; - let fold = function (f, _m, _accu) { + let fold = (f, _m, _accu) => { while (true) { let accu = _accu; let m = _m; @@ -589,7 +589,7 @@ function Make(funarg) { continue; }; }; - let for_all = function (p, _param) { + let for_all = (p, _param) => { while (true) { let param = _param; if (typeof param !== "object") { @@ -605,7 +605,7 @@ function Make(funarg) { continue; }; }; - let exists = function (p, _param) { + let exists = (p, _param) => { while (true) { let param = _param; if (typeof param !== "object") { @@ -621,21 +621,21 @@ function Make(funarg) { continue; }; }; - let add_min_binding = function (k, x, param) { + let add_min_binding = (k, x, param) => { if (typeof param !== "object") { return singleton(k, x); } else { return bal(add_min_binding(k, x, param.l), param.v, param.d, param.r); } }; - let add_max_binding = function (k, x, param) { + let add_max_binding = (k, x, param) => { if (typeof param !== "object") { return singleton(k, x); } else { return bal(param.l, param.v, param.d, add_max_binding(k, x, param.r)); } }; - let join = function (l, v, d, r) { + let join = (l, v, d, r) => { if (typeof l !== "object") { return add_min_binding(v, d, r); } @@ -652,7 +652,7 @@ function Make(funarg) { return create(l, v, d, r); } }; - let concat = function (t1, t2) { + let concat = (t1, t2) => { if (typeof t1 !== "object") { return t2; } @@ -662,14 +662,14 @@ function Make(funarg) { let match = min_binding(t2); return join(t1, match[0], match[1], remove_min_binding(t2)); }; - let concat_or_join = function (t1, v, d, t2) { + let concat_or_join = (t1, v, d, t2) => { if (d !== undefined) { return join(t1, v, Caml_option.valFromOption(d), t2); } else { return concat(t1, t2); } }; - let split = function (x, param) { + let split = (x, param) => { if (typeof param !== "object") { return [ "Empty", @@ -704,7 +704,7 @@ function Make(funarg) { match$1[2] ]; }; - let merge$1 = function (f, s1, s2) { + let merge$1 = (f, s1, s2) => { if (typeof s1 !== "object") { if (typeof s2 !== "object") { return "Empty"; @@ -734,7 +734,7 @@ function Make(funarg) { let match$1 = split(v2, s1); return concat_or_join(merge$1(f, match$1[0], s2.l), v2, f(v2, match$1[1], Caml_option.some(s2.d)), merge$1(f, match$1[2], s2.r)); }; - let union = function (f, s1, s2) { + let union = (f, s1, s2) => { if (typeof s1 !== "object") { return s2; } @@ -766,7 +766,7 @@ function Make(funarg) { return join(l$1, v2, d2, r$1); } }; - let filter = function (p, param) { + let filter = (p, param) => { if (typeof param !== "object") { return "Empty"; } @@ -787,7 +787,7 @@ function Make(funarg) { return concat(l$p, r$p); } }; - let partition = function (p, param) { + let partition = (p, param) => { if (typeof param !== "object") { return [ "Empty", @@ -815,7 +815,7 @@ function Make(funarg) { ]; } }; - let cons_enum = function (_m, _e) { + let cons_enum = (_m, _e) => { while (true) { let e = _e; let m = _m; @@ -833,7 +833,7 @@ function Make(funarg) { continue; }; }; - let compare = function (cmp, m1, m2) { + let compare = (cmp, m1, m2) => { let _e1 = cons_enum(m1, "End"); let _e2 = cons_enum(m2, "End"); while (true) { @@ -862,7 +862,7 @@ function Make(funarg) { continue; }; }; - let equal = function (cmp, m1, m2) { + let equal = (cmp, m1, m2) => { let _e1 = cons_enum(m1, "End"); let _e2 = cons_enum(m2, "End"); while (true) { @@ -889,14 +889,14 @@ function Make(funarg) { continue; }; }; - let cardinal = function (param) { + let cardinal = (param) => { if (typeof param !== "object") { return 0; } else { return (cardinal(param.l) + 1 | 0) + cardinal(param.r) | 0; } }; - let bindings_aux = function (_accu, _param) { + let bindings_aux = (_accu, _param) => { while (true) { let param = _param; let accu = _accu; @@ -914,7 +914,7 @@ function Make(funarg) { continue; }; }; - let bindings = function (s) { + let bindings = (s) => { return bindings_aux(/* [] */0, s); }; return { diff --git a/lib/es6/mapLabels.js b/lib/es6/mapLabels.js index af3164d63e9..1badc16d8d2 100644 --- a/lib/es6/mapLabels.js +++ b/lib/es6/mapLabels.js @@ -3,14 +3,14 @@ import * as Caml_option from "./caml_option.js"; function Make(Ord) { - let height = function (param) { + let height = (param) => { if (typeof param !== "object") { return 0; } else { return param.h; } }; - let create = function (l, x, d, r) { + let create = (l, x, d, r) => { let hl = height(l); let hr = height(r); return { @@ -22,7 +22,7 @@ function Make(Ord) { h: hl >= hr ? hl + 1 | 0 : hr + 1 | 0 }; }; - let singleton = function (x, d) { + let singleton = (x, d) => { return { TAG: "Node", l: "Empty", @@ -32,7 +32,7 @@ function Make(Ord) { h: 1 }; }; - let bal = function (l, x, d, r) { + let bal = (l, x, d, r) => { let hl; hl = typeof l !== "object" ? 0 : l.h; let hr; @@ -98,14 +98,14 @@ function Make(Ord) { } }); }; - let is_empty = function (param) { + let is_empty = (param) => { if (typeof param !== "object") { return true; } else { return false; } }; - let add = function (x, data, param) { + let add = (x, data, param) => { if (typeof param !== "object") { return { TAG: "Node", @@ -150,7 +150,7 @@ function Make(Ord) { return bal(l, v, d, rr); } }; - let find = function (x, _param) { + let find = (x, _param) => { while (true) { let param = _param; if (typeof param !== "object") { @@ -168,7 +168,7 @@ function Make(Ord) { continue; }; }; - let find_first_aux = function (_v0, _d0, f, _param) { + let find_first_aux = (_v0, _d0, f, _param) => { while (true) { let param = _param; let d0 = _d0; @@ -190,7 +190,7 @@ function Make(Ord) { continue; }; }; - let find_first = function (f, _param) { + let find_first = (f, _param) => { while (true) { let param = _param; if (typeof param !== "object") { @@ -208,7 +208,7 @@ function Make(Ord) { continue; }; }; - let find_first_opt_aux = function (_v0, _d0, f, _param) { + let find_first_opt_aux = (_v0, _d0, f, _param) => { while (true) { let param = _param; let d0 = _d0; @@ -230,7 +230,7 @@ function Make(Ord) { continue; }; }; - let find_first_opt = function (f, _param) { + let find_first_opt = (f, _param) => { while (true) { let param = _param; if (typeof param !== "object") { @@ -244,7 +244,7 @@ function Make(Ord) { continue; }; }; - let find_last_aux = function (_v0, _d0, f, _param) { + let find_last_aux = (_v0, _d0, f, _param) => { while (true) { let param = _param; let d0 = _d0; @@ -266,7 +266,7 @@ function Make(Ord) { continue; }; }; - let find_last = function (f, _param) { + let find_last = (f, _param) => { while (true) { let param = _param; if (typeof param !== "object") { @@ -284,7 +284,7 @@ function Make(Ord) { continue; }; }; - let find_last_opt_aux = function (_v0, _d0, f, _param) { + let find_last_opt_aux = (_v0, _d0, f, _param) => { while (true) { let param = _param; let d0 = _d0; @@ -306,7 +306,7 @@ function Make(Ord) { continue; }; }; - let find_last_opt = function (f, _param) { + let find_last_opt = (f, _param) => { while (true) { let param = _param; if (typeof param !== "object") { @@ -320,7 +320,7 @@ function Make(Ord) { continue; }; }; - let find_opt = function (x, _param) { + let find_opt = (x, _param) => { while (true) { let param = _param; if (typeof param !== "object") { @@ -334,7 +334,7 @@ function Make(Ord) { continue; }; }; - let mem = function (x, _param) { + let mem = (x, _param) => { while (true) { let param = _param; if (typeof param !== "object") { @@ -348,7 +348,7 @@ function Make(Ord) { continue; }; }; - let min_binding = function (_param) { + let min_binding = (_param) => { while (true) { let param = _param; if (typeof param !== "object") { @@ -369,7 +369,7 @@ function Make(Ord) { continue; }; }; - let min_binding_opt = function (_param) { + let min_binding_opt = (_param) => { while (true) { let param = _param; if (typeof param !== "object") { @@ -386,7 +386,7 @@ function Make(Ord) { continue; }; }; - let max_binding = function (_param) { + let max_binding = (_param) => { while (true) { let param = _param; if (typeof param !== "object") { @@ -407,7 +407,7 @@ function Make(Ord) { continue; }; }; - let max_binding_opt = function (_param) { + let max_binding_opt = (_param) => { while (true) { let param = _param; if (typeof param !== "object") { @@ -424,7 +424,7 @@ function Make(Ord) { continue; }; }; - let remove_min_binding = function (param) { + let remove_min_binding = (param) => { if (typeof param !== "object") { throw new Error("Invalid_argument", { cause: { @@ -440,7 +440,7 @@ function Make(Ord) { return bal(remove_min_binding(l), param.v, param.d, param.r); } }; - let merge = function (t1, t2) { + let merge = (t1, t2) => { if (typeof t1 !== "object") { return t2; } @@ -450,7 +450,7 @@ function Make(Ord) { let match = min_binding(t2); return bal(t1, match[0], match[1], remove_min_binding(t2)); }; - let remove = function (x, param) { + let remove = (x, param) => { if (typeof param !== "object") { return "Empty"; } @@ -477,7 +477,7 @@ function Make(Ord) { return bal(l, v, d, rr); } }; - let update = function (x, f, param) { + let update = (x, f, param) => { if (typeof param !== "object") { let data = f(undefined); if (data !== undefined) { @@ -532,7 +532,7 @@ function Make(Ord) { return bal(l, v, d, rr); } }; - let iter = function (f, _param) { + let iter = (f, _param) => { while (true) { let param = _param; if (typeof param !== "object") { @@ -544,7 +544,7 @@ function Make(Ord) { continue; }; }; - let map = function (f, param) { + let map = (f, param) => { if (typeof param !== "object") { return "Empty"; } @@ -560,7 +560,7 @@ function Make(Ord) { h: param.h }; }; - let mapi = function (f, param) { + let mapi = (f, param) => { if (typeof param !== "object") { return "Empty"; } @@ -577,7 +577,7 @@ function Make(Ord) { h: param.h }; }; - let fold = function (f, _m, _accu) { + let fold = (f, _m, _accu) => { while (true) { let accu = _accu; let m = _m; @@ -589,7 +589,7 @@ function Make(Ord) { continue; }; }; - let for_all = function (p, _param) { + let for_all = (p, _param) => { while (true) { let param = _param; if (typeof param !== "object") { @@ -605,7 +605,7 @@ function Make(Ord) { continue; }; }; - let exists = function (p, _param) { + let exists = (p, _param) => { while (true) { let param = _param; if (typeof param !== "object") { @@ -621,21 +621,21 @@ function Make(Ord) { continue; }; }; - let add_min_binding = function (k, x, param) { + let add_min_binding = (k, x, param) => { if (typeof param !== "object") { return singleton(k, x); } else { return bal(add_min_binding(k, x, param.l), param.v, param.d, param.r); } }; - let add_max_binding = function (k, x, param) { + let add_max_binding = (k, x, param) => { if (typeof param !== "object") { return singleton(k, x); } else { return bal(param.l, param.v, param.d, add_max_binding(k, x, param.r)); } }; - let join = function (l, v, d, r) { + let join = (l, v, d, r) => { if (typeof l !== "object") { return add_min_binding(v, d, r); } @@ -652,7 +652,7 @@ function Make(Ord) { return create(l, v, d, r); } }; - let concat = function (t1, t2) { + let concat = (t1, t2) => { if (typeof t1 !== "object") { return t2; } @@ -662,14 +662,14 @@ function Make(Ord) { let match = min_binding(t2); return join(t1, match[0], match[1], remove_min_binding(t2)); }; - let concat_or_join = function (t1, v, d, t2) { + let concat_or_join = (t1, v, d, t2) => { if (d !== undefined) { return join(t1, v, Caml_option.valFromOption(d), t2); } else { return concat(t1, t2); } }; - let split = function (x, param) { + let split = (x, param) => { if (typeof param !== "object") { return [ "Empty", @@ -704,7 +704,7 @@ function Make(Ord) { match$1[2] ]; }; - let merge$1 = function (f, s1, s2) { + let merge$1 = (f, s1, s2) => { if (typeof s1 !== "object") { if (typeof s2 !== "object") { return "Empty"; @@ -734,7 +734,7 @@ function Make(Ord) { let match$1 = split(v2, s1); return concat_or_join(merge$1(f, match$1[0], s2.l), v2, f(v2, match$1[1], Caml_option.some(s2.d)), merge$1(f, match$1[2], s2.r)); }; - let union = function (f, s1, s2) { + let union = (f, s1, s2) => { if (typeof s1 !== "object") { return s2; } @@ -766,7 +766,7 @@ function Make(Ord) { return join(l$1, v2, d2, r$1); } }; - let filter = function (p, param) { + let filter = (p, param) => { if (typeof param !== "object") { return "Empty"; } @@ -787,7 +787,7 @@ function Make(Ord) { return concat(l$p, r$p); } }; - let partition = function (p, param) { + let partition = (p, param) => { if (typeof param !== "object") { return [ "Empty", @@ -815,7 +815,7 @@ function Make(Ord) { ]; } }; - let cons_enum = function (_m, _e) { + let cons_enum = (_m, _e) => { while (true) { let e = _e; let m = _m; @@ -833,7 +833,7 @@ function Make(Ord) { continue; }; }; - let compare = function (cmp, m1, m2) { + let compare = (cmp, m1, m2) => { let _e1 = cons_enum(m1, "End"); let _e2 = cons_enum(m2, "End"); while (true) { @@ -862,7 +862,7 @@ function Make(Ord) { continue; }; }; - let equal = function (cmp, m1, m2) { + let equal = (cmp, m1, m2) => { let _e1 = cons_enum(m1, "End"); let _e2 = cons_enum(m2, "End"); while (true) { @@ -889,14 +889,14 @@ function Make(Ord) { continue; }; }; - let cardinal = function (param) { + let cardinal = (param) => { if (typeof param !== "object") { return 0; } else { return (cardinal(param.l) + 1 | 0) + cardinal(param.r) | 0; } }; - let bindings_aux = function (_accu, _param) { + let bindings_aux = (_accu, _param) => { while (true) { let param = _param; let accu = _accu; @@ -914,7 +914,7 @@ function Make(Ord) { continue; }; }; - let bindings = function (s) { + let bindings = (s) => { return bindings_aux(/* [] */0, s); }; return { diff --git a/lib/es6/moreLabels.js b/lib/es6/moreLabels.js index 36efe9670a5..4e70e9869d9 100644 --- a/lib/es6/moreLabels.js +++ b/lib/es6/moreLabels.js @@ -32,15 +32,15 @@ let Hashtbl = { }; let $$Map = { - Make: (function (funarg) { - let height = function (param) { + Make: ((funarg) => { + let height = (param) => { if (typeof param !== "object") { return 0; } else { return param.h; } }; - let create = function (l, x, d, r) { + let create = (l, x, d, r) => { let hl = height(l); let hr = height(r); return { @@ -52,7 +52,7 @@ let $$Map = { h: hl >= hr ? hl + 1 | 0 : hr + 1 | 0 }; }; - let singleton = function (x, d) { + let singleton = (x, d) => { return { TAG: "Node", l: "Empty", @@ -62,7 +62,7 @@ let $$Map = { h: 1 }; }; - let bal = function (l, x, d, r) { + let bal = (l, x, d, r) => { let hl; hl = typeof l !== "object" ? 0 : l.h; let hr; @@ -128,14 +128,14 @@ let $$Map = { } }); }; - let is_empty = function (param) { + let is_empty = (param) => { if (typeof param !== "object") { return true; } else { return false; } }; - let add = function (x, data, param) { + let add = (x, data, param) => { if (typeof param !== "object") { return { TAG: "Node", @@ -180,7 +180,7 @@ let $$Map = { return bal(l, v, d, rr); } }; - let find = function (x, _param) { + let find = (x, _param) => { while (true) { let param = _param; if (typeof param !== "object") { @@ -198,7 +198,7 @@ let $$Map = { continue; }; }; - let find_first_aux = function (_v0, _d0, f, _param) { + let find_first_aux = (_v0, _d0, f, _param) => { while (true) { let param = _param; let d0 = _d0; @@ -220,7 +220,7 @@ let $$Map = { continue; }; }; - let find_first = function (f, _param) { + let find_first = (f, _param) => { while (true) { let param = _param; if (typeof param !== "object") { @@ -238,7 +238,7 @@ let $$Map = { continue; }; }; - let find_first_opt_aux = function (_v0, _d0, f, _param) { + let find_first_opt_aux = (_v0, _d0, f, _param) => { while (true) { let param = _param; let d0 = _d0; @@ -260,7 +260,7 @@ let $$Map = { continue; }; }; - let find_first_opt = function (f, _param) { + let find_first_opt = (f, _param) => { while (true) { let param = _param; if (typeof param !== "object") { @@ -274,7 +274,7 @@ let $$Map = { continue; }; }; - let find_last_aux = function (_v0, _d0, f, _param) { + let find_last_aux = (_v0, _d0, f, _param) => { while (true) { let param = _param; let d0 = _d0; @@ -296,7 +296,7 @@ let $$Map = { continue; }; }; - let find_last = function (f, _param) { + let find_last = (f, _param) => { while (true) { let param = _param; if (typeof param !== "object") { @@ -314,7 +314,7 @@ let $$Map = { continue; }; }; - let find_last_opt_aux = function (_v0, _d0, f, _param) { + let find_last_opt_aux = (_v0, _d0, f, _param) => { while (true) { let param = _param; let d0 = _d0; @@ -336,7 +336,7 @@ let $$Map = { continue; }; }; - let find_last_opt = function (f, _param) { + let find_last_opt = (f, _param) => { while (true) { let param = _param; if (typeof param !== "object") { @@ -350,7 +350,7 @@ let $$Map = { continue; }; }; - let find_opt = function (x, _param) { + let find_opt = (x, _param) => { while (true) { let param = _param; if (typeof param !== "object") { @@ -364,7 +364,7 @@ let $$Map = { continue; }; }; - let mem = function (x, _param) { + let mem = (x, _param) => { while (true) { let param = _param; if (typeof param !== "object") { @@ -378,7 +378,7 @@ let $$Map = { continue; }; }; - let min_binding = function (_param) { + let min_binding = (_param) => { while (true) { let param = _param; if (typeof param !== "object") { @@ -399,7 +399,7 @@ let $$Map = { continue; }; }; - let min_binding_opt = function (_param) { + let min_binding_opt = (_param) => { while (true) { let param = _param; if (typeof param !== "object") { @@ -416,7 +416,7 @@ let $$Map = { continue; }; }; - let max_binding = function (_param) { + let max_binding = (_param) => { while (true) { let param = _param; if (typeof param !== "object") { @@ -437,7 +437,7 @@ let $$Map = { continue; }; }; - let max_binding_opt = function (_param) { + let max_binding_opt = (_param) => { while (true) { let param = _param; if (typeof param !== "object") { @@ -454,7 +454,7 @@ let $$Map = { continue; }; }; - let remove_min_binding = function (param) { + let remove_min_binding = (param) => { if (typeof param !== "object") { throw new Error("Invalid_argument", { cause: { @@ -470,7 +470,7 @@ let $$Map = { return bal(remove_min_binding(l), param.v, param.d, param.r); } }; - let merge = function (t1, t2) { + let merge = (t1, t2) => { if (typeof t1 !== "object") { return t2; } @@ -480,7 +480,7 @@ let $$Map = { let match = min_binding(t2); return bal(t1, match[0], match[1], remove_min_binding(t2)); }; - let remove = function (x, param) { + let remove = (x, param) => { if (typeof param !== "object") { return "Empty"; } @@ -507,7 +507,7 @@ let $$Map = { return bal(l, v, d, rr); } }; - let update = function (x, f, param) { + let update = (x, f, param) => { if (typeof param !== "object") { let data = f(undefined); if (data !== undefined) { @@ -562,7 +562,7 @@ let $$Map = { return bal(l, v, d, rr); } }; - let iter = function (f, _param) { + let iter = (f, _param) => { while (true) { let param = _param; if (typeof param !== "object") { @@ -574,7 +574,7 @@ let $$Map = { continue; }; }; - let map = function (f, param) { + let map = (f, param) => { if (typeof param !== "object") { return "Empty"; } @@ -590,7 +590,7 @@ let $$Map = { h: param.h }; }; - let mapi = function (f, param) { + let mapi = (f, param) => { if (typeof param !== "object") { return "Empty"; } @@ -607,7 +607,7 @@ let $$Map = { h: param.h }; }; - let fold = function (f, _m, _accu) { + let fold = (f, _m, _accu) => { while (true) { let accu = _accu; let m = _m; @@ -619,7 +619,7 @@ let $$Map = { continue; }; }; - let for_all = function (p, _param) { + let for_all = (p, _param) => { while (true) { let param = _param; if (typeof param !== "object") { @@ -635,7 +635,7 @@ let $$Map = { continue; }; }; - let exists = function (p, _param) { + let exists = (p, _param) => { while (true) { let param = _param; if (typeof param !== "object") { @@ -651,21 +651,21 @@ let $$Map = { continue; }; }; - let add_min_binding = function (k, x, param) { + let add_min_binding = (k, x, param) => { if (typeof param !== "object") { return singleton(k, x); } else { return bal(add_min_binding(k, x, param.l), param.v, param.d, param.r); } }; - let add_max_binding = function (k, x, param) { + let add_max_binding = (k, x, param) => { if (typeof param !== "object") { return singleton(k, x); } else { return bal(param.l, param.v, param.d, add_max_binding(k, x, param.r)); } }; - let join = function (l, v, d, r) { + let join = (l, v, d, r) => { if (typeof l !== "object") { return add_min_binding(v, d, r); } @@ -682,7 +682,7 @@ let $$Map = { return create(l, v, d, r); } }; - let concat = function (t1, t2) { + let concat = (t1, t2) => { if (typeof t1 !== "object") { return t2; } @@ -692,14 +692,14 @@ let $$Map = { let match = min_binding(t2); return join(t1, match[0], match[1], remove_min_binding(t2)); }; - let concat_or_join = function (t1, v, d, t2) { + let concat_or_join = (t1, v, d, t2) => { if (d !== undefined) { return join(t1, v, Caml_option.valFromOption(d), t2); } else { return concat(t1, t2); } }; - let split = function (x, param) { + let split = (x, param) => { if (typeof param !== "object") { return [ "Empty", @@ -734,7 +734,7 @@ let $$Map = { match$1[2] ]; }; - let merge$1 = function (f, s1, s2) { + let merge$1 = (f, s1, s2) => { if (typeof s1 !== "object") { if (typeof s2 !== "object") { return "Empty"; @@ -764,7 +764,7 @@ let $$Map = { let match$1 = split(v2, s1); return concat_or_join(merge$1(f, match$1[0], s2.l), v2, f(v2, match$1[1], Caml_option.some(s2.d)), merge$1(f, match$1[2], s2.r)); }; - let union = function (f, s1, s2) { + let union = (f, s1, s2) => { if (typeof s1 !== "object") { return s2; } @@ -796,7 +796,7 @@ let $$Map = { return join(l$1, v2, d2, r$1); } }; - let filter = function (p, param) { + let filter = (p, param) => { if (typeof param !== "object") { return "Empty"; } @@ -817,7 +817,7 @@ let $$Map = { return concat(l$p, r$p); } }; - let partition = function (p, param) { + let partition = (p, param) => { if (typeof param !== "object") { return [ "Empty", @@ -845,7 +845,7 @@ let $$Map = { ]; } }; - let cons_enum = function (_m, _e) { + let cons_enum = (_m, _e) => { while (true) { let e = _e; let m = _m; @@ -863,7 +863,7 @@ let $$Map = { continue; }; }; - let compare = function (cmp, m1, m2) { + let compare = (cmp, m1, m2) => { let _e1 = cons_enum(m1, "End"); let _e2 = cons_enum(m2, "End"); while (true) { @@ -892,7 +892,7 @@ let $$Map = { continue; }; }; - let equal = function (cmp, m1, m2) { + let equal = (cmp, m1, m2) => { let _e1 = cons_enum(m1, "End"); let _e2 = cons_enum(m2, "End"); while (true) { @@ -919,14 +919,14 @@ let $$Map = { continue; }; }; - let cardinal = function (param) { + let cardinal = (param) => { if (typeof param !== "object") { return 0; } else { return (cardinal(param.l) + 1 | 0) + cardinal(param.r) | 0; } }; - let bindings_aux = function (_accu, _param) { + let bindings_aux = (_accu, _param) => { while (true) { let param = _param; let accu = _accu; @@ -944,7 +944,7 @@ let $$Map = { continue; }; }; - let bindings = function (s) { + let bindings = (s) => { return bindings_aux(/* [] */0, s); }; return { @@ -987,15 +987,15 @@ let $$Map = { }; let $$Set = { - Make: (function (funarg) { - let height = function (param) { + Make: ((funarg) => { + let height = (param) => { if (typeof param !== "object") { return 0; } else { return param.h; } }; - let create = function (l, v, r) { + let create = (l, v, r) => { let hl; hl = typeof l !== "object" ? 0 : l.h; let hr; @@ -1008,7 +1008,7 @@ let $$Set = { h: hl >= hr ? hl + 1 | 0 : hr + 1 | 0 }; }; - let bal = function (l, v, r) { + let bal = (l, v, r) => { let hl; hl = typeof l !== "object" ? 0 : l.h; let hr; @@ -1071,7 +1071,7 @@ let $$Set = { } }); }; - let add = function (x, param) { + let add = (x, param) => { if (typeof param !== "object") { return { TAG: "Node", @@ -1103,7 +1103,7 @@ let $$Set = { return bal(l, v, rr); } }; - let singleton = function (x) { + let singleton = (x) => { return { TAG: "Node", l: "Empty", @@ -1112,21 +1112,21 @@ let $$Set = { h: 1 }; }; - let add_min_element = function (x, param) { + let add_min_element = (x, param) => { if (typeof param !== "object") { return singleton(x); } else { return bal(add_min_element(x, param.l), param.v, param.r); } }; - let add_max_element = function (x, param) { + let add_max_element = (x, param) => { if (typeof param !== "object") { return singleton(x); } else { return bal(param.l, param.v, add_max_element(x, param.r)); } }; - let join = function (l, v, r) { + let join = (l, v, r) => { if (typeof l !== "object") { return add_min_element(v, r); } @@ -1143,7 +1143,7 @@ let $$Set = { return create(l, v, r); } }; - let min_elt = function (_param) { + let min_elt = (_param) => { while (true) { let param = _param; if (typeof param !== "object") { @@ -1161,7 +1161,7 @@ let $$Set = { continue; }; }; - let min_elt_opt = function (_param) { + let min_elt_opt = (_param) => { while (true) { let param = _param; if (typeof param !== "object") { @@ -1175,7 +1175,7 @@ let $$Set = { continue; }; }; - let max_elt = function (_param) { + let max_elt = (_param) => { while (true) { let param = _param; if (typeof param !== "object") { @@ -1193,7 +1193,7 @@ let $$Set = { continue; }; }; - let max_elt_opt = function (_param) { + let max_elt_opt = (_param) => { while (true) { let param = _param; if (typeof param !== "object") { @@ -1207,7 +1207,7 @@ let $$Set = { continue; }; }; - let remove_min_elt = function (param) { + let remove_min_elt = (param) => { if (typeof param !== "object") { throw new Error("Invalid_argument", { cause: { @@ -1223,7 +1223,7 @@ let $$Set = { return bal(remove_min_elt(l), param.v, param.r); } }; - let merge = function (t1, t2) { + let merge = (t1, t2) => { if (typeof t1 !== "object") { return t2; } else if (typeof t2 !== "object") { @@ -1232,7 +1232,7 @@ let $$Set = { return bal(t1, min_elt(t2), remove_min_elt(t2)); } }; - let concat = function (t1, t2) { + let concat = (t1, t2) => { if (typeof t1 !== "object") { return t2; } else if (typeof t2 !== "object") { @@ -1241,7 +1241,7 @@ let $$Set = { return join(t1, min_elt(t2), remove_min_elt(t2)); } }; - let split = function (x, param) { + let split = (x, param) => { if (typeof param !== "object") { return [ "Empty", @@ -1275,14 +1275,14 @@ let $$Set = { match$1[2] ]; }; - let is_empty = function (param) { + let is_empty = (param) => { if (typeof param !== "object") { return true; } else { return false; } }; - let mem = function (x, _param) { + let mem = (x, _param) => { while (true) { let param = _param; if (typeof param !== "object") { @@ -1296,7 +1296,7 @@ let $$Set = { continue; }; }; - let remove = function (x, param) { + let remove = (x, param) => { if (typeof param !== "object") { return "Empty"; } @@ -1322,7 +1322,7 @@ let $$Set = { return bal(l, v, rr); } }; - let union = function (s1, s2) { + let union = (s1, s2) => { if (typeof s1 !== "object") { return s2; } @@ -1346,7 +1346,7 @@ let $$Set = { let match$1 = split(v2, s1); return join(union(match$1[0], s2.l), v2, union(match$1[2], s2.r)); }; - let inter = function (s1, s2) { + let inter = (s1, s2) => { if (typeof s1 !== "object") { return "Empty"; } @@ -1364,7 +1364,7 @@ let $$Set = { return concat(inter(l1, l2), inter(r1, match[2])); } }; - let diff = function (s1, s2) { + let diff = (s1, s2) => { if (typeof s1 !== "object") { return "Empty"; } @@ -1382,7 +1382,7 @@ let $$Set = { return join(diff(l1, l2), v1, diff(r1, match[2])); } }; - let cons_enum = function (_s, _e) { + let cons_enum = (_s, _e) => { while (true) { let e = _e; let s = _s; @@ -1399,7 +1399,7 @@ let $$Set = { continue; }; }; - let compare_aux = function (_e1, _e2) { + let compare_aux = (_e1, _e2) => { while (true) { let e2 = _e2; let e1 = _e1; @@ -1422,13 +1422,13 @@ let $$Set = { continue; }; }; - let compare = function (s1, s2) { + let compare = (s1, s2) => { return compare_aux(cons_enum(s1, "End"), cons_enum(s2, "End")); }; - let equal = function (s1, s2) { + let equal = (s1, s2) => { return compare(s1, s2) === 0; }; - let subset = function (_s1, _s2) { + let subset = (_s1, _s2) => { while (true) { let s2 = _s2; let s1 = _s1; @@ -1478,7 +1478,7 @@ let $$Set = { continue; }; }; - let iter = function (f, _param) { + let iter = (f, _param) => { while (true) { let param = _param; if (typeof param !== "object") { @@ -1490,7 +1490,7 @@ let $$Set = { continue; }; }; - let fold = function (f, _s, _accu) { + let fold = (f, _s, _accu) => { while (true) { let accu = _accu; let s = _s; @@ -1502,7 +1502,7 @@ let $$Set = { continue; }; }; - let for_all = function (p, _param) { + let for_all = (p, _param) => { while (true) { let param = _param; if (typeof param !== "object") { @@ -1518,7 +1518,7 @@ let $$Set = { continue; }; }; - let exists = function (p, _param) { + let exists = (p, _param) => { while (true) { let param = _param; if (typeof param !== "object") { @@ -1534,7 +1534,7 @@ let $$Set = { continue; }; }; - let filter = function (p, param) { + let filter = (p, param) => { if (typeof param !== "object") { return "Empty"; } @@ -1554,7 +1554,7 @@ let $$Set = { return concat(l$p, r$p); } }; - let partition = function (p, param) { + let partition = (p, param) => { if (typeof param !== "object") { return [ "Empty", @@ -1581,14 +1581,14 @@ let $$Set = { ]; } }; - let cardinal = function (param) { + let cardinal = (param) => { if (typeof param !== "object") { return 0; } else { return (cardinal(param.l) + 1 | 0) + cardinal(param.r) | 0; } }; - let elements_aux = function (_accu, _param) { + let elements_aux = (_accu, _param) => { while (true) { let param = _param; let accu = _accu; @@ -1603,10 +1603,10 @@ let $$Set = { continue; }; }; - let elements = function (s) { + let elements = (s) => { return elements_aux(/* [] */0, s); }; - let find = function (x, _param) { + let find = (x, _param) => { while (true) { let param = _param; if (typeof param !== "object") { @@ -1625,7 +1625,7 @@ let $$Set = { continue; }; }; - let find_first_aux = function (_v0, f, _param) { + let find_first_aux = (_v0, f, _param) => { while (true) { let param = _param; let v0 = _v0; @@ -1642,7 +1642,7 @@ let $$Set = { continue; }; }; - let find_first = function (f, _param) { + let find_first = (f, _param) => { while (true) { let param = _param; if (typeof param !== "object") { @@ -1660,7 +1660,7 @@ let $$Set = { continue; }; }; - let find_first_opt_aux = function (_v0, f, _param) { + let find_first_opt_aux = (_v0, f, _param) => { while (true) { let param = _param; let v0 = _v0; @@ -1677,7 +1677,7 @@ let $$Set = { continue; }; }; - let find_first_opt = function (f, _param) { + let find_first_opt = (f, _param) => { while (true) { let param = _param; if (typeof param !== "object") { @@ -1691,7 +1691,7 @@ let $$Set = { continue; }; }; - let find_last_aux = function (_v0, f, _param) { + let find_last_aux = (_v0, f, _param) => { while (true) { let param = _param; let v0 = _v0; @@ -1708,7 +1708,7 @@ let $$Set = { continue; }; }; - let find_last = function (f, _param) { + let find_last = (f, _param) => { while (true) { let param = _param; if (typeof param !== "object") { @@ -1726,7 +1726,7 @@ let $$Set = { continue; }; }; - let find_last_opt_aux = function (_v0, f, _param) { + let find_last_opt_aux = (_v0, f, _param) => { while (true) { let param = _param; let v0 = _v0; @@ -1743,7 +1743,7 @@ let $$Set = { continue; }; }; - let find_last_opt = function (f, _param) { + let find_last_opt = (f, _param) => { while (true) { let param = _param; if (typeof param !== "object") { @@ -1757,7 +1757,7 @@ let $$Set = { continue; }; }; - let find_opt = function (x, _param) { + let find_opt = (x, _param) => { while (true) { let param = _param; if (typeof param !== "object") { @@ -1772,14 +1772,14 @@ let $$Set = { continue; }; }; - let try_join = function (l, v, r) { + let try_join = (l, v, r) => { if ((l === "Empty" || funarg.compare(max_elt(l), v) < 0) && (r === "Empty" || funarg.compare(v, min_elt(r)) < 0)) { return join(l, v, r); } else { return union(l, add(v, r)); } }; - let map = function (f, param) { + let map = (f, param) => { if (typeof param !== "object") { return "Empty"; } @@ -1795,8 +1795,8 @@ let $$Set = { return try_join(l$p, v$p, r$p); } }; - let of_sorted_list = function (l) { - let sub = function (n, l) { + let of_sorted_list = (l) => { + let sub = (n, l) => { switch (n) { case 0 : return [ @@ -1899,7 +1899,7 @@ let $$Set = { }; return sub(List.length(l), l)[0]; }; - let of_list = function (l) { + let of_list = (l) => { if (!l) { return "Empty"; } diff --git a/lib/es6/parsing.js b/lib/es6/parsing.js index bf77a01d443..32cb0b85c98 100644 --- a/lib/es6/parsing.js +++ b/lib/es6/parsing.js @@ -55,7 +55,7 @@ function clear_parser() { } let current_lookahead_fun = { - contents: (function (param) { + contents: ((param) => { return false; }) }; @@ -145,7 +145,7 @@ function yyparse(tables, start, lexer, lexbuf) { if (exn$1.RE_EXN_ID === YYexit) { return exn$1._1; } - current_lookahead_fun.contents = (function (tok) { + current_lookahead_fun.contents = ((tok) => { if (typeof tok !== "number") { return Caml_array.get(tables.transl_block, tok.TAG) === curr_char; } else { diff --git a/lib/es6/pervasives.js b/lib/es6/pervasives.js index a80ead8cb41..106dc04c488 100644 --- a/lib/es6/pervasives.js +++ b/lib/es6/pervasives.js @@ -191,14 +191,14 @@ function print_string(prim) { } let exit_function = { - contents: (function (prim) { + contents: ((prim) => { }) }; function at_exit(f) { let g = exit_function.contents; - exit_function.contents = (function () { + exit_function.contents = (() => { f(); g(); }); diff --git a/lib/es6/random.js b/lib/es6/random.js index 4f584989499..9cfcb60be9b 100644 --- a/lib/es6/random.js +++ b/lib/es6/random.js @@ -19,10 +19,10 @@ function assign(st1, st2) { } function full_init(s, seed) { - let combine = function (accu, x) { + let combine = (accu, x) => { return Digest.string(accu + String(x)); }; - let extract = function (d) { + let extract = (d) => { return ((Caml_string.get(d, 0) + (Caml_string.get(d, 1) << 8) | 0) + (Caml_string.get(d, 2) << 16) | 0) + (Caml_string.get(d, 3) << 24) | 0; }; let seed$1 = seed.length === 0 ? [0] : seed; diff --git a/lib/es6/set.js b/lib/es6/set.js index 764a62ec360..c5adb9b9514 100644 --- a/lib/es6/set.js +++ b/lib/es6/set.js @@ -4,14 +4,14 @@ import * as List from "./list.js"; import * as Caml_option from "./caml_option.js"; function Make(funarg) { - let height = function (param) { + let height = (param) => { if (typeof param !== "object") { return 0; } else { return param.h; } }; - let create = function (l, v, r) { + let create = (l, v, r) => { let hl; hl = typeof l !== "object" ? 0 : l.h; let hr; @@ -24,7 +24,7 @@ function Make(funarg) { h: hl >= hr ? hl + 1 | 0 : hr + 1 | 0 }; }; - let bal = function (l, v, r) { + let bal = (l, v, r) => { let hl; hl = typeof l !== "object" ? 0 : l.h; let hr; @@ -87,7 +87,7 @@ function Make(funarg) { } }); }; - let add = function (x, param) { + let add = (x, param) => { if (typeof param !== "object") { return { TAG: "Node", @@ -119,7 +119,7 @@ function Make(funarg) { return bal(l, v, rr); } }; - let singleton = function (x) { + let singleton = (x) => { return { TAG: "Node", l: "Empty", @@ -128,21 +128,21 @@ function Make(funarg) { h: 1 }; }; - let add_min_element = function (x, param) { + let add_min_element = (x, param) => { if (typeof param !== "object") { return singleton(x); } else { return bal(add_min_element(x, param.l), param.v, param.r); } }; - let add_max_element = function (x, param) { + let add_max_element = (x, param) => { if (typeof param !== "object") { return singleton(x); } else { return bal(param.l, param.v, add_max_element(x, param.r)); } }; - let join = function (l, v, r) { + let join = (l, v, r) => { if (typeof l !== "object") { return add_min_element(v, r); } @@ -159,7 +159,7 @@ function Make(funarg) { return create(l, v, r); } }; - let min_elt = function (_param) { + let min_elt = (_param) => { while (true) { let param = _param; if (typeof param !== "object") { @@ -177,7 +177,7 @@ function Make(funarg) { continue; }; }; - let min_elt_opt = function (_param) { + let min_elt_opt = (_param) => { while (true) { let param = _param; if (typeof param !== "object") { @@ -191,7 +191,7 @@ function Make(funarg) { continue; }; }; - let max_elt = function (_param) { + let max_elt = (_param) => { while (true) { let param = _param; if (typeof param !== "object") { @@ -209,7 +209,7 @@ function Make(funarg) { continue; }; }; - let max_elt_opt = function (_param) { + let max_elt_opt = (_param) => { while (true) { let param = _param; if (typeof param !== "object") { @@ -223,7 +223,7 @@ function Make(funarg) { continue; }; }; - let remove_min_elt = function (param) { + let remove_min_elt = (param) => { if (typeof param !== "object") { throw new Error("Invalid_argument", { cause: { @@ -239,7 +239,7 @@ function Make(funarg) { return bal(remove_min_elt(l), param.v, param.r); } }; - let concat = function (t1, t2) { + let concat = (t1, t2) => { if (typeof t1 !== "object") { return t2; } else if (typeof t2 !== "object") { @@ -248,7 +248,7 @@ function Make(funarg) { return join(t1, min_elt(t2), remove_min_elt(t2)); } }; - let split = function (x, param) { + let split = (x, param) => { if (typeof param !== "object") { return [ "Empty", @@ -282,14 +282,14 @@ function Make(funarg) { match$1[2] ]; }; - let is_empty = function (param) { + let is_empty = (param) => { if (typeof param !== "object") { return true; } else { return false; } }; - let mem = function (x, _param) { + let mem = (x, _param) => { while (true) { let param = _param; if (typeof param !== "object") { @@ -303,7 +303,7 @@ function Make(funarg) { continue; }; }; - let remove = function (x, param) { + let remove = (x, param) => { if (typeof param !== "object") { return "Empty"; } @@ -335,7 +335,7 @@ function Make(funarg) { return bal(l, v, rr); } }; - let union = function (s1, s2) { + let union = (s1, s2) => { if (typeof s1 !== "object") { return s2; } @@ -359,7 +359,7 @@ function Make(funarg) { let match$1 = split(v2, s1); return join(union(match$1[0], s2.l), v2, union(match$1[2], s2.r)); }; - let inter = function (s1, s2) { + let inter = (s1, s2) => { if (typeof s1 !== "object") { return "Empty"; } @@ -377,7 +377,7 @@ function Make(funarg) { return concat(inter(l1, l2), inter(r1, match[2])); } }; - let diff = function (s1, s2) { + let diff = (s1, s2) => { if (typeof s1 !== "object") { return "Empty"; } @@ -395,7 +395,7 @@ function Make(funarg) { return join(diff(l1, l2), v1, diff(r1, match[2])); } }; - let cons_enum = function (_s, _e) { + let cons_enum = (_s, _e) => { while (true) { let e = _e; let s = _s; @@ -412,7 +412,7 @@ function Make(funarg) { continue; }; }; - let compare = function (s1, s2) { + let compare = (s1, s2) => { let _e1 = cons_enum(s1, "End"); let _e2 = cons_enum(s2, "End"); while (true) { @@ -437,10 +437,10 @@ function Make(funarg) { continue; }; }; - let equal = function (s1, s2) { + let equal = (s1, s2) => { return compare(s1, s2) === 0; }; - let subset = function (_s1, _s2) { + let subset = (_s1, _s2) => { while (true) { let s2 = _s2; let s1 = _s1; @@ -490,7 +490,7 @@ function Make(funarg) { continue; }; }; - let iter = function (f, _param) { + let iter = (f, _param) => { while (true) { let param = _param; if (typeof param !== "object") { @@ -502,7 +502,7 @@ function Make(funarg) { continue; }; }; - let fold = function (f, _s, _accu) { + let fold = (f, _s, _accu) => { while (true) { let accu = _accu; let s = _s; @@ -514,7 +514,7 @@ function Make(funarg) { continue; }; }; - let for_all = function (p, _param) { + let for_all = (p, _param) => { while (true) { let param = _param; if (typeof param !== "object") { @@ -530,7 +530,7 @@ function Make(funarg) { continue; }; }; - let exists = function (p, _param) { + let exists = (p, _param) => { while (true) { let param = _param; if (typeof param !== "object") { @@ -546,7 +546,7 @@ function Make(funarg) { continue; }; }; - let filter = function (p, param) { + let filter = (p, param) => { if (typeof param !== "object") { return "Empty"; } @@ -566,7 +566,7 @@ function Make(funarg) { return concat(l$p, r$p); } }; - let partition = function (p, param) { + let partition = (p, param) => { if (typeof param !== "object") { return [ "Empty", @@ -593,14 +593,14 @@ function Make(funarg) { ]; } }; - let cardinal = function (param) { + let cardinal = (param) => { if (typeof param !== "object") { return 0; } else { return (cardinal(param.l) + 1 | 0) + cardinal(param.r) | 0; } }; - let elements_aux = function (_accu, _param) { + let elements_aux = (_accu, _param) => { while (true) { let param = _param; let accu = _accu; @@ -615,10 +615,10 @@ function Make(funarg) { continue; }; }; - let elements = function (s) { + let elements = (s) => { return elements_aux(/* [] */0, s); }; - let find = function (x, _param) { + let find = (x, _param) => { while (true) { let param = _param; if (typeof param !== "object") { @@ -637,7 +637,7 @@ function Make(funarg) { continue; }; }; - let find_first = function (f, _param) { + let find_first = (f, _param) => { while (true) { let param = _param; if (typeof param !== "object") { @@ -671,7 +671,7 @@ function Make(funarg) { continue; }; }; - let find_first_opt = function (f, _param) { + let find_first_opt = (f, _param) => { while (true) { let param = _param; if (typeof param !== "object") { @@ -701,7 +701,7 @@ function Make(funarg) { continue; }; }; - let find_last = function (f, _param) { + let find_last = (f, _param) => { while (true) { let param = _param; if (typeof param !== "object") { @@ -735,7 +735,7 @@ function Make(funarg) { continue; }; }; - let find_last_opt = function (f, _param) { + let find_last_opt = (f, _param) => { while (true) { let param = _param; if (typeof param !== "object") { @@ -765,7 +765,7 @@ function Make(funarg) { continue; }; }; - let find_opt = function (x, _param) { + let find_opt = (x, _param) => { while (true) { let param = _param; if (typeof param !== "object") { @@ -780,7 +780,7 @@ function Make(funarg) { continue; }; }; - let map = function (f, param) { + let map = (f, param) => { if (typeof param !== "object") { return "Empty"; } @@ -798,7 +798,7 @@ function Make(funarg) { return union(l$p, add(v$p, r$p)); } }; - let of_list = function (l) { + let of_list = (l) => { if (!l) { return "Empty"; } @@ -822,7 +822,7 @@ function Make(funarg) { if (match$3) { if (match$3.tl) { let l$1 = List.sort_uniq(funarg.compare, l); - let sub = function (n, l) { + let sub = (n, l) => { switch (n) { case 0 : return [ diff --git a/lib/es6/setLabels.js b/lib/es6/setLabels.js index 0d962692621..876fc093755 100644 --- a/lib/es6/setLabels.js +++ b/lib/es6/setLabels.js @@ -4,14 +4,14 @@ import * as List from "./list.js"; import * as Caml_option from "./caml_option.js"; function Make(Ord) { - let height = function (param) { + let height = (param) => { if (typeof param !== "object") { return 0; } else { return param.h; } }; - let create = function (l, v, r) { + let create = (l, v, r) => { let hl; hl = typeof l !== "object" ? 0 : l.h; let hr; @@ -24,7 +24,7 @@ function Make(Ord) { h: hl >= hr ? hl + 1 | 0 : hr + 1 | 0 }; }; - let bal = function (l, v, r) { + let bal = (l, v, r) => { let hl; hl = typeof l !== "object" ? 0 : l.h; let hr; @@ -87,7 +87,7 @@ function Make(Ord) { } }); }; - let add = function (x, param) { + let add = (x, param) => { if (typeof param !== "object") { return { TAG: "Node", @@ -119,7 +119,7 @@ function Make(Ord) { return bal(l, v, rr); } }; - let singleton = function (x) { + let singleton = (x) => { return { TAG: "Node", l: "Empty", @@ -128,21 +128,21 @@ function Make(Ord) { h: 1 }; }; - let add_min_element = function (x, param) { + let add_min_element = (x, param) => { if (typeof param !== "object") { return singleton(x); } else { return bal(add_min_element(x, param.l), param.v, param.r); } }; - let add_max_element = function (x, param) { + let add_max_element = (x, param) => { if (typeof param !== "object") { return singleton(x); } else { return bal(param.l, param.v, add_max_element(x, param.r)); } }; - let join = function (l, v, r) { + let join = (l, v, r) => { if (typeof l !== "object") { return add_min_element(v, r); } @@ -159,7 +159,7 @@ function Make(Ord) { return create(l, v, r); } }; - let min_elt = function (_param) { + let min_elt = (_param) => { while (true) { let param = _param; if (typeof param !== "object") { @@ -177,7 +177,7 @@ function Make(Ord) { continue; }; }; - let min_elt_opt = function (_param) { + let min_elt_opt = (_param) => { while (true) { let param = _param; if (typeof param !== "object") { @@ -191,7 +191,7 @@ function Make(Ord) { continue; }; }; - let max_elt = function (_param) { + let max_elt = (_param) => { while (true) { let param = _param; if (typeof param !== "object") { @@ -209,7 +209,7 @@ function Make(Ord) { continue; }; }; - let max_elt_opt = function (_param) { + let max_elt_opt = (_param) => { while (true) { let param = _param; if (typeof param !== "object") { @@ -223,7 +223,7 @@ function Make(Ord) { continue; }; }; - let remove_min_elt = function (param) { + let remove_min_elt = (param) => { if (typeof param !== "object") { throw new Error("Invalid_argument", { cause: { @@ -239,7 +239,7 @@ function Make(Ord) { return bal(remove_min_elt(l), param.v, param.r); } }; - let merge = function (t1, t2) { + let merge = (t1, t2) => { if (typeof t1 !== "object") { return t2; } else if (typeof t2 !== "object") { @@ -248,7 +248,7 @@ function Make(Ord) { return bal(t1, min_elt(t2), remove_min_elt(t2)); } }; - let concat = function (t1, t2) { + let concat = (t1, t2) => { if (typeof t1 !== "object") { return t2; } else if (typeof t2 !== "object") { @@ -257,7 +257,7 @@ function Make(Ord) { return join(t1, min_elt(t2), remove_min_elt(t2)); } }; - let split = function (x, param) { + let split = (x, param) => { if (typeof param !== "object") { return [ "Empty", @@ -291,14 +291,14 @@ function Make(Ord) { match$1[2] ]; }; - let is_empty = function (param) { + let is_empty = (param) => { if (typeof param !== "object") { return true; } else { return false; } }; - let mem = function (x, _param) { + let mem = (x, _param) => { while (true) { let param = _param; if (typeof param !== "object") { @@ -312,7 +312,7 @@ function Make(Ord) { continue; }; }; - let remove = function (x, param) { + let remove = (x, param) => { if (typeof param !== "object") { return "Empty"; } @@ -338,7 +338,7 @@ function Make(Ord) { return bal(l, v, rr); } }; - let union = function (s1, s2) { + let union = (s1, s2) => { if (typeof s1 !== "object") { return s2; } @@ -362,7 +362,7 @@ function Make(Ord) { let match$1 = split(v2, s1); return join(union(match$1[0], s2.l), v2, union(match$1[2], s2.r)); }; - let inter = function (s1, s2) { + let inter = (s1, s2) => { if (typeof s1 !== "object") { return "Empty"; } @@ -380,7 +380,7 @@ function Make(Ord) { return concat(inter(l1, l2), inter(r1, match[2])); } }; - let diff = function (s1, s2) { + let diff = (s1, s2) => { if (typeof s1 !== "object") { return "Empty"; } @@ -398,7 +398,7 @@ function Make(Ord) { return join(diff(l1, l2), v1, diff(r1, match[2])); } }; - let cons_enum = function (_s, _e) { + let cons_enum = (_s, _e) => { while (true) { let e = _e; let s = _s; @@ -415,7 +415,7 @@ function Make(Ord) { continue; }; }; - let compare_aux = function (_e1, _e2) { + let compare_aux = (_e1, _e2) => { while (true) { let e2 = _e2; let e1 = _e1; @@ -438,13 +438,13 @@ function Make(Ord) { continue; }; }; - let compare = function (s1, s2) { + let compare = (s1, s2) => { return compare_aux(cons_enum(s1, "End"), cons_enum(s2, "End")); }; - let equal = function (s1, s2) { + let equal = (s1, s2) => { return compare(s1, s2) === 0; }; - let subset = function (_s1, _s2) { + let subset = (_s1, _s2) => { while (true) { let s2 = _s2; let s1 = _s1; @@ -494,7 +494,7 @@ function Make(Ord) { continue; }; }; - let iter = function (f, _param) { + let iter = (f, _param) => { while (true) { let param = _param; if (typeof param !== "object") { @@ -506,7 +506,7 @@ function Make(Ord) { continue; }; }; - let fold = function (f, _s, _accu) { + let fold = (f, _s, _accu) => { while (true) { let accu = _accu; let s = _s; @@ -518,7 +518,7 @@ function Make(Ord) { continue; }; }; - let for_all = function (p, _param) { + let for_all = (p, _param) => { while (true) { let param = _param; if (typeof param !== "object") { @@ -534,7 +534,7 @@ function Make(Ord) { continue; }; }; - let exists = function (p, _param) { + let exists = (p, _param) => { while (true) { let param = _param; if (typeof param !== "object") { @@ -550,7 +550,7 @@ function Make(Ord) { continue; }; }; - let filter = function (p, param) { + let filter = (p, param) => { if (typeof param !== "object") { return "Empty"; } @@ -570,7 +570,7 @@ function Make(Ord) { return concat(l$p, r$p); } }; - let partition = function (p, param) { + let partition = (p, param) => { if (typeof param !== "object") { return [ "Empty", @@ -597,14 +597,14 @@ function Make(Ord) { ]; } }; - let cardinal = function (param) { + let cardinal = (param) => { if (typeof param !== "object") { return 0; } else { return (cardinal(param.l) + 1 | 0) + cardinal(param.r) | 0; } }; - let elements_aux = function (_accu, _param) { + let elements_aux = (_accu, _param) => { while (true) { let param = _param; let accu = _accu; @@ -619,10 +619,10 @@ function Make(Ord) { continue; }; }; - let elements = function (s) { + let elements = (s) => { return elements_aux(/* [] */0, s); }; - let find = function (x, _param) { + let find = (x, _param) => { while (true) { let param = _param; if (typeof param !== "object") { @@ -641,7 +641,7 @@ function Make(Ord) { continue; }; }; - let find_first_aux = function (_v0, f, _param) { + let find_first_aux = (_v0, f, _param) => { while (true) { let param = _param; let v0 = _v0; @@ -658,7 +658,7 @@ function Make(Ord) { continue; }; }; - let find_first = function (f, _param) { + let find_first = (f, _param) => { while (true) { let param = _param; if (typeof param !== "object") { @@ -676,7 +676,7 @@ function Make(Ord) { continue; }; }; - let find_first_opt_aux = function (_v0, f, _param) { + let find_first_opt_aux = (_v0, f, _param) => { while (true) { let param = _param; let v0 = _v0; @@ -693,7 +693,7 @@ function Make(Ord) { continue; }; }; - let find_first_opt = function (f, _param) { + let find_first_opt = (f, _param) => { while (true) { let param = _param; if (typeof param !== "object") { @@ -707,7 +707,7 @@ function Make(Ord) { continue; }; }; - let find_last_aux = function (_v0, f, _param) { + let find_last_aux = (_v0, f, _param) => { while (true) { let param = _param; let v0 = _v0; @@ -724,7 +724,7 @@ function Make(Ord) { continue; }; }; - let find_last = function (f, _param) { + let find_last = (f, _param) => { while (true) { let param = _param; if (typeof param !== "object") { @@ -742,7 +742,7 @@ function Make(Ord) { continue; }; }; - let find_last_opt_aux = function (_v0, f, _param) { + let find_last_opt_aux = (_v0, f, _param) => { while (true) { let param = _param; let v0 = _v0; @@ -759,7 +759,7 @@ function Make(Ord) { continue; }; }; - let find_last_opt = function (f, _param) { + let find_last_opt = (f, _param) => { while (true) { let param = _param; if (typeof param !== "object") { @@ -773,7 +773,7 @@ function Make(Ord) { continue; }; }; - let find_opt = function (x, _param) { + let find_opt = (x, _param) => { while (true) { let param = _param; if (typeof param !== "object") { @@ -788,14 +788,14 @@ function Make(Ord) { continue; }; }; - let try_join = function (l, v, r) { + let try_join = (l, v, r) => { if ((l === "Empty" || Ord.compare(max_elt(l), v) < 0) && (r === "Empty" || Ord.compare(v, min_elt(r)) < 0)) { return join(l, v, r); } else { return union(l, add(v, r)); } }; - let map = function (f, param) { + let map = (f, param) => { if (typeof param !== "object") { return "Empty"; } @@ -811,8 +811,8 @@ function Make(Ord) { return try_join(l$p, v$p, r$p); } }; - let of_sorted_list = function (l) { - let sub = function (n, l) { + let of_sorted_list = (l) => { + let sub = (n, l) => { switch (n) { case 0 : return [ @@ -915,7 +915,7 @@ function Make(Ord) { }; return sub(List.length(l), l)[0]; }; - let of_list = function (l) { + let of_list = (l) => { if (!l) { return "Empty"; } diff --git a/lib/es6/sort.js b/lib/es6/sort.js index f2c66fedfa5..83358bc64f0 100644 --- a/lib/es6/sort.js +++ b/lib/es6/sort.js @@ -24,7 +24,7 @@ function merge(order, l1, l2) { } function list(order, l) { - let initlist = function (param) { + let initlist = (param) => { if (!param) { return /* [] */0; } @@ -57,7 +57,7 @@ function list(order, l) { tl: initlist(match.tl) }; }; - let merge2 = function (param) { + let merge2 = (param) => { if (!param) { return param; } @@ -92,7 +92,7 @@ function swap(arr, i, j) { } function array(cmp, arr) { - let qsort = function (_lo, _hi) { + let qsort = (_lo, _hi) => { while (true) { let hi = _hi; let lo = _lo; diff --git a/lib/es6/stream.js b/lib/es6/stream.js index 548760f914c..a26ebf6cf51 100644 --- a/lib/es6/stream.js +++ b/lib/es6/stream.js @@ -254,7 +254,7 @@ function empty(s) { } function iter(f, strm) { - let do_rec = function () { + let do_rec = () => { while (true) { let a = peek(strm); if (a === undefined) { @@ -284,7 +284,7 @@ function from(f) { function of_list(l) { return { count: 0, - data: List.fold_right((function (x, l) { + data: List.fold_right(((x, l) => { return { TAG: "Scons", _0: x, @@ -298,7 +298,7 @@ function of_string(s) { let count = { contents: 0 }; - return from(function (param) { + return from((param) => { let c = count.contents; if (c < s.length) { count.contents = count.contents + 1 | 0; @@ -312,7 +312,7 @@ function of_bytes(s) { let count = { contents: 0 }; - return from(function (param) { + return from((param) => { let c = count.contents; if (c < s.length) { count.contents = count.contents + 1 | 0; @@ -356,7 +356,7 @@ function ising(i) { } function lapp(f, s) { - let f$1 = function () { + let f$1 = () => { return { TAG: "Sapp", _0: data(f()), @@ -367,7 +367,7 @@ function lapp(f, s) { count: 0, data: { TAG: "Slazy", - _0: CamlinternalLazy.from_fun(function () { + _0: CamlinternalLazy.from_fun(() => { return f$1(); }) } @@ -375,7 +375,7 @@ function lapp(f, s) { } function lcons(f, s) { - let f$1 = function () { + let f$1 = () => { return { TAG: "Scons", _0: f(), @@ -386,7 +386,7 @@ function lcons(f, s) { count: 0, data: { TAG: "Slazy", - _0: CamlinternalLazy.from_fun(function () { + _0: CamlinternalLazy.from_fun(() => { return f$1(); }) } @@ -398,7 +398,7 @@ function lsing(f) { count: 0, data: { TAG: "Slazy", - _0: CamlinternalLazy.from_fun(function () { + _0: CamlinternalLazy.from_fun(() => { return { TAG: "Scons", _0: f(), @@ -414,7 +414,7 @@ function slazy(f) { count: 0, data: { TAG: "Slazy", - _0: CamlinternalLazy.from_fun(function () { + _0: CamlinternalLazy.from_fun(() => { return data(f()); }) } diff --git a/lib/es6/string.js b/lib/es6/string.js index c19e2db03ce..d260d31410e 100644 --- a/lib/es6/string.js +++ b/lib/es6/string.js @@ -55,7 +55,7 @@ function trim(s) { } function escaped(s) { - let needs_escape = function (_i) { + let needs_escape = (_i) => { while (true) { let i = _i; if (i >= s.length) { diff --git a/lib/es6/stringLabels.js b/lib/es6/stringLabels.js index 74f7f99d18d..c1df4983baa 100644 --- a/lib/es6/stringLabels.js +++ b/lib/es6/stringLabels.js @@ -57,7 +57,7 @@ function trim(s) { } function escaped(s) { - let needs_escape = function (_i) { + let needs_escape = (_i) => { while (true) { let i = _i; if (i >= s.length) { diff --git a/lib/js/arg.js b/lib/js/arg.js index e06814b14b6..08c73487596 100644 --- a/lib/js/arg.js +++ b/lib/js/arg.js @@ -50,7 +50,7 @@ function split(s) { function make_symlist(prefix, sep, suffix, l) { if (l) { - return List.fold_left((function (x, y) { + return List.fold_left(((x, y) => { return x + (sep + y); }), prefix + l.hd, l.tl) + suffix; } else { @@ -124,7 +124,7 @@ function add_help(speclist) { function usage_b(buf, speclist, errmsg) { Buffer.add_string(buf, errmsg + "\n"); - List.iter((function (x) { + List.iter(((x) => { let doc = x[2]; if (doc.length === 0) { return; @@ -197,7 +197,7 @@ function float_of_string_opt(x) { function parse_and_expand_argv_dynamic_aux(allow_expand, current, argv, speclist, anonfun, errmsg) { let initpos = current.contents; - let convert_error = function (error) { + let convert_error = (error) => { let b = Buffer.create(200); let progname = initpos < argv.contents.length ? Caml_array.get(argv.contents, initpos) : "(?)"; switch (error.TAG) { @@ -284,7 +284,7 @@ function parse_and_expand_argv_dynamic_aux(allow_expand, current, argv, speclist } } let follow = match[1]; - let no_arg = function () { + let no_arg = () => { if (follow === undefined) { return; } @@ -300,7 +300,7 @@ function parse_and_expand_argv_dynamic_aux(allow_expand, current, argv, speclist } }); }; - let get_arg = function () { + let get_arg = () => { if (follow !== undefined) { return follow; } @@ -317,7 +317,7 @@ function parse_and_expand_argv_dynamic_aux(allow_expand, current, argv, speclist } }); }; - let consume_arg = function () { + let consume_arg = () => { if (follow !== undefined) { return; } else { @@ -325,7 +325,7 @@ function parse_and_expand_argv_dynamic_aux(allow_expand, current, argv, speclist return; } }; - let treat_action = function (f) { + let treat_action = (f) => { switch (f.TAG) { case "Unit" : return f._0(); @@ -609,7 +609,7 @@ function parse_expand(l, f, msg) { function second_word(s) { let len = s.length; - let loop = function (_n) { + let loop = (_n) => { while (true) { let n = _n; if (n >= len) { @@ -668,7 +668,7 @@ function replace_leading_tab(s) { let seen = { contents: false }; - return $$String.map((function (c) { + return $$String.map(((c) => { if (c !== 9 || seen.contents) { return c; } else { @@ -683,7 +683,7 @@ function align(limitOpt, speclist) { let completed = add_help(speclist); let len = List.fold_left(max_arg_len, 0, completed); let len$1 = len < limit ? len : limit; - return List.map((function (x) { + return List.map(((x) => { let spec = x[1]; let kwd = x[0]; if (x[2] === "") { diff --git a/lib/js/array.js b/lib/js/array.js index 81d2af9cb43..8bdf08b5526 100644 --- a/lib/js/array.js +++ b/lib/js/array.js @@ -299,7 +299,7 @@ function memq(x, a) { let Bottom = /* @__PURE__ */Caml_exceptions.create("Array.Bottom"); function sort(cmp, a) { - let maxson = function (l, i) { + let maxson = (l, i) => { let i31 = ((i + i | 0) + i | 0) + 1 | 0; let x = i31; if ((i31 + 2 | 0) < l) { @@ -324,7 +324,7 @@ function sort(cmp, a) { } }); }; - let trickle = function (l, i, e) { + let trickle = (l, i, e) => { try { let _i = i; while (true) { @@ -347,7 +347,7 @@ function sort(cmp, a) { }); } }; - let bubble = function (l, i) { + let bubble = (l, i) => { try { let _i = i; while (true) { @@ -367,7 +367,7 @@ function sort(cmp, a) { }); } }; - let trickleup = function (_i, e) { + let trickleup = (_i, e) => { while (true) { let i = _i; let father = (i - 1 | 0) / 3 | 0; @@ -412,7 +412,7 @@ function sort(cmp, a) { } function stable_sort(cmp, a) { - let merge = function (src1ofs, src1len, src2, src2ofs, src2len, dst, dstofs) { + let merge = (src1ofs, src1len, src2, src2ofs, src2len, dst, dstofs) => { let src1r = src1ofs + src1len | 0; let src2r = src2ofs + src2len | 0; let _i1 = src1ofs; @@ -448,7 +448,7 @@ function stable_sort(cmp, a) { continue; }; }; - let isortto = function (srcofs, dst, dstofs, len) { + let isortto = (srcofs, dst, dstofs, len) => { for (let i = 0; i < len; ++i) { let e = Caml_array.get(a, srcofs + i | 0); let j = (dstofs + i | 0) - 1 | 0; @@ -459,7 +459,7 @@ function stable_sort(cmp, a) { Caml_array.set(dst, j + 1 | 0, e); } }; - let sortto = function (srcofs, dst, dstofs, len) { + let sortto = (srcofs, dst, dstofs, len) => { if (len <= 5) { return isortto(srcofs, dst, dstofs, len); } diff --git a/lib/js/arrayLabels.js b/lib/js/arrayLabels.js index cd50a85c003..cc4be0533e5 100644 --- a/lib/js/arrayLabels.js +++ b/lib/js/arrayLabels.js @@ -299,7 +299,7 @@ function memq(x, a) { let Bottom = /* @__PURE__ */Caml_exceptions.create("ArrayLabels.Bottom"); function sort(cmp, a) { - let maxson = function (l, i) { + let maxson = (l, i) => { let i31 = ((i + i | 0) + i | 0) + 1 | 0; let x = i31; if ((i31 + 2 | 0) < l) { @@ -324,7 +324,7 @@ function sort(cmp, a) { } }); }; - let trickle = function (l, i, e) { + let trickle = (l, i, e) => { try { let _i = i; while (true) { @@ -347,7 +347,7 @@ function sort(cmp, a) { }); } }; - let bubble = function (l, i) { + let bubble = (l, i) => { try { let _i = i; while (true) { @@ -367,7 +367,7 @@ function sort(cmp, a) { }); } }; - let trickleup = function (_i, e) { + let trickleup = (_i, e) => { while (true) { let i = _i; let father = (i - 1 | 0) / 3 | 0; @@ -412,7 +412,7 @@ function sort(cmp, a) { } function stable_sort(cmp, a) { - let merge = function (src1ofs, src1len, src2, src2ofs, src2len, dst, dstofs) { + let merge = (src1ofs, src1len, src2, src2ofs, src2len, dst, dstofs) => { let src1r = src1ofs + src1len | 0; let src2r = src2ofs + src2len | 0; let _i1 = src1ofs; @@ -448,7 +448,7 @@ function stable_sort(cmp, a) { continue; }; }; - let isortto = function (srcofs, dst, dstofs, len) { + let isortto = (srcofs, dst, dstofs, len) => { for (let i = 0; i < len; ++i) { let e = Caml_array.get(a, srcofs + i | 0); let j = (dstofs + i | 0) - 1 | 0; @@ -459,7 +459,7 @@ function stable_sort(cmp, a) { Caml_array.set(dst, j + 1 | 0, e); } }; - let sortto = function (srcofs, dst, dstofs, len) { + let sortto = (srcofs, dst, dstofs, len) => { if (len <= 5) { return isortto(srcofs, dst, dstofs, len); } diff --git a/lib/js/belt_Array.js b/lib/js/belt_Array.js index 6a48e4f3485..358382b7468 100644 --- a/lib/js/belt_Array.js +++ b/lib/js/belt_Array.js @@ -59,7 +59,7 @@ function swapUnsafe(xs, i, j) { function shuffleInPlace(xs) { let len = xs.length; - let random_int = function (min, max) { + let random_int = (min, max) => { return Math.floor(Math.random() * (max - min | 0)) + min | 0; }; for (let i = 0; i < len; ++i) { diff --git a/lib/js/belt_MapDict.js b/lib/js/belt_MapDict.js index 8522d778908..98c89e13a9f 100644 --- a/lib/js/belt_MapDict.js +++ b/lib/js/belt_MapDict.js @@ -196,7 +196,7 @@ function split(n, x, cmp) { function merge(s1, s2, f, cmp) { if (s1 === undefined) { if (s2 !== undefined) { - return Belt_internalAVLtree.keepMap(s2, (function (k, v) { + return Belt_internalAVLtree.keepMap(s2, ((k, v) => { return f(k, undefined, Caml_option.some(v)); })); } else { @@ -204,7 +204,7 @@ function merge(s1, s2, f, cmp) { } } if (s2 === undefined) { - return Belt_internalAVLtree.keepMap(s1, (function (k, v) { + return Belt_internalAVLtree.keepMap(s1, ((k, v) => { return f(k, Caml_option.some(v), undefined); })); } diff --git a/lib/js/belt_internalAVLset.js b/lib/js/belt_internalAVLset.js index dd45a21036f..8d6682e394a 100644 --- a/lib/js/belt_internalAVLset.js +++ b/lib/js/belt_internalAVLset.js @@ -827,7 +827,7 @@ function fromArray(xs, cmp) { if (len === 0) { return; } - let next = Belt_SortArray.strictlySortedLength(xs, (function (x, y) { + let next = Belt_SortArray.strictlySortedLength(xs, ((x, y) => { return cmp(x, y) < 0; })); let result; diff --git a/lib/js/belt_internalAVLtree.js b/lib/js/belt_internalAVLtree.js index abf3c136074..06b5a6ffab1 100644 --- a/lib/js/belt_internalAVLtree.js +++ b/lib/js/belt_internalAVLtree.js @@ -1001,7 +1001,7 @@ function fromArray(xs, cmp) { if (len === 0) { return; } - let next = Belt_SortArray.strictlySortedLength(xs, (function (param, param$1) { + let next = Belt_SortArray.strictlySortedLength(xs, ((param, param$1) => { return cmp(param[0], param$1[0]) < 0; })); let result; diff --git a/lib/js/belt_internalBuckets.js b/lib/js/belt_internalBuckets.js index d09ba287606..2b4e3bc4e3a 100644 --- a/lib/js/belt_internalBuckets.js +++ b/lib/js/belt_internalBuckets.js @@ -108,7 +108,7 @@ function reduce(h, init, f) { } function getMaxBucketLength(h) { - return Belt_Array.reduce(h.buckets, 0, (function (m, b) { + return Belt_Array.reduce(h.buckets, 0, ((m, b) => { let len = bucketLength(0, b); if (m > len) { return m; @@ -120,10 +120,10 @@ function getMaxBucketLength(h) { function getBucketHistogram(h) { let mbl = getMaxBucketLength(h); - let histo = Belt_Array.makeBy(mbl + 1 | 0, (function (param) { + let histo = Belt_Array.makeBy(mbl + 1 | 0, ((param) => { return 0; })); - Belt_Array.forEach(h.buckets, (function (b) { + Belt_Array.forEach(h.buckets, ((b) => { let l = bucketLength(0, b); histo[l] = histo[l] + 1 | 0; })); @@ -233,19 +233,19 @@ function linear(h, f) { } function keysToArray(h) { - return linear(h, (function (x) { + return linear(h, ((x) => { return x.key; })); } function valuesToArray(h) { - return linear(h, (function (x) { + return linear(h, ((x) => { return x.value; })); } function toArray(h) { - return linear(h, (function (x) { + return linear(h, ((x) => { return [ x.key, x.value diff --git a/lib/js/belt_internalMapInt.js b/lib/js/belt_internalMapInt.js index c7558033f2f..f40b805ac3a 100644 --- a/lib/js/belt_internalMapInt.js +++ b/lib/js/belt_internalMapInt.js @@ -303,7 +303,7 @@ function fromArray(xs) { if (len === 0) { return; } - let next = Belt_SortArray.strictlySortedLength(xs, (function (param, param$1) { + let next = Belt_SortArray.strictlySortedLength(xs, ((param, param$1) => { return param[0] < param$1[0]; })); let result; diff --git a/lib/js/belt_internalMapString.js b/lib/js/belt_internalMapString.js index fee0b6cb216..ffb2909c1c7 100644 --- a/lib/js/belt_internalMapString.js +++ b/lib/js/belt_internalMapString.js @@ -303,7 +303,7 @@ function fromArray(xs) { if (len === 0) { return; } - let next = Belt_SortArray.strictlySortedLength(xs, (function (param, param$1) { + let next = Belt_SortArray.strictlySortedLength(xs, ((param, param$1) => { return param[0] < param$1[0]; })); let result; diff --git a/lib/js/belt_internalSetBuckets.js b/lib/js/belt_internalSetBuckets.js index 5484d3296ab..88c3e29dc69 100644 --- a/lib/js/belt_internalSetBuckets.js +++ b/lib/js/belt_internalSetBuckets.js @@ -134,7 +134,7 @@ function reduce(h, init, f) { } function getMaxBucketLength(h) { - return Belt_Array.reduce(h.buckets, 0, (function (m, b) { + return Belt_Array.reduce(h.buckets, 0, ((m, b) => { let len = bucketLength(0, b); if (m > len) { return m; @@ -146,10 +146,10 @@ function getMaxBucketLength(h) { function getBucketHistogram(h) { let mbl = getMaxBucketLength(h); - let histo = Belt_Array.makeBy(mbl + 1 | 0, (function (param) { + let histo = Belt_Array.makeBy(mbl + 1 | 0, ((param) => { return 0; })); - Belt_Array.forEach(h.buckets, (function (b) { + Belt_Array.forEach(h.buckets, ((b) => { let l = bucketLength(0, b); histo[l] = histo[l] + 1 | 0; })); diff --git a/lib/js/caml_format.js b/lib/js/caml_format.js index c272d1b695f..7ec916dc577 100644 --- a/lib/js/caml_format.js +++ b/lib/js/caml_format.js @@ -136,7 +136,7 @@ function int_of_string(s) { } }); } - let aux = function (_acc, _k) { + let aux = (_acc, _k) => { while (true) { let k = _k; let acc = _acc; @@ -225,7 +225,7 @@ function int64_of_string(s) { } }); } - let aux = function (_acc, _k) { + let aux = (_acc, _k) => { while (true) { let k = _k; let acc = _acc; @@ -404,7 +404,7 @@ function parse_format(fmt) { case 46 : f.prec = 0; let j = i + 1 | 0; - while ((function () { + while ((() => { let w = fmt.codePointAt(j) - 48 | 0; return w >= 0 && w <= 9; })()) { @@ -443,7 +443,7 @@ function parse_format(fmt) { case 3 : f.width = 0; let j$1 = i; - while ((function () { + while ((() => { let w = fmt.codePointAt(j$1) - 48 | 0; return w >= 0 && w <= 9; })()) { @@ -676,7 +676,7 @@ function format_float(fmt, x) { p = p - (exp + 1 | 0) | 0; s = x$1.toFixed(p); } else { - while ((function () { + while ((() => { s = x$1.toFixed(p); return s.length > (prec$1 + 1 | 0); })()) { diff --git a/lib/js/caml_hash.js b/lib/js/caml_hash.js index 0fbd07cb73c..7447da09ab5 100644 --- a/lib/js/caml_hash.js +++ b/lib/js/caml_hash.js @@ -84,7 +84,7 @@ function hash(count, _limit, seed, obj) { ++ size } return size - })(obj$1, (function (v) { + })(obj$1, ((v) => { push_back(queue, v); })); s = Caml_hash_primitive.hash_mix_int(s, (size$1 << 10) | 0); diff --git a/lib/js/caml_int64.js b/lib/js/caml_int64.js index 10e77156ba4..d15fe6b9a04 100644 --- a/lib/js/caml_int64.js +++ b/lib/js/caml_int64.js @@ -527,7 +527,7 @@ function to_int32(x) { function to_hex(x) { let x_lo = x[1]; let x_hi = x[0]; - let aux = function (v) { + let aux = (v) => { return (v >>> 0).toString(16); }; if (x_hi === 0 && x_lo === 0) { diff --git a/lib/js/caml_module.js b/lib/js/caml_module.js index 32846e33c24..287f03e2230 100644 --- a/lib/js/caml_module.js +++ b/lib/js/caml_module.js @@ -3,7 +3,7 @@ let Caml_obj = require("./caml_obj.js"); function init_mod(loc, shape) { - let undef_module = function (param) { + let undef_module = (param) => { throw new Error("Undefined_recursive_module", { cause: { RE_EXN_ID: "Undefined_recursive_module", @@ -11,7 +11,7 @@ function init_mod(loc, shape) { } }); }; - let loop = function (shape, struct_, idx) { + let loop = (shape, struct_, idx) => { if (typeof shape !== "object") { switch (shape) { case "Function" : @@ -50,7 +50,7 @@ function init_mod(loc, shape) { } function update_mod(shape, o, n) { - let aux = function (shape, o, n, parent, i) { + let aux = (shape, o, n, parent, i) => { if (typeof shape !== "object") { switch (shape) { case "Function" : diff --git a/lib/js/caml_obj.js b/lib/js/caml_obj.js index 65e0d78ebc0..2e79f5fbf0e 100644 --- a/lib/js/caml_obj.js +++ b/lib/js/caml_obj.js @@ -211,7 +211,7 @@ function aux_obj_compare(a, b) { let min_key_rhs = { contents: undefined }; - let do_key = function (param, key) { + let do_key = (param, key) => { let min_key = param[2]; let b = param[1]; if (!(!Object.prototype.hasOwnProperty.call(b, key) || compare(param[0][key], b[key]) > 0)) { @@ -225,14 +225,14 @@ function aux_obj_compare(a, b) { return; } }; - let do_key_a = function (key) { + let do_key_a = (key) => { do_key([ a, b, min_key_rhs ], key); }; - let do_key_b = function (key) { + let do_key_b = (key) => { do_key([ b, a, @@ -314,14 +314,14 @@ function equal(a, b) { let result = { contents: true }; - let do_key_a = function (key) { + let do_key_a = (key) => { if (!Object.prototype.hasOwnProperty.call(b, key)) { result.contents = false; return; } }; - let do_key_b = function (key) { + let do_key_b = (key) => { if (!Object.prototype.hasOwnProperty.call(a, key) || !equal(b[key], a[key])) { result.contents = false; return; diff --git a/lib/js/camlinternalLazy.js b/lib/js/camlinternalLazy.js index a1f4efec8ac..b5e07541d69 100644 --- a/lib/js/camlinternalLazy.js +++ b/lib/js/camlinternalLazy.js @@ -32,7 +32,7 @@ function force(lzv) { try { return forward_with_closure(lzv, closure); } catch (e) { - lzv.VAL = (function () { + lzv.VAL = (() => { throw new Error(e.RE_EXN_ID, { cause: e }); diff --git a/lib/js/curry.js b/lib/js/curry.js index 54c46389bfe..d35d7b7f74a 100644 --- a/lib/js/curry.js +++ b/lib/js/curry.js @@ -14,7 +14,7 @@ function app(_f, _args) { return f.apply(null, args); } if (d >= 0) { - return function (x) { + return (x) => { return app(f, args.concat([x])); }; } @@ -33,27 +33,27 @@ function _1(o, a0) { case 1 : return o(a0); case 2 : - return function (param) { + return (param) => { return o(a0, param); }; case 3 : - return function (param, param$1) { + return (param, param$1) => { return o(a0, param, param$1); }; case 4 : - return function (param, param$1, param$2) { + return (param, param$1, param$2) => { return o(a0, param, param$1, param$2); }; case 5 : - return function (param, param$1, param$2, param$3) { + return (param, param$1, param$2, param$3) => { return o(a0, param, param$1, param$2, param$3); }; case 6 : - return function (param, param$1, param$2, param$3, param$4) { + return (param, param$1, param$2, param$3, param$4) => { return o(a0, param, param$1, param$2, param$3, param$4); }; case 7 : - return function (param, param$1, param$2, param$3, param$4, param$5) { + return (param, param$1, param$2, param$3, param$4, param$5) => { return o(a0, param, param$1, param$2, param$3, param$4, param$5); }; default: @@ -67,7 +67,7 @@ function __1(o) { if (arity === 1) { return o; } else { - return function (a0) { + return (a0) => { return _1(o, a0); }; } @@ -84,23 +84,23 @@ function _2(o, a0, a1) { case 2 : return o(a0, a1); case 3 : - return function (param) { + return (param) => { return o(a0, a1, param); }; case 4 : - return function (param, param$1) { + return (param, param$1) => { return o(a0, a1, param, param$1); }; case 5 : - return function (param, param$1, param$2) { + return (param, param$1, param$2) => { return o(a0, a1, param, param$1, param$2); }; case 6 : - return function (param, param$1, param$2, param$3) { + return (param, param$1, param$2, param$3) => { return o(a0, a1, param, param$1, param$2, param$3); }; case 7 : - return function (param, param$1, param$2, param$3, param$4) { + return (param, param$1, param$2, param$3, param$4) => { return o(a0, a1, param, param$1, param$2, param$3, param$4); }; default: @@ -117,7 +117,7 @@ function __2(o) { if (arity === 2) { return o; } else { - return function (a0, a1) { + return (a0, a1) => { return _2(o, a0, a1); }; } @@ -139,19 +139,19 @@ function _3(o, a0, a1, a2) { case 3 : return o(a0, a1, a2); case 4 : - return function (param) { + return (param) => { return o(a0, a1, a2, param); }; case 5 : - return function (param, param$1) { + return (param, param$1) => { return o(a0, a1, a2, param, param$1); }; case 6 : - return function (param, param$1, param$2) { + return (param, param$1, param$2) => { return o(a0, a1, a2, param, param$1, param$2); }; case 7 : - return function (param, param$1, param$2, param$3) { + return (param, param$1, param$2, param$3) => { return o(a0, a1, a2, param, param$1, param$2, param$3); }; default: @@ -169,7 +169,7 @@ function __3(o) { if (arity === 3) { return o; } else { - return function (a0, a1, a2) { + return (a0, a1, a2) => { return _3(o, a0, a1, a2); }; } @@ -197,15 +197,15 @@ function _4(o, a0, a1, a2, a3) { case 4 : return o(a0, a1, a2, a3); case 5 : - return function (param) { + return (param) => { return o(a0, a1, a2, a3, param); }; case 6 : - return function (param, param$1) { + return (param, param$1) => { return o(a0, a1, a2, a3, param, param$1); }; case 7 : - return function (param, param$1, param$2) { + return (param, param$1, param$2) => { return o(a0, a1, a2, a3, param, param$1, param$2); }; default: @@ -224,7 +224,7 @@ function __4(o) { if (arity === 4) { return o; } else { - return function (a0, a1, a2, a3) { + return (a0, a1, a2, a3) => { return _4(o, a0, a1, a2, a3); }; } @@ -259,11 +259,11 @@ function _5(o, a0, a1, a2, a3, a4) { case 5 : return o(a0, a1, a2, a3, a4); case 6 : - return function (param) { + return (param) => { return o(a0, a1, a2, a3, a4, param); }; case 7 : - return function (param, param$1) { + return (param, param$1) => { return o(a0, a1, a2, a3, a4, param, param$1); }; default: @@ -283,7 +283,7 @@ function __5(o) { if (arity === 5) { return o; } else { - return function (a0, a1, a2, a3, a4) { + return (a0, a1, a2, a3, a4) => { return _5(o, a0, a1, a2, a3, a4); }; } @@ -326,7 +326,7 @@ function _6(o, a0, a1, a2, a3, a4, a5) { case 6 : return o(a0, a1, a2, a3, a4, a5); case 7 : - return function (param) { + return (param) => { return o(a0, a1, a2, a3, a4, a5, param); }; default: @@ -347,7 +347,7 @@ function __6(o) { if (arity === 6) { return o; } else { - return function (a0, a1, a2, a3, a4, a5) { + return (a0, a1, a2, a3, a4, a5) => { return _6(o, a0, a1, a2, a3, a4, a5); }; } @@ -417,7 +417,7 @@ function __7(o) { if (arity === 7) { return o; } else { - return function (a0, a1, a2, a3, a4, a5, a6) { + return (a0, a1, a2, a3, a4, a5, a6) => { return _7(o, a0, a1, a2, a3, a4, a5, a6); }; } @@ -496,7 +496,7 @@ function __8(o) { if (arity === 8) { return o; } else { - return function (a0, a1, a2, a3, a4, a5, a6, a7) { + return (a0, a1, a2, a3, a4, a5, a6, a7) => { return _8(o, a0, a1, a2, a3, a4, a5, a6, a7); }; } diff --git a/lib/js/digest.js b/lib/js/digest.js index 103d5c8fa99..a8ec47df8fc 100644 --- a/lib/js/digest.js +++ b/lib/js/digest.js @@ -64,7 +64,7 @@ function from_hex(s) { } }); } - let digit = function (c) { + let digit = (c) => { if (c >= 65) { if (c >= 97) { if (c >= 103) { @@ -97,7 +97,7 @@ function from_hex(s) { } return c - /* '0' */48 | 0; }; - let byte = function (i) { + let byte = (i) => { return (digit(Caml_string.get(s, i)) << 4) + digit(Caml_string.get(s, i + 1 | 0)) | 0; }; let result = Caml_bytes.create(16); diff --git a/lib/js/filename.js b/lib/js/filename.js index 4cbda618347..7e8140e9688 100644 --- a/lib/js/filename.js +++ b/lib/js/filename.js @@ -215,7 +215,7 @@ function quote$1(s) { let l = s.length; let b = Buffer.create(l + 20 | 0); Buffer.add_char(b, /* '"' */34); - let loop = function (_i) { + let loop = (_i) => { while (true) { let i = _i; if (i === l) { @@ -233,7 +233,7 @@ function quote$1(s) { continue; }; }; - let loop_bs = function (_n, _i) { + let loop_bs = (_n, _i) => { while (true) { let i = _i; let n = _n; @@ -256,7 +256,7 @@ function quote$1(s) { return loop(i + 1 | 0); }; }; - let add_bs = function (n) { + let add_bs = (n) => { for (let _j = 1; _j <= n; ++_j) { Buffer.add_char(b, /* '\\' */92); } @@ -266,7 +266,7 @@ function quote$1(s) { } function has_drive(s) { - let is_letter = function (param) { + let is_letter = (param) => { if (param >= 91) { return !(param > 122 || param < 97); } else { diff --git a/lib/js/genlex.js b/lib/js/genlex.js index e708d6239b5..6100065e379 100644 --- a/lib/js/genlex.js +++ b/lib/js/genlex.js @@ -43,13 +43,13 @@ function get_string() { function make_lexer(keywords) { let kwd_table = Hashtbl.create(undefined, 17); - List.iter((function (s) { + List.iter(((s) => { Hashtbl.add(kwd_table, s, { TAG: "Kwd", _0: s }); }), keywords); - let ident_or_keyword = function (id) { + let ident_or_keyword = (id) => { try { return Hashtbl.find(kwd_table, id); } catch (raw_exn) { @@ -65,7 +65,7 @@ function make_lexer(keywords) { }); } }; - let keyword_or_error = function (c) { + let keyword_or_error = (c) => { let s = Caml_string.make(1, c); try { return Hashtbl.find(kwd_table, s); @@ -84,7 +84,7 @@ function make_lexer(keywords) { }); } }; - let next_token = function (strm__) { + let next_token = (strm__) => { while (true) { let c = Stream.peek(strm__); if (c === undefined) { @@ -310,7 +310,7 @@ function make_lexer(keywords) { } }; }; - let ident2 = function (strm__) { + let ident2 = (strm__) => { while (true) { let c = Stream.peek(strm__); if (c === undefined) { @@ -377,7 +377,7 @@ function make_lexer(keywords) { continue; }; }; - let number = function (strm__) { + let number = (strm__) => { while (true) { let c = Stream.peek(strm__); if (c !== undefined) { @@ -428,7 +428,7 @@ function make_lexer(keywords) { }; }; }; - let exponent_part = function (strm__) { + let exponent_part = (strm__) => { let c = Stream.peek(strm__); if (c !== undefined && !(c !== 43 && c !== 45)) { Stream.junk(strm__); @@ -438,7 +438,7 @@ function make_lexer(keywords) { return end_exponent_part(strm__); } }; - let end_exponent_part = function (strm__) { + let end_exponent_part = (strm__) => { while (true) { let c = Stream.peek(strm__); if (c === undefined) { @@ -458,7 +458,7 @@ function make_lexer(keywords) { continue; }; }; - let string = function (strm__) { + let string = (strm__) => { while (true) { let c = Stream.peek(strm__); if (c !== undefined) { @@ -499,7 +499,7 @@ function make_lexer(keywords) { }); }; }; - let char = function (strm__) { + let char = (strm__) => { let c = Stream.peek(strm__); if (c !== undefined) { if (c !== 92) { @@ -531,7 +531,7 @@ function make_lexer(keywords) { }); } }; - let escape = function (strm__) { + let escape = (strm__) => { let c1 = Stream.peek(strm__); if (c1 !== undefined) { if (c1 >= 58) { @@ -601,7 +601,7 @@ function make_lexer(keywords) { }); } }; - let comment = function (strm__) { + let comment = (strm__) => { while (true) { let match = Stream.peek(strm__); if (match !== undefined) { @@ -659,8 +659,8 @@ function make_lexer(keywords) { } }; }; - return function (input) { - return Stream.from(function (_count) { + return (input) => { + return Stream.from((_count) => { return next_token(input); }); }; diff --git a/lib/js/hashtbl.js b/lib/js/hashtbl.js index 112833ee171..8cf0bb387d1 100644 --- a/lib/js/hashtbl.js +++ b/lib/js/hashtbl.js @@ -38,7 +38,7 @@ function is_randomized() { return randomized.contents; } -let prng = CamlinternalLazy.from_fun(function () { +let prng = CamlinternalLazy.from_fun(() => { return Random.State.make_self_init(); }); @@ -94,7 +94,7 @@ function copy_bucketlist(param) { let key = param.key; let data = param.data; let next = param.next; - let loop = function (_prec, _param) { + let loop = (_prec, _param) => { while (true) { let param = _param; let prec = _prec; @@ -162,7 +162,7 @@ function resize(indexfun, h) { let ndata_tail = Caml_array.make(nsize, "Empty"); let inplace = h.initial_size >= 0; h.data = ndata; - let insert_bucket = function (_param) { + let insert_bucket = (_param) => { while (true) { let param = _param; if (typeof param !== "object") { @@ -362,7 +362,7 @@ function find_opt(h, key) { } function find_all(h, key) { - let find_in_bucket = function (_param) { + let find_in_bucket = (_param) => { while (true) { let param = _param; if (typeof param !== "object") { @@ -440,7 +440,7 @@ function mem(h, key) { } function iter(f, h) { - let do_bucket = function (_param) { + let do_bucket = (_param) => { while (true) { let param = _param; if (typeof param !== "object") { @@ -539,7 +539,7 @@ function filter_map_inplace(f, h) { } function fold(f, h, init) { - let do_bucket = function (_b, _accu) { + let do_bucket = (_b, _accu) => { while (true) { let accu = _accu; let b = _b; @@ -596,11 +596,11 @@ function bucket_length(_accu, _param) { } function stats(h) { - let mbl = $$Array.fold_left((function (m, b) { + let mbl = $$Array.fold_left(((m, b) => { return Caml.int_max(m, bucket_length(0, b)); }), 0, h.data); let histo = Caml_array.make(mbl + 1 | 0, 0); - $$Array.iter((function (b) { + $$Array.iter(((b) => { let l = bucket_length(0, b); Caml_array.set(histo, l, Caml_array.get(histo, l) + 1 | 0); }), h.data); @@ -613,10 +613,10 @@ function stats(h) { } function MakeSeeded(H) { - let key_index = function (h, key) { + let key_index = (h, key) => { return H.hash(h.seed, key) & (h.data.length - 1 | 0); }; - let add = function (h, key, data) { + let add = (h, key, data) => { let i = key_index(h, key); let bucket = { TAG: "Cons", @@ -631,7 +631,7 @@ function MakeSeeded(H) { } }; - let remove = function (h, key) { + let remove = (h, key) => { let i = key_index(h, key); let _prec = "Empty"; let _param = Caml_array.get(h.data, i); @@ -657,7 +657,7 @@ function MakeSeeded(H) { continue; }; }; - let find = function (h, key) { + let find = (h, key) => { let match = Caml_array.get(h.data, key_index(h, key)); if (typeof match !== "object") { throw new Error("Not_found", { @@ -719,7 +719,7 @@ function MakeSeeded(H) { }; } }; - let find_opt = function (h, key) { + let find_opt = (h, key) => { let match = Caml_array.get(h.data, key_index(h, key)); if (typeof match !== "object") { return; @@ -765,8 +765,8 @@ function MakeSeeded(H) { }; } }; - let find_all = function (h, key) { - let find_in_bucket = function (_param) { + let find_all = (h, key) => { + let find_in_bucket = (_param) => { while (true) { let param = _param; if (typeof param !== "object") { @@ -787,7 +787,7 @@ function MakeSeeded(H) { }; return find_in_bucket(Caml_array.get(h.data, key_index(h, key))); }; - let replace_bucket = function (key, data, _param) { + let replace_bucket = (key, data, _param) => { while (true) { let param = _param; if (typeof param !== "object") { @@ -804,7 +804,7 @@ function MakeSeeded(H) { continue; }; }; - let replace = function (h, key, data) { + let replace = (h, key, data) => { let i = key_index(h, key); let l = Caml_array.get(h.data, i); if (replace_bucket(key, data, l)) { @@ -823,7 +823,7 @@ function MakeSeeded(H) { } }; - let mem = function (h, key) { + let mem = (h, key) => { let _param = Caml_array.get(h.data, key_index(h, key)); while (true) { let param = _param; @@ -861,10 +861,10 @@ function MakeSeeded(H) { function Make(H) { let equal = H.equal; - let key_index = function (h, key) { + let key_index = (h, key) => { return H.hash(key) & (h.data.length - 1 | 0); }; - let add = function (h, key, data) { + let add = (h, key, data) => { let i = key_index(h, key); let bucket = { TAG: "Cons", @@ -879,7 +879,7 @@ function Make(H) { } }; - let remove = function (h, key) { + let remove = (h, key) => { let i = key_index(h, key); let _prec = "Empty"; let _param = Caml_array.get(h.data, i); @@ -905,7 +905,7 @@ function Make(H) { continue; }; }; - let find = function (h, key) { + let find = (h, key) => { let match = Caml_array.get(h.data, key_index(h, key)); if (typeof match !== "object") { throw new Error("Not_found", { @@ -967,7 +967,7 @@ function Make(H) { }; } }; - let find_opt = function (h, key) { + let find_opt = (h, key) => { let match = Caml_array.get(h.data, key_index(h, key)); if (typeof match !== "object") { return; @@ -1013,8 +1013,8 @@ function Make(H) { }; } }; - let find_all = function (h, key) { - let find_in_bucket = function (_param) { + let find_all = (h, key) => { + let find_in_bucket = (_param) => { while (true) { let param = _param; if (typeof param !== "object") { @@ -1035,7 +1035,7 @@ function Make(H) { }; return find_in_bucket(Caml_array.get(h.data, key_index(h, key))); }; - let replace_bucket = function (key, data, _param) { + let replace_bucket = (key, data, _param) => { while (true) { let param = _param; if (typeof param !== "object") { @@ -1052,7 +1052,7 @@ function Make(H) { continue; }; }; - let replace = function (h, key, data) { + let replace = (h, key, data) => { let i = key_index(h, key); let l = Caml_array.get(h.data, i); if (replace_bucket(key, data, l)) { @@ -1071,7 +1071,7 @@ function Make(H) { } }; - let mem = function (h, key) { + let mem = (h, key) => { let _param = Caml_array.get(h.data, key_index(h, key)); while (true) { let param = _param; @@ -1087,7 +1087,7 @@ function Make(H) { continue; }; }; - let create$1 = function (sz) { + let create$1 = (sz) => { return create(false, sz); }; return { diff --git a/lib/js/hashtblLabels.js b/lib/js/hashtblLabels.js index 6aa7894bbb5..e2fd4caf86d 100644 --- a/lib/js/hashtblLabels.js +++ b/lib/js/hashtblLabels.js @@ -11,19 +11,19 @@ function replace(tbl, key, data) { } function iter(f, tbl) { - Hashtbl.iter((function (key, data) { + Hashtbl.iter(((key, data) => { f(key, data); }), tbl); } function filter_map_inplace(f, tbl) { - Hashtbl.filter_map_inplace((function (key, data) { + Hashtbl.filter_map_inplace(((key, data) => { return f(key, data); }), tbl); } function fold(f, tbl, init) { - return Hashtbl.fold((function (key, data, acc) { + return Hashtbl.fold(((key, data, acc) => { return f(key, data, acc); }), tbl, init); } @@ -35,24 +35,24 @@ function MakeSeeded(H) { let iter = include.iter; let filter_map_inplace = include.filter_map_inplace; let fold = include.fold; - let add$1 = function (tbl, key, data) { + let add$1 = (tbl, key, data) => { add(tbl, key, data); }; - let replace$1 = function (tbl, key, data) { + let replace$1 = (tbl, key, data) => { replace(tbl, key, data); }; - let iter$1 = function (f, tbl) { - iter((function (key, data) { + let iter$1 = (f, tbl) => { + iter(((key, data) => { f(key, data); }), tbl); }; - let filter_map_inplace$1 = function (f, tbl) { - filter_map_inplace((function (key, data) { + let filter_map_inplace$1 = (f, tbl) => { + filter_map_inplace(((key, data) => { return f(key, data); }), tbl); }; - let fold$1 = function (f, tbl, init) { - return fold((function (key, data, acc) { + let fold$1 = (f, tbl, init) => { + return fold(((key, data, acc) => { return f(key, data, acc); }), tbl, init); }; @@ -77,7 +77,7 @@ function MakeSeeded(H) { } function Make(H) { - let hash = function (_seed, x) { + let hash = (_seed, x) => { return H.hash(x); }; let H_equal = H.equal; @@ -92,28 +92,28 @@ function Make(H) { let iter = include.iter; let filter_map_inplace = include.filter_map_inplace; let fold = include.fold; - let add$1 = function (tbl, key, data) { + let add$1 = (tbl, key, data) => { add(tbl, key, data); }; - let replace$1 = function (tbl, key, data) { + let replace$1 = (tbl, key, data) => { replace(tbl, key, data); }; - let iter$1 = function (f, tbl) { - iter((function (key, data) { + let iter$1 = (f, tbl) => { + iter(((key, data) => { f(key, data); }), tbl); }; - let filter_map_inplace$1 = function (f, tbl) { - filter_map_inplace((function (key, data) { + let filter_map_inplace$1 = (f, tbl) => { + filter_map_inplace(((key, data) => { return f(key, data); }), tbl); }; - let fold$1 = function (f, tbl, init) { - return fold((function (key, data, acc) { + let fold$1 = (f, tbl, init) => { + return fold(((key, data, acc) => { return f(key, data, acc); }), tbl, init); }; - let create$1 = function (sz) { + let create$1 = (sz) => { return create(false, sz); }; return { diff --git a/lib/js/lazy.js b/lib/js/lazy.js index fe1b4b9d8ba..d95578bd561 100644 --- a/lib/js/lazy.js +++ b/lib/js/lazy.js @@ -3,7 +3,7 @@ let CamlinternalLazy = require("./camlinternalLazy.js"); function from_fun(f) { - return CamlinternalLazy.from_fun(function () { + return CamlinternalLazy.from_fun(() => { return f(); }); } diff --git a/lib/js/lexing.js b/lib/js/lexing.js index eb3b49462b2..833b477f3f6 100644 --- a/lib/js/lexing.js +++ b/lib/js/lexing.js @@ -44,7 +44,7 @@ let zero_pos = { function from_function(f) { return { - refill_buff: (function (x) { + refill_buff: ((x) => { let aux_buffer = Caml_bytes.create(512); let read = f(aux_buffer, aux_buffer.length); let n = read > 0 ? read : (x.lex_eof_reached = true, 0); @@ -99,7 +99,7 @@ function from_function(f) { function from_string(s) { return { - refill_buff: (function (lexbuf) { + refill_buff: ((lexbuf) => { lexbuf.lex_eof_reached = true; }), lex_buffer: Bytes.of_string(s), diff --git a/lib/js/list.js b/lib/js/list.js index 46da49279ab..cebd113d2dd 100644 --- a/lib/js/list.js +++ b/lib/js/list.js @@ -856,7 +856,7 @@ function chop(_k, _l) { } function stable_sort(cmp, l) { - let sort = function (n, l) { + let sort = (n, l) => { if (n !== 2) { if (n === 3 && l) { let match = l.tl; @@ -1002,7 +1002,7 @@ function stable_sort(cmp, l) { continue; }; }; - let rev_sort = function (n, l) { + let rev_sort = (n, l) => { if (n !== 2) { if (n === 3 && l) { let match = l.tl; @@ -1157,7 +1157,7 @@ function stable_sort(cmp, l) { } function sort_uniq(cmp, l) { - let sort = function (n, l) { + let sort = (n, l) => { if (n !== 2) { if (n === 3 && l) { let match = l.tl; @@ -1388,7 +1388,7 @@ function sort_uniq(cmp, l) { continue; }; }; - let rev_sort = function (n, l) { + let rev_sort = (n, l) => { if (n !== 2) { if (n === 3 && l) { let match = l.tl; diff --git a/lib/js/listLabels.js b/lib/js/listLabels.js index 564e9376f2a..b026ab1ad4a 100644 --- a/lib/js/listLabels.js +++ b/lib/js/listLabels.js @@ -856,7 +856,7 @@ function chop(_k, _l) { } function stable_sort(cmp, l) { - let sort = function (n, l) { + let sort = (n, l) => { if (n !== 2) { if (n === 3 && l) { let match = l.tl; @@ -1002,7 +1002,7 @@ function stable_sort(cmp, l) { continue; }; }; - let rev_sort = function (n, l) { + let rev_sort = (n, l) => { if (n !== 2) { if (n === 3 && l) { let match = l.tl; @@ -1157,7 +1157,7 @@ function stable_sort(cmp, l) { } function sort_uniq(cmp, l) { - let sort = function (n, l) { + let sort = (n, l) => { if (n !== 2) { if (n === 3 && l) { let match = l.tl; @@ -1388,7 +1388,7 @@ function sort_uniq(cmp, l) { continue; }; }; - let rev_sort = function (n, l) { + let rev_sort = (n, l) => { if (n !== 2) { if (n === 3 && l) { let match = l.tl; diff --git a/lib/js/map.js b/lib/js/map.js index 62e301eb404..ce29b432ec3 100644 --- a/lib/js/map.js +++ b/lib/js/map.js @@ -3,14 +3,14 @@ let Caml_option = require("./caml_option.js"); function Make(funarg) { - let height = function (param) { + let height = (param) => { if (typeof param !== "object") { return 0; } else { return param.h; } }; - let create = function (l, x, d, r) { + let create = (l, x, d, r) => { let hl = height(l); let hr = height(r); return { @@ -22,7 +22,7 @@ function Make(funarg) { h: hl >= hr ? hl + 1 | 0 : hr + 1 | 0 }; }; - let singleton = function (x, d) { + let singleton = (x, d) => { return { TAG: "Node", l: "Empty", @@ -32,7 +32,7 @@ function Make(funarg) { h: 1 }; }; - let bal = function (l, x, d, r) { + let bal = (l, x, d, r) => { let hl; hl = typeof l !== "object" ? 0 : l.h; let hr; @@ -98,14 +98,14 @@ function Make(funarg) { } }); }; - let is_empty = function (param) { + let is_empty = (param) => { if (typeof param !== "object") { return true; } else { return false; } }; - let add = function (x, data, param) { + let add = (x, data, param) => { if (typeof param !== "object") { return { TAG: "Node", @@ -150,7 +150,7 @@ function Make(funarg) { return bal(l, v, d, rr); } }; - let find = function (x, _param) { + let find = (x, _param) => { while (true) { let param = _param; if (typeof param !== "object") { @@ -168,7 +168,7 @@ function Make(funarg) { continue; }; }; - let find_first = function (f, _param) { + let find_first = (f, _param) => { while (true) { let param = _param; if (typeof param !== "object") { @@ -208,7 +208,7 @@ function Make(funarg) { continue; }; }; - let find_first_opt = function (f, _param) { + let find_first_opt = (f, _param) => { while (true) { let param = _param; if (typeof param !== "object") { @@ -244,7 +244,7 @@ function Make(funarg) { continue; }; }; - let find_last = function (f, _param) { + let find_last = (f, _param) => { while (true) { let param = _param; if (typeof param !== "object") { @@ -284,7 +284,7 @@ function Make(funarg) { continue; }; }; - let find_last_opt = function (f, _param) { + let find_last_opt = (f, _param) => { while (true) { let param = _param; if (typeof param !== "object") { @@ -320,7 +320,7 @@ function Make(funarg) { continue; }; }; - let find_opt = function (x, _param) { + let find_opt = (x, _param) => { while (true) { let param = _param; if (typeof param !== "object") { @@ -334,7 +334,7 @@ function Make(funarg) { continue; }; }; - let mem = function (x, _param) { + let mem = (x, _param) => { while (true) { let param = _param; if (typeof param !== "object") { @@ -348,7 +348,7 @@ function Make(funarg) { continue; }; }; - let min_binding = function (_param) { + let min_binding = (_param) => { while (true) { let param = _param; if (typeof param !== "object") { @@ -369,7 +369,7 @@ function Make(funarg) { continue; }; }; - let min_binding_opt = function (_param) { + let min_binding_opt = (_param) => { while (true) { let param = _param; if (typeof param !== "object") { @@ -386,7 +386,7 @@ function Make(funarg) { continue; }; }; - let max_binding = function (_param) { + let max_binding = (_param) => { while (true) { let param = _param; if (typeof param !== "object") { @@ -407,7 +407,7 @@ function Make(funarg) { continue; }; }; - let max_binding_opt = function (_param) { + let max_binding_opt = (_param) => { while (true) { let param = _param; if (typeof param !== "object") { @@ -424,7 +424,7 @@ function Make(funarg) { continue; }; }; - let remove_min_binding = function (param) { + let remove_min_binding = (param) => { if (typeof param !== "object") { throw new Error("Invalid_argument", { cause: { @@ -440,7 +440,7 @@ function Make(funarg) { return bal(remove_min_binding(l), param.v, param.d, param.r); } }; - let merge = function (t1, t2) { + let merge = (t1, t2) => { if (typeof t1 !== "object") { return t2; } @@ -450,7 +450,7 @@ function Make(funarg) { let match = min_binding(t2); return bal(t1, match[0], match[1], remove_min_binding(t2)); }; - let remove = function (x, param) { + let remove = (x, param) => { if (typeof param !== "object") { return "Empty"; } @@ -477,7 +477,7 @@ function Make(funarg) { return bal(l, v, d, rr); } }; - let update = function (x, f, param) { + let update = (x, f, param) => { if (typeof param !== "object") { let data = f(undefined); if (data !== undefined) { @@ -532,7 +532,7 @@ function Make(funarg) { return bal(l, v, d, rr); } }; - let iter = function (f, _param) { + let iter = (f, _param) => { while (true) { let param = _param; if (typeof param !== "object") { @@ -544,7 +544,7 @@ function Make(funarg) { continue; }; }; - let map = function (f, param) { + let map = (f, param) => { if (typeof param !== "object") { return "Empty"; } @@ -560,7 +560,7 @@ function Make(funarg) { h: param.h }; }; - let mapi = function (f, param) { + let mapi = (f, param) => { if (typeof param !== "object") { return "Empty"; } @@ -577,7 +577,7 @@ function Make(funarg) { h: param.h }; }; - let fold = function (f, _m, _accu) { + let fold = (f, _m, _accu) => { while (true) { let accu = _accu; let m = _m; @@ -589,7 +589,7 @@ function Make(funarg) { continue; }; }; - let for_all = function (p, _param) { + let for_all = (p, _param) => { while (true) { let param = _param; if (typeof param !== "object") { @@ -605,7 +605,7 @@ function Make(funarg) { continue; }; }; - let exists = function (p, _param) { + let exists = (p, _param) => { while (true) { let param = _param; if (typeof param !== "object") { @@ -621,21 +621,21 @@ function Make(funarg) { continue; }; }; - let add_min_binding = function (k, x, param) { + let add_min_binding = (k, x, param) => { if (typeof param !== "object") { return singleton(k, x); } else { return bal(add_min_binding(k, x, param.l), param.v, param.d, param.r); } }; - let add_max_binding = function (k, x, param) { + let add_max_binding = (k, x, param) => { if (typeof param !== "object") { return singleton(k, x); } else { return bal(param.l, param.v, param.d, add_max_binding(k, x, param.r)); } }; - let join = function (l, v, d, r) { + let join = (l, v, d, r) => { if (typeof l !== "object") { return add_min_binding(v, d, r); } @@ -652,7 +652,7 @@ function Make(funarg) { return create(l, v, d, r); } }; - let concat = function (t1, t2) { + let concat = (t1, t2) => { if (typeof t1 !== "object") { return t2; } @@ -662,14 +662,14 @@ function Make(funarg) { let match = min_binding(t2); return join(t1, match[0], match[1], remove_min_binding(t2)); }; - let concat_or_join = function (t1, v, d, t2) { + let concat_or_join = (t1, v, d, t2) => { if (d !== undefined) { return join(t1, v, Caml_option.valFromOption(d), t2); } else { return concat(t1, t2); } }; - let split = function (x, param) { + let split = (x, param) => { if (typeof param !== "object") { return [ "Empty", @@ -704,7 +704,7 @@ function Make(funarg) { match$1[2] ]; }; - let merge$1 = function (f, s1, s2) { + let merge$1 = (f, s1, s2) => { if (typeof s1 !== "object") { if (typeof s2 !== "object") { return "Empty"; @@ -734,7 +734,7 @@ function Make(funarg) { let match$1 = split(v2, s1); return concat_or_join(merge$1(f, match$1[0], s2.l), v2, f(v2, match$1[1], Caml_option.some(s2.d)), merge$1(f, match$1[2], s2.r)); }; - let union = function (f, s1, s2) { + let union = (f, s1, s2) => { if (typeof s1 !== "object") { return s2; } @@ -766,7 +766,7 @@ function Make(funarg) { return join(l$1, v2, d2, r$1); } }; - let filter = function (p, param) { + let filter = (p, param) => { if (typeof param !== "object") { return "Empty"; } @@ -787,7 +787,7 @@ function Make(funarg) { return concat(l$p, r$p); } }; - let partition = function (p, param) { + let partition = (p, param) => { if (typeof param !== "object") { return [ "Empty", @@ -815,7 +815,7 @@ function Make(funarg) { ]; } }; - let cons_enum = function (_m, _e) { + let cons_enum = (_m, _e) => { while (true) { let e = _e; let m = _m; @@ -833,7 +833,7 @@ function Make(funarg) { continue; }; }; - let compare = function (cmp, m1, m2) { + let compare = (cmp, m1, m2) => { let _e1 = cons_enum(m1, "End"); let _e2 = cons_enum(m2, "End"); while (true) { @@ -862,7 +862,7 @@ function Make(funarg) { continue; }; }; - let equal = function (cmp, m1, m2) { + let equal = (cmp, m1, m2) => { let _e1 = cons_enum(m1, "End"); let _e2 = cons_enum(m2, "End"); while (true) { @@ -889,14 +889,14 @@ function Make(funarg) { continue; }; }; - let cardinal = function (param) { + let cardinal = (param) => { if (typeof param !== "object") { return 0; } else { return (cardinal(param.l) + 1 | 0) + cardinal(param.r) | 0; } }; - let bindings_aux = function (_accu, _param) { + let bindings_aux = (_accu, _param) => { while (true) { let param = _param; let accu = _accu; @@ -914,7 +914,7 @@ function Make(funarg) { continue; }; }; - let bindings = function (s) { + let bindings = (s) => { return bindings_aux(/* [] */0, s); }; return { diff --git a/lib/js/mapLabels.js b/lib/js/mapLabels.js index 09ef63e7159..124a6bb6653 100644 --- a/lib/js/mapLabels.js +++ b/lib/js/mapLabels.js @@ -3,14 +3,14 @@ let Caml_option = require("./caml_option.js"); function Make(Ord) { - let height = function (param) { + let height = (param) => { if (typeof param !== "object") { return 0; } else { return param.h; } }; - let create = function (l, x, d, r) { + let create = (l, x, d, r) => { let hl = height(l); let hr = height(r); return { @@ -22,7 +22,7 @@ function Make(Ord) { h: hl >= hr ? hl + 1 | 0 : hr + 1 | 0 }; }; - let singleton = function (x, d) { + let singleton = (x, d) => { return { TAG: "Node", l: "Empty", @@ -32,7 +32,7 @@ function Make(Ord) { h: 1 }; }; - let bal = function (l, x, d, r) { + let bal = (l, x, d, r) => { let hl; hl = typeof l !== "object" ? 0 : l.h; let hr; @@ -98,14 +98,14 @@ function Make(Ord) { } }); }; - let is_empty = function (param) { + let is_empty = (param) => { if (typeof param !== "object") { return true; } else { return false; } }; - let add = function (x, data, param) { + let add = (x, data, param) => { if (typeof param !== "object") { return { TAG: "Node", @@ -150,7 +150,7 @@ function Make(Ord) { return bal(l, v, d, rr); } }; - let find = function (x, _param) { + let find = (x, _param) => { while (true) { let param = _param; if (typeof param !== "object") { @@ -168,7 +168,7 @@ function Make(Ord) { continue; }; }; - let find_first_aux = function (_v0, _d0, f, _param) { + let find_first_aux = (_v0, _d0, f, _param) => { while (true) { let param = _param; let d0 = _d0; @@ -190,7 +190,7 @@ function Make(Ord) { continue; }; }; - let find_first = function (f, _param) { + let find_first = (f, _param) => { while (true) { let param = _param; if (typeof param !== "object") { @@ -208,7 +208,7 @@ function Make(Ord) { continue; }; }; - let find_first_opt_aux = function (_v0, _d0, f, _param) { + let find_first_opt_aux = (_v0, _d0, f, _param) => { while (true) { let param = _param; let d0 = _d0; @@ -230,7 +230,7 @@ function Make(Ord) { continue; }; }; - let find_first_opt = function (f, _param) { + let find_first_opt = (f, _param) => { while (true) { let param = _param; if (typeof param !== "object") { @@ -244,7 +244,7 @@ function Make(Ord) { continue; }; }; - let find_last_aux = function (_v0, _d0, f, _param) { + let find_last_aux = (_v0, _d0, f, _param) => { while (true) { let param = _param; let d0 = _d0; @@ -266,7 +266,7 @@ function Make(Ord) { continue; }; }; - let find_last = function (f, _param) { + let find_last = (f, _param) => { while (true) { let param = _param; if (typeof param !== "object") { @@ -284,7 +284,7 @@ function Make(Ord) { continue; }; }; - let find_last_opt_aux = function (_v0, _d0, f, _param) { + let find_last_opt_aux = (_v0, _d0, f, _param) => { while (true) { let param = _param; let d0 = _d0; @@ -306,7 +306,7 @@ function Make(Ord) { continue; }; }; - let find_last_opt = function (f, _param) { + let find_last_opt = (f, _param) => { while (true) { let param = _param; if (typeof param !== "object") { @@ -320,7 +320,7 @@ function Make(Ord) { continue; }; }; - let find_opt = function (x, _param) { + let find_opt = (x, _param) => { while (true) { let param = _param; if (typeof param !== "object") { @@ -334,7 +334,7 @@ function Make(Ord) { continue; }; }; - let mem = function (x, _param) { + let mem = (x, _param) => { while (true) { let param = _param; if (typeof param !== "object") { @@ -348,7 +348,7 @@ function Make(Ord) { continue; }; }; - let min_binding = function (_param) { + let min_binding = (_param) => { while (true) { let param = _param; if (typeof param !== "object") { @@ -369,7 +369,7 @@ function Make(Ord) { continue; }; }; - let min_binding_opt = function (_param) { + let min_binding_opt = (_param) => { while (true) { let param = _param; if (typeof param !== "object") { @@ -386,7 +386,7 @@ function Make(Ord) { continue; }; }; - let max_binding = function (_param) { + let max_binding = (_param) => { while (true) { let param = _param; if (typeof param !== "object") { @@ -407,7 +407,7 @@ function Make(Ord) { continue; }; }; - let max_binding_opt = function (_param) { + let max_binding_opt = (_param) => { while (true) { let param = _param; if (typeof param !== "object") { @@ -424,7 +424,7 @@ function Make(Ord) { continue; }; }; - let remove_min_binding = function (param) { + let remove_min_binding = (param) => { if (typeof param !== "object") { throw new Error("Invalid_argument", { cause: { @@ -440,7 +440,7 @@ function Make(Ord) { return bal(remove_min_binding(l), param.v, param.d, param.r); } }; - let merge = function (t1, t2) { + let merge = (t1, t2) => { if (typeof t1 !== "object") { return t2; } @@ -450,7 +450,7 @@ function Make(Ord) { let match = min_binding(t2); return bal(t1, match[0], match[1], remove_min_binding(t2)); }; - let remove = function (x, param) { + let remove = (x, param) => { if (typeof param !== "object") { return "Empty"; } @@ -477,7 +477,7 @@ function Make(Ord) { return bal(l, v, d, rr); } }; - let update = function (x, f, param) { + let update = (x, f, param) => { if (typeof param !== "object") { let data = f(undefined); if (data !== undefined) { @@ -532,7 +532,7 @@ function Make(Ord) { return bal(l, v, d, rr); } }; - let iter = function (f, _param) { + let iter = (f, _param) => { while (true) { let param = _param; if (typeof param !== "object") { @@ -544,7 +544,7 @@ function Make(Ord) { continue; }; }; - let map = function (f, param) { + let map = (f, param) => { if (typeof param !== "object") { return "Empty"; } @@ -560,7 +560,7 @@ function Make(Ord) { h: param.h }; }; - let mapi = function (f, param) { + let mapi = (f, param) => { if (typeof param !== "object") { return "Empty"; } @@ -577,7 +577,7 @@ function Make(Ord) { h: param.h }; }; - let fold = function (f, _m, _accu) { + let fold = (f, _m, _accu) => { while (true) { let accu = _accu; let m = _m; @@ -589,7 +589,7 @@ function Make(Ord) { continue; }; }; - let for_all = function (p, _param) { + let for_all = (p, _param) => { while (true) { let param = _param; if (typeof param !== "object") { @@ -605,7 +605,7 @@ function Make(Ord) { continue; }; }; - let exists = function (p, _param) { + let exists = (p, _param) => { while (true) { let param = _param; if (typeof param !== "object") { @@ -621,21 +621,21 @@ function Make(Ord) { continue; }; }; - let add_min_binding = function (k, x, param) { + let add_min_binding = (k, x, param) => { if (typeof param !== "object") { return singleton(k, x); } else { return bal(add_min_binding(k, x, param.l), param.v, param.d, param.r); } }; - let add_max_binding = function (k, x, param) { + let add_max_binding = (k, x, param) => { if (typeof param !== "object") { return singleton(k, x); } else { return bal(param.l, param.v, param.d, add_max_binding(k, x, param.r)); } }; - let join = function (l, v, d, r) { + let join = (l, v, d, r) => { if (typeof l !== "object") { return add_min_binding(v, d, r); } @@ -652,7 +652,7 @@ function Make(Ord) { return create(l, v, d, r); } }; - let concat = function (t1, t2) { + let concat = (t1, t2) => { if (typeof t1 !== "object") { return t2; } @@ -662,14 +662,14 @@ function Make(Ord) { let match = min_binding(t2); return join(t1, match[0], match[1], remove_min_binding(t2)); }; - let concat_or_join = function (t1, v, d, t2) { + let concat_or_join = (t1, v, d, t2) => { if (d !== undefined) { return join(t1, v, Caml_option.valFromOption(d), t2); } else { return concat(t1, t2); } }; - let split = function (x, param) { + let split = (x, param) => { if (typeof param !== "object") { return [ "Empty", @@ -704,7 +704,7 @@ function Make(Ord) { match$1[2] ]; }; - let merge$1 = function (f, s1, s2) { + let merge$1 = (f, s1, s2) => { if (typeof s1 !== "object") { if (typeof s2 !== "object") { return "Empty"; @@ -734,7 +734,7 @@ function Make(Ord) { let match$1 = split(v2, s1); return concat_or_join(merge$1(f, match$1[0], s2.l), v2, f(v2, match$1[1], Caml_option.some(s2.d)), merge$1(f, match$1[2], s2.r)); }; - let union = function (f, s1, s2) { + let union = (f, s1, s2) => { if (typeof s1 !== "object") { return s2; } @@ -766,7 +766,7 @@ function Make(Ord) { return join(l$1, v2, d2, r$1); } }; - let filter = function (p, param) { + let filter = (p, param) => { if (typeof param !== "object") { return "Empty"; } @@ -787,7 +787,7 @@ function Make(Ord) { return concat(l$p, r$p); } }; - let partition = function (p, param) { + let partition = (p, param) => { if (typeof param !== "object") { return [ "Empty", @@ -815,7 +815,7 @@ function Make(Ord) { ]; } }; - let cons_enum = function (_m, _e) { + let cons_enum = (_m, _e) => { while (true) { let e = _e; let m = _m; @@ -833,7 +833,7 @@ function Make(Ord) { continue; }; }; - let compare = function (cmp, m1, m2) { + let compare = (cmp, m1, m2) => { let _e1 = cons_enum(m1, "End"); let _e2 = cons_enum(m2, "End"); while (true) { @@ -862,7 +862,7 @@ function Make(Ord) { continue; }; }; - let equal = function (cmp, m1, m2) { + let equal = (cmp, m1, m2) => { let _e1 = cons_enum(m1, "End"); let _e2 = cons_enum(m2, "End"); while (true) { @@ -889,14 +889,14 @@ function Make(Ord) { continue; }; }; - let cardinal = function (param) { + let cardinal = (param) => { if (typeof param !== "object") { return 0; } else { return (cardinal(param.l) + 1 | 0) + cardinal(param.r) | 0; } }; - let bindings_aux = function (_accu, _param) { + let bindings_aux = (_accu, _param) => { while (true) { let param = _param; let accu = _accu; @@ -914,7 +914,7 @@ function Make(Ord) { continue; }; }; - let bindings = function (s) { + let bindings = (s) => { return bindings_aux(/* [] */0, s); }; return { diff --git a/lib/js/moreLabels.js b/lib/js/moreLabels.js index 0a88535c301..c04ea3476cc 100644 --- a/lib/js/moreLabels.js +++ b/lib/js/moreLabels.js @@ -32,15 +32,15 @@ let Hashtbl = { }; let $$Map = { - Make: (function (funarg) { - let height = function (param) { + Make: ((funarg) => { + let height = (param) => { if (typeof param !== "object") { return 0; } else { return param.h; } }; - let create = function (l, x, d, r) { + let create = (l, x, d, r) => { let hl = height(l); let hr = height(r); return { @@ -52,7 +52,7 @@ let $$Map = { h: hl >= hr ? hl + 1 | 0 : hr + 1 | 0 }; }; - let singleton = function (x, d) { + let singleton = (x, d) => { return { TAG: "Node", l: "Empty", @@ -62,7 +62,7 @@ let $$Map = { h: 1 }; }; - let bal = function (l, x, d, r) { + let bal = (l, x, d, r) => { let hl; hl = typeof l !== "object" ? 0 : l.h; let hr; @@ -128,14 +128,14 @@ let $$Map = { } }); }; - let is_empty = function (param) { + let is_empty = (param) => { if (typeof param !== "object") { return true; } else { return false; } }; - let add = function (x, data, param) { + let add = (x, data, param) => { if (typeof param !== "object") { return { TAG: "Node", @@ -180,7 +180,7 @@ let $$Map = { return bal(l, v, d, rr); } }; - let find = function (x, _param) { + let find = (x, _param) => { while (true) { let param = _param; if (typeof param !== "object") { @@ -198,7 +198,7 @@ let $$Map = { continue; }; }; - let find_first_aux = function (_v0, _d0, f, _param) { + let find_first_aux = (_v0, _d0, f, _param) => { while (true) { let param = _param; let d0 = _d0; @@ -220,7 +220,7 @@ let $$Map = { continue; }; }; - let find_first = function (f, _param) { + let find_first = (f, _param) => { while (true) { let param = _param; if (typeof param !== "object") { @@ -238,7 +238,7 @@ let $$Map = { continue; }; }; - let find_first_opt_aux = function (_v0, _d0, f, _param) { + let find_first_opt_aux = (_v0, _d0, f, _param) => { while (true) { let param = _param; let d0 = _d0; @@ -260,7 +260,7 @@ let $$Map = { continue; }; }; - let find_first_opt = function (f, _param) { + let find_first_opt = (f, _param) => { while (true) { let param = _param; if (typeof param !== "object") { @@ -274,7 +274,7 @@ let $$Map = { continue; }; }; - let find_last_aux = function (_v0, _d0, f, _param) { + let find_last_aux = (_v0, _d0, f, _param) => { while (true) { let param = _param; let d0 = _d0; @@ -296,7 +296,7 @@ let $$Map = { continue; }; }; - let find_last = function (f, _param) { + let find_last = (f, _param) => { while (true) { let param = _param; if (typeof param !== "object") { @@ -314,7 +314,7 @@ let $$Map = { continue; }; }; - let find_last_opt_aux = function (_v0, _d0, f, _param) { + let find_last_opt_aux = (_v0, _d0, f, _param) => { while (true) { let param = _param; let d0 = _d0; @@ -336,7 +336,7 @@ let $$Map = { continue; }; }; - let find_last_opt = function (f, _param) { + let find_last_opt = (f, _param) => { while (true) { let param = _param; if (typeof param !== "object") { @@ -350,7 +350,7 @@ let $$Map = { continue; }; }; - let find_opt = function (x, _param) { + let find_opt = (x, _param) => { while (true) { let param = _param; if (typeof param !== "object") { @@ -364,7 +364,7 @@ let $$Map = { continue; }; }; - let mem = function (x, _param) { + let mem = (x, _param) => { while (true) { let param = _param; if (typeof param !== "object") { @@ -378,7 +378,7 @@ let $$Map = { continue; }; }; - let min_binding = function (_param) { + let min_binding = (_param) => { while (true) { let param = _param; if (typeof param !== "object") { @@ -399,7 +399,7 @@ let $$Map = { continue; }; }; - let min_binding_opt = function (_param) { + let min_binding_opt = (_param) => { while (true) { let param = _param; if (typeof param !== "object") { @@ -416,7 +416,7 @@ let $$Map = { continue; }; }; - let max_binding = function (_param) { + let max_binding = (_param) => { while (true) { let param = _param; if (typeof param !== "object") { @@ -437,7 +437,7 @@ let $$Map = { continue; }; }; - let max_binding_opt = function (_param) { + let max_binding_opt = (_param) => { while (true) { let param = _param; if (typeof param !== "object") { @@ -454,7 +454,7 @@ let $$Map = { continue; }; }; - let remove_min_binding = function (param) { + let remove_min_binding = (param) => { if (typeof param !== "object") { throw new Error("Invalid_argument", { cause: { @@ -470,7 +470,7 @@ let $$Map = { return bal(remove_min_binding(l), param.v, param.d, param.r); } }; - let merge = function (t1, t2) { + let merge = (t1, t2) => { if (typeof t1 !== "object") { return t2; } @@ -480,7 +480,7 @@ let $$Map = { let match = min_binding(t2); return bal(t1, match[0], match[1], remove_min_binding(t2)); }; - let remove = function (x, param) { + let remove = (x, param) => { if (typeof param !== "object") { return "Empty"; } @@ -507,7 +507,7 @@ let $$Map = { return bal(l, v, d, rr); } }; - let update = function (x, f, param) { + let update = (x, f, param) => { if (typeof param !== "object") { let data = f(undefined); if (data !== undefined) { @@ -562,7 +562,7 @@ let $$Map = { return bal(l, v, d, rr); } }; - let iter = function (f, _param) { + let iter = (f, _param) => { while (true) { let param = _param; if (typeof param !== "object") { @@ -574,7 +574,7 @@ let $$Map = { continue; }; }; - let map = function (f, param) { + let map = (f, param) => { if (typeof param !== "object") { return "Empty"; } @@ -590,7 +590,7 @@ let $$Map = { h: param.h }; }; - let mapi = function (f, param) { + let mapi = (f, param) => { if (typeof param !== "object") { return "Empty"; } @@ -607,7 +607,7 @@ let $$Map = { h: param.h }; }; - let fold = function (f, _m, _accu) { + let fold = (f, _m, _accu) => { while (true) { let accu = _accu; let m = _m; @@ -619,7 +619,7 @@ let $$Map = { continue; }; }; - let for_all = function (p, _param) { + let for_all = (p, _param) => { while (true) { let param = _param; if (typeof param !== "object") { @@ -635,7 +635,7 @@ let $$Map = { continue; }; }; - let exists = function (p, _param) { + let exists = (p, _param) => { while (true) { let param = _param; if (typeof param !== "object") { @@ -651,21 +651,21 @@ let $$Map = { continue; }; }; - let add_min_binding = function (k, x, param) { + let add_min_binding = (k, x, param) => { if (typeof param !== "object") { return singleton(k, x); } else { return bal(add_min_binding(k, x, param.l), param.v, param.d, param.r); } }; - let add_max_binding = function (k, x, param) { + let add_max_binding = (k, x, param) => { if (typeof param !== "object") { return singleton(k, x); } else { return bal(param.l, param.v, param.d, add_max_binding(k, x, param.r)); } }; - let join = function (l, v, d, r) { + let join = (l, v, d, r) => { if (typeof l !== "object") { return add_min_binding(v, d, r); } @@ -682,7 +682,7 @@ let $$Map = { return create(l, v, d, r); } }; - let concat = function (t1, t2) { + let concat = (t1, t2) => { if (typeof t1 !== "object") { return t2; } @@ -692,14 +692,14 @@ let $$Map = { let match = min_binding(t2); return join(t1, match[0], match[1], remove_min_binding(t2)); }; - let concat_or_join = function (t1, v, d, t2) { + let concat_or_join = (t1, v, d, t2) => { if (d !== undefined) { return join(t1, v, Caml_option.valFromOption(d), t2); } else { return concat(t1, t2); } }; - let split = function (x, param) { + let split = (x, param) => { if (typeof param !== "object") { return [ "Empty", @@ -734,7 +734,7 @@ let $$Map = { match$1[2] ]; }; - let merge$1 = function (f, s1, s2) { + let merge$1 = (f, s1, s2) => { if (typeof s1 !== "object") { if (typeof s2 !== "object") { return "Empty"; @@ -764,7 +764,7 @@ let $$Map = { let match$1 = split(v2, s1); return concat_or_join(merge$1(f, match$1[0], s2.l), v2, f(v2, match$1[1], Caml_option.some(s2.d)), merge$1(f, match$1[2], s2.r)); }; - let union = function (f, s1, s2) { + let union = (f, s1, s2) => { if (typeof s1 !== "object") { return s2; } @@ -796,7 +796,7 @@ let $$Map = { return join(l$1, v2, d2, r$1); } }; - let filter = function (p, param) { + let filter = (p, param) => { if (typeof param !== "object") { return "Empty"; } @@ -817,7 +817,7 @@ let $$Map = { return concat(l$p, r$p); } }; - let partition = function (p, param) { + let partition = (p, param) => { if (typeof param !== "object") { return [ "Empty", @@ -845,7 +845,7 @@ let $$Map = { ]; } }; - let cons_enum = function (_m, _e) { + let cons_enum = (_m, _e) => { while (true) { let e = _e; let m = _m; @@ -863,7 +863,7 @@ let $$Map = { continue; }; }; - let compare = function (cmp, m1, m2) { + let compare = (cmp, m1, m2) => { let _e1 = cons_enum(m1, "End"); let _e2 = cons_enum(m2, "End"); while (true) { @@ -892,7 +892,7 @@ let $$Map = { continue; }; }; - let equal = function (cmp, m1, m2) { + let equal = (cmp, m1, m2) => { let _e1 = cons_enum(m1, "End"); let _e2 = cons_enum(m2, "End"); while (true) { @@ -919,14 +919,14 @@ let $$Map = { continue; }; }; - let cardinal = function (param) { + let cardinal = (param) => { if (typeof param !== "object") { return 0; } else { return (cardinal(param.l) + 1 | 0) + cardinal(param.r) | 0; } }; - let bindings_aux = function (_accu, _param) { + let bindings_aux = (_accu, _param) => { while (true) { let param = _param; let accu = _accu; @@ -944,7 +944,7 @@ let $$Map = { continue; }; }; - let bindings = function (s) { + let bindings = (s) => { return bindings_aux(/* [] */0, s); }; return { @@ -987,15 +987,15 @@ let $$Map = { }; let $$Set = { - Make: (function (funarg) { - let height = function (param) { + Make: ((funarg) => { + let height = (param) => { if (typeof param !== "object") { return 0; } else { return param.h; } }; - let create = function (l, v, r) { + let create = (l, v, r) => { let hl; hl = typeof l !== "object" ? 0 : l.h; let hr; @@ -1008,7 +1008,7 @@ let $$Set = { h: hl >= hr ? hl + 1 | 0 : hr + 1 | 0 }; }; - let bal = function (l, v, r) { + let bal = (l, v, r) => { let hl; hl = typeof l !== "object" ? 0 : l.h; let hr; @@ -1071,7 +1071,7 @@ let $$Set = { } }); }; - let add = function (x, param) { + let add = (x, param) => { if (typeof param !== "object") { return { TAG: "Node", @@ -1103,7 +1103,7 @@ let $$Set = { return bal(l, v, rr); } }; - let singleton = function (x) { + let singleton = (x) => { return { TAG: "Node", l: "Empty", @@ -1112,21 +1112,21 @@ let $$Set = { h: 1 }; }; - let add_min_element = function (x, param) { + let add_min_element = (x, param) => { if (typeof param !== "object") { return singleton(x); } else { return bal(add_min_element(x, param.l), param.v, param.r); } }; - let add_max_element = function (x, param) { + let add_max_element = (x, param) => { if (typeof param !== "object") { return singleton(x); } else { return bal(param.l, param.v, add_max_element(x, param.r)); } }; - let join = function (l, v, r) { + let join = (l, v, r) => { if (typeof l !== "object") { return add_min_element(v, r); } @@ -1143,7 +1143,7 @@ let $$Set = { return create(l, v, r); } }; - let min_elt = function (_param) { + let min_elt = (_param) => { while (true) { let param = _param; if (typeof param !== "object") { @@ -1161,7 +1161,7 @@ let $$Set = { continue; }; }; - let min_elt_opt = function (_param) { + let min_elt_opt = (_param) => { while (true) { let param = _param; if (typeof param !== "object") { @@ -1175,7 +1175,7 @@ let $$Set = { continue; }; }; - let max_elt = function (_param) { + let max_elt = (_param) => { while (true) { let param = _param; if (typeof param !== "object") { @@ -1193,7 +1193,7 @@ let $$Set = { continue; }; }; - let max_elt_opt = function (_param) { + let max_elt_opt = (_param) => { while (true) { let param = _param; if (typeof param !== "object") { @@ -1207,7 +1207,7 @@ let $$Set = { continue; }; }; - let remove_min_elt = function (param) { + let remove_min_elt = (param) => { if (typeof param !== "object") { throw new Error("Invalid_argument", { cause: { @@ -1223,7 +1223,7 @@ let $$Set = { return bal(remove_min_elt(l), param.v, param.r); } }; - let merge = function (t1, t2) { + let merge = (t1, t2) => { if (typeof t1 !== "object") { return t2; } else if (typeof t2 !== "object") { @@ -1232,7 +1232,7 @@ let $$Set = { return bal(t1, min_elt(t2), remove_min_elt(t2)); } }; - let concat = function (t1, t2) { + let concat = (t1, t2) => { if (typeof t1 !== "object") { return t2; } else if (typeof t2 !== "object") { @@ -1241,7 +1241,7 @@ let $$Set = { return join(t1, min_elt(t2), remove_min_elt(t2)); } }; - let split = function (x, param) { + let split = (x, param) => { if (typeof param !== "object") { return [ "Empty", @@ -1275,14 +1275,14 @@ let $$Set = { match$1[2] ]; }; - let is_empty = function (param) { + let is_empty = (param) => { if (typeof param !== "object") { return true; } else { return false; } }; - let mem = function (x, _param) { + let mem = (x, _param) => { while (true) { let param = _param; if (typeof param !== "object") { @@ -1296,7 +1296,7 @@ let $$Set = { continue; }; }; - let remove = function (x, param) { + let remove = (x, param) => { if (typeof param !== "object") { return "Empty"; } @@ -1322,7 +1322,7 @@ let $$Set = { return bal(l, v, rr); } }; - let union = function (s1, s2) { + let union = (s1, s2) => { if (typeof s1 !== "object") { return s2; } @@ -1346,7 +1346,7 @@ let $$Set = { let match$1 = split(v2, s1); return join(union(match$1[0], s2.l), v2, union(match$1[2], s2.r)); }; - let inter = function (s1, s2) { + let inter = (s1, s2) => { if (typeof s1 !== "object") { return "Empty"; } @@ -1364,7 +1364,7 @@ let $$Set = { return concat(inter(l1, l2), inter(r1, match[2])); } }; - let diff = function (s1, s2) { + let diff = (s1, s2) => { if (typeof s1 !== "object") { return "Empty"; } @@ -1382,7 +1382,7 @@ let $$Set = { return join(diff(l1, l2), v1, diff(r1, match[2])); } }; - let cons_enum = function (_s, _e) { + let cons_enum = (_s, _e) => { while (true) { let e = _e; let s = _s; @@ -1399,7 +1399,7 @@ let $$Set = { continue; }; }; - let compare_aux = function (_e1, _e2) { + let compare_aux = (_e1, _e2) => { while (true) { let e2 = _e2; let e1 = _e1; @@ -1422,13 +1422,13 @@ let $$Set = { continue; }; }; - let compare = function (s1, s2) { + let compare = (s1, s2) => { return compare_aux(cons_enum(s1, "End"), cons_enum(s2, "End")); }; - let equal = function (s1, s2) { + let equal = (s1, s2) => { return compare(s1, s2) === 0; }; - let subset = function (_s1, _s2) { + let subset = (_s1, _s2) => { while (true) { let s2 = _s2; let s1 = _s1; @@ -1478,7 +1478,7 @@ let $$Set = { continue; }; }; - let iter = function (f, _param) { + let iter = (f, _param) => { while (true) { let param = _param; if (typeof param !== "object") { @@ -1490,7 +1490,7 @@ let $$Set = { continue; }; }; - let fold = function (f, _s, _accu) { + let fold = (f, _s, _accu) => { while (true) { let accu = _accu; let s = _s; @@ -1502,7 +1502,7 @@ let $$Set = { continue; }; }; - let for_all = function (p, _param) { + let for_all = (p, _param) => { while (true) { let param = _param; if (typeof param !== "object") { @@ -1518,7 +1518,7 @@ let $$Set = { continue; }; }; - let exists = function (p, _param) { + let exists = (p, _param) => { while (true) { let param = _param; if (typeof param !== "object") { @@ -1534,7 +1534,7 @@ let $$Set = { continue; }; }; - let filter = function (p, param) { + let filter = (p, param) => { if (typeof param !== "object") { return "Empty"; } @@ -1554,7 +1554,7 @@ let $$Set = { return concat(l$p, r$p); } }; - let partition = function (p, param) { + let partition = (p, param) => { if (typeof param !== "object") { return [ "Empty", @@ -1581,14 +1581,14 @@ let $$Set = { ]; } }; - let cardinal = function (param) { + let cardinal = (param) => { if (typeof param !== "object") { return 0; } else { return (cardinal(param.l) + 1 | 0) + cardinal(param.r) | 0; } }; - let elements_aux = function (_accu, _param) { + let elements_aux = (_accu, _param) => { while (true) { let param = _param; let accu = _accu; @@ -1603,10 +1603,10 @@ let $$Set = { continue; }; }; - let elements = function (s) { + let elements = (s) => { return elements_aux(/* [] */0, s); }; - let find = function (x, _param) { + let find = (x, _param) => { while (true) { let param = _param; if (typeof param !== "object") { @@ -1625,7 +1625,7 @@ let $$Set = { continue; }; }; - let find_first_aux = function (_v0, f, _param) { + let find_first_aux = (_v0, f, _param) => { while (true) { let param = _param; let v0 = _v0; @@ -1642,7 +1642,7 @@ let $$Set = { continue; }; }; - let find_first = function (f, _param) { + let find_first = (f, _param) => { while (true) { let param = _param; if (typeof param !== "object") { @@ -1660,7 +1660,7 @@ let $$Set = { continue; }; }; - let find_first_opt_aux = function (_v0, f, _param) { + let find_first_opt_aux = (_v0, f, _param) => { while (true) { let param = _param; let v0 = _v0; @@ -1677,7 +1677,7 @@ let $$Set = { continue; }; }; - let find_first_opt = function (f, _param) { + let find_first_opt = (f, _param) => { while (true) { let param = _param; if (typeof param !== "object") { @@ -1691,7 +1691,7 @@ let $$Set = { continue; }; }; - let find_last_aux = function (_v0, f, _param) { + let find_last_aux = (_v0, f, _param) => { while (true) { let param = _param; let v0 = _v0; @@ -1708,7 +1708,7 @@ let $$Set = { continue; }; }; - let find_last = function (f, _param) { + let find_last = (f, _param) => { while (true) { let param = _param; if (typeof param !== "object") { @@ -1726,7 +1726,7 @@ let $$Set = { continue; }; }; - let find_last_opt_aux = function (_v0, f, _param) { + let find_last_opt_aux = (_v0, f, _param) => { while (true) { let param = _param; let v0 = _v0; @@ -1743,7 +1743,7 @@ let $$Set = { continue; }; }; - let find_last_opt = function (f, _param) { + let find_last_opt = (f, _param) => { while (true) { let param = _param; if (typeof param !== "object") { @@ -1757,7 +1757,7 @@ let $$Set = { continue; }; }; - let find_opt = function (x, _param) { + let find_opt = (x, _param) => { while (true) { let param = _param; if (typeof param !== "object") { @@ -1772,14 +1772,14 @@ let $$Set = { continue; }; }; - let try_join = function (l, v, r) { + let try_join = (l, v, r) => { if ((l === "Empty" || funarg.compare(max_elt(l), v) < 0) && (r === "Empty" || funarg.compare(v, min_elt(r)) < 0)) { return join(l, v, r); } else { return union(l, add(v, r)); } }; - let map = function (f, param) { + let map = (f, param) => { if (typeof param !== "object") { return "Empty"; } @@ -1795,8 +1795,8 @@ let $$Set = { return try_join(l$p, v$p, r$p); } }; - let of_sorted_list = function (l) { - let sub = function (n, l) { + let of_sorted_list = (l) => { + let sub = (n, l) => { switch (n) { case 0 : return [ @@ -1899,7 +1899,7 @@ let $$Set = { }; return sub(List.length(l), l)[0]; }; - let of_list = function (l) { + let of_list = (l) => { if (!l) { return "Empty"; } diff --git a/lib/js/parsing.js b/lib/js/parsing.js index 72a439cfa88..902226151ef 100644 --- a/lib/js/parsing.js +++ b/lib/js/parsing.js @@ -55,7 +55,7 @@ function clear_parser() { } let current_lookahead_fun = { - contents: (function (param) { + contents: ((param) => { return false; }) }; @@ -145,7 +145,7 @@ function yyparse(tables, start, lexer, lexbuf) { if (exn$1.RE_EXN_ID === YYexit) { return exn$1._1; } - current_lookahead_fun.contents = (function (tok) { + current_lookahead_fun.contents = ((tok) => { if (typeof tok !== "number") { return Caml_array.get(tables.transl_block, tok.TAG) === curr_char; } else { diff --git a/lib/js/pervasives.js b/lib/js/pervasives.js index adb37289e32..67886f01ca7 100644 --- a/lib/js/pervasives.js +++ b/lib/js/pervasives.js @@ -191,14 +191,14 @@ function print_string(prim) { } let exit_function = { - contents: (function (prim) { + contents: ((prim) => { }) }; function at_exit(f) { let g = exit_function.contents; - exit_function.contents = (function () { + exit_function.contents = (() => { f(); g(); }); diff --git a/lib/js/random.js b/lib/js/random.js index f10fd3cdde7..907bc10ce53 100644 --- a/lib/js/random.js +++ b/lib/js/random.js @@ -19,10 +19,10 @@ function assign(st1, st2) { } function full_init(s, seed) { - let combine = function (accu, x) { + let combine = (accu, x) => { return Digest.string(accu + String(x)); }; - let extract = function (d) { + let extract = (d) => { return ((Caml_string.get(d, 0) + (Caml_string.get(d, 1) << 8) | 0) + (Caml_string.get(d, 2) << 16) | 0) + (Caml_string.get(d, 3) << 24) | 0; }; let seed$1 = seed.length === 0 ? [0] : seed; diff --git a/lib/js/set.js b/lib/js/set.js index 3c6211b6693..4c1668fbf16 100644 --- a/lib/js/set.js +++ b/lib/js/set.js @@ -4,14 +4,14 @@ let List = require("./list.js"); let Caml_option = require("./caml_option.js"); function Make(funarg) { - let height = function (param) { + let height = (param) => { if (typeof param !== "object") { return 0; } else { return param.h; } }; - let create = function (l, v, r) { + let create = (l, v, r) => { let hl; hl = typeof l !== "object" ? 0 : l.h; let hr; @@ -24,7 +24,7 @@ function Make(funarg) { h: hl >= hr ? hl + 1 | 0 : hr + 1 | 0 }; }; - let bal = function (l, v, r) { + let bal = (l, v, r) => { let hl; hl = typeof l !== "object" ? 0 : l.h; let hr; @@ -87,7 +87,7 @@ function Make(funarg) { } }); }; - let add = function (x, param) { + let add = (x, param) => { if (typeof param !== "object") { return { TAG: "Node", @@ -119,7 +119,7 @@ function Make(funarg) { return bal(l, v, rr); } }; - let singleton = function (x) { + let singleton = (x) => { return { TAG: "Node", l: "Empty", @@ -128,21 +128,21 @@ function Make(funarg) { h: 1 }; }; - let add_min_element = function (x, param) { + let add_min_element = (x, param) => { if (typeof param !== "object") { return singleton(x); } else { return bal(add_min_element(x, param.l), param.v, param.r); } }; - let add_max_element = function (x, param) { + let add_max_element = (x, param) => { if (typeof param !== "object") { return singleton(x); } else { return bal(param.l, param.v, add_max_element(x, param.r)); } }; - let join = function (l, v, r) { + let join = (l, v, r) => { if (typeof l !== "object") { return add_min_element(v, r); } @@ -159,7 +159,7 @@ function Make(funarg) { return create(l, v, r); } }; - let min_elt = function (_param) { + let min_elt = (_param) => { while (true) { let param = _param; if (typeof param !== "object") { @@ -177,7 +177,7 @@ function Make(funarg) { continue; }; }; - let min_elt_opt = function (_param) { + let min_elt_opt = (_param) => { while (true) { let param = _param; if (typeof param !== "object") { @@ -191,7 +191,7 @@ function Make(funarg) { continue; }; }; - let max_elt = function (_param) { + let max_elt = (_param) => { while (true) { let param = _param; if (typeof param !== "object") { @@ -209,7 +209,7 @@ function Make(funarg) { continue; }; }; - let max_elt_opt = function (_param) { + let max_elt_opt = (_param) => { while (true) { let param = _param; if (typeof param !== "object") { @@ -223,7 +223,7 @@ function Make(funarg) { continue; }; }; - let remove_min_elt = function (param) { + let remove_min_elt = (param) => { if (typeof param !== "object") { throw new Error("Invalid_argument", { cause: { @@ -239,7 +239,7 @@ function Make(funarg) { return bal(remove_min_elt(l), param.v, param.r); } }; - let concat = function (t1, t2) { + let concat = (t1, t2) => { if (typeof t1 !== "object") { return t2; } else if (typeof t2 !== "object") { @@ -248,7 +248,7 @@ function Make(funarg) { return join(t1, min_elt(t2), remove_min_elt(t2)); } }; - let split = function (x, param) { + let split = (x, param) => { if (typeof param !== "object") { return [ "Empty", @@ -282,14 +282,14 @@ function Make(funarg) { match$1[2] ]; }; - let is_empty = function (param) { + let is_empty = (param) => { if (typeof param !== "object") { return true; } else { return false; } }; - let mem = function (x, _param) { + let mem = (x, _param) => { while (true) { let param = _param; if (typeof param !== "object") { @@ -303,7 +303,7 @@ function Make(funarg) { continue; }; }; - let remove = function (x, param) { + let remove = (x, param) => { if (typeof param !== "object") { return "Empty"; } @@ -335,7 +335,7 @@ function Make(funarg) { return bal(l, v, rr); } }; - let union = function (s1, s2) { + let union = (s1, s2) => { if (typeof s1 !== "object") { return s2; } @@ -359,7 +359,7 @@ function Make(funarg) { let match$1 = split(v2, s1); return join(union(match$1[0], s2.l), v2, union(match$1[2], s2.r)); }; - let inter = function (s1, s2) { + let inter = (s1, s2) => { if (typeof s1 !== "object") { return "Empty"; } @@ -377,7 +377,7 @@ function Make(funarg) { return concat(inter(l1, l2), inter(r1, match[2])); } }; - let diff = function (s1, s2) { + let diff = (s1, s2) => { if (typeof s1 !== "object") { return "Empty"; } @@ -395,7 +395,7 @@ function Make(funarg) { return join(diff(l1, l2), v1, diff(r1, match[2])); } }; - let cons_enum = function (_s, _e) { + let cons_enum = (_s, _e) => { while (true) { let e = _e; let s = _s; @@ -412,7 +412,7 @@ function Make(funarg) { continue; }; }; - let compare = function (s1, s2) { + let compare = (s1, s2) => { let _e1 = cons_enum(s1, "End"); let _e2 = cons_enum(s2, "End"); while (true) { @@ -437,10 +437,10 @@ function Make(funarg) { continue; }; }; - let equal = function (s1, s2) { + let equal = (s1, s2) => { return compare(s1, s2) === 0; }; - let subset = function (_s1, _s2) { + let subset = (_s1, _s2) => { while (true) { let s2 = _s2; let s1 = _s1; @@ -490,7 +490,7 @@ function Make(funarg) { continue; }; }; - let iter = function (f, _param) { + let iter = (f, _param) => { while (true) { let param = _param; if (typeof param !== "object") { @@ -502,7 +502,7 @@ function Make(funarg) { continue; }; }; - let fold = function (f, _s, _accu) { + let fold = (f, _s, _accu) => { while (true) { let accu = _accu; let s = _s; @@ -514,7 +514,7 @@ function Make(funarg) { continue; }; }; - let for_all = function (p, _param) { + let for_all = (p, _param) => { while (true) { let param = _param; if (typeof param !== "object") { @@ -530,7 +530,7 @@ function Make(funarg) { continue; }; }; - let exists = function (p, _param) { + let exists = (p, _param) => { while (true) { let param = _param; if (typeof param !== "object") { @@ -546,7 +546,7 @@ function Make(funarg) { continue; }; }; - let filter = function (p, param) { + let filter = (p, param) => { if (typeof param !== "object") { return "Empty"; } @@ -566,7 +566,7 @@ function Make(funarg) { return concat(l$p, r$p); } }; - let partition = function (p, param) { + let partition = (p, param) => { if (typeof param !== "object") { return [ "Empty", @@ -593,14 +593,14 @@ function Make(funarg) { ]; } }; - let cardinal = function (param) { + let cardinal = (param) => { if (typeof param !== "object") { return 0; } else { return (cardinal(param.l) + 1 | 0) + cardinal(param.r) | 0; } }; - let elements_aux = function (_accu, _param) { + let elements_aux = (_accu, _param) => { while (true) { let param = _param; let accu = _accu; @@ -615,10 +615,10 @@ function Make(funarg) { continue; }; }; - let elements = function (s) { + let elements = (s) => { return elements_aux(/* [] */0, s); }; - let find = function (x, _param) { + let find = (x, _param) => { while (true) { let param = _param; if (typeof param !== "object") { @@ -637,7 +637,7 @@ function Make(funarg) { continue; }; }; - let find_first = function (f, _param) { + let find_first = (f, _param) => { while (true) { let param = _param; if (typeof param !== "object") { @@ -671,7 +671,7 @@ function Make(funarg) { continue; }; }; - let find_first_opt = function (f, _param) { + let find_first_opt = (f, _param) => { while (true) { let param = _param; if (typeof param !== "object") { @@ -701,7 +701,7 @@ function Make(funarg) { continue; }; }; - let find_last = function (f, _param) { + let find_last = (f, _param) => { while (true) { let param = _param; if (typeof param !== "object") { @@ -735,7 +735,7 @@ function Make(funarg) { continue; }; }; - let find_last_opt = function (f, _param) { + let find_last_opt = (f, _param) => { while (true) { let param = _param; if (typeof param !== "object") { @@ -765,7 +765,7 @@ function Make(funarg) { continue; }; }; - let find_opt = function (x, _param) { + let find_opt = (x, _param) => { while (true) { let param = _param; if (typeof param !== "object") { @@ -780,7 +780,7 @@ function Make(funarg) { continue; }; }; - let map = function (f, param) { + let map = (f, param) => { if (typeof param !== "object") { return "Empty"; } @@ -798,7 +798,7 @@ function Make(funarg) { return union(l$p, add(v$p, r$p)); } }; - let of_list = function (l) { + let of_list = (l) => { if (!l) { return "Empty"; } @@ -822,7 +822,7 @@ function Make(funarg) { if (match$3) { if (match$3.tl) { let l$1 = List.sort_uniq(funarg.compare, l); - let sub = function (n, l) { + let sub = (n, l) => { switch (n) { case 0 : return [ diff --git a/lib/js/setLabels.js b/lib/js/setLabels.js index 737c8d4c8f4..bb9f2ad5ce0 100644 --- a/lib/js/setLabels.js +++ b/lib/js/setLabels.js @@ -4,14 +4,14 @@ let List = require("./list.js"); let Caml_option = require("./caml_option.js"); function Make(Ord) { - let height = function (param) { + let height = (param) => { if (typeof param !== "object") { return 0; } else { return param.h; } }; - let create = function (l, v, r) { + let create = (l, v, r) => { let hl; hl = typeof l !== "object" ? 0 : l.h; let hr; @@ -24,7 +24,7 @@ function Make(Ord) { h: hl >= hr ? hl + 1 | 0 : hr + 1 | 0 }; }; - let bal = function (l, v, r) { + let bal = (l, v, r) => { let hl; hl = typeof l !== "object" ? 0 : l.h; let hr; @@ -87,7 +87,7 @@ function Make(Ord) { } }); }; - let add = function (x, param) { + let add = (x, param) => { if (typeof param !== "object") { return { TAG: "Node", @@ -119,7 +119,7 @@ function Make(Ord) { return bal(l, v, rr); } }; - let singleton = function (x) { + let singleton = (x) => { return { TAG: "Node", l: "Empty", @@ -128,21 +128,21 @@ function Make(Ord) { h: 1 }; }; - let add_min_element = function (x, param) { + let add_min_element = (x, param) => { if (typeof param !== "object") { return singleton(x); } else { return bal(add_min_element(x, param.l), param.v, param.r); } }; - let add_max_element = function (x, param) { + let add_max_element = (x, param) => { if (typeof param !== "object") { return singleton(x); } else { return bal(param.l, param.v, add_max_element(x, param.r)); } }; - let join = function (l, v, r) { + let join = (l, v, r) => { if (typeof l !== "object") { return add_min_element(v, r); } @@ -159,7 +159,7 @@ function Make(Ord) { return create(l, v, r); } }; - let min_elt = function (_param) { + let min_elt = (_param) => { while (true) { let param = _param; if (typeof param !== "object") { @@ -177,7 +177,7 @@ function Make(Ord) { continue; }; }; - let min_elt_opt = function (_param) { + let min_elt_opt = (_param) => { while (true) { let param = _param; if (typeof param !== "object") { @@ -191,7 +191,7 @@ function Make(Ord) { continue; }; }; - let max_elt = function (_param) { + let max_elt = (_param) => { while (true) { let param = _param; if (typeof param !== "object") { @@ -209,7 +209,7 @@ function Make(Ord) { continue; }; }; - let max_elt_opt = function (_param) { + let max_elt_opt = (_param) => { while (true) { let param = _param; if (typeof param !== "object") { @@ -223,7 +223,7 @@ function Make(Ord) { continue; }; }; - let remove_min_elt = function (param) { + let remove_min_elt = (param) => { if (typeof param !== "object") { throw new Error("Invalid_argument", { cause: { @@ -239,7 +239,7 @@ function Make(Ord) { return bal(remove_min_elt(l), param.v, param.r); } }; - let merge = function (t1, t2) { + let merge = (t1, t2) => { if (typeof t1 !== "object") { return t2; } else if (typeof t2 !== "object") { @@ -248,7 +248,7 @@ function Make(Ord) { return bal(t1, min_elt(t2), remove_min_elt(t2)); } }; - let concat = function (t1, t2) { + let concat = (t1, t2) => { if (typeof t1 !== "object") { return t2; } else if (typeof t2 !== "object") { @@ -257,7 +257,7 @@ function Make(Ord) { return join(t1, min_elt(t2), remove_min_elt(t2)); } }; - let split = function (x, param) { + let split = (x, param) => { if (typeof param !== "object") { return [ "Empty", @@ -291,14 +291,14 @@ function Make(Ord) { match$1[2] ]; }; - let is_empty = function (param) { + let is_empty = (param) => { if (typeof param !== "object") { return true; } else { return false; } }; - let mem = function (x, _param) { + let mem = (x, _param) => { while (true) { let param = _param; if (typeof param !== "object") { @@ -312,7 +312,7 @@ function Make(Ord) { continue; }; }; - let remove = function (x, param) { + let remove = (x, param) => { if (typeof param !== "object") { return "Empty"; } @@ -338,7 +338,7 @@ function Make(Ord) { return bal(l, v, rr); } }; - let union = function (s1, s2) { + let union = (s1, s2) => { if (typeof s1 !== "object") { return s2; } @@ -362,7 +362,7 @@ function Make(Ord) { let match$1 = split(v2, s1); return join(union(match$1[0], s2.l), v2, union(match$1[2], s2.r)); }; - let inter = function (s1, s2) { + let inter = (s1, s2) => { if (typeof s1 !== "object") { return "Empty"; } @@ -380,7 +380,7 @@ function Make(Ord) { return concat(inter(l1, l2), inter(r1, match[2])); } }; - let diff = function (s1, s2) { + let diff = (s1, s2) => { if (typeof s1 !== "object") { return "Empty"; } @@ -398,7 +398,7 @@ function Make(Ord) { return join(diff(l1, l2), v1, diff(r1, match[2])); } }; - let cons_enum = function (_s, _e) { + let cons_enum = (_s, _e) => { while (true) { let e = _e; let s = _s; @@ -415,7 +415,7 @@ function Make(Ord) { continue; }; }; - let compare_aux = function (_e1, _e2) { + let compare_aux = (_e1, _e2) => { while (true) { let e2 = _e2; let e1 = _e1; @@ -438,13 +438,13 @@ function Make(Ord) { continue; }; }; - let compare = function (s1, s2) { + let compare = (s1, s2) => { return compare_aux(cons_enum(s1, "End"), cons_enum(s2, "End")); }; - let equal = function (s1, s2) { + let equal = (s1, s2) => { return compare(s1, s2) === 0; }; - let subset = function (_s1, _s2) { + let subset = (_s1, _s2) => { while (true) { let s2 = _s2; let s1 = _s1; @@ -494,7 +494,7 @@ function Make(Ord) { continue; }; }; - let iter = function (f, _param) { + let iter = (f, _param) => { while (true) { let param = _param; if (typeof param !== "object") { @@ -506,7 +506,7 @@ function Make(Ord) { continue; }; }; - let fold = function (f, _s, _accu) { + let fold = (f, _s, _accu) => { while (true) { let accu = _accu; let s = _s; @@ -518,7 +518,7 @@ function Make(Ord) { continue; }; }; - let for_all = function (p, _param) { + let for_all = (p, _param) => { while (true) { let param = _param; if (typeof param !== "object") { @@ -534,7 +534,7 @@ function Make(Ord) { continue; }; }; - let exists = function (p, _param) { + let exists = (p, _param) => { while (true) { let param = _param; if (typeof param !== "object") { @@ -550,7 +550,7 @@ function Make(Ord) { continue; }; }; - let filter = function (p, param) { + let filter = (p, param) => { if (typeof param !== "object") { return "Empty"; } @@ -570,7 +570,7 @@ function Make(Ord) { return concat(l$p, r$p); } }; - let partition = function (p, param) { + let partition = (p, param) => { if (typeof param !== "object") { return [ "Empty", @@ -597,14 +597,14 @@ function Make(Ord) { ]; } }; - let cardinal = function (param) { + let cardinal = (param) => { if (typeof param !== "object") { return 0; } else { return (cardinal(param.l) + 1 | 0) + cardinal(param.r) | 0; } }; - let elements_aux = function (_accu, _param) { + let elements_aux = (_accu, _param) => { while (true) { let param = _param; let accu = _accu; @@ -619,10 +619,10 @@ function Make(Ord) { continue; }; }; - let elements = function (s) { + let elements = (s) => { return elements_aux(/* [] */0, s); }; - let find = function (x, _param) { + let find = (x, _param) => { while (true) { let param = _param; if (typeof param !== "object") { @@ -641,7 +641,7 @@ function Make(Ord) { continue; }; }; - let find_first_aux = function (_v0, f, _param) { + let find_first_aux = (_v0, f, _param) => { while (true) { let param = _param; let v0 = _v0; @@ -658,7 +658,7 @@ function Make(Ord) { continue; }; }; - let find_first = function (f, _param) { + let find_first = (f, _param) => { while (true) { let param = _param; if (typeof param !== "object") { @@ -676,7 +676,7 @@ function Make(Ord) { continue; }; }; - let find_first_opt_aux = function (_v0, f, _param) { + let find_first_opt_aux = (_v0, f, _param) => { while (true) { let param = _param; let v0 = _v0; @@ -693,7 +693,7 @@ function Make(Ord) { continue; }; }; - let find_first_opt = function (f, _param) { + let find_first_opt = (f, _param) => { while (true) { let param = _param; if (typeof param !== "object") { @@ -707,7 +707,7 @@ function Make(Ord) { continue; }; }; - let find_last_aux = function (_v0, f, _param) { + let find_last_aux = (_v0, f, _param) => { while (true) { let param = _param; let v0 = _v0; @@ -724,7 +724,7 @@ function Make(Ord) { continue; }; }; - let find_last = function (f, _param) { + let find_last = (f, _param) => { while (true) { let param = _param; if (typeof param !== "object") { @@ -742,7 +742,7 @@ function Make(Ord) { continue; }; }; - let find_last_opt_aux = function (_v0, f, _param) { + let find_last_opt_aux = (_v0, f, _param) => { while (true) { let param = _param; let v0 = _v0; @@ -759,7 +759,7 @@ function Make(Ord) { continue; }; }; - let find_last_opt = function (f, _param) { + let find_last_opt = (f, _param) => { while (true) { let param = _param; if (typeof param !== "object") { @@ -773,7 +773,7 @@ function Make(Ord) { continue; }; }; - let find_opt = function (x, _param) { + let find_opt = (x, _param) => { while (true) { let param = _param; if (typeof param !== "object") { @@ -788,14 +788,14 @@ function Make(Ord) { continue; }; }; - let try_join = function (l, v, r) { + let try_join = (l, v, r) => { if ((l === "Empty" || Ord.compare(max_elt(l), v) < 0) && (r === "Empty" || Ord.compare(v, min_elt(r)) < 0)) { return join(l, v, r); } else { return union(l, add(v, r)); } }; - let map = function (f, param) { + let map = (f, param) => { if (typeof param !== "object") { return "Empty"; } @@ -811,8 +811,8 @@ function Make(Ord) { return try_join(l$p, v$p, r$p); } }; - let of_sorted_list = function (l) { - let sub = function (n, l) { + let of_sorted_list = (l) => { + let sub = (n, l) => { switch (n) { case 0 : return [ @@ -915,7 +915,7 @@ function Make(Ord) { }; return sub(List.length(l), l)[0]; }; - let of_list = function (l) { + let of_list = (l) => { if (!l) { return "Empty"; } diff --git a/lib/js/sort.js b/lib/js/sort.js index c48404ca4ec..4e4679faf07 100644 --- a/lib/js/sort.js +++ b/lib/js/sort.js @@ -24,7 +24,7 @@ function merge(order, l1, l2) { } function list(order, l) { - let initlist = function (param) { + let initlist = (param) => { if (!param) { return /* [] */0; } @@ -57,7 +57,7 @@ function list(order, l) { tl: initlist(match.tl) }; }; - let merge2 = function (param) { + let merge2 = (param) => { if (!param) { return param; } @@ -92,7 +92,7 @@ function swap(arr, i, j) { } function array(cmp, arr) { - let qsort = function (_lo, _hi) { + let qsort = (_lo, _hi) => { while (true) { let hi = _hi; let lo = _lo; diff --git a/lib/js/stream.js b/lib/js/stream.js index e6e3b32d274..60cce80afe7 100644 --- a/lib/js/stream.js +++ b/lib/js/stream.js @@ -254,7 +254,7 @@ function empty(s) { } function iter(f, strm) { - let do_rec = function () { + let do_rec = () => { while (true) { let a = peek(strm); if (a === undefined) { @@ -284,7 +284,7 @@ function from(f) { function of_list(l) { return { count: 0, - data: List.fold_right((function (x, l) { + data: List.fold_right(((x, l) => { return { TAG: "Scons", _0: x, @@ -298,7 +298,7 @@ function of_string(s) { let count = { contents: 0 }; - return from(function (param) { + return from((param) => { let c = count.contents; if (c < s.length) { count.contents = count.contents + 1 | 0; @@ -312,7 +312,7 @@ function of_bytes(s) { let count = { contents: 0 }; - return from(function (param) { + return from((param) => { let c = count.contents; if (c < s.length) { count.contents = count.contents + 1 | 0; @@ -356,7 +356,7 @@ function ising(i) { } function lapp(f, s) { - let f$1 = function () { + let f$1 = () => { return { TAG: "Sapp", _0: data(f()), @@ -367,7 +367,7 @@ function lapp(f, s) { count: 0, data: { TAG: "Slazy", - _0: CamlinternalLazy.from_fun(function () { + _0: CamlinternalLazy.from_fun(() => { return f$1(); }) } @@ -375,7 +375,7 @@ function lapp(f, s) { } function lcons(f, s) { - let f$1 = function () { + let f$1 = () => { return { TAG: "Scons", _0: f(), @@ -386,7 +386,7 @@ function lcons(f, s) { count: 0, data: { TAG: "Slazy", - _0: CamlinternalLazy.from_fun(function () { + _0: CamlinternalLazy.from_fun(() => { return f$1(); }) } @@ -398,7 +398,7 @@ function lsing(f) { count: 0, data: { TAG: "Slazy", - _0: CamlinternalLazy.from_fun(function () { + _0: CamlinternalLazy.from_fun(() => { return { TAG: "Scons", _0: f(), @@ -414,7 +414,7 @@ function slazy(f) { count: 0, data: { TAG: "Slazy", - _0: CamlinternalLazy.from_fun(function () { + _0: CamlinternalLazy.from_fun(() => { return data(f()); }) } diff --git a/lib/js/string.js b/lib/js/string.js index d6be0fd764c..20caecfd98f 100644 --- a/lib/js/string.js +++ b/lib/js/string.js @@ -55,7 +55,7 @@ function trim(s) { } function escaped(s) { - let needs_escape = function (_i) { + let needs_escape = (_i) => { while (true) { let i = _i; if (i >= s.length) { diff --git a/lib/js/stringLabels.js b/lib/js/stringLabels.js index d66bfccf312..20c6506e582 100644 --- a/lib/js/stringLabels.js +++ b/lib/js/stringLabels.js @@ -57,7 +57,7 @@ function trim(s) { } function escaped(s) { - let needs_escape = function (_i) { + let needs_escape = (_i) => { while (true) { let i = _i; if (i >= s.length) { From b8a721537c9f2c82fcd5a4f1e006850c10483350 Mon Sep 17 00:00:00 2001 From: Hyeseong Kim Date: Sun, 11 Aug 2024 11:22:23 +0900 Subject: [PATCH 2/8] remove unnecessary parens --- jscomp/core/js_dump.ml | 28 +++++++++++++++++----------- jscomp/test/async_inline.js | 16 ++++++++-------- jscomp/test/gpr_1692_test.js | 6 +++--- 3 files changed, 28 insertions(+), 22 deletions(-) diff --git a/jscomp/core/js_dump.ml b/jscomp/core/js_dump.ml index ac4daa087e1..73e1b3504f4 100644 --- a/jscomp/core/js_dump.ml +++ b/jscomp/core/js_dump.ml @@ -163,7 +163,7 @@ let raw_snippet_exp_simple_enough (s : string) = let exp_need_paren (e : J.expression) = match e.expression_desc with (* | Caml_uninitialized_obj _ *) - | Call ({ expression_desc = Fun _ | Raw_js_code _ }, _, _) -> true + | Call ({ expression_desc = Raw_js_code _ }, _, _) -> true | Raw_js_code { code_info = Exp _ } | Fun _ | Caml_block @@ -301,7 +301,7 @@ let rec try_optimize_curry cxt f len function_id = Curry_gen.pp_optimize_curry f len; P.paren_group f 1 (fun _ -> expression ~level:1 cxt f function_id) -and pp_function ~return_unit ~async ~is_method ?directive cxt (f : P.t) ~fn_state +and pp_function ~return_unit ~async ~is_method ~need_paren ?directive cxt (f : P.t) ~fn_state (l : Ident.t list) (b : J.block) (env : Js_fun_env.t) : cxt = match b with | [ @@ -410,7 +410,7 @@ and pp_function ~return_unit ~async ~is_method ?directive cxt (f : P.t) ~fn_stat param_body () | No_name { single_arg } -> (* see # 1692, add a paren for annoymous function for safety *) - P.cond_paren_group f (not single_arg) (fun _ -> + P.cond_paren_group f (need_paren && not single_arg) (fun _ -> P.string f (L.function_ ~async ~arrow); param_body ()) | Name_non_top x -> @@ -510,8 +510,10 @@ and expression_desc cxt ~(level : int) f x : cxt = expression ~level:0 cxt f e2) | Fun { is_method; params; body; env; return_unit; async; directive } -> (* TODO: dump for comments *) - pp_function ?directive ~is_method cxt f ~fn_state:default_fn_exp_state params body - env ~return_unit ~async + pp_function ?directive ~is_method ~return_unit ~async + ~need_paren:true + ~fn_state:default_fn_exp_state + cxt f params body env (* TODO: when [e] is [Js_raw_code] with arity print it in a more precise way @@ -544,9 +546,10 @@ and expression_desc cxt ~(level : int) f x : cxt = }; }; ] -> - pp_function ?directive ~is_method ~return_unit ~async cxt f + pp_function ?directive ~is_method ~return_unit ~async + ~need_paren:false ~fn_state:(No_name { single_arg = true }) - params body env + cxt f params body env | _ -> let el = match el with | [e] when e.expression_desc = Undefined {is_unit = true} -> @@ -947,9 +950,10 @@ and variable_declaration top cxt f (variable : J.variable_declaration) : cxt = | _ -> ( match e.expression_desc with | Fun { is_method; params; body; env; return_unit; async; directive } -> - pp_function ?directive ~is_method cxt f ~return_unit ~async + pp_function ?directive ~is_method ~return_unit ~async + ~need_paren:false ~fn_state:(if top then Name_top name else Name_non_top name) - params body env + cxt f params body env | _ -> let cxt = pp_var_assign cxt f name in let cxt = expression ~level:1 cxt f e in @@ -1157,8 +1161,10 @@ and statement_desc top cxt f (s : J.statement_desc) : cxt = match e.expression_desc with | Fun { is_method; params; body; env; return_unit; async; directive } -> let cxt = - pp_function ?directive ~return_unit ~is_method ~async cxt f ~fn_state:Is_return - params body env + pp_function ?directive ~return_unit ~is_method ~async + ~need_paren:false + ~fn_state:Is_return + cxt f params body env in semi f; cxt diff --git a/jscomp/test/async_inline.js b/jscomp/test/async_inline.js index bb5dfebc5ce..9f2c24a86b8 100644 --- a/jscomp/test/async_inline.js +++ b/jscomp/test/async_inline.js @@ -10,17 +10,17 @@ async function willBeInlined() { let inlined = willBeInlined(); function wrapSomethingAsync() { - ((async (param) => { - let test = await Promise.resolve("Test"); - console.log(test); - })(777)); + (async (param) => { + let test = await Promise.resolve("Test"); + console.log(test); + })(777); } function wrapSomethingAsync2() { - ((async () => { - let test = await Promise.resolve("Test"); - console.log(test); - })()); + (async () => { + let test = await Promise.resolve("Test"); + console.log(test); + })(); } async function doSomethingAsync(someAsyncFunction) { diff --git a/jscomp/test/gpr_1692_test.js b/jscomp/test/gpr_1692_test.js index edec96040e7..955d7585a66 100644 --- a/jscomp/test/gpr_1692_test.js +++ b/jscomp/test/gpr_1692_test.js @@ -2,8 +2,8 @@ 'use strict'; -(((f) => { - return 0; - })("")); +((f) => { + return 0; +})(""); /* Not a pure module */ From 8ebf9d63a916dc84a39b44e8736a6475877aa76b Mon Sep 17 00:00:00 2001 From: Hyeseong Kim Date: Sun, 11 Aug 2024 11:38:34 +0900 Subject: [PATCH 3/8] fix cond --- jscomp/core/js_dump.ml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/jscomp/core/js_dump.ml b/jscomp/core/js_dump.ml index 73e1b3504f4..edbb6c36c9c 100644 --- a/jscomp/core/js_dump.ml +++ b/jscomp/core/js_dump.ml @@ -408,9 +408,9 @@ and pp_function ~return_unit ~async ~is_method ~need_paren ?directive cxt (f : P return_sp f; P.string f (L.function_ ~async ~arrow); param_body () - | No_name { single_arg } -> + | No_name _ -> (* see # 1692, add a paren for annoymous function for safety *) - P.cond_paren_group f (need_paren && not single_arg) (fun _ -> + P.cond_paren_group f (need_paren) (fun _ -> P.string f (L.function_ ~async ~arrow); param_body ()) | Name_non_top x -> From 2dbc4ee662febd85b09d9f4cc97ec264f5c5e2f9 Mon Sep 17 00:00:00 2001 From: Hyeseong Kim Date: Wed, 21 Aug 2024 03:43:20 +0900 Subject: [PATCH 4/8] skip paren for arrow function with single param --- jscomp/core/js_dump.ml | 6 +- .../src/ErrorHandler.res.js | 2 +- .../typescript-react-example/src/Hooks.res.js | 10 +- .../src/ImmutableArray.res.js | 16 +-- .../src/Records.res.js | 18 +-- .../src/TestPromise.res.js | 2 +- .../src/Uncurried.res.js | 6 +- .../src/nested/Tuples.res.js | 4 +- jscomp/test/Import.js | 10 +- .../test/PartialApplicationNoRuntimeCurry.js | 2 +- jscomp/test/SafePromises.js | 6 +- jscomp/test/UncurriedAlways.js | 2 +- jscomp/test/UncurriedExternals.js | 2 +- jscomp/test/UntaggedVariants.js | 6 +- jscomp/test/a_list_test.js | 8 +- jscomp/test/a_string_test.js | 14 +- jscomp/test/and_or_tailcall_test.js | 4 +- jscomp/test/ari_regress_test.js | 8 +- jscomp/test/arith_parser.js | 22 +-- jscomp/test/arity_deopt.js | 2 +- jscomp/test/arity_infer.js | 10 +- jscomp/test/array_data_util.js | 4 +- jscomp/test/array_test.js | 38 ++--- jscomp/test/async_await.js | 2 +- jscomp/test/async_inline.js | 8 +- jscomp/test/bdd.js | 2 +- jscomp/test/belt_float_ntest.js | 12 +- jscomp/test/belt_int_ntest.js | 12 +- jscomp/test/belt_mapint_ntest.js | 4 +- jscomp/test/belt_result_alias_test.js | 4 +- jscomp/test/bench.js | 8 +- jscomp/test/bs_abstract_test.js | 2 +- jscomp/test/bs_array_test.js | 50 +++---- jscomp/test/bs_auto_uncurry.js | 8 +- jscomp/test/bs_auto_uncurry_test.js | 12 +- jscomp/test/bs_hashmap_test.js | 2 +- jscomp/test/bs_hashset_int_test.js | 2 +- jscomp/test/bs_list_test.js | 50 +++---- jscomp/test/bs_map_set_dict_test.js | 12 +- jscomp/test/bs_map_test.js | 2 +- jscomp/test/bs_mutable_set_test.js | 32 ++--- jscomp/test/bs_poly_map_test.js | 22 +-- jscomp/test/bs_poly_mutable_map_test.js | 6 +- jscomp/test/bs_poly_mutable_set_test.js | 14 +- jscomp/test/bs_poly_set_test.js | 30 ++-- jscomp/test/bs_queue_test.js | 6 +- jscomp/test/bs_set_int_test.js | 10 +- jscomp/test/bs_sort_test.js | 10 +- jscomp/test/bs_stack_test.js | 2 +- jscomp/test/buffer_test.js | 6 +- jscomp/test/caml_compare_bigint_test.js | 68 ++++----- jscomp/test/caml_compare_test.js | 4 +- jscomp/test/caml_format_test.js | 8 +- jscomp/test/chn_test.js | 2 +- jscomp/test/coercion_module_alias_test.js | 2 +- jscomp/test/complex_if_test.js | 2 +- jscomp/test/complex_test.js | 2 +- jscomp/test/complex_while_loop.js | 2 +- jscomp/test/cps_test.js | 12 +- jscomp/test/demo_pipe.js | 2 +- jscomp/test/digest_test.js | 2 +- jscomp/test/earger_curry_test.js | 8 +- jscomp/test/epsilon_test.js | 4 +- jscomp/test/event_ffi.js | 6 +- jscomp/test/ext_array_test.js | 2 +- jscomp/test/ext_bytes_test.js | 4 +- jscomp/test/ext_filename_test.js | 10 +- jscomp/test/ext_string_test.js | 16 +-- jscomp/test/extensible_variant_test.js | 6 +- jscomp/test/ffi_arity_test.js | 6 +- jscomp/test/ffi_array_test.js | 2 +- jscomp/test/flexible_array_test.js | 8 +- jscomp/test/float_of_bits_test.js | 4 +- jscomp/test/float_test.js | 6 +- jscomp/test/for_loop_test.js | 40 +++--- jscomp/test/for_side_effect_test.js | 2 +- jscomp/test/format_test.js | 6 +- jscomp/test/functors.js | 14 +- jscomp/test/genlex_test.js | 2 +- .../test/global_exception_regression_test.js | 4 +- jscomp/test/gpr_1409_test.js | 2 +- jscomp/test/gpr_1438.js | 2 +- jscomp/test/gpr_1692_test.js | 2 +- jscomp/test/gpr_1701_test.js | 2 +- jscomp/test/gpr_2608_test.js | 4 +- jscomp/test/gpr_2682_test.js | 4 +- jscomp/test/gpr_3566_test.js | 8 +- jscomp/test/gpr_4274_test.js | 6 +- jscomp/test/hash_test.js | 2 +- jscomp/test/hashtbl_test.js | 8 +- jscomp/test/import2.js | 2 +- jscomp/test/import_external.js | 2 +- jscomp/test/import_side_effect.js | 2 +- jscomp/test/import_side_effect_free.js | 2 +- jscomp/test/inline_map2_test.js | 14 +- jscomp/test/inline_regression_test.js | 2 +- jscomp/test/inner_unused.js | 2 +- jscomp/test/int32_test.js | 6 +- jscomp/test/int64_mul_div_test.js | 10 +- jscomp/test/int64_string_test.js | 2 +- jscomp/test/int64_test.js | 18 +-- jscomp/test/int_hashtbl_test.js | 6 +- jscomp/test/js_array_test.js | 132 ++++++++--------- jscomp/test/js_bool_test.js | 6 +- jscomp/test/js_date_test.js | 134 +++++++++--------- jscomp/test/js_dict_test.js | 28 ++-- jscomp/test/js_float_test.js | 86 +++++------ jscomp/test/js_global_test.js | 12 +- jscomp/test/js_int_test.js | 38 ++--- jscomp/test/js_json_test.js | 10 +- jscomp/test/js_math_test.js | 116 +++++++-------- jscomp/test/js_null_test.js | 30 ++-- jscomp/test/js_null_undefined_test.js | 62 ++++---- jscomp/test/js_obj_test.js | 4 +- jscomp/test/js_option_test.js | 60 ++++---- jscomp/test/js_re_test.js | 34 ++--- jscomp/test/js_string_test.js | 112 +++++++-------- jscomp/test/js_undefined_test.js | 30 ++-- jscomp/test/lib_js_test.js | 2 +- jscomp/test/libqueue_test.js | 2 +- jscomp/test/list_stack.js | 2 +- jscomp/test/list_test.js | 16 +-- jscomp/test/loop_regression_test.js | 2 +- jscomp/test/map_test.js | 8 +- jscomp/test/mario_game.js | 16 +-- jscomp/test/mock_mt.js | 2 +- jscomp/test/module_parameter_test.js | 4 +- jscomp/test/more_poly_variant_test.js | 2 +- jscomp/test/mt.js | 10 +- jscomp/test/mt_global.js | 6 +- jscomp/test/mutable_obj_test.js | 2 +- jscomp/test/mutable_uncurry_test.js | 20 +-- jscomp/test/obj_magic_test.js | 8 +- jscomp/test/ocaml_re_test.js | 52 +++---- jscomp/test/of_string_test.js | 6 +- jscomp/test/option_repr_test.js | 14 +- jscomp/test/pipe_send_readline.js | 2 +- jscomp/test/prepend_data_ffi.js | 12 +- jscomp/test/queue_test.js | 14 +- jscomp/test/reactTestUtils.js | 8 +- jscomp/test/reasonReact.js | 2 +- jscomp/test/reasonReactRouter.js | 6 +- jscomp/test/rec_module_test.js | 14 +- jscomp/test/recmodule.js | 6 +- jscomp/test/record_with_test.js | 2 +- jscomp/test/res_debug.js | 4 +- jscomp/test/set_gen.js | 2 +- jscomp/test/sexp.js | 32 ++--- jscomp/test/sexpm.js | 26 ++-- jscomp/test/side_effect2.js | 2 +- jscomp/test/stack_comp_test.js | 4 +- jscomp/test/stack_test.js | 2 +- jscomp/test/stream_parser_test.js | 8 +- jscomp/test/string_runtime_test.js | 8 +- jscomp/test/string_test.js | 2 +- jscomp/test/tailcall_inline_test.js | 4 +- jscomp/test/test_closure.js | 6 +- jscomp/test/test_cps.js | 4 +- jscomp/test/test_demo.js | 2 +- jscomp/test/test_for_loop.js | 16 +-- jscomp/test/test_google_closure.js | 6 +- jscomp/test/test_list.js | 2 +- jscomp/test/test_set.js | 20 +-- jscomp/test/test_while_closure.js | 2 +- jscomp/test/ticker.js | 6 +- jscomp/test/topsort_test.js | 12 +- jscomp/test/tramp_fib.js | 6 +- jscomp/test/tuple_alloc.js | 2 +- jscomp/test/typeof_test.js | 28 ++-- jscomp/test/uncurried_cast.js | 8 +- jscomp/test/unit_undefined_test.js | 2 +- jscomp/test/unsafe_ppx_test.js | 2 +- jscomp/test/variant.js | 2 +- jscomp/test/webpack_config.js | 8 +- lib/es6/arg.js | 12 +- lib/es6/belt_internalBuckets.js | 10 +- lib/es6/belt_internalSetBuckets.js | 4 +- lib/es6/caml_hash.js | 2 +- lib/es6/caml_int64.js | 2 +- lib/es6/caml_module.js | 2 +- lib/es6/caml_obj.js | 8 +- lib/es6/curry.js | 16 +-- lib/es6/digest.js | 4 +- lib/es6/filename.js | 6 +- lib/es6/genlex.js | 28 ++-- lib/es6/hashtbl.js | 14 +- lib/es6/hashtblLabels.js | 2 +- lib/es6/lexing.js | 4 +- lib/es6/map.js | 18 +-- lib/es6/mapLabels.js | 18 +-- lib/es6/moreLabels.js | 46 +++--- lib/es6/parsing.js | 4 +- lib/es6/pervasives.js | 2 +- lib/es6/random.js | 2 +- lib/es6/set.js | 22 +-- lib/es6/setLabels.js | 24 ++-- lib/es6/sort.js | 4 +- lib/es6/stream.js | 4 +- lib/es6/string.js | 2 +- lib/es6/stringLabels.js | 2 +- lib/js/arg.js | 12 +- lib/js/belt_internalBuckets.js | 10 +- lib/js/belt_internalSetBuckets.js | 4 +- lib/js/caml_hash.js | 2 +- lib/js/caml_int64.js | 2 +- lib/js/caml_module.js | 2 +- lib/js/caml_obj.js | 8 +- lib/js/curry.js | 16 +-- lib/js/digest.js | 4 +- lib/js/filename.js | 6 +- lib/js/genlex.js | 28 ++-- lib/js/hashtbl.js | 14 +- lib/js/hashtblLabels.js | 2 +- lib/js/lexing.js | 4 +- lib/js/map.js | 18 +-- lib/js/mapLabels.js | 18 +-- lib/js/moreLabels.js | 46 +++--- lib/js/parsing.js | 4 +- lib/js/pervasives.js | 2 +- lib/js/random.js | 2 +- lib/js/set.js | 22 +-- lib/js/setLabels.js | 24 ++-- lib/js/sort.js | 4 +- lib/js/stream.js | 4 +- lib/js/string.js | 2 +- lib/js/stringLabels.js | 2 +- 226 files changed, 1393 insertions(+), 1389 deletions(-) diff --git a/jscomp/core/js_dump.ml b/jscomp/core/js_dump.ml index edbb6c36c9c..6d52ef7524f 100644 --- a/jscomp/core/js_dump.ml +++ b/jscomp/core/js_dump.ml @@ -391,7 +391,11 @@ and pp_function ~return_unit ~async ~is_method ~need_paren ?directive cxt (f : P function_body ?directive ~return_unit cxt f b)) else let cxt = - P.paren_group f 1 (fun _ -> formal_parameter_list inner_cxt f l) + match l with + | [ single ] when arrow -> + Ext_pp_scope.ident inner_cxt f single + | l -> + P.paren_group f 1 (fun _ -> formal_parameter_list inner_cxt f l) in P.space f; if arrow then ( diff --git a/jscomp/gentype_tests/typescript-react-example/src/ErrorHandler.res.js b/jscomp/gentype_tests/typescript-react-example/src/ErrorHandler.res.js index b1de694a228..9b6c8d14422 100644 --- a/jscomp/gentype_tests/typescript-react-example/src/ErrorHandler.res.js +++ b/jscomp/gentype_tests/typescript-react-example/src/ErrorHandler.res.js @@ -2,7 +2,7 @@ function Make($$Error) { - let notify = (x) => { + let notify = x => { return $$Error.notification(x); }; return { diff --git a/jscomp/gentype_tests/typescript-react-example/src/Hooks.res.js b/jscomp/gentype_tests/typescript-react-example/src/Hooks.res.js index 3030cabe6ec..51644f0e304 100644 --- a/jscomp/gentype_tests/typescript-react-example/src/Hooks.res.js +++ b/jscomp/gentype_tests/typescript-react-example/src/Hooks.res.js @@ -12,8 +12,8 @@ function Hooks(Props) { let setCount = match[1]; let count = match[0]; return React.createElement("div", undefined, React.createElement("p", undefined, "Hooks example " + (vehicle.name + (" clicked " + (String(count) + " times")))), React.createElement("button", { - onClick: ((param) => { - setCount((param) => { + onClick: (param => { + setCount(param => { return count + 1 | 0; }); }) @@ -23,7 +23,7 @@ function Hooks(Props) { age: 71 }, children: null, - renderMe: ((x) => { + renderMe: (x => { return x.randomString; }) }, "child1", "child2"), React.createElement(ImportHookDefault.make, { @@ -32,7 +32,7 @@ function Hooks(Props) { age: 42 }, children: null, - renderMe: ((x) => { + renderMe: (x => { return x.randomString; }) }, "child1", "child2")); @@ -114,7 +114,7 @@ let WithRename = { }; function makeWithRef(vehicle) { - return (ref) => { + return ref => { if (ref == null) { return null; } else { diff --git a/jscomp/gentype_tests/typescript-react-example/src/ImmutableArray.res.js b/jscomp/gentype_tests/typescript-react-example/src/ImmutableArray.res.js index 1ae06e84055..dcfb5a814d2 100644 --- a/jscomp/gentype_tests/typescript-react-example/src/ImmutableArray.res.js +++ b/jscomp/gentype_tests/typescript-react-example/src/ImmutableArray.res.js @@ -51,7 +51,7 @@ let rangeBy = Belt_Array.rangeBy; let makeByU = Belt_Array.makeByU; function makeBy(c, f) { - return Belt_Array.makeBy(c, ((x) => { + return Belt_Array.makeBy(c, (x => { return f(x); })); } @@ -59,7 +59,7 @@ function makeBy(c, f) { let makeByAndShuffleU = Belt_Array.makeByAndShuffleU; function makeByAndShuffle(c, f) { - return Belt_Array.makeByAndShuffle(c, ((x) => { + return Belt_Array.makeByAndShuffle(c, (x => { return f(x); })); } @@ -91,7 +91,7 @@ function copy(a) { let forEachU = Belt_Array.forEachU; function forEach(a, f) { - Belt_Array.forEach(a, ((x) => { + Belt_Array.forEach(a, (x => { f(x); })); } @@ -99,7 +99,7 @@ function forEach(a, f) { let mapU = Belt_Array.mapU; function map(a, f) { - return Belt_Array.map(a, ((x) => { + return Belt_Array.map(a, (x => { return f(x); })); } @@ -115,7 +115,7 @@ function keepWithIndex(a, f) { let keepMapU = Belt_Array.keepMapU; function keepMap(a, f) { - return Belt_Array.keepMap(a, ((x) => { + return Belt_Array.keepMap(a, (x => { return f(x); })); } @@ -139,7 +139,7 @@ function mapWithIndex(a, f) { let partitionU = Belt_Array.partitionU; function partition(a, f) { - return Belt_Array.partition(a, ((x) => { + return Belt_Array.partition(a, (x => { return f(x); })); } @@ -171,7 +171,7 @@ function reduceReverse2(a1, a2, c, f) { let someU = Belt_Array.someU; function some(a, f) { - return Belt_Array.some(a, ((x) => { + return Belt_Array.some(a, (x => { return f(x); })); } @@ -179,7 +179,7 @@ function some(a, f) { let everyU = Belt_Array.everyU; function every(a, f) { - return Belt_Array.every(a, ((x) => { + return Belt_Array.every(a, (x => { return f(x); })); } diff --git a/jscomp/gentype_tests/typescript-react-example/src/Records.res.js b/jscomp/gentype_tests/typescript-react-example/src/Records.res.js index f8c2a10020d..df7c5e02e64 100644 --- a/jscomp/gentype_tests/typescript-react-example/src/Records.res.js +++ b/jscomp/gentype_tests/typescript-react-example/src/Records.res.js @@ -6,7 +6,7 @@ import * as Belt_Option from "rescript/lib/es6/belt_Option.js"; import * as Caml_option from "rescript/lib/es6/caml_option.js"; function computeArea(param) { - return Math.imul(Math.imul(param.x, param.y), Belt_Option.mapWithDefault(param.z, 1, ((n) => { + return Math.imul(Math.imul(param.x, param.y), Belt_Option.mapWithDefault(param.z, 1, (n => { return n; }))); } @@ -22,7 +22,7 @@ function coord2d(x, y) { let getOpt = Belt_Option.mapWithDefault; function findAddress(business) { - return Belt_Option.mapWithDefault(business.address, /* [] */0, ((a) => { + return Belt_Option.mapWithDefault(business.address, /* [] */0, (a => { return { hd: a, tl: /* [] */0 @@ -31,14 +31,14 @@ function findAddress(business) { } function findAllAddresses(businesses) { - return Belt_List.toArray(Belt_List.flatten(Belt_List.fromArray(Belt_Array.map(businesses, ((business) => { - return Belt_List.concat(Belt_Option.mapWithDefault(business.address, /* [] */0, ((a) => { + return Belt_List.toArray(Belt_List.flatten(Belt_List.fromArray(Belt_Array.map(businesses, (business => { + return Belt_List.concat(Belt_Option.mapWithDefault(business.address, /* [] */0, (a => { return { hd: a, tl: /* [] */0 }; - })), Belt_Option.mapWithDefault(business.owner, /* [] */0, ((p) => { - return Belt_Option.mapWithDefault(p.address, /* [] */0, ((a) => { + })), Belt_Option.mapWithDefault(business.owner, /* [] */0, (p => { + return Belt_Option.mapWithDefault(p.address, /* [] */0, (a => { return { hd: a, tl: /* [] */0 @@ -75,7 +75,7 @@ function getPayloadRecordPlusOne(param) { } function findAddress2(business) { - return Belt_Option.mapWithDefault(Caml_option.nullable_to_opt(business.address2), /* [] */0, ((a) => { + return Belt_Option.mapWithDefault(Caml_option.nullable_to_opt(business.address2), /* [] */0, (a => { return { hd: a, tl: /* [] */0 @@ -94,13 +94,13 @@ let someBusiness2 = { }; function computeArea3(o) { - return Math.imul(Math.imul(o.x, o.y), Belt_Option.mapWithDefault(Caml_option.nullable_to_opt(o.z), 1, ((n) => { + return Math.imul(Math.imul(o.x, o.y), Belt_Option.mapWithDefault(Caml_option.nullable_to_opt(o.z), 1, (n => { return n; }))); } function computeArea4(o) { - return Math.imul(Math.imul(o.x, o.y), Belt_Option.mapWithDefault(o.z, 1, ((n) => { + return Math.imul(Math.imul(o.x, o.y), Belt_Option.mapWithDefault(o.z, 1, (n => { return n; }))); } diff --git a/jscomp/gentype_tests/typescript-react-example/src/TestPromise.res.js b/jscomp/gentype_tests/typescript-react-example/src/TestPromise.res.js index f2235ac4978..3a1b1dacbc1 100644 --- a/jscomp/gentype_tests/typescript-react-example/src/TestPromise.res.js +++ b/jscomp/gentype_tests/typescript-react-example/src/TestPromise.res.js @@ -5,7 +5,7 @@ import * as Js_promise from "rescript/lib/es6/js_promise.js"; import * as Caml_option from "rescript/lib/es6/caml_option.js"; function convert(p) { - return Js_promise.then_(((param) => { + return Js_promise.then_((param => { return Promise.resolve({ result: param.s }); diff --git a/jscomp/gentype_tests/typescript-react-example/src/Uncurried.res.js b/jscomp/gentype_tests/typescript-react-example/src/Uncurried.res.js index 9b755baa66b..e962e18f3d9 100644 --- a/jscomp/gentype_tests/typescript-react-example/src/Uncurried.res.js +++ b/jscomp/gentype_tests/typescript-react-example/src/Uncurried.res.js @@ -38,21 +38,21 @@ function sumU(n, m) { } function sumU2(n) { - return (m) => { + return m => { console.log("sumU2 2nd arg", m, "result", n + m | 0); }; } function sumCurried(n) { console.log("sumCurried 1st arg", n); - return (m) => { + return m => { console.log("sumCurried 2nd arg", m, "result", n + m | 0); }; } function sumLblCurried(s, n) { console.log(s, "sumLblCurried 1st arg", n); - return (m) => { + return m => { console.log("sumLblCurried 2nd arg", m, "result", n + m | 0); }; } diff --git a/jscomp/gentype_tests/typescript-react-example/src/nested/Tuples.res.js b/jscomp/gentype_tests/typescript-react-example/src/nested/Tuples.res.js index 558398f2338..0beaac87fec 100644 --- a/jscomp/gentype_tests/typescript-react-example/src/nested/Tuples.res.js +++ b/jscomp/gentype_tests/typescript-react-example/src/nested/Tuples.res.js @@ -7,13 +7,13 @@ function testTuple(param) { } function computeArea(param) { - return Math.imul(Math.imul(param[0], param[1]), Belt_Option.mapWithDefault(param[2], 1, ((n) => { + return Math.imul(Math.imul(param[0], param[1]), Belt_Option.mapWithDefault(param[2], 1, (n => { return n; }))); } function computeAreaWithIdent(param) { - return Math.imul(Math.imul(param[0], param[1]), Belt_Option.mapWithDefault(param[2], 1, ((n) => { + return Math.imul(Math.imul(param[0], param[1]), Belt_Option.mapWithDefault(param[2], 1, (n => { return n; }))); } diff --git a/jscomp/test/Import.js b/jscomp/test/Import.js index faa1c1f76e2..7b250960b08 100644 --- a/jscomp/test/Import.js +++ b/jscomp/test/Import.js @@ -3,15 +3,15 @@ async function eachIntAsync(list, f) { - return (await import("../../lib/js/belt_List.js").then((m) => { + return (await import("../../lib/js/belt_List.js").then(m => { return m.forEach; }))(list, f); } function eachIntLazy(list, f) { - return import("../../lib/js/belt_List.js").then((m) => { + return import("../../lib/js/belt_List.js").then(m => { return m.forEach; - }).then((each) => { + }).then(each => { return Promise.resolve(each(list, f)); }); } @@ -25,7 +25,7 @@ eachIntLazy({ tl: /* [] */0 } } -}, ((n) => { +}, (n => { console.log("lazy", n); })); @@ -38,7 +38,7 @@ eachIntAsync({ tl: /* [] */0 } } -}, ((n) => { +}, (n => { console.log("async", n); })); diff --git a/jscomp/test/PartialApplicationNoRuntimeCurry.js b/jscomp/test/PartialApplicationNoRuntimeCurry.js index 3c4714cf850..385f6cc36a5 100644 --- a/jscomp/test/PartialApplicationNoRuntimeCurry.js +++ b/jscomp/test/PartialApplicationNoRuntimeCurry.js @@ -10,7 +10,7 @@ function add(x) { function f(u) { let f$1 = add(u); - return (extra) => { + return extra => { return f$1(1, extra); }; } diff --git a/jscomp/test/SafePromises.js b/jscomp/test/SafePromises.js index 34f367fd3be..d97fb8ef1de 100644 --- a/jscomp/test/SafePromises.js +++ b/jscomp/test/SafePromises.js @@ -5,14 +5,14 @@ let Js_promise2 = require("../../lib/js/js_promise2.js"); async function nestedPromise(xxx) { let xx = await xxx; - Js_promise2.then(xx, ((x) => { + Js_promise2.then(xx, (x => { return Promise.resolve((console.log("Promise2.then", x), undefined)); })); - Js_promise2.$$catch(xx, ((x) => { + Js_promise2.$$catch(xx, (x => { console.log("Promise2.catch_", x); return Promise.resolve(0); })); - xx.then((x) => { + xx.then(x => { return Promise.resolve((console.log("Promise.then_", x), undefined)); }); } diff --git a/jscomp/test/UncurriedAlways.js b/jscomp/test/UncurriedAlways.js index ba7494c036b..9ea002f7c7d 100644 --- a/jscomp/test/UncurriedAlways.js +++ b/jscomp/test/UncurriedAlways.js @@ -20,7 +20,7 @@ let a = 7; console.log(a); -[1].map((x) => { +[1].map(x => { return x + 1 | 0; }); diff --git a/jscomp/test/UncurriedExternals.js b/jscomp/test/UncurriedExternals.js index 08690cf9fdc..9ffb5d3d0cf 100644 --- a/jscomp/test/UncurriedExternals.js +++ b/jscomp/test/UncurriedExternals.js @@ -75,7 +75,7 @@ let StandardNotation = { function methodWithAsync() { let $$this = this ; - return async (arg) => { + return async arg => { return $$this + arg | 0; }; } diff --git a/jscomp/test/UntaggedVariants.js b/jscomp/test/UntaggedVariants.js index 8e4a84da8f9..0435531e4b0 100644 --- a/jscomp/test/UntaggedVariants.js +++ b/jscomp/test/UntaggedVariants.js @@ -367,7 +367,7 @@ function classify$9(v) { } } -let ff = ((x) => { +let ff = (x => { return x + 1 | 0; }); @@ -488,7 +488,7 @@ async function classify$10(a) { return; } else { if (Array.isArray(a)) { - console.log(Belt_Array.joinWith(a, "-", ((x) => { + console.log(Belt_Array.joinWith(a, "-", (x => { return x; }))); return; @@ -514,7 +514,7 @@ let Arr = { async function classifyAll(t) { if (Array.isArray(t)) { - console.log(Belt_Array.joinWith(t, "-", ((x) => { + console.log(Belt_Array.joinWith(t, "-", (x => { return x; }))); return; diff --git a/jscomp/test/a_list_test.js b/jscomp/test/a_list_test.js index 828ed1b3fbe..678e8e54e8d 100644 --- a/jscomp/test/a_list_test.js +++ b/jscomp/test/a_list_test.js @@ -6,7 +6,7 @@ let Ext_list_test = require("./ext_list_test.js"); let suites_0 = [ "drop", - ((param) => { + (param => { return { TAG: "Eq", _0: Ext_list_test.drop(3, { @@ -27,7 +27,7 @@ let suites_0 = [ let suites_1 = { hd: [ "drop1", - ((param) => { + (param => { return { TAG: "Eq", _0: Ext_list_test.drop(2, { @@ -50,7 +50,7 @@ let suites_1 = { tl: { hd: [ "flat_map", - ((param) => { + (param => { return { TAG: "Eq", _0: { @@ -69,7 +69,7 @@ let suites_1 = { } } }, - _1: Ext_list_test.flat_map(((x) => { + _1: Ext_list_test.flat_map((x => { if (x % 2 === 0) { return { hd: 0, diff --git a/jscomp/test/a_string_test.js b/jscomp/test/a_string_test.js index df1050ab0ba..0be90ebc3b0 100644 --- a/jscomp/test/a_string_test.js +++ b/jscomp/test/a_string_test.js @@ -7,7 +7,7 @@ let Ext_string_test = require("./ext_string_test.js"); let suites_0 = [ "split", - ((param) => { + (param => { return { TAG: "Eq", _0: Ext_string_test.split(true, "hihi", /* 'i' */105), @@ -28,7 +28,7 @@ let suites_0 = [ let suites_1 = { hd: [ "split_non_empty", - ((param) => { + (param => { return { TAG: "Eq", _0: Ext_string_test.split(undefined, "hihi", /* 'i' */105), @@ -45,7 +45,7 @@ let suites_1 = { tl: { hd: [ "split_empty", - ((param) => { + (param => { return { TAG: "Eq", _0: Ext_string_test.split(true, "", /* 'i' */105), @@ -56,7 +56,7 @@ let suites_1 = { tl: { hd: [ "split_normal", - ((param) => { + (param => { return { TAG: "Eq", _0: Ext_string_test.split(true, "h i i", /* ' ' */32), @@ -76,12 +76,12 @@ let suites_1 = { tl: { hd: [ "split_by", - ((param) => { + (param => { return { TAG: "Eq", - _0: List.filter(((s) => { + _0: List.filter((s => { return s !== ""; - }), Ext_string_test.split_by(undefined, ((x) => { + }), Ext_string_test.split_by(undefined, (x => { if (x === /* ' ' */32) { return true; } else { diff --git a/jscomp/test/and_or_tailcall_test.js b/jscomp/test/and_or_tailcall_test.js index db5b1b206bf..db53a2bc3a2 100644 --- a/jscomp/test/and_or_tailcall_test.js +++ b/jscomp/test/and_or_tailcall_test.js @@ -33,7 +33,7 @@ function or_f(b, x, _n) { let suites_0 = [ "and_tail", - ((param) => { + (param => { return { TAG: "Eq", _0: false, @@ -45,7 +45,7 @@ let suites_0 = [ let suites_1 = { hd: [ "or_tail", - ((param) => { + (param => { return { TAG: "Eq", _0: false, diff --git a/jscomp/test/ari_regress_test.js b/jscomp/test/ari_regress_test.js index 5ad31ea9651..a0a8de3331b 100644 --- a/jscomp/test/ari_regress_test.js +++ b/jscomp/test/ari_regress_test.js @@ -27,7 +27,7 @@ function v(__x) { let suites_0 = [ "curry", - ((param) => { + (param => { return { TAG: "Eq", _0: g, @@ -39,7 +39,7 @@ let suites_0 = [ let suites_1 = { hd: [ "curry2", - ((param) => { + (param => { return { TAG: "Eq", _0: 14, @@ -50,7 +50,7 @@ let suites_1 = { tl: { hd: [ "curry3", - ((param) => { + (param => { return { TAG: "Eq", _0: x, @@ -61,7 +61,7 @@ let suites_1 = { tl: { hd: [ "File \"ari_regress_test.res\", line 35, characters 5-12", - ((param) => { + (param => { return { TAG: "Eq", _0: h.contents, diff --git a/jscomp/test/arith_parser.js b/jscomp/test/arith_parser.js index 479635866bf..7da412c6d77 100644 --- a/jscomp/test/arith_parser.js +++ b/jscomp/test/arith_parser.js @@ -139,7 +139,7 @@ let yynames_block = "\ "; let yyact = [ - ((param) => { + (param => { throw new Error("Failure", { cause: { RE_EXN_ID: "Failure", @@ -147,24 +147,24 @@ let yyact = [ } }); }), - ((__caml_parser_env) => { + (__caml_parser_env => { return Parsing.peek_val(__caml_parser_env, 1); }), - ((__caml_parser_env) => { + (__caml_parser_env => { let _1 = Parsing.peek_val(__caml_parser_env, 0); return { TAG: "Numeral", _0: _1 }; }), - ((__caml_parser_env) => { + (__caml_parser_env => { let _1 = Parsing.peek_val(__caml_parser_env, 0); return { TAG: "Variable", _0: _1 }; }), - ((__caml_parser_env) => { + (__caml_parser_env => { let _1 = Parsing.peek_val(__caml_parser_env, 2); let _3 = Parsing.peek_val(__caml_parser_env, 0); return { @@ -173,7 +173,7 @@ let yyact = [ _1: _3 }; }), - ((__caml_parser_env) => { + (__caml_parser_env => { let _1 = Parsing.peek_val(__caml_parser_env, 2); let _3 = Parsing.peek_val(__caml_parser_env, 0); return { @@ -182,7 +182,7 @@ let yyact = [ _1: _3 }; }), - ((__caml_parser_env) => { + (__caml_parser_env => { let _1 = Parsing.peek_val(__caml_parser_env, 2); let _3 = Parsing.peek_val(__caml_parser_env, 0); return { @@ -191,7 +191,7 @@ let yyact = [ _1: _3 }; }), - ((__caml_parser_env) => { + (__caml_parser_env => { let _1 = Parsing.peek_val(__caml_parser_env, 2); let _3 = Parsing.peek_val(__caml_parser_env, 0); return { @@ -200,17 +200,17 @@ let yyact = [ _1: _3 }; }), - ((__caml_parser_env) => { + (__caml_parser_env => { let _2 = Parsing.peek_val(__caml_parser_env, 0); return { TAG: "Negate", _0: _2 }; }), - ((__caml_parser_env) => { + (__caml_parser_env => { return Parsing.peek_val(__caml_parser_env, 1); }), - ((__caml_parser_env) => { + (__caml_parser_env => { throw new Error(Parsing.YYexit, { cause: { RE_EXN_ID: Parsing.YYexit, diff --git a/jscomp/test/arity_deopt.js b/jscomp/test/arity_deopt.js index d326e8484bc..cedaca47b5a 100644 --- a/jscomp/test/arity_deopt.js +++ b/jscomp/test/arity_deopt.js @@ -39,7 +39,7 @@ function f1(x) { } function f2(x, y) { - return (z) => { + return z => { return (x + y | 0) + z | 0; }; } diff --git a/jscomp/test/arity_infer.js b/jscomp/test/arity_infer.js index db7b502df43..58055009250 100644 --- a/jscomp/test/arity_infer.js +++ b/jscomp/test/arity_infer.js @@ -5,7 +5,7 @@ function f0(x) { let tmp; if (x > 3) { - tmp = ((x) => { + tmp = (x => { return x + 1 | 0; }); } else { @@ -31,22 +31,22 @@ function f3(x) { let tmp; switch (x) { case 0 : - tmp = ((x) => { + tmp = (x => { return x + 1 | 0; }); break; case 1 : - tmp = ((x) => { + tmp = (x => { return x + 2 | 0; }); break; case 2 : - tmp = ((x) => { + tmp = (x => { return x + 3 | 0; }); break; case 3 : - tmp = ((x) => { + tmp = (x => { return x + 4 | 0; }); break; diff --git a/jscomp/test/array_data_util.js b/jscomp/test/array_data_util.js index 88f49228459..8fb5c1bcdb3 100644 --- a/jscomp/test/array_data_util.js +++ b/jscomp/test/array_data_util.js @@ -4,13 +4,13 @@ let Belt_Array = require("../../lib/js/belt_Array.js"); function range(i, j) { - return Belt_Array.makeBy((j - i | 0) + 1 | 0, ((k) => { + return Belt_Array.makeBy((j - i | 0) + 1 | 0, (k => { return k + i | 0; })); } function randomRange(i, j) { - let v = Belt_Array.makeBy((j - i | 0) + 1 | 0, ((k) => { + let v = Belt_Array.makeBy((j - i | 0) + 1 | 0, (k => { return k + i | 0; })); Belt_Array.shuffleInPlace(v); diff --git a/jscomp/test/array_test.js b/jscomp/test/array_test.js index e1506bdbfd3..11076a9d069 100644 --- a/jscomp/test/array_test.js +++ b/jscomp/test/array_test.js @@ -58,10 +58,10 @@ function is_sorted(x) { let array_suites_0 = [ "init", - ((param) => { + (param => { return { TAG: "Eq", - _0: $$Array.init(5, ((x) => { + _0: $$Array.init(5, (x => { return x; })), _1: [ @@ -78,8 +78,8 @@ let array_suites_0 = [ let array_suites_1 = { hd: [ "toList", - ((param) => { - let aux = (xs) => { + (param => { + let aux = xs => { return List.fold_left(((acc, param) => { return { hd: [ @@ -107,7 +107,7 @@ let array_suites_1 = { tl: { hd: [ "concat", - ((param) => { + (param => { return { TAG: "Eq", _0: [ @@ -144,7 +144,7 @@ let array_suites_1 = { tl: { hd: [ "make", - ((param) => { + (param => { return { TAG: "Eq", _0: [ @@ -152,10 +152,10 @@ let array_suites_1 = { Caml_array.make_float(100) ], _1: [ - $$Array.init(100, ((param) => { + $$Array.init(100, (param => { return /* 'a' */97; })), - $$Array.init(100, ((param) => { + $$Array.init(100, (param => { return 0; })) ] @@ -165,7 +165,7 @@ let array_suites_1 = { tl: { hd: [ "sub", - ((param) => { + (param => { return { TAG: "Eq", _0: $$Array.sub([ @@ -185,13 +185,13 @@ let array_suites_1 = { tl: { hd: [ "blit", - ((param) => { + (param => { let u = [ 100, 0, 0 ]; - let v = $$Array.init(3, ((x) => { + let v = $$Array.init(3, (x => { return (x << 1); })); $$Array.blit(v, 1, u, 1, 2); @@ -219,8 +219,8 @@ let array_suites_1 = { tl: { hd: [ "File \"array_test.res\", line 75, characters 8-15", - ((param) => { - let a0 = $$Array.init(100, ((i) => { + (param => { + let a0 = $$Array.init(100, (i => { return (i << 0); })); $$Array.blit(a0, 10, a0, 5, 20); @@ -261,8 +261,8 @@ let array_suites_1 = { tl: { hd: [ "File \"array_test.res\", line 118, characters 8-15", - ((param) => { - let a0 = $$Array.init(100, ((i) => { + (param => { + let a0 = $$Array.init(100, (i => { return (i << 0); })); $$Array.blit(a0, 5, a0, 10, 20); @@ -305,7 +305,7 @@ let array_suites_1 = { tl: { hd: [ "make", - ((param) => { + (param => { return { TAG: "Eq", _0: Caml_array.make(2, 1), @@ -319,7 +319,7 @@ let array_suites_1 = { tl: { hd: [ "sort", - ((param) => { + (param => { let u = [ 3, 0, @@ -340,8 +340,8 @@ let array_suites_1 = { tl: { hd: [ "sort_large", - ((param) => { - let v = $$Array.init(4, ((i) => { + (param => { + let v = $$Array.init(4, (i => { return i % 17; })); $$Array.sort(Caml.int_compare, v); diff --git a/jscomp/test/async_await.js b/jscomp/test/async_await.js index 7fad4a84168..748bb18cc85 100644 --- a/jscomp/test/async_await.js +++ b/jscomp/test/async_await.js @@ -12,7 +12,7 @@ async function useNext() { } function Make(I) { - let get = async (key) => { + let get = async key => { return await I.get(key); }; return { diff --git a/jscomp/test/async_inline.js b/jscomp/test/async_inline.js index 9f2c24a86b8..c45d110ef9d 100644 --- a/jscomp/test/async_inline.js +++ b/jscomp/test/async_inline.js @@ -10,7 +10,7 @@ async function willBeInlined() { let inlined = willBeInlined(); function wrapSomethingAsync() { - (async (param) => { + (async param => { let test = await Promise.resolve("Test"); console.log(test); })(777); @@ -64,19 +64,19 @@ let tui = 3; let tuia = uncurriedIdAsync(3); function nested1() { - return async (y) => { + return async y => { return await y; }; } async function nested2() { - return async (y) => { + return async y => { return await y; }; } function onSubmit() { - return React.useCallback(async (b) => { + return React.useCallback(async b => { return await b; }); } diff --git a/jscomp/test/bdd.js b/jscomp/test/bdd.js index 8fd5e52ed8c..a7b4f929b54 100644 --- a/jscomp/test/bdd.js +++ b/jscomp/test/bdd.js @@ -58,7 +58,7 @@ function resize(newSize) { let arr = htab.contents; let newSz_1 = newSize - 1 | 0; let newArr = Caml_array.make(newSize, /* [] */0); - let copyBucket = (_bucket) => { + let copyBucket = _bucket => { while (true) { let bucket = _bucket; if (!bucket) { diff --git a/jscomp/test/belt_float_ntest.js b/jscomp/test/belt_float_ntest.js index 5513ffad546..e81041b9184 100644 --- a/jscomp/test/belt_float_ntest.js +++ b/jscomp/test/belt_float_ntest.js @@ -9,12 +9,12 @@ function eq(loc, a, b) { Nodeassert.strictEqual(a, b, loc); } -Nodetest.describe("Belt.Float", (function () { - Nodetest.test("fromInt", (function () { +Nodetest.describe("Belt.Float", (() => { + Nodetest.test("fromInt", (() => { eq("File \"belt_float_ntest.res\", line 9, characters 7-14", 1, 1.0); eq("File \"belt_float_ntest.res\", line 10, characters 7-14", -1, -1.0); })); - Nodetest.test("toInt", (function () { + Nodetest.test("toInt", (() => { eq("File \"belt_float_ntest.res\", line 14, characters 7-14", 1, 1); eq("File \"belt_float_ntest.res\", line 15, characters 7-14", 1, 1); eq("File \"belt_float_ntest.res\", line 16, characters 7-14", 1, 1); @@ -22,7 +22,7 @@ Nodetest.describe("Belt.Float", (function () { eq("File \"belt_float_ntest.res\", line 18, characters 7-14", -1, -1); eq("File \"belt_float_ntest.res\", line 19, characters 7-14", -1, -1); })); - Nodetest.test("fromString", (function () { + Nodetest.test("fromString", (() => { eq("File \"belt_float_ntest.res\", line 23, characters 7-14", Belt_Float.fromString("1"), 1.0); eq("File \"belt_float_ntest.res\", line 24, characters 7-14", Belt_Float.fromString("-1"), -1.0); eq("File \"belt_float_ntest.res\", line 25, characters 7-14", Belt_Float.fromString("1.7"), 1.7); @@ -31,12 +31,12 @@ Nodetest.describe("Belt.Float", (function () { eq("File \"belt_float_ntest.res\", line 28, characters 7-14", Belt_Float.fromString("-1.7"), -1.7); eq("File \"belt_float_ntest.res\", line 29, characters 7-14", Belt_Float.fromString("not a float"), undefined); })); - Nodetest.test("toString", (function () { + Nodetest.test("toString", (() => { eq("File \"belt_float_ntest.res\", line 33, characters 7-14", String(1.0), "1"); eq("File \"belt_float_ntest.res\", line 34, characters 7-14", String(-1.0), "-1"); eq("File \"belt_float_ntest.res\", line 35, characters 7-14", String(-1.5), "-1.5"); })); - Nodetest.test("operators", (function () { + Nodetest.test("operators", (() => { eq("File \"belt_float_ntest.res\", line 40, characters 7-14", 2.0 + 3.0, 5.0); eq("File \"belt_float_ntest.res\", line 41, characters 7-14", 2.0 - 3.0, -1.0); eq("File \"belt_float_ntest.res\", line 42, characters 7-14", 2.0 * 3.0, 6.0); diff --git a/jscomp/test/belt_int_ntest.js b/jscomp/test/belt_int_ntest.js index 664dfa5947f..1448cf0ee9c 100644 --- a/jscomp/test/belt_int_ntest.js +++ b/jscomp/test/belt_int_ntest.js @@ -9,12 +9,12 @@ function eq(loc, a, b) { Nodeassert.strictEqual(a, b, loc); } -Nodetest.describe("Belt.Int", (function () { - Nodetest.test("toFloat", (function () { +Nodetest.describe("Belt.Int", (() => { + Nodetest.test("toFloat", (() => { eq("File \"belt_int_ntest.res\", line 9, characters 7-14", 1, 1.0); eq("File \"belt_int_ntest.res\", line 10, characters 7-14", -1, -1.0); })); - Nodetest.test("fromFloat", (function () { + Nodetest.test("fromFloat", (() => { eq("File \"belt_int_ntest.res\", line 14, characters 7-14", 1, 1); eq("File \"belt_int_ntest.res\", line 15, characters 7-14", 1, 1); eq("File \"belt_int_ntest.res\", line 16, characters 7-14", 1, 1); @@ -22,7 +22,7 @@ Nodetest.describe("Belt.Int", (function () { eq("File \"belt_int_ntest.res\", line 18, characters 7-14", -1, -1); eq("File \"belt_int_ntest.res\", line 19, characters 7-14", -1, -1); })); - Nodetest.test("fromString", (function () { + Nodetest.test("fromString", (() => { eq("File \"belt_int_ntest.res\", line 23, characters 7-14", Belt_Int.fromString("1"), 1); eq("File \"belt_int_ntest.res\", line 24, characters 7-14", Belt_Int.fromString("-1"), -1); eq("File \"belt_int_ntest.res\", line 25, characters 7-14", Belt_Int.fromString("1.7"), 1); @@ -31,11 +31,11 @@ Nodetest.describe("Belt.Int", (function () { eq("File \"belt_int_ntest.res\", line 28, characters 7-14", Belt_Int.fromString("-1.7"), -1); eq("File \"belt_int_ntest.res\", line 29, characters 7-14", Belt_Int.fromString("not an int"), undefined); })); - Nodetest.test("toString", (function () { + Nodetest.test("toString", (() => { eq("File \"belt_int_ntest.res\", line 33, characters 7-14", String(1), "1"); eq("File \"belt_int_ntest.res\", line 34, characters 7-14", String(-1), "-1"); })); - Nodetest.test("operators", (function () { + Nodetest.test("operators", (() => { eq("File \"belt_int_ntest.res\", line 40, characters 7-14", 5, 5); eq("File \"belt_int_ntest.res\", line 41, characters 7-14", -1, -1); eq("File \"belt_int_ntest.res\", line 42, characters 7-14", 6, 6); diff --git a/jscomp/test/belt_mapint_ntest.js b/jscomp/test/belt_mapint_ntest.js index f5402de1f10..bc6c8b9fd75 100644 --- a/jscomp/test/belt_mapint_ntest.js +++ b/jscomp/test/belt_mapint_ntest.js @@ -9,8 +9,8 @@ function ok(loc, a) { Nodeassert.ok(a, loc); } -Nodetest.describe("Belt.Map.Int", (function () { - Nodetest.test("set", (function () { +Nodetest.describe("Belt.Map.Int", (() => { + Nodetest.test("set", (() => { let m; for (let i = 0; i <= 999999; ++i) { m = Belt_MapInt.set(m, i, i); diff --git a/jscomp/test/belt_result_alias_test.js b/jscomp/test/belt_result_alias_test.js index db2c05e7a60..d8bd1771cf1 100644 --- a/jscomp/test/belt_result_alias_test.js +++ b/jscomp/test/belt_result_alias_test.js @@ -6,14 +6,14 @@ let Belt_Result = require("../../lib/js/belt_Result.js"); Belt_Result.map({ TAG: "Ok", _0: "Test" -}, ((r) => { +}, (r => { return "Value: " + r; })); Belt_Result.getWithDefault(Belt_Result.map({ TAG: "Error", _0: "error" -}, ((r) => { +}, (r => { return "Value: " + r; })), "success"); diff --git a/jscomp/test/bench.js b/jscomp/test/bench.js index 4d573c95bfe..facbe613f44 100644 --- a/jscomp/test/bench.js +++ b/jscomp/test/bench.js @@ -5,7 +5,7 @@ let Caml_array = require("../../lib/js/caml_array.js"); let Pervasives = require("../../lib/js/pervasives.js"); function map(f, a) { - let f$1 = (x) => { + let f$1 = x => { return f(x); }; let l = a.length; @@ -20,7 +20,7 @@ function map(f, a) { } function init(l, f) { - let f$1 = (x) => { + let f$1 = x => { return f(x); }; if (l === 0) { @@ -53,10 +53,10 @@ function fold_left(f, x, a) { } function f2() { - let arr = init(3000000, ((i) => { + let arr = init(3000000, (i => { return i; })); - let b = map(((i) => { + let b = map((i => { return i + i - 1; }), arr); let v = fold_left(((prim0, prim1) => { diff --git a/jscomp/test/bs_abstract_test.js b/jscomp/test/bs_abstract_test.js index ddd0f78a1fd..4b9a341ad9e 100644 --- a/jscomp/test/bs_abstract_test.js +++ b/jscomp/test/bs_abstract_test.js @@ -21,7 +21,7 @@ function uf(u) { } function uf1(u) { - return (extra) => { + return extra => { return u.y1(1, extra); }; } diff --git a/jscomp/test/bs_array_test.js b/jscomp/test/bs_array_test.js index e91410a8f51..7ed476ea94b 100644 --- a/jscomp/test/bs_array_test.js +++ b/jscomp/test/bs_array_test.js @@ -53,7 +53,7 @@ console.log([ 2, 3, 4 -].filter((x) => { +].filter(x => { return x > 2; }).map((x, i) => { return x + i | 0; @@ -186,7 +186,7 @@ function add(x, y) { return x + y | 0; } -let v$5 = Belt_Array.makeBy(3000, ((i) => { +let v$5 = Belt_Array.makeBy(3000, (i => { return i; })); @@ -300,11 +300,11 @@ function makeMatrixExn(sx, sy, init) { return res; } -eq("File \"bs_array_test.res\", line 129, characters 5-12", Belt_Array.makeBy(0, ((param) => { +eq("File \"bs_array_test.res\", line 129, characters 5-12", Belt_Array.makeBy(0, (param => { return 1; })), []); -eq("File \"bs_array_test.res\", line 130, characters 5-12", Belt_Array.makeBy(3, ((i) => { +eq("File \"bs_array_test.res\", line 130, characters 5-12", Belt_Array.makeBy(3, (i => { return i; })), [ 0, @@ -345,7 +345,7 @@ eq("File \"bs_array_test.res\", line 134, characters 5-12", makeMatrixExn(1, 1, eq("File \"bs_array_test.res\", line 135, characters 5-12", [].slice(0), []); -eq("File \"bs_array_test.res\", line 136, characters 5-12", Belt_Array.map([], ((prim) => { +eq("File \"bs_array_test.res\", line 136, characters 5-12", Belt_Array.map([], (prim => { return prim + 1 | 0; })), []); @@ -387,7 +387,7 @@ eq("File \"bs_array_test.res\", line 142, characters 5-12", Belt_Array.map([ 1, 2, 3 -], ((prim) => { +], (prim => { return prim + 1 | 0; })), [ 2, @@ -428,19 +428,19 @@ eq("File \"bs_array_test.res\", line 146, characters 5-12", Belt_List.toArray({ 3 ]); -let v$6 = Belt_Array.makeBy(10, ((i) => { +let v$6 = Belt_Array.makeBy(10, (i => { return i; })); -let v0 = Belt_Array.keep(v$6, ((x) => { +let v0 = Belt_Array.keep(v$6, (x => { return x % 2 === 0; })); -let v1 = Belt_Array.keep(v$6, ((x) => { +let v1 = Belt_Array.keep(v$6, (x => { return x % 3 === 0; })); -let v2 = Belt_Array.keepMap(v$6, ((x) => { +let v2 = Belt_Array.keepMap(v$6, (x => { if (x % 2 === 0) { return x + 1 | 0; } @@ -478,7 +478,7 @@ let a = [ 5 ]; -let match = Belt_Array.partition(a, ((x) => { +let match = Belt_Array.partition(a, (x => { return x % 2 === 0; })); @@ -493,7 +493,7 @@ eq("File \"bs_array_test.res\", line 169, characters 5-12", match[1], [ 5 ]); -let match$1 = Belt_Array.partition(a, ((x) => { +let match$1 = Belt_Array.partition(a, (x => { return x === 2; })); @@ -506,7 +506,7 @@ eq("File \"bs_array_test.res\", line 172, characters 5-12", match$1[1], [ 5 ]); -let match$2 = Belt_Array.partition([], ((x) => { +let match$2 = Belt_Array.partition([], (x => { return false; })); @@ -633,7 +633,7 @@ eq("File \"bs_array_test.res\", line 205, characters 5-12", Belt_Array.sliceToEn eq("File \"bs_array_test.res\", line 206, characters 5-12", Belt_Array.sliceToEnd(a$2, 6), []); -let a$3 = Belt_Array.makeBy(10, ((x) => { +let a$3 = Belt_Array.makeBy(10, (x => { return x; })); @@ -802,7 +802,7 @@ eq("File \"bs_array_test.res\", line 236, characters 5-12", b$1, [ 3 ]); -let a0 = Belt_Array.makeBy(10, ((x) => { +let a0 = Belt_Array.makeBy(10, (x => { return x; })); @@ -876,7 +876,7 @@ Belt_Array.blit(a0, -11, b0, -11, 2); eq("File \"bs_array_test.res\", line 253, characters 5-12", b0.slice(0), a0); -let aa = Belt_Array.makeBy(10, ((x) => { +let aa = Belt_Array.makeBy(10, (x => { return x; })); @@ -1038,7 +1038,7 @@ eq("File \"bs_array_test.res\", line 274, characters 5-12", Belt_Array.zipBy([ 1, 1, 1 -], ((x) => { +], (x => { return -x | 0; }))); @@ -1072,7 +1072,7 @@ function sumUsingForEach(xs) { let v = { contents: 0 }; - Belt_Array.forEach(xs, ((x) => { + Belt_Array.forEach(xs, (x => { v.contents = v.contents + x | 0; })); return v.contents; @@ -1092,7 +1092,7 @@ b("File \"bs_array_test.res\", line 288, characters 4-11", !Belt_Array.every([ 2, 3, 4 -], ((x) => { +], (x => { return x > 2; }))); @@ -1101,7 +1101,7 @@ b("File \"bs_array_test.res\", line 289, characters 4-11", Belt_Array.some([ 3, 7, 8 -], ((x) => { +], (x => { return x % 2 === 0; }))); @@ -1109,7 +1109,7 @@ b("File \"bs_array_test.res\", line 290, characters 4-11", !Belt_Array.some([ 1, 3, 7 -], ((x) => { +], (x => { return x % 2 === 0; }))); @@ -1446,7 +1446,7 @@ eq("File \"bs_array_test.res\", line 357, characters 5-12", Belt_Array.getBy([ 1, 2, 3 -], ((x) => { +], (x => { return x > 1; })), 2); @@ -1454,7 +1454,7 @@ eq("File \"bs_array_test.res\", line 358, characters 5-12", Belt_Array.getBy([ 1, 2, 3 -], ((x) => { +], (x => { return x > 3; })), undefined); @@ -1462,7 +1462,7 @@ eq("File \"bs_array_test.res\", line 362, characters 5-12", Belt_Array.getIndexB 1, 2, 3 -], ((x) => { +], (x => { return x > 1; })), 1); @@ -1470,7 +1470,7 @@ eq("File \"bs_array_test.res\", line 363, characters 5-12", Belt_Array.getIndexB 1, 2, 3 -], ((x) => { +], (x => { return x > 3; })), undefined); diff --git a/jscomp/test/bs_auto_uncurry.js b/jscomp/test/bs_auto_uncurry.js index 1d9cb675312..52d88d14bed 100644 --- a/jscomp/test/bs_auto_uncurry.js +++ b/jscomp/test/bs_auto_uncurry.js @@ -12,7 +12,7 @@ let xbs = Array.prototype.map.call([ 2, 3, 5 -], ((x) => { +], (x => { return x + 1 | 0; })); @@ -38,7 +38,7 @@ let xs = Array.prototype.map.call([ 2, 1 ] -], ((param) => { +], (param => { return (param[1] + param[0] | 0) + 1 | 0; })); @@ -49,7 +49,7 @@ function f_0() { } function f_01() { - return hi((x) => { + return hi(x => { if (x === undefined) { console.log("x"); return; @@ -59,7 +59,7 @@ function f_01() { } function f_02(xs) { - return hi((x) => { + return hi(x => { xs.contents = x; console.log("x"); }); diff --git a/jscomp/test/bs_auto_uncurry_test.js b/jscomp/test/bs_auto_uncurry_test.js index 31051da5f43..f2b31f6d436 100644 --- a/jscomp/test/bs_auto_uncurry_test.js +++ b/jscomp/test/bs_auto_uncurry_test.js @@ -38,14 +38,14 @@ let xs = { contents: /* [] */0 }; -hi((x) => { +hi(x => { xs.contents = { hd: x, tl: xs.contents }; }); -hi((x) => { +hi(x => { xs.contents = { hd: x, tl: xs.contents @@ -64,7 +64,7 @@ eq("File \"bs_auto_uncurry_test.res\", line 28, characters 5-12", [ 1, 2, 3 -].map((x) => { +].map(x => { return x + 1 | 0; }), [ 2, @@ -76,7 +76,7 @@ eq("File \"bs_auto_uncurry_test.res\", line 29, characters 5-12", [ 1, 2, 3 -].map((x) => { +].map(x => { return x + 1 | 0; }), [ 2, @@ -104,7 +104,7 @@ eq("File \"bs_auto_uncurry_test.res\", line 35, characters 5-12", [ 1, 2, 3 -].some((x) => { +].some(x => { return x < 1; }), false); @@ -112,7 +112,7 @@ eq("File \"bs_auto_uncurry_test.res\", line 37, characters 5-12", [ 1, 2, 3 -].every((x) => { +].every(x => { return x > 0; }), true); diff --git a/jscomp/test/bs_hashmap_test.js b/jscomp/test/bs_hashmap_test.js index 8d1200d5f04..22849363487 100644 --- a/jscomp/test/bs_hashmap_test.js +++ b/jscomp/test/bs_hashmap_test.js @@ -98,7 +98,7 @@ for (let i$1 = 0; i$1 <= 2000; ++i$1) { eqx("File \"bs_hashmap_test.res\", line 57, characters 6-13", v$1.size, 98000); -b("File \"bs_hashmap_test.res\", line 58, characters 4-11", Belt_Array.every(Array_data_util.range(2001, 100000), ((x) => { +b("File \"bs_hashmap_test.res\", line 58, characters 4-11", Belt_Array.every(Array_data_util.range(2001, 100000), (x => { return Belt_HashMap.has(v$1, x); }))); diff --git a/jscomp/test/bs_hashset_int_test.js b/jscomp/test/bs_hashset_int_test.js index f69b2c6b72b..6c14c79db41 100644 --- a/jscomp/test/bs_hashset_int_test.js +++ b/jscomp/test/bs_hashset_int_test.js @@ -33,7 +33,7 @@ function sum2(h) { let v = { contents: 0 }; - Belt_HashSetInt.forEach(h, ((x) => { + Belt_HashSetInt.forEach(h, (x => { v.contents = v.contents + x | 0; })); return v.contents; diff --git a/jscomp/test/bs_list_test.js b/jscomp/test/bs_list_test.js index 7367afd169d..af9de56cd7d 100644 --- a/jscomp/test/bs_list_test.js +++ b/jscomp/test/bs_list_test.js @@ -31,7 +31,7 @@ function sum(xs) { let v = { contents: 0 }; - Belt_List.forEach(xs, ((x) => { + Belt_List.forEach(xs, (x => { v.contents = v.contents + x | 0; })); return v.contents; @@ -47,7 +47,7 @@ function sum2(xs, ys) { return v.contents; } -let u = Belt_List.makeBy(5, ((i) => { +let u = Belt_List.makeBy(5, (i => { return Math.imul(i, i); })); @@ -59,7 +59,7 @@ for (let i = 0; i <= 4; ++i) { f(i); } -eq("File \"bs_list_test.res\", line 31, characters 5-12", Belt_List.map(u, ((i) => { +eq("File \"bs_list_test.res\", line 31, characters 5-12", Belt_List.map(u, (i => { return i + 1 | 0; })), { hd: 1, @@ -90,7 +90,7 @@ eq("File \"bs_list_test.res\", line 32, characters 5-12", Belt_List.getBy({ } } } -}, ((x) => { +}, (x => { return x % 2 === 0; })), 4); @@ -106,7 +106,7 @@ eq("File \"bs_list_test.res\", line 33, characters 5-12", Belt_List.getBy({ } } } -}, ((x) => { +}, (x => { return x % 5 === 0; })), undefined); @@ -128,7 +128,7 @@ eq("FLATTEN", Belt_List.flatten({ tl: { hd: /* [] */0, tl: { - hd: Belt_List.makeBy(4, ((i) => { + hd: Belt_List.makeBy(4, (i => { return i; })), tl: /* [] */0 @@ -213,7 +213,7 @@ eq("CONCATMANY", Belt_List.concatMany([ tl: /* [] */0 }, /* [] */0, - Belt_List.makeBy(4, ((i) => { + Belt_List.makeBy(4, (i => { return i; })) ]), { @@ -321,13 +321,13 @@ eq("CONCATMANY", Belt_List.concatMany([{ } }); -eq("File \"bs_list_test.res\", line 66, characters 2-9", Belt_List.toArray(Belt_List.concat(Belt_List.makeBy(100, ((i) => { +eq("File \"bs_list_test.res\", line 66, characters 2-9", Belt_List.toArray(Belt_List.concat(Belt_List.makeBy(100, (i => { return i; -})), Belt_List.makeBy(100, ((i) => { +})), Belt_List.makeBy(100, (i => { return i; -})))), Belt_Array.concat(Belt_Array.makeBy(100, ((i) => { +})))), Belt_Array.concat(Belt_Array.makeBy(100, (i => { return i; -})), Belt_Array.makeBy(100, ((i) => { +})), Belt_Array.makeBy(100, (i => { return i; })))); @@ -522,7 +522,7 @@ eq("PARTITION", Belt_List.partition({ } } } -}, ((x) => { +}, (x => { return !mod2(x); })), [ /* [] */0, @@ -726,7 +726,7 @@ function id(x) { return x; } -eq("MAP", Belt_List.map(Belt_List.makeBy(5, id), ((x) => { +eq("MAP", Belt_List.map(Belt_List.makeBy(5, id), (x => { return (x << 1); })), { hd: 0, @@ -750,7 +750,7 @@ eq("MAP", Belt_List.map(/* [] */0, id), /* [] */0); eq("MAP", Belt_List.map({ hd: 1, tl: /* [] */0 -}, ((x) => { +}, (x => { return -x | 0; })), { hd: -1, @@ -765,7 +765,7 @@ let length_10_id = Belt_List.makeBy(10, id); let length_8_id = Belt_List.makeBy(8, id); -let d = Belt_List.makeBy(10, ((x) => { +let d = Belt_List.makeBy(10, (x => { return (x << 1); })); @@ -783,7 +783,7 @@ eq("MAP2", Belt_List.zipBy({ eq("MAP2", Belt_List.zipBy(/* [] */0, /* [] */0, add), /* [] */0); -eq("MAP2", Belt_List.zipBy(length_10_id, length_10_id, add), Belt_List.concat(Belt_List.map(length_8_id, ((x) => { +eq("MAP2", Belt_List.zipBy(length_10_id, length_10_id, add), Belt_List.concat(Belt_List.map(length_8_id, (x => { return (x << 1); })), { hd: 16, @@ -797,7 +797,7 @@ eq("MAP2", Belt_List.zipBy(length_10_id, length_8_id, add), Belt_List.mapWithInd return i + x | 0; }))); -eq("MAP2", Belt_List.reverse(Belt_List.mapReverse2(length_10_id, length_10_id, add)), Belt_List.map(length_10_id, ((x) => { +eq("MAP2", Belt_List.reverse(Belt_List.mapReverse2(length_10_id, length_10_id, add)), Belt_List.map(length_10_id, (x => { return (x << 1); }))); @@ -1585,7 +1585,7 @@ eq("File \"bs_list_test.res\", line 260, characters 5-12", Belt_List.map({ hd: 1, tl: /* [] */0 } -}, ((i) => { +}, (i => { return Belt_List.getExn({ hd: 0, tl: { @@ -1645,7 +1645,7 @@ eq("File \"bs_list_test.res\", line 290, characters 5-12", Belt_List.reduce(leng eq("File \"bs_list_test.res\", line 291, characters 5-12", Belt_List.reduceReverse(length_10_id, 0, add), 45); -eq("File \"bs_list_test.res\", line 292, characters 5-12", Belt_List.reduceReverse(Belt_List.makeBy(10000, ((i) => { +eq("File \"bs_list_test.res\", line 292, characters 5-12", Belt_List.reduceReverse(Belt_List.makeBy(10000, (i => { return i; })), 0, ((prim0, prim1) => { return prim0 + prim1 | 0; @@ -1929,7 +1929,7 @@ b("File \"bs_list_test.res\", line 319, characters 4-11", Belt_List.reduceRevers return (acc + x | 0) + y | 0; })) === 6); -let a$1 = Belt_List.makeBy(10000, ((i) => { +let a$1 = Belt_List.makeBy(10000, (i => { return i; })); @@ -2090,7 +2090,7 @@ eq("File \"bs_list_test.res\", line 338, characters 5-12", Belt_List.some2({ })), false); function makeTest(n) { - eq("File \"bs_list_test.res\", line 341, characters 23-30", Belt_List.make(n, 3), Belt_List.makeBy(n, ((param) => { + eq("File \"bs_list_test.res\", line 341, characters 23-30", Belt_List.make(n, 3), Belt_List.makeBy(n, (param => { return 3; }))); } @@ -2444,11 +2444,11 @@ b("File \"bs_list_test.res\", line 377, characters 4-11", !Belt_List.eq({ return prim0 === prim1; }))); -let u0 = Belt_List.makeBy(20, ((x) => { +let u0 = Belt_List.makeBy(20, (x => { return x; })); -let u1 = Belt_List.keepMap(u0, ((x) => { +let u1 = Belt_List.keepMap(u0, (x => { if (x % 7 === 0) { return x + 1 | 0; } @@ -2478,7 +2478,7 @@ b("File \"bs_list_test.res\", line 390, characters 4-11", Caml_obj.equal(Belt_Li } } } -}, ((x) => { +}, (x => { if (x % 2 === 0) { return -x | 0; } @@ -2503,7 +2503,7 @@ b("File \"bs_list_test.res\", line 404, characters 4-11", Belt_List.keepMap({ } } } -}, ((x) => { +}, (x => { if (x % 5 === 0) { return x; } diff --git a/jscomp/test/bs_map_set_dict_test.js b/jscomp/test/bs_map_set_dict_test.js index 37de71b0265..d85cd134920 100644 --- a/jscomp/test/bs_map_set_dict_test.js +++ b/jscomp/test/bs_map_set_dict_test.js @@ -114,12 +114,12 @@ function f(none) { } function $eq$tilde(a, b) { - return (extra) => { + return extra => { return Belt_Map.eq(a, b, extra); }; } -let u0 = Belt_Map.fromArray(Belt_Array.map(Array_data_util.randomRange(0, 39), ((x) => { +let u0 = Belt_Map.fromArray(Belt_Array.map(Array_data_util.randomRange(0, 39), (x => { return [ x, x @@ -128,7 +128,7 @@ let u0 = Belt_Map.fromArray(Belt_Array.map(Array_data_util.randomRange(0, 39), ( let u1 = Belt_Map.set(u0, 39, 120); -b("File \"bs_map_set_dict_test.res\", line 72, characters 4-11", Belt_Array.every2(Belt_MapDict.toArray(u0.data), Belt_Array.map(Array_data_util.range(0, 39), ((x) => { +b("File \"bs_map_set_dict_test.res\", line 72, characters 4-11", Belt_Array.every2(Belt_MapDict.toArray(u0.data), Belt_Array.map(Array_data_util.range(0, 39), (x => { return [ x, x @@ -141,7 +141,7 @@ b("File \"bs_map_set_dict_test.res\", line 72, characters 4-11", Belt_Array.ever } }))); -b("File \"bs_map_set_dict_test.res\", line 79, characters 4-11", Belt_List.every2(Belt_MapDict.toList(u0.data), Belt_List.fromArray(Belt_Array.map(Array_data_util.range(0, 39), ((x) => { +b("File \"bs_map_set_dict_test.res\", line 79, characters 4-11", Belt_List.every2(Belt_MapDict.toList(u0.data), Belt_List.fromArray(Belt_Array.map(Array_data_util.range(0, 39), (x => { return [ x, x @@ -158,14 +158,14 @@ eq("File \"bs_map_set_dict_test.res\", line 84, characters 5-12", Belt_Map.get(u eq("File \"bs_map_set_dict_test.res\", line 85, characters 5-12", Belt_Map.get(u1, 39), 120); -let u = Belt_Map.fromArray(Belt_Array.makeByAndShuffle(10000, ((x) => { +let u = Belt_Map.fromArray(Belt_Array.makeByAndShuffle(10000, (x => { return [ x, x ]; })), Icmp); -eq("File \"bs_map_set_dict_test.res\", line 90, characters 5-12", Belt_Array.makeBy(10000, ((x) => { +eq("File \"bs_map_set_dict_test.res\", line 90, characters 5-12", Belt_Array.makeBy(10000, (x => { return [ x, x diff --git a/jscomp/test/bs_map_test.js b/jscomp/test/bs_map_test.js index 466ba4f88ff..cae7732411a 100644 --- a/jscomp/test/bs_map_test.js +++ b/jscomp/test/bs_map_test.js @@ -55,7 +55,7 @@ function emptyMap() { } -let v = Belt_Array.makeByAndShuffle(1000000, ((i) => { +let v = Belt_Array.makeByAndShuffle(1000000, (i => { return [ i, i diff --git a/jscomp/test/bs_mutable_set_test.js b/jscomp/test/bs_mutable_set_test.js index 3a5851b068b..f99272ce4a5 100644 --- a/jscomp/test/bs_mutable_set_test.js +++ b/jscomp/test/bs_mutable_set_test.js @@ -113,7 +113,7 @@ let v = { data: Belt_internalSetInt.fromArray(xs$1) }; -let bs = Belt_Array.map(Array_data_util.randomRange(500, 1499), ((x) => { +let bs = Belt_Array.map(Array_data_util.randomRange(500, 1499), (x => { return Belt_MutableSetInt.removeCheck(v, x); })); @@ -129,7 +129,7 @@ eq("File \"bs_mutable_set_test.res\", line 72, characters 9-16", indeedRemoved, eq("File \"bs_mutable_set_test.res\", line 73, characters 9-16", Belt_internalAVLset.size(v.data), 501); -let cs = Belt_Array.map(Array_data_util.randomRange(500, 2000), ((x) => { +let cs = Belt_Array.map(Array_data_util.randomRange(500, 2000), (x => { return Belt_MutableSetInt.addCheck(v, x); })); @@ -161,7 +161,7 @@ eq("File \"bs_mutable_set_test.res\", line 89, characters 9-16", Belt_MutableSet return x + y | 0; })), 1876250); -b("File \"bs_mutable_set_test.res\", line 90, characters 8-15", Belt_List.eq(Belt_internalAVLset.toList(v.data), Belt_List.makeBy(1501, ((i) => { +b("File \"bs_mutable_set_test.res\", line 90, characters 8-15", Belt_List.eq(Belt_internalAVLset.toList(v.data), Belt_List.makeBy(1501, (i => { return i + 500 | 0; })), ((x, y) => { return x === y; @@ -378,15 +378,15 @@ let a0 = { data: Belt_internalSetInt.fromArray(xs$24) }; -let a1 = Belt_MutableSetInt.keep(a0, ((x) => { +let a1 = Belt_MutableSetInt.keep(a0, (x => { return x % 2 === 0; })); -let a2 = Belt_MutableSetInt.keep(a0, ((x) => { +let a2 = Belt_MutableSetInt.keep(a0, (x => { return x % 2 !== 0; })); -let match$4 = Belt_MutableSetInt.partition(a0, ((x) => { +let match$4 = Belt_MutableSetInt.partition(a0, (x => { return x % 2 === 0; })); @@ -413,7 +413,7 @@ Belt_List.forEach({ } } } -}, ((x) => { +}, (x => { Belt_internalAVLset.checkInvariantInternal(x.data); })); @@ -427,7 +427,7 @@ for (let i$2 = 0; i$2 <= 100000; ++i$2) { Belt_internalAVLset.checkInvariantInternal(v$1.data); -b("File \"bs_mutable_set_test.res\", line 188, characters 10-17", Belt_Range.every(0, 100000, ((i) => { +b("File \"bs_mutable_set_test.res\", line 188, characters 10-17", Belt_Range.every(0, 100000, (i => { return Belt_internalSetInt.has(v$1.data, i); }))); @@ -471,7 +471,7 @@ eq("File \"bs_mutable_set_test.res\", line 216, characters 5-12", Belt_internalA b("File \"bs_mutable_set_test.res\", line 217, characters 4-11", Belt_MutableSetInt.isEmpty(v$3)); -let xs$25 = Belt_Array.makeBy(30, ((i) => { +let xs$25 = Belt_Array.makeBy(30, (i => { return i; })); @@ -598,15 +598,15 @@ let v$5 = { data: Belt_internalSetInt.fromArray(xs$26) }; -let copyV = Belt_MutableSetInt.keep(v$5, ((x) => { +let copyV = Belt_MutableSetInt.keep(v$5, (x => { return x % 8 === 0; })); -let match$5 = Belt_MutableSetInt.partition(v$5, ((x) => { +let match$5 = Belt_MutableSetInt.partition(v$5, (x => { return x % 8 === 0; })); -let cc$1 = Belt_MutableSetInt.keep(v$5, ((x) => { +let cc$1 = Belt_MutableSetInt.keep(v$5, (x => { return x % 8 !== 0; })); @@ -616,7 +616,7 @@ for (let i$6 = 0; i$6 <= 200; ++i$6) { eq("File \"bs_mutable_set_test.res\", line 264, characters 5-12", Belt_internalAVLset.size(copyV.data), 126); -eq("File \"bs_mutable_set_test.res\", line 265, characters 5-12", Belt_internalAVLset.toArray(copyV.data), Belt_Array.makeBy(126, ((i) => { +eq("File \"bs_mutable_set_test.res\", line 265, characters 5-12", Belt_internalAVLset.toArray(copyV.data), Belt_Array.makeBy(126, (i => { return (i << 3); }))); @@ -648,7 +648,7 @@ b("File \"bs_mutable_set_test.res\", line 275, characters 4-11", Belt_MutableSet data: Belt_internalSetInt.fromArray(xs$29) })); -let xs$30 = Belt_Array.map(Array_data_util.randomRange(0, 1000), ((x) => { +let xs$30 = Belt_Array.map(Array_data_util.randomRange(0, 1000), (x => { return (x << 1); })); @@ -660,7 +660,7 @@ let match$8 = Belt_MutableSetInt.split(d, 1001); let match$9 = match$8[0]; -let xs$31 = Belt_Array.makeBy(501, ((x) => { +let xs$31 = Belt_Array.makeBy(501, (x => { return (x << 1); })); @@ -668,7 +668,7 @@ b("File \"bs_mutable_set_test.res\", line 278, characters 4-11", Belt_MutableSet data: Belt_internalSetInt.fromArray(xs$31) })); -let xs$32 = Belt_Array.makeBy(500, ((x) => { +let xs$32 = Belt_Array.makeBy(500, (x => { return 1002 + (x << 1) | 0; })); diff --git a/jscomp/test/bs_poly_map_test.js b/jscomp/test/bs_poly_map_test.js index e9fac4d6d8e..2b36e09e309 100644 --- a/jscomp/test/bs_poly_map_test.js +++ b/jscomp/test/bs_poly_map_test.js @@ -76,7 +76,7 @@ function mergeDiff(s1, s2) { } function randomRange(i, j) { - return Belt_Array.map(Array_data_util.randomRange(i, j), ((x) => { + return Belt_Array.map(Array_data_util.randomRange(i, j), (x => { return [ x, x @@ -102,7 +102,7 @@ let a1 = Belt_Map.set(a0, 3, 33); let a2 = Belt_Map.remove(a1, 3); -let a3 = Belt_Map.update(a2, 3, ((k) => { +let a3 = Belt_Map.update(a2, 3, (k => { if (k !== undefined) { return k + 1 | 0; } else { @@ -110,7 +110,7 @@ let a3 = Belt_Map.update(a2, 3, ((k) => { } })); -let a4 = Belt_Map.update(a2, 3, ((k) => { +let a4 = Belt_Map.update(a2, 3, (k => { if (k !== undefined) { return k + 1 | 0; } @@ -170,7 +170,7 @@ eq("File \"bs_poly_map_test.res\", line 109, characters 5-12", Belt_Map.get(u0$1 function acc(m, is) { return Belt_Array.reduce(is, m, ((a, i) => { - return Belt_Map.update(a, i, ((n) => { + return Belt_Map.update(a, i, (n => { if (n !== undefined) { return n + 1 | 0; } else { @@ -189,7 +189,7 @@ let m = { let m1 = acc(m, Belt_Array.concat(Array_data_util.randomRange(0, 20), Array_data_util.randomRange(10, 30))); -b("File \"bs_poly_map_test.res\", line 126, characters 4-11", Belt_Map.eq(m1, Belt_Map.fromArray(Belt_Array.makeBy(31, ((i) => { +b("File \"bs_poly_map_test.res\", line 126, characters 4-11", Belt_Map.eq(m1, Belt_Map.fromArray(Belt_Array.makeBy(31, (i => { return [ i, i >= 10 && i <= 20 ? 2 : 1 @@ -205,14 +205,14 @@ let v0 = { data: undefined }; -let v1 = Belt_Map.mergeMany(v0, Belt_Array.map(Array_data_util.randomRange(0, 10000), ((x) => { +let v1 = Belt_Map.mergeMany(v0, Belt_Array.map(Array_data_util.randomRange(0, 10000), (x => { return [ x, x ]; }))); -let v2 = Belt_Map.fromArray(Belt_Array.map(Array_data_util.randomRange(0, 10000), ((x) => { +let v2 = Belt_Map.fromArray(Belt_Array.map(Array_data_util.randomRange(0, 10000), (x => { return [ x, x @@ -269,13 +269,13 @@ b("File \"bs_poly_map_test.res\", line 182, characters 4-11", Belt_MapDict.isEmp b("File \"bs_poly_map_test.res\", line 184, characters 4-11", pres !== undefined ? pres === 5000 : false); -b("File \"bs_poly_map_test.res\", line 190, characters 4-11", Belt_Array.eq(Belt_MapDict.keysToArray(match$1[0].data), Belt_Array.makeBy(5000, ((i) => { +b("File \"bs_poly_map_test.res\", line 190, characters 4-11", Belt_Array.eq(Belt_MapDict.keysToArray(match$1[0].data), Belt_Array.makeBy(5000, (i => { return i; })), ((prim0, prim1) => { return prim0 === prim1; }))); -b("File \"bs_poly_map_test.res\", line 191, characters 4-11", Belt_Array.eq(Belt_MapDict.keysToArray(match$1[1].data), Belt_Array.makeBy(5000, ((i) => { +b("File \"bs_poly_map_test.res\", line 191, characters 4-11", Belt_Array.eq(Belt_MapDict.keysToArray(match$1[1].data), Belt_Array.makeBy(5000, (i => { return 5001 + i | 0; })), ((prim0, prim1) => { return prim0 === prim1; @@ -289,13 +289,13 @@ let match$6 = match$5[0]; b("File \"bs_poly_map_test.res\", line 196, characters 4-11", match$5[1] === undefined); -b("File \"bs_poly_map_test.res\", line 202, characters 4-11", Belt_Array.eq(Belt_MapDict.keysToArray(match$6[0].data), Belt_Array.makeBy(5000, ((i) => { +b("File \"bs_poly_map_test.res\", line 202, characters 4-11", Belt_Array.eq(Belt_MapDict.keysToArray(match$6[0].data), Belt_Array.makeBy(5000, (i => { return i; })), ((prim0, prim1) => { return prim0 === prim1; }))); -b("File \"bs_poly_map_test.res\", line 203, characters 4-11", Belt_Array.eq(Belt_MapDict.keysToArray(match$6[1].data), Belt_Array.makeBy(5000, ((i) => { +b("File \"bs_poly_map_test.res\", line 203, characters 4-11", Belt_Array.eq(Belt_MapDict.keysToArray(match$6[1].data), Belt_Array.makeBy(5000, (i => { return 5001 + i | 0; })), ((prim0, prim1) => { return prim0 === prim1; diff --git a/jscomp/test/bs_poly_mutable_map_test.js b/jscomp/test/bs_poly_mutable_map_test.js index ae483b1e6c7..84bb84d290a 100644 --- a/jscomp/test/bs_poly_mutable_map_test.js +++ b/jscomp/test/bs_poly_mutable_map_test.js @@ -38,7 +38,7 @@ function ff(x) { } function randomRange(i, j) { - return Belt_Array.map(Array_data_util.randomRange(i, j), ((x) => { + return Belt_Array.map(Array_data_util.randomRange(i, j), (x => { return [ x, x @@ -79,11 +79,11 @@ let a0$1 = Belt_MutableMap.fromArray(randomRange(0, 10000), Icmp); Belt_MutableMap.set(a0$1, 2000, 33); -Belt_MutableMap.removeMany(a0$1, Belt_Array.map(randomRange(0, 1998), ((prim) => { +Belt_MutableMap.removeMany(a0$1, Belt_Array.map(randomRange(0, 1998), (prim => { return prim[0]; }))); -Belt_MutableMap.removeMany(a0$1, Belt_Array.map(randomRange(2002, 11000), ((prim) => { +Belt_MutableMap.removeMany(a0$1, Belt_Array.map(randomRange(2002, 11000), (prim => { return prim[0]; }))); diff --git a/jscomp/test/bs_poly_mutable_set_test.js b/jscomp/test/bs_poly_mutable_set_test.js index 5df8eef073b..674b0726b9b 100644 --- a/jscomp/test/bs_poly_mutable_set_test.js +++ b/jscomp/test/bs_poly_mutable_set_test.js @@ -118,7 +118,7 @@ b("File \"bs_poly_mutable_set_test.res\", line 54, characters 4-11", Belt_Mutabl let v = Belt_MutableSet.fromArray(Array_data_util.randomRange(1000, 2000), IntCmp); -let bs = Belt_Array.map(Array_data_util.randomRange(500, 1499), ((x) => { +let bs = Belt_Array.map(Array_data_util.randomRange(500, 1499), (x => { return Belt_MutableSet.removeCheck(v, x); })); @@ -134,7 +134,7 @@ eq("File \"bs_poly_mutable_set_test.res\", line 67, characters 5-12", indeedRemo eq("File \"bs_poly_mutable_set_test.res\", line 68, characters 5-12", Belt_internalAVLset.size(v.data), 501); -let cs = Belt_Array.map(Array_data_util.randomRange(500, 2000), ((x) => { +let cs = Belt_Array.map(Array_data_util.randomRange(500, 2000), (x => { return Belt_MutableSet.addCheck(v, x); })); @@ -167,7 +167,7 @@ eq("File \"bs_poly_mutable_set_test.res\", line 84, characters 5-12", Belt_Mutab return x + y | 0; })), 1876250); -b("File \"bs_poly_mutable_set_test.res\", line 85, characters 4-11", Belt_List.eq(Belt_internalAVLset.toList(v.data), Belt_List.makeBy(1501, ((i) => { +b("File \"bs_poly_mutable_set_test.res\", line 85, characters 4-11", Belt_List.eq(Belt_internalAVLset.toList(v.data), Belt_List.makeBy(1501, (i => { return i + 500 | 0; })), ((x, y) => { return x === y; @@ -288,15 +288,15 @@ b("File \"bs_poly_mutable_set_test.res\", line 150, characters 4-11", Belt_Mutab let a0 = Belt_MutableSet.fromArray(Array_data_util.randomRange(0, 1000), IntCmp); -let a1 = Belt_MutableSet.keep(a0, ((x) => { +let a1 = Belt_MutableSet.keep(a0, (x => { return x % 2 === 0; })); -let a2 = Belt_MutableSet.keep(a0, ((x) => { +let a2 = Belt_MutableSet.keep(a0, (x => { return x % 2 !== 0; })); -let match$4 = Belt_MutableSet.partition(a0, ((x) => { +let match$4 = Belt_MutableSet.partition(a0, (x => { return x % 2 === 0; })); @@ -323,7 +323,7 @@ Belt_List.forEach({ } } } -}, ((x) => { +}, (x => { Belt_internalAVLset.checkInvariantInternal(x.data); })); diff --git a/jscomp/test/bs_poly_set_test.js b/jscomp/test/bs_poly_set_test.js index dcde2d812de..9b19fa2db3f 100644 --- a/jscomp/test/bs_poly_set_test.js +++ b/jscomp/test/bs_poly_set_test.js @@ -146,7 +146,7 @@ let u26 = Belt_Set.add({ data: undefined }, 3); -let ss = Belt_Array.makeByAndShuffle(100, ((i) => { +let ss = Belt_Array.makeByAndShuffle(100, (i => { return (i << 1); })); @@ -200,7 +200,7 @@ function testIterToList(xs) { let v = { contents: /* [] */0 }; - Belt_SetDict.forEach(xs.data, ((x) => { + Belt_SetDict.forEach(xs.data, (x => { v.contents = { hd: x, tl: v.contents @@ -213,7 +213,7 @@ function testIterToList2(xs) { let v = { contents: /* [] */0 }; - Belt_SetDict.forEach(xs.data, ((x) => { + Belt_SetDict.forEach(xs.data, (x => { v.contents = { hd: x, tl: v.contents @@ -228,13 +228,13 @@ let u1$1 = Belt_Set.remove(u0$1, 17); let u2$1 = Belt_Set.add(u1$1, 33); -b("File \"bs_poly_set_test.res\", line 110, characters 4-11", Belt_List.every2(testIterToList(u0$1), Belt_List.makeBy(21, ((i) => { +b("File \"bs_poly_set_test.res\", line 110, characters 4-11", Belt_List.every2(testIterToList(u0$1), Belt_List.makeBy(21, (i => { return i; })), ((x, y) => { return x === y; }))); -b("File \"bs_poly_set_test.res\", line 111, characters 4-11", Belt_List.every2(testIterToList2(u0$1), Belt_List.makeBy(21, ((i) => { +b("File \"bs_poly_set_test.res\", line 111, characters 4-11", Belt_List.every2(testIterToList2(u0$1), Belt_List.makeBy(21, (i => { return i; })), ((x, y) => { return x === y; @@ -262,7 +262,7 @@ function f$2(x) { b("File \"bs_poly_set_test.res\", line 115, characters 4-11", Belt_SetDict.every(u0$1.data, f$2)); -b("File \"bs_poly_set_test.res\", line 116, characters 4-11", Belt_SetDict.every(u0$1.data, ((x) => { +b("File \"bs_poly_set_test.res\", line 116, characters 4-11", Belt_SetDict.every(u0$1.data, (x => { return x < 24; }))); @@ -290,15 +290,15 @@ b("File \"bs_poly_set_test.res\", line 120, characters 4-11", Belt_Set.cmp(u0$1, let a0 = Belt_Set.fromArray(Array_data_util.randomRange(0, 1000), IntCmp); -let a1 = Belt_Set.keep(a0, ((x) => { +let a1 = Belt_Set.keep(a0, (x => { return x % 2 === 0; })); -let a2 = Belt_Set.keep(a0, ((x) => { +let a2 = Belt_Set.keep(a0, (x => { return x % 2 !== 0; })); -let match = Belt_Set.partition(a0, ((x) => { +let match = Belt_Set.partition(a0, (x => { return x % 2 === 0; })); @@ -332,11 +332,11 @@ let match$2 = match$1[0]; b("File \"bs_poly_set_test.res\", line 136, characters 4-11", match$1[1]); -eq("File \"bs_poly_set_test.res\", line 137, characters 5-12", Belt_SetDict.toArray(match$2[0].data), Belt_Array.makeBy(200, ((i) => { +eq("File \"bs_poly_set_test.res\", line 137, characters 5-12", Belt_SetDict.toArray(match$2[0].data), Belt_Array.makeBy(200, (i => { return i; }))); -eq("File \"bs_poly_set_test.res\", line 138, characters 5-12", Belt_SetDict.toList(match$2[1].data), Belt_List.makeBy(800, ((i) => { +eq("File \"bs_poly_set_test.res\", line 138, characters 5-12", Belt_SetDict.toList(match$2[1].data), Belt_List.makeBy(800, (i => { return i + 201 | 0; }))); @@ -352,11 +352,11 @@ let a8 = match$4[0]; b("File \"bs_poly_set_test.res\", line 141, characters 4-11", !match$3[1]); -eq("File \"bs_poly_set_test.res\", line 142, characters 5-12", Belt_SetDict.toArray(a8.data), Belt_Array.makeBy(200, ((i) => { +eq("File \"bs_poly_set_test.res\", line 142, characters 5-12", Belt_SetDict.toArray(a8.data), Belt_Array.makeBy(200, (i => { return i; }))); -eq("File \"bs_poly_set_test.res\", line 143, characters 5-12", Belt_SetDict.toList(a9.data), Belt_List.makeBy(800, ((i) => { +eq("File \"bs_poly_set_test.res\", line 143, characters 5-12", Belt_SetDict.toList(a9.data), Belt_List.makeBy(800, (i => { return i + 201 | 0; }))); @@ -379,13 +379,13 @@ Belt_List.forEach({ } } } -}, ((x) => { +}, (x => { Belt_SetDict.checkInvariantInternal(x.data); })); let a = Belt_Set.fromArray([], IntCmp); -let m$1 = Belt_Set.keep(a, ((x) => { +let m$1 = Belt_Set.keep(a, (x => { return x % 2 === 0; })); diff --git a/jscomp/test/bs_queue_test.js b/jscomp/test/bs_queue_test.js index 9880a4536f5..2c643235258 100644 --- a/jscomp/test/bs_queue_test.js +++ b/jscomp/test/bs_queue_test.js @@ -767,7 +767,7 @@ let i$7 = { contents: 1 }; -Belt_MutableQueue.forEach(q$5, ((j) => { +Belt_MutableQueue.forEach(q$5, (j => { if (i$7.contents !== j) { throw new Error("Assert_failure", { cause: { @@ -1338,7 +1338,7 @@ let q$6 = Belt_MutableQueue.fromArray([ 4 ]); -let q1$5 = Belt_MutableQueue.map(q$6, ((x) => { +let q1$5 = Belt_MutableQueue.map(q$6, (x => { return x - 1 | 0; })); @@ -1353,7 +1353,7 @@ let q$7 = Belt_MutableQueue.fromArray([]); b("File \"bs_queue_test.res\", line 198, characters 4-11", q$7.length === 0); -let q$8 = Belt_MutableQueue.map(Belt_MutableQueue.fromArray([]), ((x) => { +let q$8 = Belt_MutableQueue.map(Belt_MutableQueue.fromArray([]), (x => { return x + 1 | 0; })); diff --git a/jscomp/test/bs_set_int_test.js b/jscomp/test/bs_set_int_test.js index f4d273c517d..cf215fc6af8 100644 --- a/jscomp/test/bs_set_int_test.js +++ b/jscomp/test/bs_set_int_test.js @@ -55,13 +55,13 @@ let u = Belt_SetInt.intersect(Belt_SetInt.fromArray([ b("File \"bs_set_int_test.res\", line 27, characters 11-18", Belt_SetInt.eq(Belt_SetInt.fromArray([3]), u)); function range(i, j) { - return $$Array.init((j - i | 0) + 1 | 0, ((k) => { + return $$Array.init((j - i | 0) + 1 | 0, (k => { return k + i | 0; })); } function revRange(i, j) { - return $$Array.of_list(List.rev($$Array.to_list($$Array.init((j - i | 0) + 1 | 0, ((k) => { + return $$Array.of_list(List.rev($$Array.to_list($$Array.init((j - i | 0) + 1 | 0, (k => { return k + i | 0; }))))); } @@ -72,7 +72,7 @@ let i = range(100, 1500); b("File \"bs_set_int_test.res\", line 37, characters 4-11", Belt_SetInt.eq(Belt_SetInt.fromArray(i), v)); -let match = Belt_SetInt.partition(v, ((x) => { +let match = Belt_SetInt.partition(v, (x => { return x % 3 === 0; })); @@ -216,7 +216,7 @@ let v$10 = Belt_SetInt.remove(v$9, 1); b("File \"bs_set_int_test.res\", line 146, characters 4-11", Belt_SetInt.isEmpty(v$10)); -let v$11 = Belt_Array.makeByAndShuffle(1000000, ((i) => { +let v$11 = Belt_Array.makeByAndShuffle(1000000, (i => { return i; })); @@ -341,7 +341,7 @@ let v3 = Belt_SetInt.removeMany(v2, [ 2001 ]); -let us = Belt_Array.map(Array_data_util.randomRange(1000, 3000), ((x) => { +let us = Belt_Array.map(Array_data_util.randomRange(1000, 3000), (x => { return Belt_SetInt.has(v$12, x); })); diff --git a/jscomp/test/bs_sort_test.js b/jscomp/test/bs_sort_test.js index ef50111c63f..783755c7c86 100644 --- a/jscomp/test/bs_sort_test.js +++ b/jscomp/test/bs_sort_test.js @@ -92,13 +92,13 @@ eq("File \"bs_sort_test.res\", line 52, characters 5-12", diffs(Array_data_util. 2 ]); -b("File \"bs_sort_test.res\", line 56, characters 4-11", Belt_Range.every(0, 200, ((i) => { +b("File \"bs_sort_test.res\", line 56, characters 4-11", Belt_Range.every(0, 200, (i => { let v = Array_data_util.randomRange(0, i); Belt_SortArray.stableSortInPlaceBy(v, cmp); return Belt_SortArray.isSorted(v, cmp); }))); -b("File \"bs_sort_test.res\", line 64, characters 4-11", Belt_Range.every(0, 200, ((i) => { +b("File \"bs_sort_test.res\", line 64, characters 4-11", Belt_Range.every(0, 200, (i => { let v = Array_data_util.randomRange(0, i); Belt_SortArray.stableSortInPlaceBy(v, cmp); return Belt_SortArray.isSorted(v, cmp); @@ -323,11 +323,11 @@ eq("File \"bs_sort_test.res\", line 116, characters 5-12", Belt_SortArray.binary let aa = Array_data_util.range(0, 1000); -b("File \"bs_sort_test.res\", line 118, characters 4-11", Belt_Range.every(0, 1000, ((i) => { +b("File \"bs_sort_test.res\", line 118, characters 4-11", Belt_Range.every(0, 1000, (i => { return Belt_SortArray.binarySearchBy(aa, i, cmp) === i; }))); -let cc = Belt_Array.map(Array_data_util.range(0, 2000), ((x) => { +let cc = Belt_Array.map(Array_data_util.range(0, 2000), (x => { return (x << 1); })); @@ -339,7 +339,7 @@ eq("File \"bs_sort_test.res\", line 123, characters 5-12", Belt_SortArray.binary eq("File \"bs_sort_test.res\", line 125, characters 5-12", Belt_SortArray.binarySearchBy(cc, 1, cmp) ^ -1, 1); -b("File \"bs_sort_test.res\", line 126, characters 6-13", Belt_Range.every(0, 1999, ((i) => { +b("File \"bs_sort_test.res\", line 126, characters 6-13", Belt_Range.every(0, 1999, (i => { return (Belt_SortArray.binarySearchBy(cc, (i << 1) + 1 | 0, cmp) ^ -1) === (i + 1 | 0); }))); diff --git a/jscomp/test/bs_stack_test.js b/jscomp/test/bs_stack_test.js index 1db4d7d4144..c533434e4c1 100644 --- a/jscomp/test/bs_stack_test.js +++ b/jscomp/test/bs_stack_test.js @@ -63,7 +63,7 @@ function inOrder3(v) { Belt_MutableStack.push(s, v$1); current = v$1.left; }; - Belt_MutableStack.dynamicPopIter(s, ((popped) => { + Belt_MutableStack.dynamicPopIter(s, (popped => { Belt_MutableQueue.add(q, popped.value); let current = popped.right; while (current !== undefined) { diff --git a/jscomp/test/buffer_test.js b/jscomp/test/buffer_test.js index d50fa12382f..685c3b5b147 100644 --- a/jscomp/test/buffer_test.js +++ b/jscomp/test/buffer_test.js @@ -11,7 +11,7 @@ let v = "gso"; let suites_0 = [ "equal", - ((param) => { + (param => { return { TAG: "Eq", _0: [ @@ -29,7 +29,7 @@ let suites_0 = [ let suites_1 = { hd: [ "equal2", - ((param) => { + (param => { let u = Bytes.make(3, /* 'a' */97); u[0] = /* 'b' */98; return { @@ -48,7 +48,7 @@ let suites_1 = { tl: { hd: [ "buffer", - ((param) => { + (param => { let v = Buffer.create(30); for (let i = 0; i <= 10; ++i) { Buffer.add_string(v, String(i)); diff --git a/jscomp/test/caml_compare_bigint_test.js b/jscomp/test/caml_compare_bigint_test.js index 0b92a76b35c..c5d05dfb9ba 100644 --- a/jscomp/test/caml_compare_bigint_test.js +++ b/jscomp/test/caml_compare_bigint_test.js @@ -9,7 +9,7 @@ function isLessThan(title, small, big) { return { hd: [ "compare: " + title, - ((param) => { + (param => { return { TAG: "Eq", _0: true, @@ -20,7 +20,7 @@ function isLessThan(title, small, big) { tl: { hd: [ "compare: " + title, - ((param) => { + (param => { return { TAG: "Eq", _0: true, @@ -31,7 +31,7 @@ function isLessThan(title, small, big) { tl: { hd: [ "< operator: " + title, - ((param) => { + (param => { return { TAG: "Eq", _0: true, @@ -42,7 +42,7 @@ function isLessThan(title, small, big) { tl: { hd: [ "<= operator: " + title, - ((param) => { + (param => { return { TAG: "Eq", _0: true, @@ -53,7 +53,7 @@ function isLessThan(title, small, big) { tl: { hd: [ "> operator: " + title, - ((param) => { + (param => { return { TAG: "Eq", _0: true, @@ -64,7 +64,7 @@ function isLessThan(title, small, big) { tl: { hd: [ ">= operator: " + title, - ((param) => { + (param => { return { TAG: "Eq", _0: true, @@ -75,7 +75,7 @@ function isLessThan(title, small, big) { tl: { hd: [ "min: " + title, - ((param) => { + (param => { return { TAG: "Eq", _0: small, @@ -86,7 +86,7 @@ function isLessThan(title, small, big) { tl: { hd: [ "min: " + title, - ((param) => { + (param => { return { TAG: "Eq", _0: small, @@ -97,7 +97,7 @@ function isLessThan(title, small, big) { tl: { hd: [ "max: " + title, - ((param) => { + (param => { return { TAG: "Eq", _0: big, @@ -108,7 +108,7 @@ function isLessThan(title, small, big) { tl: { hd: [ "max: " + title, - ((param) => { + (param => { return { TAG: "Eq", _0: big, @@ -119,7 +119,7 @@ function isLessThan(title, small, big) { tl: { hd: [ "!== operator: " + title, - ((param) => { + (param => { return { TAG: "Eq", _0: true, @@ -130,7 +130,7 @@ function isLessThan(title, small, big) { tl: { hd: [ "!== operator: " + title, - ((param) => { + (param => { return { TAG: "Eq", _0: true, @@ -141,7 +141,7 @@ function isLessThan(title, small, big) { tl: { hd: [ "!= operator: " + title, - ((param) => { + (param => { return { TAG: "Eq", _0: true, @@ -152,7 +152,7 @@ function isLessThan(title, small, big) { tl: { hd: [ "!= operator: " + title, - ((param) => { + (param => { return { TAG: "Eq", _0: true, @@ -163,7 +163,7 @@ function isLessThan(title, small, big) { tl: { hd: [ "== operator: " + title, - ((param) => { + (param => { return { TAG: "Eq", _0: false, @@ -174,7 +174,7 @@ function isLessThan(title, small, big) { tl: { hd: [ "== operator: " + title, - ((param) => { + (param => { return { TAG: "Eq", _0: false, @@ -185,7 +185,7 @@ function isLessThan(title, small, big) { tl: { hd: [ "=== operator: " + title, - ((param) => { + (param => { return { TAG: "Eq", _0: false, @@ -196,7 +196,7 @@ function isLessThan(title, small, big) { tl: { hd: [ "=== operator: " + title, - ((param) => { + (param => { return { TAG: "Eq", _0: false, @@ -229,7 +229,7 @@ function isEqual(title, num1, num2) { return { hd: [ "< operator: " + title, - ((param) => { + (param => { return { TAG: "Eq", _0: false, @@ -240,7 +240,7 @@ function isEqual(title, num1, num2) { tl: { hd: [ "<= operator: " + title, - ((param) => { + (param => { return { TAG: "Eq", _0: true, @@ -251,7 +251,7 @@ function isEqual(title, num1, num2) { tl: { hd: [ "> operator: " + title, - ((param) => { + (param => { return { TAG: "Eq", _0: false, @@ -262,7 +262,7 @@ function isEqual(title, num1, num2) { tl: { hd: [ ">= operator: " + title, - ((param) => { + (param => { return { TAG: "Eq", _0: true, @@ -273,7 +273,7 @@ function isEqual(title, num1, num2) { tl: { hd: [ "min: " + title, - ((param) => { + (param => { return { TAG: "Eq", _0: num1, @@ -284,7 +284,7 @@ function isEqual(title, num1, num2) { tl: { hd: [ "max: " + title, - ((param) => { + (param => { return { TAG: "Eq", _0: num1, @@ -295,7 +295,7 @@ function isEqual(title, num1, num2) { tl: { hd: [ "compare: " + title, - ((param) => { + (param => { return { TAG: "Eq", _0: 0, @@ -306,7 +306,7 @@ function isEqual(title, num1, num2) { tl: { hd: [ "compare: " + title, - ((param) => { + (param => { return { TAG: "Eq", _0: 0, @@ -317,7 +317,7 @@ function isEqual(title, num1, num2) { tl: { hd: [ "!= operator: " + title, - ((param) => { + (param => { return { TAG: "Eq", _0: false, @@ -328,7 +328,7 @@ function isEqual(title, num1, num2) { tl: { hd: [ "!= operator: " + title, - ((param) => { + (param => { return { TAG: "Eq", _0: false, @@ -339,7 +339,7 @@ function isEqual(title, num1, num2) { tl: { hd: [ "!= operator: " + title, - ((param) => { + (param => { return { TAG: "Eq", _0: false, @@ -350,7 +350,7 @@ function isEqual(title, num1, num2) { tl: { hd: [ "!= operator: " + title, - ((param) => { + (param => { return { TAG: "Eq", _0: false, @@ -361,7 +361,7 @@ function isEqual(title, num1, num2) { tl: { hd: [ "== operator: " + title, - ((param) => { + (param => { return { TAG: "Eq", _0: true, @@ -372,7 +372,7 @@ function isEqual(title, num1, num2) { tl: { hd: [ "== operator: " + title, - ((param) => { + (param => { return { TAG: "Eq", _0: true, @@ -383,7 +383,7 @@ function isEqual(title, num1, num2) { tl: { hd: [ "=== operator: " + title, - ((param) => { + (param => { return { TAG: "Eq", _0: true, @@ -394,7 +394,7 @@ function isEqual(title, num1, num2) { tl: { hd: [ "=== operator: " + title, - ((param) => { + (param => { return { TAG: "Eq", _0: true, diff --git a/jscomp/test/caml_compare_test.js b/jscomp/test/caml_compare_test.js index 17775ed42c0..5d149c4a978 100644 --- a/jscomp/test/caml_compare_test.js +++ b/jscomp/test/caml_compare_test.js @@ -8,9 +8,9 @@ let Caml_js_exceptions = require("../../lib/js/caml_js_exceptions.js"); let function_equal_test; try { - function_equal_test = Caml_obj.equal(((x) => { + function_equal_test = Caml_obj.equal((x => { return x + 1 | 0; - }), ((x) => { + }), (x => { return x + 2 | 0; })); } catch (raw_exn) { diff --git a/jscomp/test/caml_format_test.js b/jscomp/test/caml_format_test.js index 5d8d0345801..69551f8a363 100644 --- a/jscomp/test/caml_format_test.js +++ b/jscomp/test/caml_format_test.js @@ -90,7 +90,7 @@ function from_of_string(xs) { let a = param[0]; return [ "of_string " + String(i), - ((param) => { + (param => { return { TAG: "Eq", _0: Caml_format.int_of_string(b), @@ -320,7 +320,7 @@ let float_data = [ let int64_suites_0 = [ "i64_simple7", - ((param) => { + (param => { return { TAG: "Eq", _0: Caml_int64.to_string([ @@ -335,7 +335,7 @@ let int64_suites_0 = [ let int64_suites_1 = { hd: [ "i64_simple15", - ((param) => { + (param => { return { TAG: "Eq", _0: Caml_int64.to_string(Caml_int64.neg_one), @@ -346,7 +346,7 @@ let int64_suites_1 = { tl: { hd: [ "i64_simple16", - ((param) => { + (param => { return { TAG: "Eq", _0: Caml_int64.to_string([ diff --git a/jscomp/test/chn_test.js b/jscomp/test/chn_test.js index b3232f08976..b75c36db0e9 100644 --- a/jscomp/test/chn_test.js +++ b/jscomp/test/chn_test.js @@ -35,7 +35,7 @@ console.log("你好,\n世界"); console.log("\x3f\u003f\b\t\n\v\f\r\0\"'"); function convert(s) { - return $$Array.to_list(Array.from(s, ((x) => { + return $$Array.to_list(Array.from(s, (x => { let x$1 = x.codePointAt(0); if (x$1 !== undefined) { return x$1; diff --git a/jscomp/test/coercion_module_alias_test.js b/jscomp/test/coercion_module_alias_test.js index b548519390f..f08f262e3b0 100644 --- a/jscomp/test/coercion_module_alias_test.js +++ b/jscomp/test/coercion_module_alias_test.js @@ -27,7 +27,7 @@ console.log(prim$2); let f = List.length; function g(x) { - return List.length(List.map(((prim) => { + return List.length(List.map((prim => { return prim + 1 | 0; }), x)); } diff --git a/jscomp/test/complex_if_test.js b/jscomp/test/complex_if_test.js index ede522bf9b0..dd489b6705b 100644 --- a/jscomp/test/complex_if_test.js +++ b/jscomp/test/complex_if_test.js @@ -122,7 +122,7 @@ function string_escaped(s) { let suites_0 = [ "complete_escape", - ((param) => { + (param => { return { TAG: "Eq", _0: Bytes.to_string(escaped(Bytes.of_string("\x00\x01\x02\x03\x04\x05\x06\x07\b\t\n\x0b\x0c\r\x0e\x0f\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\x7f\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xaa\xab\xac\xad\xae\xaf\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff"))), diff --git a/jscomp/test/complex_test.js b/jscomp/test/complex_test.js index 457578ed542..b37c4a45a71 100644 --- a/jscomp/test/complex_test.js +++ b/jscomp/test/complex_test.js @@ -6,7 +6,7 @@ let Complex = require("../../lib/js/complex.js"); let suites_0 = [ "basic_add", - ((param) => { + (param => { return { TAG: "Eq", _0: { diff --git a/jscomp/test/complex_while_loop.js b/jscomp/test/complex_while_loop.js index 4889894e3d5..74fe66fea80 100644 --- a/jscomp/test/complex_while_loop.js +++ b/jscomp/test/complex_while_loop.js @@ -5,7 +5,7 @@ function f() { let n = 0; while ((() => { - let fib = (x) => { + let fib = x => { if (x === 0 || x === 1) { return 1; } else { diff --git a/jscomp/test/cps_test.js b/jscomp/test/cps_test.js index f5fc09f0546..775475b3711 100644 --- a/jscomp/test/cps_test.js +++ b/jscomp/test/cps_test.js @@ -34,15 +34,15 @@ function test_closure() { let v = { contents: 0 }; - let arr = Caml_array.make(6, ((x) => { + let arr = Caml_array.make(6, (x => { return x; })); for (let i = 0; i <= 5; ++i) { - Caml_array.set(arr, i, ((param) => { + Caml_array.set(arr, i, (param => { return i; })); } - $$Array.iter(((i) => { + $$Array.iter((i => { v.contents = v.contents + i(0) | 0; }), arr); return v.contents; @@ -52,16 +52,16 @@ function test_closure2() { let v = { contents: 0 }; - let arr = Caml_array.make(6, ((x) => { + let arr = Caml_array.make(6, (x => { return x; })); for (let i = 0; i <= 5; ++i) { let j = i + i | 0; - Caml_array.set(arr, i, ((param) => { + Caml_array.set(arr, i, (param => { return j; })); } - $$Array.iter(((i) => { + $$Array.iter((i => { v.contents = v.contents + i(0) | 0; }), arr); return v.contents; diff --git a/jscomp/test/demo_pipe.js b/jscomp/test/demo_pipe.js index 3023c224dae..51570c3f84d 100644 --- a/jscomp/test/demo_pipe.js +++ b/jscomp/test/demo_pipe.js @@ -3,7 +3,7 @@ function register(rl) { - return rl.on("line", ((x) => { + return rl.on("line", (x => { console.log(x); })).on("close", (() => { console.log("finished"); diff --git a/jscomp/test/digest_test.js b/jscomp/test/digest_test.js index 0de15cdac56..50fddfb30ae 100644 --- a/jscomp/test/digest_test.js +++ b/jscomp/test/digest_test.js @@ -217,7 +217,7 @@ Mt.from_pair_suites("Digest_test", Pervasives.$at({ } } } -}, $$Array.to_list($$Array.map(((i) => { +}, $$Array.to_list($$Array.map((i => { return [ String(i), (() => { diff --git a/jscomp/test/earger_curry_test.js b/jscomp/test/earger_curry_test.js index 523572b745a..d04d8386032 100644 --- a/jscomp/test/earger_curry_test.js +++ b/jscomp/test/earger_curry_test.js @@ -6,7 +6,7 @@ let Caml_array = require("../../lib/js/caml_array.js"); let Pervasives = require("../../lib/js/pervasives.js"); function map(f, a) { - let f$1 = (x) => { + let f$1 = x => { return f(x); }; let l = a.length; @@ -21,7 +21,7 @@ function map(f, a) { } function init(l, f) { - let f$1 = (x) => { + let f$1 = x => { return f(x); }; if (l === 0) { @@ -54,10 +54,10 @@ function fold_left(f, x, a) { } function f2() { - let arr = init(30000000, ((i) => { + let arr = init(30000000, (i => { return i; })); - let b = map(((i) => { + let b = map((i => { return i + i - 1; }), arr); let v = fold_left(((prim0, prim1) => { diff --git a/jscomp/test/epsilon_test.js b/jscomp/test/epsilon_test.js index e1d4c563a1a..7766655f571 100644 --- a/jscomp/test/epsilon_test.js +++ b/jscomp/test/epsilon_test.js @@ -8,7 +8,7 @@ let v = (Number.EPSILON?Number.EPSILON:2.220446049250313e-16); let suites_0 = [ "epsilon", - ((param) => { + (param => { return { TAG: "Eq", _0: Pervasives.epsilon_float, @@ -20,7 +20,7 @@ let suites_0 = [ let suites_1 = { hd: [ "raw_epsilon", - ((param) => { + (param => { return { TAG: "Eq", _0: 2.220446049250313e-16, diff --git a/jscomp/test/event_ffi.js b/jscomp/test/event_ffi.js index bcc191972af..4a0472be91a 100644 --- a/jscomp/test/event_ffi.js +++ b/jscomp/test/event_ffi.js @@ -20,7 +20,7 @@ function h10(x) { } function h30(x) { - return (a) => { + return a => { return x(3, 3, a); }; } @@ -42,7 +42,7 @@ function a0() { } function a1() { - return (x) => { + return x => { return x; }; } @@ -56,7 +56,7 @@ function a3(x, y, z) { } function xx() { - return (param) => { + return param => { console.log(3); }; } diff --git a/jscomp/test/ext_array_test.js b/jscomp/test/ext_array_test.js index 1c575766589..f7aef56e879 100644 --- a/jscomp/test/ext_array_test.js +++ b/jscomp/test/ext_array_test.js @@ -112,7 +112,7 @@ function range(from, to_) { } }); } - return $$Array.init((to_ - from | 0) + 1 | 0, ((i) => { + return $$Array.init((to_ - from | 0) + 1 | 0, (i => { return i + from | 0; })); } diff --git a/jscomp/test/ext_bytes_test.js b/jscomp/test/ext_bytes_test.js index cef53846f6a..08dea9cca83 100644 --- a/jscomp/test/ext_bytes_test.js +++ b/jscomp/test/ext_bytes_test.js @@ -170,7 +170,7 @@ let f = Char.chr; let a$2 = Bytes.unsafe_to_string(Bytes.init(100, f)); -let b = Bytes.init(100, ((i) => { +let b = Bytes.init(100, (i => { return /* '\000' */0; })); @@ -178,7 +178,7 @@ Bytes.blit_string(a$2, 10, b, 5, 10); eq("File \"ext_bytes_test.res\", line 141, characters 4-11", b, Bytes.of_string("\x00\x00\x00\x00\x00\n\x0b\x0c\r\x0e\x0f\x10\x11\x12\x13\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00")); -let s = Bytes.init(50000, ((i) => { +let s = Bytes.init(50000, (i => { return Char.chr(i % 137); })); diff --git a/jscomp/test/ext_filename_test.js b/jscomp/test/ext_filename_test.js index 035ee6c5876..f9bce06151f 100644 --- a/jscomp/test/ext_filename_test.js +++ b/jscomp/test/ext_filename_test.js @@ -33,7 +33,7 @@ function path_as_directory(x) { function absolute_path(s) { let s$1 = Filename.is_relative(s) ? Filename.concat(CamlinternalLazy.force(cwd), s) : s; - let aux = (_s) => { + let aux = _s => { while (true) { let s = _s; let base = Filename.basename(s); @@ -106,7 +106,7 @@ function relative_path(file_or_dir_1, file_or_dir_2) { _dir1 = dir1.tl; continue; } - return Pervasives.$at(List.map(((param) => { + return Pervasives.$at(List.map((param => { return node_parent; }), dir2), dir1); }; @@ -141,7 +141,7 @@ function node_relative_path(node_modules_shorten, file1, dep_file) { VAL: absolute_path(file1.VAL) })) + (node_sep + Filename.basename(file2)); } - let skip = (_i) => { + let skip = _i => { while (true) { let i = _i; if (i >= len) { @@ -281,7 +281,7 @@ function rel_normalized_absolute_path(from, to_) { } function normalize_absolute_path(x) { - let drop_if_exist = (xs) => { + let drop_if_exist = xs => { if (xs) { return xs.tl; } else { @@ -347,7 +347,7 @@ function get_extension(x) { let simple_convert_node_path_to_os_path; if (Sys.unix) { - simple_convert_node_path_to_os_path = ((x) => { + simple_convert_node_path_to_os_path = (x => { return x; }); } else if (Sys.win32 || false) { diff --git a/jscomp/test/ext_string_test.js b/jscomp/test/ext_string_test.js index a5321cf0c0a..5f906c7919c 100644 --- a/jscomp/test/ext_string_test.js +++ b/jscomp/test/ext_string_test.js @@ -82,14 +82,14 @@ function split(keep_empty, str, on) { if (str === "") { return /* [] */0; } else { - return split_by(keep_empty, ((x) => { + return split_by(keep_empty, (x => { return x === on; }), str); } } function quick_split_by_ws(str) { - return split_by(false, ((x) => { + return split_by(false, (x => { if (x === /* '\t' */9 || x === /* '\n' */10) { return true; } else { @@ -147,7 +147,7 @@ function ends_with_then_chop(s, beg) { } function check_any_suffix_case(s, suffixes) { - return List.exists(((x) => { + return List.exists((x => { return ends_with(s, x); }), suffixes); } @@ -169,7 +169,7 @@ function check_any_suffix_case_then_chop(s, suffixes) { } function escaped(s) { - let needs_escape = (_i) => { + let needs_escape = _i => { while (true) { let i = _i; if (i >= s.length) { @@ -449,7 +449,7 @@ function is_valid_module_file(s) { } else if (match < 65) { return false; } - return unsafe_for_all_range(s, 1, len - 1 | 0, ((x) => { + return unsafe_for_all_range(s, 1, len - 1 | 0, (x => { if (x >= 65) { if (x > 96 || x < 91) { return x < 123; @@ -481,7 +481,7 @@ function is_valid_npm_package_name(s) { } else if (match !== 64) { return false; } - return unsafe_for_all_range(s, 1, len - 1 | 0, ((x) => { + return unsafe_for_all_range(s, 1, len - 1 | 0, (x => { if (x >= 58) { if (x >= 97) { return x < 123; @@ -575,7 +575,7 @@ function replace_slash_backward(x) { if (unsafe_no_char(x, /* '/' */47, 0, len - 1 | 0)) { return x; } else { - return $$String.map(((x) => { + return $$String.map((x => { if (x !== 47) { return x; } else { @@ -590,7 +590,7 @@ function replace_backward_slash(x) { if (unsafe_no_char(x, /* '\\' */92, 0, len - 1 | 0)) { return x; } else { - return $$String.map(((x) => { + return $$String.map((x => { if (x !== 92) { return x; } else { diff --git a/jscomp/test/extensible_variant_test.js b/jscomp/test/extensible_variant_test.js index 676c9d8d62d..29905fc5a32 100644 --- a/jscomp/test/extensible_variant_test.js +++ b/jscomp/test/extensible_variant_test.js @@ -38,7 +38,7 @@ function to_int(x) { let suites_0 = [ "test_int", - ((param) => { + (param => { return { TAG: "Eq", _0: 3, @@ -54,7 +54,7 @@ let suites_0 = [ let suites_1 = { hd: [ "test_int2", - ((param) => { + (param => { return { TAG: "Eq", _0: 0, @@ -69,7 +69,7 @@ let suites_1 = { tl: { hd: [ "test_string", - ((param) => { + (param => { return { TAG: "Eq", _0: -1, diff --git a/jscomp/test/ffi_arity_test.js b/jscomp/test/ffi_arity_test.js index 9b2cce2d160..a47b3770cc3 100644 --- a/jscomp/test/ffi_arity_test.js +++ b/jscomp/test/ffi_arity_test.js @@ -5,11 +5,11 @@ let Mt = require("./mt.js"); function f(v) { if (v % 2 === 0) { - return (v) => { + return v => { return Math.imul(v, v); }; } else { - return (v) => { + return v => { return v + v | 0; }; } @@ -35,7 +35,7 @@ let hh = [ "1", "2", "3" -].map((x) => { +].map(x => { return parseInt(x); }); diff --git a/jscomp/test/ffi_array_test.js b/jscomp/test/ffi_array_test.js index 9000ef2e800..3946ce8764b 100644 --- a/jscomp/test/ffi_array_test.js +++ b/jscomp/test/ffi_array_test.js @@ -33,7 +33,7 @@ eq("File \"ffi_array_test.res\", line 11, characters 12-19", [ 2, 3, 4 -].map((x) => { +].map(x => { return x + 1 | 0; }), [ 2, diff --git a/jscomp/test/flexible_array_test.js b/jscomp/test/flexible_array_test.js index 139a2008d34..1cf78048a4f 100644 --- a/jscomp/test/flexible_array_test.js +++ b/jscomp/test/flexible_array_test.js @@ -269,10 +269,10 @@ function sort(s) { return s; } let head = get(s, 0); - let larger = sort(filter_from(1, ((x) => { + let larger = sort(filter_from(1, (x => { return Caml_obj.greaterthan(x, head); }), s)); - let smaller = sort(filter_from(1, ((x) => { + let smaller = sort(filter_from(1, (x => { return Caml_obj.lessequal(x, head); }), s)); return append(smaller, push_front(larger, head)); @@ -335,11 +335,11 @@ if (!$eq$tilde(sort(u), [ }); } -let v = $$Array.init(500, ((i) => { +let v = $$Array.init(500, (i => { return 500 - i | 0; })); -$eq$tilde(sort(of_array(v)), $$Array.init(500, ((i) => { +$eq$tilde(sort(of_array(v)), $$Array.init(500, (i => { return i + 1 | 0; }))); diff --git a/jscomp/test/float_of_bits_test.js b/jscomp/test/float_of_bits_test.js index 1e34c7819d2..40b698b9436 100644 --- a/jscomp/test/float_of_bits_test.js +++ b/jscomp/test/float_of_bits_test.js @@ -31,7 +31,7 @@ function from_pairs(pair) { return { hd: [ "int32_float_of_bits " + i, - ((param) => { + (param => { return { TAG: "Eq", _0: Caml_float.int_float_of_bits(i32), @@ -42,7 +42,7 @@ function from_pairs(pair) { tl: { hd: [ "int32_bits_of_float " + i, - ((param) => { + (param => { return { TAG: "Eq", _0: Caml_float.int_bits_of_float(f), diff --git a/jscomp/test/float_test.js b/jscomp/test/float_test.js index cec7b9e76bf..236150f421f 100644 --- a/jscomp/test/float_test.js +++ b/jscomp/test/float_test.js @@ -123,7 +123,7 @@ function from_pairs(ps) { let a = param[0]; return [ "pair " + i, - ((param) => { + (param => { return { TAG: "Approx", _0: a, @@ -191,7 +191,7 @@ eq("File \"float_test.res\", line 62, characters 4-11", [ true ]); -eq("File \"float_test.res\", line 71, characters 4-11", $$Array.map(((x) => { +eq("File \"float_test.res\", line 71, characters 4-11", $$Array.map((x => { if (x > 0) { return 1; } else if (x < 0) { @@ -199,7 +199,7 @@ eq("File \"float_test.res\", line 71, characters 4-11", $$Array.map(((x) => { } else { return 0; } -}), $$Array.map(((param) => { +}), $$Array.map((param => { return Caml.float_compare(param[0], param[1]); }), [ [ diff --git a/jscomp/test/for_loop_test.js b/jscomp/test/for_loop_test.js index 26000477487..03e19b4ae87 100644 --- a/jscomp/test/for_loop_test.js +++ b/jscomp/test/for_loop_test.js @@ -9,7 +9,7 @@ function for_3(x) { let v = { contents: 0 }; - let arr = $$Array.map(((param) => { + let arr = $$Array.map((param => { return () => { }; @@ -20,7 +20,7 @@ function for_3(x) { v.contents = v.contents + j | 0; })); } - $$Array.iter(((x) => { + $$Array.iter((x => { x(); }), arr); return v.contents; @@ -30,7 +30,7 @@ function for_4(x) { let v = { contents: 0 }; - let arr = $$Array.map(((param) => { + let arr = $$Array.map((param => { return () => { }; @@ -42,7 +42,7 @@ function for_4(x) { v.contents = v.contents + k | 0; })); } - $$Array.iter(((x) => { + $$Array.iter((x => { x(); }), arr); return v.contents; @@ -52,7 +52,7 @@ function for_5(x, u) { let v = { contents: 0 }; - let arr = $$Array.map(((param) => { + let arr = $$Array.map((param => { return () => { }; @@ -63,7 +63,7 @@ function for_5(x, u) { v.contents = v.contents + k | 0; })); } - $$Array.iter(((x) => { + $$Array.iter((x => { x(); }), arr); return v.contents; @@ -73,7 +73,7 @@ function for_6(x, u) { let v = { contents: 0 }; - let arr = $$Array.map(((param) => { + let arr = $$Array.map((param => { return () => { }; @@ -101,7 +101,7 @@ function for_6(x, u) { } inspect_3 = v2.contents; } - $$Array.iter(((x) => { + $$Array.iter((x => { x(); }), arr); return [ @@ -126,7 +126,7 @@ function for_7() { })); } } - $$Array.iter(((f) => { + $$Array.iter((f => { f(); }), arr); return v.contents; @@ -148,7 +148,7 @@ function for_8() { })); } } - $$Array.iter(((f) => { + $$Array.iter((f => { f(); }), arr); return v.contents; @@ -158,7 +158,7 @@ function for_9() { let v = { contents: /* [] */0 }; - let collect = (x) => { + let collect = x => { v.contents = { hd: x, tl: v.contents @@ -192,10 +192,10 @@ function for_9() { vv2.contents = vv2.contents + v$1.contents | 0; })); } - $$Array.iter(((f) => { + $$Array.iter((f => { f(); }), arr); - $$Array.iter(((f) => { + $$Array.iter((f => { f(); }), arr2); return [[ @@ -207,7 +207,7 @@ function for_9() { let suites_0 = [ "for_loop_test_3", - ((param) => { + (param => { return { TAG: "Eq", _0: 90, @@ -219,7 +219,7 @@ let suites_0 = [ let suites_1 = { hd: [ "for_loop_test_4", - ((param) => { + (param => { return { TAG: "Eq", _0: 180, @@ -230,7 +230,7 @@ let suites_1 = { tl: { hd: [ "for_loop_test_5", - ((param) => { + (param => { return { TAG: "Eq", _0: 2420, @@ -241,7 +241,7 @@ let suites_1 = { tl: { hd: [ "for_loop_test_6", - ((param) => { + (param => { return { TAG: "Eq", _0: [ @@ -257,7 +257,7 @@ let suites_1 = { tl: { hd: [ "for_loop_test_7", - ((param) => { + (param => { return { TAG: "Eq", _0: 84, @@ -268,7 +268,7 @@ let suites_1 = { tl: { hd: [ "for_loop_test_8", - ((param) => { + (param => { return { TAG: "Eq", _0: 294, @@ -279,7 +279,7 @@ let suites_1 = { tl: { hd: [ "for_loop_test_9", - ((param) => { + (param => { return { TAG: "Eq", _0: [[ diff --git a/jscomp/test/for_side_effect_test.js b/jscomp/test/for_side_effect_test.js index 77a3541244c..b09d72bbaeb 100644 --- a/jscomp/test/for_side_effect_test.js +++ b/jscomp/test/for_side_effect_test.js @@ -21,7 +21,7 @@ function test2() { let suites_0 = [ "for_order", - ((param) => { + (param => { return { TAG: "Eq", _0: 10, diff --git a/jscomp/test/format_test.js b/jscomp/test/format_test.js index 16873b760ea..c56ca5671b5 100644 --- a/jscomp/test/format_test.js +++ b/jscomp/test/format_test.js @@ -77,7 +77,7 @@ eq("File \"format_test.res\", line 45, characters 5-12", (1 + 4095 / 4096) * 8, eq("File \"format_test.res\", line 46, characters 5-12", (1 + 65535 / 65536) * 8, 15.9998779296875); function f(loc, ls) { - List.iter(((param) => { + List.iter((param => { eq(loc, Caml_format.float_of_string(param[0]), param[1]); }), ls); } @@ -107,7 +107,7 @@ function sl(f) { } function aux_list(loc, ls) { - List.iter(((param) => { + List.iter((param => { eq(loc, Caml_format.hexstring_of_float(param[0], -1, /* '-' */45), param[1]); }), ls); } @@ -186,7 +186,7 @@ scan_float("File \"format_test.res\", line 80, characters 13-20", "0x3f.p1", 126 scan_float("File \"format_test.res\", line 81, characters 13-20", "0x1.3333333333333p-2", 0.3); -List.iter(((param) => { +List.iter((param => { scan_float("File \"format_test.res\", line 82, characters 35-42", param[1], param[0]); }), literals); diff --git a/jscomp/test/functors.js b/jscomp/test/functors.js index d7a7df9cd9f..f603ffb3f55 100644 --- a/jscomp/test/functors.js +++ b/jscomp/test/functors.js @@ -3,10 +3,10 @@ function O(X) { - let cow = (x) => { + let cow = x => { return X.foo(x); }; - let sheep = (x) => { + let sheep = x => { return 1 + X.foo(x) | 0; }; return { @@ -16,10 +16,10 @@ function O(X) { } function F(X, Y) { - let cow = (x) => { + let cow = x => { return Y.foo(X.foo(x)); }; - let sheep = (x) => { + let sheep = x => { return 1 + Y.foo(X.foo(x)) | 0; }; return { @@ -29,7 +29,7 @@ function F(X, Y) { } function F1(X, Y) { - let sheep = (x) => { + let sheep = x => { return 1 + Y.foo(X.foo(x)) | 0; }; return { @@ -38,7 +38,7 @@ function F1(X, Y) { } function F2(X, Y) { - let sheep = (x) => { + let sheep = x => { return 1 + Y.foo(X.foo(x)) | 0; }; return { @@ -48,7 +48,7 @@ function F2(X, Y) { let M = { F: ((funarg, funarg$1) => { - let sheep = (x) => { + let sheep = x => { return 1 + funarg$1.foo(funarg.foo(x)) | 0; }; return { diff --git a/jscomp/test/genlex_test.js b/jscomp/test/genlex_test.js index 6a5c74618a1..351756a40dc 100644 --- a/jscomp/test/genlex_test.js +++ b/jscomp/test/genlex_test.js @@ -59,7 +59,7 @@ function to_list(s) { let suites_0 = [ "lexer_stream_genlex", - ((param) => { + (param => { return { TAG: "Eq", _0: { diff --git a/jscomp/test/global_exception_regression_test.js b/jscomp/test/global_exception_regression_test.js index e5a5c87f9f8..39e4feb2abc 100644 --- a/jscomp/test/global_exception_regression_test.js +++ b/jscomp/test/global_exception_regression_test.js @@ -17,7 +17,7 @@ let s = { let suites_0 = [ "not_found_equal", - ((param) => { + (param => { return { TAG: "Eq", _0: u, @@ -29,7 +29,7 @@ let suites_0 = [ let suites_1 = { hd: [ "not_found_not_equal_end_of_file", - ((param) => { + (param => { return { TAG: "Neq", _0: u, diff --git a/jscomp/test/gpr_1409_test.js b/jscomp/test/gpr_1409_test.js index 32016b7976f..cc023a68eb5 100644 --- a/jscomp/test/gpr_1409_test.js +++ b/jscomp/test/gpr_1409_test.js @@ -46,7 +46,7 @@ function map(f, x) { function make(foo, param) { let tmp = {}; - let tmp$1 = map(((prim) => { + let tmp$1 = map((prim => { return String(prim); }), foo); if (tmp$1 !== undefined) { diff --git a/jscomp/test/gpr_1438.js b/jscomp/test/gpr_1438.js index 2b33b505ce6..ccbd93c17ae 100644 --- a/jscomp/test/gpr_1438.js +++ b/jscomp/test/gpr_1438.js @@ -16,7 +16,7 @@ function actionKey(key, a, b, c, d, e) { case 118 : return a; } - return (param) => { + return param => { }; } diff --git a/jscomp/test/gpr_1692_test.js b/jscomp/test/gpr_1692_test.js index 955d7585a66..6e74a6ca12a 100644 --- a/jscomp/test/gpr_1692_test.js +++ b/jscomp/test/gpr_1692_test.js @@ -2,7 +2,7 @@ 'use strict'; -((f) => { +(f => { return 0; })(""); diff --git a/jscomp/test/gpr_1701_test.js b/jscomp/test/gpr_1701_test.js index dbd44e2ca67..dbf9f7c67a3 100644 --- a/jscomp/test/gpr_1701_test.js +++ b/jscomp/test/gpr_1701_test.js @@ -83,7 +83,7 @@ function read_lines2(inc) { } function read_lines3(inc) { - let loop = (acc) => { + let loop = acc => { try { let l = input_line(inc); return loop({ diff --git a/jscomp/test/gpr_2608_test.js b/jscomp/test/gpr_2608_test.js index d436f8a5db7..9373980495a 100644 --- a/jscomp/test/gpr_2608_test.js +++ b/jscomp/test/gpr_2608_test.js @@ -24,7 +24,7 @@ let oppHeroes = { let huntGrootCondition = false; if (List.length(/* [] */0) > 0) { - let x = List.filter(((h) => { + let x = List.filter((h => { return List.hd(/* [] */0) <= 1000; }), oppHeroes); huntGrootCondition = List.length(x) === 0; @@ -33,7 +33,7 @@ if (List.length(/* [] */0) > 0) { let huntGrootCondition2 = true; if (List.length(/* [] */0) < 0) { - let x$1 = List.filter(((h) => { + let x$1 = List.filter((h => { return List.hd(/* [] */0) <= 1000; }), oppHeroes); huntGrootCondition2 = List.length(x$1) === 0; diff --git a/jscomp/test/gpr_2682_test.js b/jscomp/test/gpr_2682_test.js index 731d7fac5cc..81c929cc5ee 100644 --- a/jscomp/test/gpr_2682_test.js +++ b/jscomp/test/gpr_2682_test.js @@ -30,14 +30,14 @@ let N = { forIn({ x: 3 -}, ((x) => { +}, (x => { console.log(x); })); forIn({ x: 3, y: 3 -}, ((x) => { +}, (x => { console.log(x); })); diff --git a/jscomp/test/gpr_3566_test.js b/jscomp/test/gpr_3566_test.js index 177d322c4e1..745294d913b 100644 --- a/jscomp/test/gpr_3566_test.js +++ b/jscomp/test/gpr_3566_test.js @@ -75,7 +75,7 @@ function Test4($star) { } function Test5($star) { - let f = (x) => { + let f = x => { return Caml_option.some(x); }; let Caml_option$1 = {}; @@ -87,7 +87,7 @@ function Test5($star) { function Test6($star) { let Caml_option$1 = {}; - let f = (x) => { + let f = x => { return Caml_option.some(x); }; return { @@ -105,7 +105,7 @@ function Test7($star) { function Test8($star) { let Curry = {}; - let f = (x) => { + let f = x => { return x(1); }; return { @@ -115,7 +115,7 @@ function Test8($star) { } function Test9($star) { - let f = (x) => { + let f = x => { return x(1); }; let Curry = {}; diff --git a/jscomp/test/gpr_4274_test.js b/jscomp/test/gpr_4274_test.js index 991848b64f9..a2413299152 100644 --- a/jscomp/test/gpr_4274_test.js +++ b/jscomp/test/gpr_4274_test.js @@ -8,7 +8,7 @@ let N = {}; function f(X, xs) { X.forEach(xs, { - i: ((x) => { + i: (x => { console.log(x.x); }) }); @@ -19,7 +19,7 @@ Belt_List.forEach({ x: 3 }, tl: /* [] */0 -}, ((x) => { +}, (x => { console.log(x.x); })); @@ -29,7 +29,7 @@ let bar = [{ foo: "bar" }]; -Belt_Array.map(bar, ((b) => { +Belt_Array.map(bar, (b => { return b.foo; })); diff --git a/jscomp/test/hash_test.js b/jscomp/test/hash_test.js index ec3c00e0fbb..14a693e2e05 100644 --- a/jscomp/test/hash_test.js +++ b/jscomp/test/hash_test.js @@ -20,7 +20,7 @@ function eq(f, x, y) { Mt_global.collect_eq(test_id, suites, f, x, y); } -let test_strings = $$Array.init(32, ((i) => { +let test_strings = $$Array.init(32, (i => { return Caml_string.make(i, Char.chr(i)); })); diff --git a/jscomp/test/hashtbl_test.js b/jscomp/test/hashtbl_test.js index 698df837d14..a0baa3f5fca 100644 --- a/jscomp/test/hashtbl_test.js +++ b/jscomp/test/hashtbl_test.js @@ -46,7 +46,7 @@ function g(count) { let suites_0 = [ "simple", - ((param) => { + (param => { return { TAG: "Eq", _0: { @@ -70,10 +70,10 @@ let suites_0 = [ let suites_1 = { hd: [ "more_iterations", - ((param) => { + (param => { return { TAG: "Eq", - _0: $$Array.init(1001, ((i) => { + _0: $$Array.init(1001, (i => { return [ (i << 1), String(i) @@ -86,7 +86,7 @@ let suites_1 = { tl: { hd: [ "More_labels_regressionfix_374", - ((param) => { + (param => { let tbl = MoreLabels.Hashtbl.create(undefined, 30); Hashtbl.add(tbl, 3, 3); return { diff --git a/jscomp/test/import2.js b/jscomp/test/import2.js index d97550b9ae0..c6ddb6aaeca 100644 --- a/jscomp/test/import2.js +++ b/jscomp/test/import2.js @@ -3,7 +3,7 @@ let A = require("a").default; -let a = import("a").then((m) => { +let a = import("a").then(m => { return m.default; }); diff --git a/jscomp/test/import_external.js b/jscomp/test/import_external.js index 2cb1be2dfa0..ad11e4f2569 100644 --- a/jscomp/test/import_external.js +++ b/jscomp/test/import_external.js @@ -2,7 +2,7 @@ 'use strict'; -let f8 = import("a").then((m) => { +let f8 = import("a").then(m => { return m.default; }); diff --git a/jscomp/test/import_side_effect.js b/jscomp/test/import_side_effect.js index c84ef1af659..4b33d31358a 100644 --- a/jscomp/test/import_side_effect.js +++ b/jscomp/test/import_side_effect.js @@ -2,7 +2,7 @@ 'use strict'; -let a = import("./side_effect2.js").then((m) => { +let a = import("./side_effect2.js").then(m => { return m.a; }); diff --git a/jscomp/test/import_side_effect_free.js b/jscomp/test/import_side_effect_free.js index 62c0cc1f123..3f014a84a6d 100644 --- a/jscomp/test/import_side_effect_free.js +++ b/jscomp/test/import_side_effect_free.js @@ -2,7 +2,7 @@ 'use strict'; -let a = await import("./side_effect_free.js").then((m) => { +let a = await import("./side_effect_free.js").then(m => { return m.a; }); diff --git a/jscomp/test/inline_map2_test.js b/jscomp/test/inline_map2_test.js index d893be954fa..bd17d86eb66 100644 --- a/jscomp/test/inline_map2_test.js +++ b/jscomp/test/inline_map2_test.js @@ -7,7 +7,7 @@ let List = require("../../lib/js/list.js"); let Caml_option = require("../../lib/js/caml_option.js"); function Make(Ord) { - let height = (x) => { + let height = x => { if (typeof x !== "object") { return 0; } else { @@ -102,7 +102,7 @@ function Make(Ord) { } }); }; - let is_empty = (x) => { + let is_empty = x => { if (typeof x !== "object") { return true; } else { @@ -172,7 +172,7 @@ function Make(Ord) { continue; }; }; - let min_binding = (_x) => { + let min_binding = _x => { while (true) { let x = _x; if (typeof x !== "object") { @@ -193,7 +193,7 @@ function Make(Ord) { continue; }; }; - let max_binding = (_x) => { + let max_binding = _x => { while (true) { let x = _x; if (typeof x !== "object") { @@ -214,7 +214,7 @@ function Make(Ord) { continue; }; }; - let remove_min_binding = (x) => { + let remove_min_binding = x => { if (typeof x !== "object") { throw new Error("Invalid_argument", { cause: { @@ -573,7 +573,7 @@ function Make(Ord) { continue; }; }; - let cardinal = (x) => { + let cardinal = x => { if (typeof x !== "object") { return 0; } else { @@ -598,7 +598,7 @@ function Make(Ord) { continue; }; }; - let bindings = (s) => { + let bindings = s => { return bindings_aux(/* [] */0, s); }; return { diff --git a/jscomp/test/inline_regression_test.js b/jscomp/test/inline_regression_test.js index 752940aa32d..0ca64bb4c1f 100644 --- a/jscomp/test/inline_regression_test.js +++ b/jscomp/test/inline_regression_test.js @@ -45,7 +45,7 @@ function basename(extra) { let suites_0 = [ "basename", - ((param) => { + (param => { return { TAG: "Eq", _0: basename("b/c/a.b"), diff --git a/jscomp/test/inner_unused.js b/jscomp/test/inner_unused.js index 15ab8e5d6e3..8ad25dd0a94 100644 --- a/jscomp/test/inner_unused.js +++ b/jscomp/test/inner_unused.js @@ -7,7 +7,7 @@ function f(x) { } function M(S) { - let f = (x) => { + let f = x => { return x; }; return { diff --git a/jscomp/test/int32_test.js b/jscomp/test/int32_test.js index 2bf16507970..796298f120b 100644 --- a/jscomp/test/int32_test.js +++ b/jscomp/test/int32_test.js @@ -16,7 +16,7 @@ function f(x) { ]; } -let shift_right_logical_tests_0 = $$Array.map(((x) => { +let shift_right_logical_tests_0 = $$Array.map((x => { return (-1 >>> x) | 0; }), Ext_array_test.range(0, 31)); @@ -60,7 +60,7 @@ let shift_right_logical_tests = [ shift_right_logical_tests_1 ]; -let shift_right_tests_0 = $$Array.map(((x) => { +let shift_right_tests_0 = $$Array.map((x => { return (Int32.min_int >> x); }), Ext_array_test.range(0, 31)); @@ -104,7 +104,7 @@ let shift_right_tests = [ shift_right_tests_1 ]; -let shift_left_tests_0 = $$Array.map(((x) => { +let shift_left_tests_0 = $$Array.map((x => { return (1 << x); }), Ext_array_test.range(0, 31)); diff --git a/jscomp/test/int64_mul_div_test.js b/jscomp/test/int64_mul_div_test.js index 362efe81228..147aeb35151 100644 --- a/jscomp/test/int64_mul_div_test.js +++ b/jscomp/test/int64_mul_div_test.js @@ -312,7 +312,7 @@ function from_pairs(prefix, pairs) { let result = param[0]; return [ prefix + "_" + i, - ((param) => { + (param => { return commutative_mul(result, a, b); }) ]; @@ -1516,7 +1516,7 @@ function from(xs) { let a = param[0]; return [ "small_divs " + i, - ((param) => { + (param => { return { TAG: "Eq", _0: [ @@ -1572,7 +1572,7 @@ function from_compare(xs) { let a = param[0]; return [ "int64_compare " + i, - ((param) => { + (param => { return { TAG: "Eq", _0: c, @@ -1589,7 +1589,7 @@ function from_to_string(xs) { let a = param[0]; return [ "to_string " + i, - ((param) => { + (param => { return { TAG: "Eq", _0: str_a, @@ -1632,7 +1632,7 @@ Mt.from_pair_suites("Int64_mul_div_test", Pervasives.$at(from_pairs("random", pa (() => { return { TAG: "Eq", - _0: $$Array.map(((param) => { + _0: $$Array.map((param => { return true; }), check_complete_compare), _1: check_complete_compare diff --git a/jscomp/test/int64_string_test.js b/jscomp/test/int64_string_test.js index fb3db17ce23..07dfa89c3e1 100644 --- a/jscomp/test/int64_string_test.js +++ b/jscomp/test/int64_string_test.js @@ -1304,7 +1304,7 @@ let random_data = { } }; -Belt_List.forEach(random_data, ((u) => { +Belt_List.forEach(random_data, (u => { if (u) { if (u.tl) { throw new Error("Assert_failure", { diff --git a/jscomp/test/int64_test.js b/jscomp/test/int64_test.js index 4906cb2b0bb..27c1d4f6052 100644 --- a/jscomp/test/int64_test.js +++ b/jscomp/test/int64_test.js @@ -35,7 +35,7 @@ function commutative_add(result, a, b) { let generic_compare = Caml_obj.compare; -let shift_left_tests_0 = $$Array.map(((i) => { +let shift_left_tests_0 = $$Array.map((i => { return Caml_int64.lsl_(Caml_int64.one, i); }), Ext_array_test.range(0, 63)); @@ -297,7 +297,7 @@ let shift_left_tests = [ shift_left_tests_1 ]; -let shift_right_tests_0 = $$Array.map(((i) => { +let shift_right_tests_0 = $$Array.map((i => { return Caml_int64.asr_(Caml_int64.min_int, i); }), Ext_array_test.range(0, 63)); @@ -559,7 +559,7 @@ let shift_right_tests = [ shift_right_tests_1 ]; -let shift_right_logical_suites_0 = $$Array.map(((i) => { +let shift_right_logical_suites_0 = $$Array.map((i => { return Caml_int64.lsr_(Caml_int64.min_int, i); }), Ext_array_test.range(0, 63)); @@ -1188,9 +1188,9 @@ let suites = Pervasives.$at({ (() => { return { TAG: "Eq", - _0: $$Array.map(((x) => { + _0: $$Array.map((x => { return Caml_int64.lsl_(Caml_int64.one, x); - }), $$Array.init(64, ((i) => { + }), $$Array.init(64, (i => { return i; }))), _1: [ @@ -1454,9 +1454,9 @@ let suites = Pervasives.$at({ (() => { return { TAG: "Eq", - _0: $$Array.map(((x) => { + _0: $$Array.map((x => { return Caml_int64.lsr_(Caml_int64.neg_one, x); - }), $$Array.init(64, ((i) => { + }), $$Array.init(64, (i => { return i; }))), _1: [ @@ -1717,9 +1717,9 @@ let suites = Pervasives.$at({ (() => { return { TAG: "Eq", - _0: $$Array.map(((x) => { + _0: $$Array.map((x => { return Caml_int64.asr_(Caml_int64.neg_one, x); - }), $$Array.init(64, ((i) => { + }), $$Array.init(64, (i => { return i; }))), _1: [ diff --git a/jscomp/test/int_hashtbl_test.js b/jscomp/test/int_hashtbl_test.js index 10f6558f7a5..a9fbce24483 100644 --- a/jscomp/test/int_hashtbl_test.js +++ b/jscomp/test/int_hashtbl_test.js @@ -60,7 +60,7 @@ let Int_hash = Hashtbl.Make({ let suites_0 = [ "simple", - ((param) => { + (param => { return { TAG: "Eq", _0: { @@ -84,10 +84,10 @@ let suites_0 = [ let suites_1 = { hd: [ "more_iterations", - ((param) => { + (param => { return { TAG: "Eq", - _0: $$Array.init(1001, ((i) => { + _0: $$Array.init(1001, (i => { return [ (i << 1), String(i) diff --git a/jscomp/test/js_array_test.js b/jscomp/test/js_array_test.js index 05f2a9b632d..cb2ca6388b0 100644 --- a/jscomp/test/js_array_test.js +++ b/jscomp/test/js_array_test.js @@ -6,7 +6,7 @@ let Caml_option = require("../../lib/js/caml_option.js"); let suites_0 = [ "isArray_array", - ((param) => { + (param => { return { TAG: "Eq", _0: true, @@ -18,7 +18,7 @@ let suites_0 = [ let suites_1 = { hd: [ "isArray_int", - ((param) => { + (param => { return { TAG: "Eq", _0: false, @@ -29,7 +29,7 @@ let suites_1 = { tl: { hd: [ "length", - ((param) => { + (param => { return { TAG: "Eq", _0: 3, @@ -44,7 +44,7 @@ let suites_1 = { tl: { hd: [ "copyWithin", - ((param) => { + (param => { return { TAG: "Eq", _0: [ @@ -67,7 +67,7 @@ let suites_1 = { tl: { hd: [ "copyWithinFrom", - ((param) => { + (param => { return { TAG: "Eq", _0: [ @@ -90,7 +90,7 @@ let suites_1 = { tl: { hd: [ "copyWithinFromRange", - ((param) => { + (param => { return { TAG: "Eq", _0: [ @@ -113,7 +113,7 @@ let suites_1 = { tl: { hd: [ "fillInPlace", - ((param) => { + (param => { return { TAG: "Eq", _0: [ @@ -132,7 +132,7 @@ let suites_1 = { tl: { hd: [ "fillFromInPlace", - ((param) => { + (param => { return { TAG: "Eq", _0: [ @@ -151,7 +151,7 @@ let suites_1 = { tl: { hd: [ "fillRangeInPlace", - ((param) => { + (param => { return { TAG: "Eq", _0: [ @@ -170,7 +170,7 @@ let suites_1 = { tl: { hd: [ "pop", - ((param) => { + (param => { return { TAG: "Eq", _0: 3, @@ -185,7 +185,7 @@ let suites_1 = { tl: { hd: [ "pop - empty array", - ((param) => { + (param => { return { TAG: "Eq", _0: undefined, @@ -196,7 +196,7 @@ let suites_1 = { tl: { hd: [ "push", - ((param) => { + (param => { return { TAG: "Eq", _0: 4, @@ -211,7 +211,7 @@ let suites_1 = { tl: { hd: [ "pushMany", - ((param) => { + (param => { return { TAG: "Eq", _0: 5, @@ -226,7 +226,7 @@ let suites_1 = { tl: { hd: [ "reverseInPlace", - ((param) => { + (param => { return { TAG: "Eq", _0: [ @@ -245,7 +245,7 @@ let suites_1 = { tl: { hd: [ "shift", - ((param) => { + (param => { return { TAG: "Eq", _0: 1, @@ -260,7 +260,7 @@ let suites_1 = { tl: { hd: [ "shift - empty array", - ((param) => { + (param => { return { TAG: "Eq", _0: undefined, @@ -271,7 +271,7 @@ let suites_1 = { tl: { hd: [ "sortInPlace", - ((param) => { + (param => { return { TAG: "Eq", _0: [ @@ -290,7 +290,7 @@ let suites_1 = { tl: { hd: [ "sortInPlaceWith", - ((param) => { + (param => { return { TAG: "Eq", _0: [ @@ -311,7 +311,7 @@ let suites_1 = { tl: { hd: [ "spliceInPlace", - ((param) => { + (param => { let arr = [ 1, 2, @@ -341,7 +341,7 @@ let suites_1 = { tl: { hd: [ "removeFromInPlace", - ((param) => { + (param => { let arr = [ 1, 2, @@ -371,7 +371,7 @@ let suites_1 = { tl: { hd: [ "removeCountInPlace", - ((param) => { + (param => { let arr = [ 1, 2, @@ -399,7 +399,7 @@ let suites_1 = { tl: { hd: [ "unshift", - ((param) => { + (param => { return { TAG: "Eq", _0: 4, @@ -414,7 +414,7 @@ let suites_1 = { tl: { hd: [ "unshiftMany", - ((param) => { + (param => { return { TAG: "Eq", _0: 5, @@ -429,7 +429,7 @@ let suites_1 = { tl: { hd: [ "append", - ((param) => { + (param => { return { TAG: "Eq", _0: [ @@ -449,7 +449,7 @@ let suites_1 = { tl: { hd: [ "concat", - ((param) => { + (param => { return { TAG: "Eq", _0: [ @@ -473,7 +473,7 @@ let suites_1 = { tl: { hd: [ "concatMany", - ((param) => { + (param => { return { TAG: "Eq", _0: [ @@ -502,7 +502,7 @@ let suites_1 = { tl: { hd: [ "includes", - ((param) => { + (param => { return { TAG: "Eq", _0: true, @@ -517,7 +517,7 @@ let suites_1 = { tl: { hd: [ "indexOf", - ((param) => { + (param => { return { TAG: "Eq", _0: 1, @@ -532,7 +532,7 @@ let suites_1 = { tl: { hd: [ "indexOfFrom", - ((param) => { + (param => { return { TAG: "Eq", _0: 3, @@ -548,7 +548,7 @@ let suites_1 = { tl: { hd: [ "join", - ((param) => { + (param => { return { TAG: "Eq", _0: "1,2,3", @@ -563,7 +563,7 @@ let suites_1 = { tl: { hd: [ "joinWith", - ((param) => { + (param => { return { TAG: "Eq", _0: "1;2;3", @@ -578,7 +578,7 @@ let suites_1 = { tl: { hd: [ "lastIndexOf", - ((param) => { + (param => { return { TAG: "Eq", _0: 1, @@ -593,7 +593,7 @@ let suites_1 = { tl: { hd: [ "lastIndexOfFrom", - ((param) => { + (param => { return { TAG: "Eq", _0: 1, @@ -609,7 +609,7 @@ let suites_1 = { tl: { hd: [ "slice", - ((param) => { + (param => { return { TAG: "Eq", _0: [ @@ -629,7 +629,7 @@ let suites_1 = { tl: { hd: [ "copy", - ((param) => { + (param => { return { TAG: "Eq", _0: [ @@ -652,7 +652,7 @@ let suites_1 = { tl: { hd: [ "sliceFrom", - ((param) => { + (param => { return { TAG: "Eq", _0: [ @@ -673,7 +673,7 @@ let suites_1 = { tl: { hd: [ "toString", - ((param) => { + (param => { return { TAG: "Eq", _0: "1,2,3", @@ -688,7 +688,7 @@ let suites_1 = { tl: { hd: [ "toLocaleString", - ((param) => { + (param => { return { TAG: "Eq", _0: "1,2,3", @@ -703,7 +703,7 @@ let suites_1 = { tl: { hd: [ "every", - ((param) => { + (param => { return { TAG: "Eq", _0: true, @@ -711,7 +711,7 @@ let suites_1 = { 1, 2, 3 - ].every((n) => { + ].every(n => { return n > 0; }) }; @@ -720,7 +720,7 @@ let suites_1 = { tl: { hd: [ "everyi", - ((param) => { + (param => { return { TAG: "Eq", _0: false, @@ -737,7 +737,7 @@ let suites_1 = { tl: { hd: [ "filter", - ((param) => { + (param => { return { TAG: "Eq", _0: [ @@ -749,7 +749,7 @@ let suites_1 = { 2, 3, 4 - ].filter((n) => { + ].filter(n => { return n % 2 === 0; }) }; @@ -758,7 +758,7 @@ let suites_1 = { tl: { hd: [ "filteri", - ((param) => { + (param => { return { TAG: "Eq", _0: [ @@ -779,7 +779,7 @@ let suites_1 = { tl: { hd: [ "find", - ((param) => { + (param => { return { TAG: "Eq", _0: 2, @@ -788,7 +788,7 @@ let suites_1 = { 2, 3, 4 - ].find((n) => { + ].find(n => { return n % 2 === 0; })) }; @@ -797,7 +797,7 @@ let suites_1 = { tl: { hd: [ "find - no match", - ((param) => { + (param => { return { TAG: "Eq", _0: undefined, @@ -806,7 +806,7 @@ let suites_1 = { 2, 3, 4 - ].find((n) => { + ].find(n => { return n % 2 === 5; })) }; @@ -815,7 +815,7 @@ let suites_1 = { tl: { hd: [ "findi", - ((param) => { + (param => { return { TAG: "Eq", _0: 1, @@ -833,7 +833,7 @@ let suites_1 = { tl: { hd: [ "findi - no match", - ((param) => { + (param => { return { TAG: "Eq", _0: undefined, @@ -851,7 +851,7 @@ let suites_1 = { tl: { hd: [ "findIndex", - ((param) => { + (param => { return { TAG: "Eq", _0: 1, @@ -860,7 +860,7 @@ let suites_1 = { 2, 3, 4 - ].findIndex((n) => { + ].findIndex(n => { return n % 2 === 0; }) }; @@ -869,7 +869,7 @@ let suites_1 = { tl: { hd: [ "findIndexi", - ((param) => { + (param => { return { TAG: "Eq", _0: 0, @@ -887,7 +887,7 @@ let suites_1 = { tl: { hd: [ "forEach", - ((param) => { + (param => { let sum = { contents: 0 }; @@ -895,7 +895,7 @@ let suites_1 = { 1, 2, 3 - ].forEach((n) => { + ].forEach(n => { sum.contents = sum.contents + n | 0; }); return { @@ -908,7 +908,7 @@ let suites_1 = { tl: { hd: [ "forEachi", - ((param) => { + (param => { let sum = { contents: 0 }; @@ -929,7 +929,7 @@ let suites_1 = { tl: { hd: [ "map", - ((param) => { + (param => { return { TAG: "Eq", _0: [ @@ -943,7 +943,7 @@ let suites_1 = { 2, 3, 4 - ].map((n) => { + ].map(n => { return (n << 1); }) }; @@ -952,7 +952,7 @@ let suites_1 = { tl: { hd: [ "map", - ((param) => { + (param => { return { TAG: "Eq", _0: [ @@ -975,7 +975,7 @@ let suites_1 = { tl: { hd: [ "reduce", - ((param) => { + (param => { return { TAG: "Eq", _0: -10, @@ -993,7 +993,7 @@ let suites_1 = { tl: { hd: [ "reducei", - ((param) => { + (param => { return { TAG: "Eq", _0: -6, @@ -1011,7 +1011,7 @@ let suites_1 = { tl: { hd: [ "reduceRight", - ((param) => { + (param => { return { TAG: "Eq", _0: -10, @@ -1029,7 +1029,7 @@ let suites_1 = { tl: { hd: [ "reduceRighti", - ((param) => { + (param => { return { TAG: "Eq", _0: -6, @@ -1047,7 +1047,7 @@ let suites_1 = { tl: { hd: [ "some", - ((param) => { + (param => { return { TAG: "Eq", _0: false, @@ -1056,7 +1056,7 @@ let suites_1 = { 2, 3, 4 - ].some((n) => { + ].some(n => { return n <= 0; }) }; @@ -1065,7 +1065,7 @@ let suites_1 = { tl: { hd: [ "somei", - ((param) => { + (param => { return { TAG: "Eq", _0: true, diff --git a/jscomp/test/js_bool_test.js b/jscomp/test/js_bool_test.js index 2d4a6aeaa3e..fbe4ce63ef4 100644 --- a/jscomp/test/js_bool_test.js +++ b/jscomp/test/js_bool_test.js @@ -33,7 +33,7 @@ let v = true; let suites_0 = [ "?bool_eq_caml_bool", - ((param) => { + (param => { return { TAG: "Eq", _0: u, @@ -45,7 +45,7 @@ let suites_0 = [ let suites_1 = { hd: [ "js_bool_eq_js_bool", - ((param) => { + (param => { return { TAG: "Eq", _0: v, @@ -56,7 +56,7 @@ let suites_1 = { tl: { hd: [ "js_bool_neq_acml_bool", - ((param) => { + (param => { return { TAG: "Eq", _0: true, diff --git a/jscomp/test/js_date_test.js b/jscomp/test/js_date_test.js index 76524bf36fc..5ae1b6e167e 100644 --- a/jscomp/test/js_date_test.js +++ b/jscomp/test/js_date_test.js @@ -10,7 +10,7 @@ function date() { let suites_0 = [ "valueOf", - ((param) => { + (param => { return { TAG: "Eq", _0: 195131516789, @@ -22,7 +22,7 @@ let suites_0 = [ let suites_1 = { hd: [ "make", - ((param) => { + (param => { return { TAG: "Ok", _0: new Date().getTime() > 1487223505382 @@ -32,7 +32,7 @@ let suites_1 = { tl: { hd: [ "parseAsFloat", - ((param) => { + (param => { return { TAG: "Eq", _0: Date.parse("1976-03-08T12:34:56.789+01:23"), @@ -43,7 +43,7 @@ let suites_1 = { tl: { hd: [ "parseAsFloat_invalid", - ((param) => { + (param => { return { TAG: "Ok", _0: Number.isNaN(Date.parse("gibberish")) @@ -53,7 +53,7 @@ let suites_1 = { tl: { hd: [ "fromFloat", - ((param) => { + (param => { return { TAG: "Eq", _0: "1976-03-08T11:11:56.789Z", @@ -64,7 +64,7 @@ let suites_1 = { tl: { hd: [ "fromString_valid", - ((param) => { + (param => { return { TAG: "Eq", _0: 195131516789, @@ -75,7 +75,7 @@ let suites_1 = { tl: { hd: [ "fromString_invalid", - ((param) => { + (param => { return { TAG: "Ok", _0: Number.isNaN(new Date("gibberish").getTime()) @@ -85,7 +85,7 @@ let suites_1 = { tl: { hd: [ "makeWithYM", - ((param) => { + (param => { let d = new Date(1984, 4); return { TAG: "Eq", @@ -103,7 +103,7 @@ let suites_1 = { tl: { hd: [ "makeWithYMD", - ((param) => { + (param => { let d = new Date(1984, 4, 6); return { TAG: "Eq", @@ -123,7 +123,7 @@ let suites_1 = { tl: { hd: [ "makeWithYMDH", - ((param) => { + (param => { let d = new Date(1984, 4, 6, 3); return { TAG: "Eq", @@ -145,7 +145,7 @@ let suites_1 = { tl: { hd: [ "makeWithYMDHM", - ((param) => { + (param => { let d = new Date(1984, 4, 6, 3, 59); return { TAG: "Eq", @@ -169,7 +169,7 @@ let suites_1 = { tl: { hd: [ "makeWithYMDHMS", - ((param) => { + (param => { let d = new Date(1984, 4, 6, 3, 59, 27); return { TAG: "Eq", @@ -195,7 +195,7 @@ let suites_1 = { tl: { hd: [ "utcWithYM", - ((param) => { + (param => { let d = Date.UTC(1984, 4); let d$1 = new Date(d); return { @@ -214,7 +214,7 @@ let suites_1 = { tl: { hd: [ "utcWithYMD", - ((param) => { + (param => { let d = Date.UTC(1984, 4, 6); let d$1 = new Date(d); return { @@ -235,7 +235,7 @@ let suites_1 = { tl: { hd: [ "utcWithYMDH", - ((param) => { + (param => { let d = Date.UTC(1984, 4, 6, 3); let d$1 = new Date(d); return { @@ -258,7 +258,7 @@ let suites_1 = { tl: { hd: [ "utcWithYMDHM", - ((param) => { + (param => { let d = Date.UTC(1984, 4, 6, 3, 59); let d$1 = new Date(d); return { @@ -283,7 +283,7 @@ let suites_1 = { tl: { hd: [ "utcWithYMDHMS", - ((param) => { + (param => { let d = Date.UTC(1984, 4, 6, 3, 59, 27); let d$1 = new Date(d); return { @@ -310,7 +310,7 @@ let suites_1 = { tl: { hd: [ "getFullYear", - ((param) => { + (param => { return { TAG: "Eq", _0: 1976, @@ -321,7 +321,7 @@ let suites_1 = { tl: { hd: [ "getMilliseconds", - ((param) => { + (param => { return { TAG: "Eq", _0: 789, @@ -332,7 +332,7 @@ let suites_1 = { tl: { hd: [ "getSeconds", - ((param) => { + (param => { return { TAG: "Eq", _0: 56, @@ -343,7 +343,7 @@ let suites_1 = { tl: { hd: [ "getTime", - ((param) => { + (param => { return { TAG: "Eq", _0: 195131516789, @@ -354,7 +354,7 @@ let suites_1 = { tl: { hd: [ "getUTCDate", - ((param) => { + (param => { return { TAG: "Eq", _0: 8, @@ -365,7 +365,7 @@ let suites_1 = { tl: { hd: [ "getUTCDay", - ((param) => { + (param => { return { TAG: "Eq", _0: 1, @@ -376,7 +376,7 @@ let suites_1 = { tl: { hd: [ "getUTCFUllYear", - ((param) => { + (param => { return { TAG: "Eq", _0: 1976, @@ -387,7 +387,7 @@ let suites_1 = { tl: { hd: [ "getUTCHours", - ((param) => { + (param => { return { TAG: "Eq", _0: 11, @@ -398,7 +398,7 @@ let suites_1 = { tl: { hd: [ "getUTCMilliseconds", - ((param) => { + (param => { return { TAG: "Eq", _0: 789, @@ -409,7 +409,7 @@ let suites_1 = { tl: { hd: [ "getUTCMinutes", - ((param) => { + (param => { return { TAG: "Eq", _0: 11, @@ -420,7 +420,7 @@ let suites_1 = { tl: { hd: [ "getUTCMonth", - ((param) => { + (param => { return { TAG: "Eq", _0: 2, @@ -431,7 +431,7 @@ let suites_1 = { tl: { hd: [ "getUTCSeconds", - ((param) => { + (param => { return { TAG: "Eq", _0: 56, @@ -442,7 +442,7 @@ let suites_1 = { tl: { hd: [ "getYear", - ((param) => { + (param => { return { TAG: "Eq", _0: 1976, @@ -453,7 +453,7 @@ let suites_1 = { tl: { hd: [ "setDate", - ((param) => { + (param => { let d = new Date("1976-03-08T12:34:56.789+01:23"); d.setDate(12); return { @@ -466,7 +466,7 @@ let suites_1 = { tl: { hd: [ "setFullYear", - ((param) => { + (param => { let d = new Date("1976-03-08T12:34:56.789+01:23"); d.setFullYear(1986); return { @@ -479,7 +479,7 @@ let suites_1 = { tl: { hd: [ "setFullYearM", - ((param) => { + (param => { let d = new Date("1976-03-08T12:34:56.789+01:23"); d.setFullYear(1986, 7); return { @@ -498,7 +498,7 @@ let suites_1 = { tl: { hd: [ "setFullYearMD", - ((param) => { + (param => { let d = new Date("1976-03-08T12:34:56.789+01:23"); d.setFullYear(1986, 7, 23); return { @@ -519,7 +519,7 @@ let suites_1 = { tl: { hd: [ "setHours", - ((param) => { + (param => { let d = new Date("1976-03-08T12:34:56.789+01:23"); d.setHours(22); return { @@ -532,7 +532,7 @@ let suites_1 = { tl: { hd: [ "setHoursM", - ((param) => { + (param => { let d = new Date("1976-03-08T12:34:56.789+01:23"); d.setHours(22, 48); return { @@ -551,7 +551,7 @@ let suites_1 = { tl: { hd: [ "setHoursMS", - ((param) => { + (param => { let d = new Date("1976-03-08T12:34:56.789+01:23"); d.setHours(22, 48, 54); return { @@ -572,7 +572,7 @@ let suites_1 = { tl: { hd: [ "setMilliseconds", - ((param) => { + (param => { let d = new Date("1976-03-08T12:34:56.789+01:23"); d.setMilliseconds(543); return { @@ -585,7 +585,7 @@ let suites_1 = { tl: { hd: [ "setMinutes", - ((param) => { + (param => { let d = new Date("1976-03-08T12:34:56.789+01:23"); d.setMinutes(18); return { @@ -598,7 +598,7 @@ let suites_1 = { tl: { hd: [ "setMinutesS", - ((param) => { + (param => { let d = new Date("1976-03-08T12:34:56.789+01:23"); d.setMinutes(18, 42); return { @@ -617,7 +617,7 @@ let suites_1 = { tl: { hd: [ "setMinutesSMs", - ((param) => { + (param => { let d = new Date("1976-03-08T12:34:56.789+01:23"); d.setMinutes(18, 42, 311); return { @@ -638,7 +638,7 @@ let suites_1 = { tl: { hd: [ "setMonth", - ((param) => { + (param => { let d = new Date("1976-03-08T12:34:56.789+01:23"); d.setMonth(10); return { @@ -651,7 +651,7 @@ let suites_1 = { tl: { hd: [ "setMonthD", - ((param) => { + (param => { let d = new Date("1976-03-08T12:34:56.789+01:23"); d.setMonth(10, 14); return { @@ -670,7 +670,7 @@ let suites_1 = { tl: { hd: [ "setSeconds", - ((param) => { + (param => { let d = new Date("1976-03-08T12:34:56.789+01:23"); d.setSeconds(36); return { @@ -683,7 +683,7 @@ let suites_1 = { tl: { hd: [ "setSecondsMs", - ((param) => { + (param => { let d = new Date("1976-03-08T12:34:56.789+01:23"); d.setSeconds(36, 420); return { @@ -702,7 +702,7 @@ let suites_1 = { tl: { hd: [ "setUTCDate", - ((param) => { + (param => { let d = new Date("1976-03-08T12:34:56.789+01:23"); d.setUTCDate(12); return { @@ -715,7 +715,7 @@ let suites_1 = { tl: { hd: [ "setUTCFullYear", - ((param) => { + (param => { let d = new Date("1976-03-08T12:34:56.789+01:23"); d.setUTCFullYear(1986); return { @@ -728,7 +728,7 @@ let suites_1 = { tl: { hd: [ "setUTCFullYearM", - ((param) => { + (param => { let d = new Date("1976-03-08T12:34:56.789+01:23"); d.setUTCFullYear(1986, 7); return { @@ -747,7 +747,7 @@ let suites_1 = { tl: { hd: [ "setUTCFullYearMD", - ((param) => { + (param => { let d = new Date("1976-03-08T12:34:56.789+01:23"); d.setUTCFullYear(1986, 7, 23); return { @@ -768,7 +768,7 @@ let suites_1 = { tl: { hd: [ "setUTCHours", - ((param) => { + (param => { let d = new Date("1976-03-08T12:34:56.789+01:23"); d.setUTCHours(22); return { @@ -781,7 +781,7 @@ let suites_1 = { tl: { hd: [ "setUTCHoursM", - ((param) => { + (param => { let d = new Date("1976-03-08T12:34:56.789+01:23"); d.setUTCHours(22, 48); return { @@ -800,7 +800,7 @@ let suites_1 = { tl: { hd: [ "setUTCHoursMS", - ((param) => { + (param => { let d = new Date("1976-03-08T12:34:56.789+01:23"); d.setUTCHours(22, 48, 54); return { @@ -821,7 +821,7 @@ let suites_1 = { tl: { hd: [ "setUTCMilliseconds", - ((param) => { + (param => { let d = new Date("1976-03-08T12:34:56.789+01:23"); d.setUTCMilliseconds(543); return { @@ -834,7 +834,7 @@ let suites_1 = { tl: { hd: [ "setUTCMinutes", - ((param) => { + (param => { let d = new Date("1976-03-08T12:34:56.789+01:23"); d.setUTCMinutes(18); return { @@ -847,7 +847,7 @@ let suites_1 = { tl: { hd: [ "setUTCMinutesS", - ((param) => { + (param => { let d = new Date("1976-03-08T12:34:56.789+01:23"); d.setUTCMinutes(18, 42); return { @@ -866,7 +866,7 @@ let suites_1 = { tl: { hd: [ "setUTCMinutesSMs", - ((param) => { + (param => { let d = new Date("1976-03-08T12:34:56.789+01:23"); d.setUTCMinutes(18, 42, 311); return { @@ -887,7 +887,7 @@ let suites_1 = { tl: { hd: [ "setUTCMonth", - ((param) => { + (param => { let d = new Date("1976-03-08T12:34:56.789+01:23"); d.setUTCMonth(10); return { @@ -900,7 +900,7 @@ let suites_1 = { tl: { hd: [ "setUTCMonthD", - ((param) => { + (param => { let d = new Date("1976-03-08T12:34:56.789+01:23"); d.setUTCMonth(10, 14); return { @@ -919,7 +919,7 @@ let suites_1 = { tl: { hd: [ "setUTCSeconds", - ((param) => { + (param => { let d = new Date("1976-03-08T12:34:56.789+01:23"); d.setUTCSeconds(36); return { @@ -932,7 +932,7 @@ let suites_1 = { tl: { hd: [ "setUTCSecondsMs", - ((param) => { + (param => { let d = new Date("1976-03-08T12:34:56.789+01:23"); d.setUTCSeconds(36, 420); return { @@ -951,7 +951,7 @@ let suites_1 = { tl: { hd: [ "toDateString", - ((param) => { + (param => { return { TAG: "Eq", _0: "Mon Mar 08 1976", @@ -962,7 +962,7 @@ let suites_1 = { tl: { hd: [ "toGMTString", - ((param) => { + (param => { return { TAG: "Eq", _0: "Mon, 08 Mar 1976 11:11:56 GMT", @@ -973,7 +973,7 @@ let suites_1 = { tl: { hd: [ "toISOString", - ((param) => { + (param => { return { TAG: "Eq", _0: "1976-03-08T11:11:56.789Z", @@ -984,7 +984,7 @@ let suites_1 = { tl: { hd: [ "toJSON", - ((param) => { + (param => { return { TAG: "Eq", _0: "1976-03-08T11:11:56.789Z", @@ -995,7 +995,7 @@ let suites_1 = { tl: { hd: [ "toJSONUnsafe", - ((param) => { + (param => { return { TAG: "Eq", _0: "1976-03-08T11:11:56.789Z", @@ -1006,7 +1006,7 @@ let suites_1 = { tl: { hd: [ "toUTCString", - ((param) => { + (param => { return { TAG: "Eq", _0: "Mon, 08 Mar 1976 11:11:56 GMT", @@ -1017,7 +1017,7 @@ let suites_1 = { tl: { hd: [ "eq", - ((param) => { + (param => { let a = new Date("2013-03-01T01:10:00"); let b = new Date("2013-03-01T01:10:00"); let c = new Date("2013-03-01T01:10:01"); diff --git a/jscomp/test/js_dict_test.js b/jscomp/test/js_dict_test.js index 498aed60c50..4beaff0ed8a 100644 --- a/jscomp/test/js_dict_test.js +++ b/jscomp/test/js_dict_test.js @@ -13,7 +13,7 @@ function obj() { let suites_0 = [ "empty", - ((param) => { + (param => { return { TAG: "Eq", _0: [], @@ -25,7 +25,7 @@ let suites_0 = [ let suites_1 = { hd: [ "get", - ((param) => { + (param => { return { TAG: "Eq", _0: 43, @@ -39,7 +39,7 @@ let suites_1 = { tl: { hd: [ "get - property not in object", - ((param) => { + (param => { return { TAG: "Eq", _0: undefined, @@ -53,7 +53,7 @@ let suites_1 = { tl: { hd: [ "unsafe_get", - ((param) => { + (param => { return { TAG: "Eq", _0: 43, @@ -67,7 +67,7 @@ let suites_1 = { tl: { hd: [ "set", - ((param) => { + (param => { let o = { foo: 43, bar: 86 @@ -83,7 +83,7 @@ let suites_1 = { tl: { hd: [ "keys", - ((param) => { + (param => { return { TAG: "Eq", _0: [ @@ -100,7 +100,7 @@ let suites_1 = { tl: { hd: [ "entries", - ((param) => { + (param => { return { TAG: "Eq", _0: [ @@ -123,7 +123,7 @@ let suites_1 = { tl: { hd: [ "values", - ((param) => { + (param => { return { TAG: "Eq", _0: [ @@ -140,7 +140,7 @@ let suites_1 = { tl: { hd: [ "fromList - []", - ((param) => { + (param => { return { TAG: "Eq", _0: {}, @@ -151,7 +151,7 @@ let suites_1 = { tl: { hd: [ "fromList", - ((param) => { + (param => { return { TAG: "Eq", _0: [ @@ -183,7 +183,7 @@ let suites_1 = { tl: { hd: [ "fromArray - []", - ((param) => { + (param => { return { TAG: "Eq", _0: {}, @@ -194,7 +194,7 @@ let suites_1 = { tl: { hd: [ "fromArray", - ((param) => { + (param => { return { TAG: "Eq", _0: [ @@ -223,14 +223,14 @@ let suites_1 = { tl: { hd: [ "map", - ((param) => { + (param => { return { TAG: "Eq", _0: { foo: "43", bar: "86" }, - _1: Js_dict.map(((i) => { + _1: Js_dict.map((i => { return String(i); }), { foo: 43, diff --git a/jscomp/test/js_float_test.js b/jscomp/test/js_float_test.js index 5c4f990759e..860427c4268 100644 --- a/jscomp/test/js_float_test.js +++ b/jscomp/test/js_float_test.js @@ -6,7 +6,7 @@ let Pervasives = require("../../lib/js/pervasives.js"); let suites_0 = [ "_NaN <> _NaN", - ((param) => { + (param => { return { TAG: "Eq", _0: false, @@ -18,7 +18,7 @@ let suites_0 = [ let suites_1 = { hd: [ "isNaN - _NaN", - ((param) => { + (param => { return { TAG: "Eq", _0: true, @@ -29,7 +29,7 @@ let suites_1 = { tl: { hd: [ "isNaN - 0.", - ((param) => { + (param => { return { TAG: "Eq", _0: false, @@ -40,7 +40,7 @@ let suites_1 = { tl: { hd: [ "isFinite - infinity", - ((param) => { + (param => { return { TAG: "Eq", _0: false, @@ -51,7 +51,7 @@ let suites_1 = { tl: { hd: [ "isFinite - neg_infinity", - ((param) => { + (param => { return { TAG: "Eq", _0: false, @@ -62,7 +62,7 @@ let suites_1 = { tl: { hd: [ "isFinite - _NaN", - ((param) => { + (param => { return { TAG: "Eq", _0: false, @@ -73,7 +73,7 @@ let suites_1 = { tl: { hd: [ "isFinite - 0.", - ((param) => { + (param => { return { TAG: "Eq", _0: true, @@ -84,7 +84,7 @@ let suites_1 = { tl: { hd: [ "toExponential", - ((param) => { + (param => { return { TAG: "Eq", _0: "1.23456e+2", @@ -95,7 +95,7 @@ let suites_1 = { tl: { hd: [ "toExponential - large number", - ((param) => { + (param => { return { TAG: "Eq", _0: "1.2e+21", @@ -106,7 +106,7 @@ let suites_1 = { tl: { hd: [ "toExponentialWithPrecision - digits:2", - ((param) => { + (param => { return { TAG: "Eq", _0: "1.23e+2", @@ -117,7 +117,7 @@ let suites_1 = { tl: { hd: [ "toExponentialWithPrecision - digits:4", - ((param) => { + (param => { return { TAG: "Eq", _0: "1.2346e+2", @@ -128,7 +128,7 @@ let suites_1 = { tl: { hd: [ "toExponentialWithPrecision - digits:20", - ((param) => { + (param => { return { TAG: "Eq", _0: "0.00000000000000000000e+0", @@ -139,7 +139,7 @@ let suites_1 = { tl: { hd: [ "File \"js_float_test.res\", line 27, characters 5-12", - ((param) => { + (param => { return { TAG: "ThrowAny", _0: (() => { @@ -151,7 +151,7 @@ let suites_1 = { tl: { hd: [ "toExponentialWithPrecision - digits:-1", - ((param) => { + (param => { return { TAG: "ThrowAny", _0: (() => { @@ -163,7 +163,7 @@ let suites_1 = { tl: { hd: [ "toFixed", - ((param) => { + (param => { return { TAG: "Eq", _0: "123", @@ -174,7 +174,7 @@ let suites_1 = { tl: { hd: [ "toFixed - large number", - ((param) => { + (param => { return { TAG: "Eq", _0: "1.2e+21", @@ -185,7 +185,7 @@ let suites_1 = { tl: { hd: [ "toFixedWithPrecision - digits:2", - ((param) => { + (param => { return { TAG: "Eq", _0: "123.46", @@ -196,7 +196,7 @@ let suites_1 = { tl: { hd: [ "toFixedWithPrecision - digits:4", - ((param) => { + (param => { return { TAG: "Eq", _0: "123.4560", @@ -207,7 +207,7 @@ let suites_1 = { tl: { hd: [ "toFixedWithPrecision - digits:20", - ((param) => { + (param => { return { TAG: "Eq", _0: "0.00000000000000000000", @@ -218,7 +218,7 @@ let suites_1 = { tl: { hd: [ "toFixedWithPrecision - digits:101", - ((param) => { + (param => { return { TAG: "ThrowAny", _0: (() => { @@ -230,7 +230,7 @@ let suites_1 = { tl: { hd: [ "toFixedWithPrecision - digits:-1", - ((param) => { + (param => { return { TAG: "ThrowAny", _0: (() => { @@ -242,7 +242,7 @@ let suites_1 = { tl: { hd: [ "toPrecision", - ((param) => { + (param => { return { TAG: "Eq", _0: "123.456", @@ -253,7 +253,7 @@ let suites_1 = { tl: { hd: [ "toPrecision - large number", - ((param) => { + (param => { return { TAG: "Eq", _0: "1.2e+21", @@ -264,7 +264,7 @@ let suites_1 = { tl: { hd: [ "toPrecisionWithPrecision - digits:2", - ((param) => { + (param => { return { TAG: "Eq", _0: "1.2e+2", @@ -275,7 +275,7 @@ let suites_1 = { tl: { hd: [ "toPrecisionWithPrecision - digits:4", - ((param) => { + (param => { return { TAG: "Eq", _0: "123.5", @@ -286,7 +286,7 @@ let suites_1 = { tl: { hd: [ "toPrecisionWithPrecision - digits:20", - ((param) => { + (param => { return { TAG: "Eq", _0: "0.0000000000000000000", @@ -297,7 +297,7 @@ let suites_1 = { tl: { hd: [ "File \"js_float_test.res\", line 68, characters 5-12", - ((param) => { + (param => { return { TAG: "ThrowAny", _0: (() => { @@ -309,7 +309,7 @@ let suites_1 = { tl: { hd: [ "toPrecisionWithPrecision - digits:-1", - ((param) => { + (param => { return { TAG: "ThrowAny", _0: (() => { @@ -321,7 +321,7 @@ let suites_1 = { tl: { hd: [ "toString", - ((param) => { + (param => { return { TAG: "Eq", _0: "1.23", @@ -332,7 +332,7 @@ let suites_1 = { tl: { hd: [ "toString - large number", - ((param) => { + (param => { return { TAG: "Eq", _0: "1.2e+21", @@ -343,7 +343,7 @@ let suites_1 = { tl: { hd: [ "toStringWithRadix - radix:2", - ((param) => { + (param => { return { TAG: "Eq", _0: "1111011.0111010010111100011010100111111011111001110111", @@ -354,7 +354,7 @@ let suites_1 = { tl: { hd: [ "toStringWithRadix - radix:16", - ((param) => { + (param => { return { TAG: "Eq", _0: "7b.74bc6a7ef9dc", @@ -365,7 +365,7 @@ let suites_1 = { tl: { hd: [ "toStringWithRadix - radix:36", - ((param) => { + (param => { return { TAG: "Eq", _0: "3f", @@ -376,7 +376,7 @@ let suites_1 = { tl: { hd: [ "toStringWithRadix - radix:37", - ((param) => { + (param => { return { TAG: "ThrowAny", _0: (() => { @@ -388,7 +388,7 @@ let suites_1 = { tl: { hd: [ "toStringWithRadix - radix:1", - ((param) => { + (param => { return { TAG: "ThrowAny", _0: (() => { @@ -400,7 +400,7 @@ let suites_1 = { tl: { hd: [ "toStringWithRadix - radix:-1", - ((param) => { + (param => { return { TAG: "ThrowAny", _0: (() => { @@ -412,7 +412,7 @@ let suites_1 = { tl: { hd: [ "fromString - 123", - ((param) => { + (param => { return { TAG: "Eq", _0: 123, @@ -423,7 +423,7 @@ let suites_1 = { tl: { hd: [ "fromString - 12.3", - ((param) => { + (param => { return { TAG: "Eq", _0: 12.3, @@ -434,7 +434,7 @@ let suites_1 = { tl: { hd: [ "fromString - empty string", - ((param) => { + (param => { return { TAG: "Eq", _0: 0, @@ -445,7 +445,7 @@ let suites_1 = { tl: { hd: [ "fromString - 0x11", - ((param) => { + (param => { return { TAG: "Eq", _0: 17, @@ -456,7 +456,7 @@ let suites_1 = { tl: { hd: [ "fromString - 0b11", - ((param) => { + (param => { return { TAG: "Eq", _0: 3, @@ -467,7 +467,7 @@ let suites_1 = { tl: { hd: [ "fromString - 0o11", - ((param) => { + (param => { return { TAG: "Eq", _0: 9, @@ -478,7 +478,7 @@ let suites_1 = { tl: { hd: [ "fromString - invalid string", - ((param) => { + (param => { return { TAG: "Eq", _0: true, diff --git a/jscomp/test/js_global_test.js b/jscomp/test/js_global_test.js index 1a50c98f7b4..cbfb2189812 100644 --- a/jscomp/test/js_global_test.js +++ b/jscomp/test/js_global_test.js @@ -5,7 +5,7 @@ let Mt = require("./mt.js"); let suites_0 = [ "setTimeout/clearTimeout sanity check", - ((param) => { + (param => { let handle = setTimeout((() => { }), 0); @@ -20,7 +20,7 @@ let suites_0 = [ let suites_1 = { hd: [ "setInerval/clearInterval sanity check", - ((param) => { + (param => { let handle = setInterval((() => { }), 0); @@ -34,7 +34,7 @@ let suites_1 = { tl: { hd: [ "encodeURI", - ((param) => { + (param => { return { TAG: "Eq", _0: encodeURI("[-=-]"), @@ -45,7 +45,7 @@ let suites_1 = { tl: { hd: [ "decodeURI", - ((param) => { + (param => { return { TAG: "Eq", _0: decodeURI("%5B-=-%5D"), @@ -56,7 +56,7 @@ let suites_1 = { tl: { hd: [ "encodeURIComponent", - ((param) => { + (param => { return { TAG: "Eq", _0: encodeURIComponent("[-=-]"), @@ -67,7 +67,7 @@ let suites_1 = { tl: { hd: [ "decodeURIComponent", - ((param) => { + (param => { return { TAG: "Eq", _0: decodeURIComponent("%5B-%3D-%5D"), diff --git a/jscomp/test/js_int_test.js b/jscomp/test/js_int_test.js index a9dbf5ab7d8..0f15cc51997 100644 --- a/jscomp/test/js_int_test.js +++ b/jscomp/test/js_int_test.js @@ -5,7 +5,7 @@ let Mt = require("./mt.js"); let suites_0 = [ "toExponential", - ((param) => { + (param => { return { TAG: "Eq", _0: "1.23456e+5", @@ -17,7 +17,7 @@ let suites_0 = [ let suites_1 = { hd: [ "toExponentialWithPrecision - digits:2", - ((param) => { + (param => { return { TAG: "Eq", _0: "1.23e+5", @@ -28,7 +28,7 @@ let suites_1 = { tl: { hd: [ "toExponentialWithPrecision - digits:4", - ((param) => { + (param => { return { TAG: "Eq", _0: "1.2346e+5", @@ -39,7 +39,7 @@ let suites_1 = { tl: { hd: [ "toExponentialWithPrecision - digits:20", - ((param) => { + (param => { return { TAG: "Eq", _0: "0.00000000000000000000e+0", @@ -50,7 +50,7 @@ let suites_1 = { tl: { hd: [ "File \"js_int_test.res\", line 19, characters 5-12", - ((param) => { + (param => { return { TAG: "ThrowAny", _0: (() => { @@ -62,7 +62,7 @@ let suites_1 = { tl: { hd: [ "toExponentialWithPrecision - digits:-1", - ((param) => { + (param => { return { TAG: "ThrowAny", _0: (() => { @@ -74,7 +74,7 @@ let suites_1 = { tl: { hd: [ "toPrecision", - ((param) => { + (param => { return { TAG: "Eq", _0: "123456", @@ -85,7 +85,7 @@ let suites_1 = { tl: { hd: [ "toPrecisionWithPrecision - digits:2", - ((param) => { + (param => { return { TAG: "Eq", _0: "1.2e+5", @@ -96,7 +96,7 @@ let suites_1 = { tl: { hd: [ "toPrecisionWithPrecision - digits:4", - ((param) => { + (param => { return { TAG: "Eq", _0: "1.235e+5", @@ -107,7 +107,7 @@ let suites_1 = { tl: { hd: [ "toPrecisionWithPrecision - digits:20", - ((param) => { + (param => { return { TAG: "Eq", _0: "0.0000000000000000000", @@ -118,7 +118,7 @@ let suites_1 = { tl: { hd: [ "File \"js_int_test.res\", line 37, characters 5-12", - ((param) => { + (param => { return { TAG: "ThrowAny", _0: (() => { @@ -130,7 +130,7 @@ let suites_1 = { tl: { hd: [ "toPrecisionWithPrecision - digits:-1", - ((param) => { + (param => { return { TAG: "ThrowAny", _0: (() => { @@ -142,7 +142,7 @@ let suites_1 = { tl: { hd: [ "toString", - ((param) => { + (param => { return { TAG: "Eq", _0: "123", @@ -153,7 +153,7 @@ let suites_1 = { tl: { hd: [ "toStringWithRadix - radix:2", - ((param) => { + (param => { return { TAG: "Eq", _0: "11110001001000000", @@ -164,7 +164,7 @@ let suites_1 = { tl: { hd: [ "toStringWithRadix - radix:16", - ((param) => { + (param => { return { TAG: "Eq", _0: "1e240", @@ -175,7 +175,7 @@ let suites_1 = { tl: { hd: [ "toStringWithRadix - radix:36", - ((param) => { + (param => { return { TAG: "Eq", _0: "2n9c", @@ -186,7 +186,7 @@ let suites_1 = { tl: { hd: [ "toStringWithRadix - radix:37", - ((param) => { + (param => { return { TAG: "ThrowAny", _0: (() => { @@ -198,7 +198,7 @@ let suites_1 = { tl: { hd: [ "toStringWithRadix - radix:1", - ((param) => { + (param => { return { TAG: "ThrowAny", _0: (() => { @@ -210,7 +210,7 @@ let suites_1 = { tl: { hd: [ "toStringWithRadix - radix:-1", - ((param) => { + (param => { return { TAG: "ThrowAny", _0: (() => { diff --git a/jscomp/test/js_json_test.js b/jscomp/test/js_json_test.js index cc7da85689e..ccde3476829 100644 --- a/jscomp/test/js_json_test.js +++ b/jscomp/test/js_json_test.js @@ -94,7 +94,7 @@ add_test("File \"js_json_test.res\", line 22, characters 11-18", (() => { _0: false }; } - ty2._0.forEach((x) => { + ty2._0.forEach(x => { let ty3 = Js_json.classify(x); if (typeof ty3 !== "object") { throw new Error("Assert_failure", { @@ -492,7 +492,7 @@ function eq_at_i(loc, json, i, kind, expected) { } } -let json$5 = JSON.parse(JSON.stringify($$Array.map(((prim) => { +let json$5 = JSON.parse(JSON.stringify($$Array.map((prim => { return prim; }), [ "string 0", @@ -538,7 +538,7 @@ let a$1 = [ -268391749 ]; -let json$8 = JSON.parse(JSON.stringify($$Array.map(((prim) => { +let json$8 = JSON.parse(JSON.stringify($$Array.map((prim => { return prim; }), a$1))); @@ -756,7 +756,7 @@ idtest({ tl: /* [] */0 }); -idtest(Belt_List.makeBy(500, ((i) => { +idtest(Belt_List.makeBy(500, (i => { if (i % 2 === 0) { return; } else { @@ -764,7 +764,7 @@ idtest(Belt_List.makeBy(500, ((i) => { } }))); -idtest(Belt_Array.makeBy(500, ((i) => { +idtest(Belt_Array.makeBy(500, (i => { if (i % 2 === 0) { return; } else { diff --git a/jscomp/test/js_math_test.js b/jscomp/test/js_math_test.js index cbaa2c34651..68da060bf48 100644 --- a/jscomp/test/js_math_test.js +++ b/jscomp/test/js_math_test.js @@ -6,7 +6,7 @@ let Js_math = require("../../lib/js/js_math.js"); let suites_0 = [ "_E", - ((param) => { + (param => { return { TAG: "ApproxThreshold", _0: 0.001, @@ -19,7 +19,7 @@ let suites_0 = [ let suites_1 = { hd: [ "_LN2", - ((param) => { + (param => { return { TAG: "ApproxThreshold", _0: 0.001, @@ -31,7 +31,7 @@ let suites_1 = { tl: { hd: [ "_LN10", - ((param) => { + (param => { return { TAG: "ApproxThreshold", _0: 0.001, @@ -43,7 +43,7 @@ let suites_1 = { tl: { hd: [ "_LOG2E", - ((param) => { + (param => { return { TAG: "ApproxThreshold", _0: 0.001, @@ -55,7 +55,7 @@ let suites_1 = { tl: { hd: [ "_LOG10E", - ((param) => { + (param => { return { TAG: "ApproxThreshold", _0: 0.001, @@ -67,7 +67,7 @@ let suites_1 = { tl: { hd: [ "_PI", - ((param) => { + (param => { return { TAG: "ApproxThreshold", _0: 0.00001, @@ -79,7 +79,7 @@ let suites_1 = { tl: { hd: [ "_SQRT1_2", - ((param) => { + (param => { return { TAG: "ApproxThreshold", _0: 0.001, @@ -91,7 +91,7 @@ let suites_1 = { tl: { hd: [ "_SQRT2", - ((param) => { + (param => { return { TAG: "ApproxThreshold", _0: 0.001, @@ -103,7 +103,7 @@ let suites_1 = { tl: { hd: [ "abs_int", - ((param) => { + (param => { return { TAG: "Eq", _0: 4, @@ -114,7 +114,7 @@ let suites_1 = { tl: { hd: [ "abs_float", - ((param) => { + (param => { return { TAG: "Eq", _0: 1.2, @@ -125,7 +125,7 @@ let suites_1 = { tl: { hd: [ "acos", - ((param) => { + (param => { return { TAG: "ApproxThreshold", _0: 0.001, @@ -137,7 +137,7 @@ let suites_1 = { tl: { hd: [ "acosh", - ((param) => { + (param => { return { TAG: "ApproxThreshold", _0: 0.001, @@ -149,7 +149,7 @@ let suites_1 = { tl: { hd: [ "asin", - ((param) => { + (param => { return { TAG: "ApproxThreshold", _0: 0.001, @@ -161,7 +161,7 @@ let suites_1 = { tl: { hd: [ "asinh", - ((param) => { + (param => { return { TAG: "ApproxThreshold", _0: 0.001, @@ -173,7 +173,7 @@ let suites_1 = { tl: { hd: [ "atan", - ((param) => { + (param => { return { TAG: "ApproxThreshold", _0: 0.001, @@ -185,7 +185,7 @@ let suites_1 = { tl: { hd: [ "atanh", - ((param) => { + (param => { return { TAG: "ApproxThreshold", _0: 0.001, @@ -197,7 +197,7 @@ let suites_1 = { tl: { hd: [ "atan2", - ((param) => { + (param => { return { TAG: "ApproxThreshold", _0: 0.001, @@ -209,7 +209,7 @@ let suites_1 = { tl: { hd: [ "cbrt", - ((param) => { + (param => { return { TAG: "Eq", _0: 2, @@ -220,7 +220,7 @@ let suites_1 = { tl: { hd: [ "unsafe_ceil_int", - ((param) => { + (param => { return { TAG: "Eq", _0: 4, @@ -231,7 +231,7 @@ let suites_1 = { tl: { hd: [ "ceil_int", - ((param) => { + (param => { return { TAG: "Eq", _0: 4, @@ -242,7 +242,7 @@ let suites_1 = { tl: { hd: [ "ceil_float", - ((param) => { + (param => { return { TAG: "Eq", _0: 4, @@ -253,7 +253,7 @@ let suites_1 = { tl: { hd: [ "cos", - ((param) => { + (param => { return { TAG: "ApproxThreshold", _0: 0.001, @@ -265,7 +265,7 @@ let suites_1 = { tl: { hd: [ "cosh", - ((param) => { + (param => { return { TAG: "ApproxThreshold", _0: 0.001, @@ -277,7 +277,7 @@ let suites_1 = { tl: { hd: [ "exp", - ((param) => { + (param => { return { TAG: "ApproxThreshold", _0: 0.001, @@ -289,7 +289,7 @@ let suites_1 = { tl: { hd: [ "expm1", - ((param) => { + (param => { return { TAG: "ApproxThreshold", _0: 0.001, @@ -301,7 +301,7 @@ let suites_1 = { tl: { hd: [ "unsafe_floor_int", - ((param) => { + (param => { return { TAG: "Eq", _0: 3, @@ -312,7 +312,7 @@ let suites_1 = { tl: { hd: [ "floor_int", - ((param) => { + (param => { return { TAG: "Eq", _0: 3, @@ -323,7 +323,7 @@ let suites_1 = { tl: { hd: [ "floor_float", - ((param) => { + (param => { return { TAG: "Eq", _0: 3, @@ -334,7 +334,7 @@ let suites_1 = { tl: { hd: [ "fround", - ((param) => { + (param => { return { TAG: "Approx", _0: 3.2, @@ -345,7 +345,7 @@ let suites_1 = { tl: { hd: [ "hypot", - ((param) => { + (param => { return { TAG: "ApproxThreshold", _0: 0.001, @@ -357,7 +357,7 @@ let suites_1 = { tl: { hd: [ "hypotMany", - ((param) => { + (param => { return { TAG: "ApproxThreshold", _0: 0.001, @@ -369,7 +369,7 @@ let suites_1 = { tl: { hd: [ "imul", - ((param) => { + (param => { return { TAG: "Eq", _0: 8, @@ -380,7 +380,7 @@ let suites_1 = { tl: { hd: [ "log", - ((param) => { + (param => { return { TAG: "ApproxThreshold", _0: 0.001, @@ -392,7 +392,7 @@ let suites_1 = { tl: { hd: [ "log1p", - ((param) => { + (param => { return { TAG: "ApproxThreshold", _0: 0.001, @@ -404,7 +404,7 @@ let suites_1 = { tl: { hd: [ "log10", - ((param) => { + (param => { return { TAG: "ApproxThreshold", _0: 0.001, @@ -416,7 +416,7 @@ let suites_1 = { tl: { hd: [ "log2", - ((param) => { + (param => { return { TAG: "ApproxThreshold", _0: 0.001, @@ -428,7 +428,7 @@ let suites_1 = { tl: { hd: [ "max_int", - ((param) => { + (param => { return { TAG: "Eq", _0: 4, @@ -439,7 +439,7 @@ let suites_1 = { tl: { hd: [ "maxMany_int", - ((param) => { + (param => { return { TAG: "Eq", _0: 4, @@ -450,7 +450,7 @@ let suites_1 = { tl: { hd: [ "max_float", - ((param) => { + (param => { return { TAG: "Eq", _0: 4.2, @@ -461,7 +461,7 @@ let suites_1 = { tl: { hd: [ "maxMany_float", - ((param) => { + (param => { return { TAG: "Eq", _0: 4.2, @@ -472,7 +472,7 @@ let suites_1 = { tl: { hd: [ "min_int", - ((param) => { + (param => { return { TAG: "Eq", _0: 2, @@ -483,7 +483,7 @@ let suites_1 = { tl: { hd: [ "minMany_int", - ((param) => { + (param => { return { TAG: "Eq", _0: 2, @@ -494,7 +494,7 @@ let suites_1 = { tl: { hd: [ "min_float", - ((param) => { + (param => { return { TAG: "Eq", _0: 2.7, @@ -505,7 +505,7 @@ let suites_1 = { tl: { hd: [ "minMany_float", - ((param) => { + (param => { return { TAG: "Eq", _0: 2.7, @@ -516,7 +516,7 @@ let suites_1 = { tl: { hd: [ "random", - ((param) => { + (param => { let a = Math.random(); return { TAG: "Ok", @@ -527,7 +527,7 @@ let suites_1 = { tl: { hd: [ "random_int", - ((param) => { + (param => { let a = Js_math.random_int(1, 3); return { TAG: "Ok", @@ -538,7 +538,7 @@ let suites_1 = { tl: { hd: [ "unsafe_round", - ((param) => { + (param => { return { TAG: "Eq", _0: 3, @@ -549,7 +549,7 @@ let suites_1 = { tl: { hd: [ "round", - ((param) => { + (param => { return { TAG: "Eq", _0: 3, @@ -560,7 +560,7 @@ let suites_1 = { tl: { hd: [ "sign_int", - ((param) => { + (param => { return { TAG: "Eq", _0: -1, @@ -571,7 +571,7 @@ let suites_1 = { tl: { hd: [ "sign_float", - ((param) => { + (param => { return { TAG: "Eq", _0: -1, @@ -582,7 +582,7 @@ let suites_1 = { tl: { hd: [ "sign_float -0", - ((param) => { + (param => { return { TAG: "Eq", _0: -0, @@ -593,7 +593,7 @@ let suites_1 = { tl: { hd: [ "sin", - ((param) => { + (param => { return { TAG: "ApproxThreshold", _0: 0.001, @@ -605,7 +605,7 @@ let suites_1 = { tl: { hd: [ "sinh", - ((param) => { + (param => { return { TAG: "ApproxThreshold", _0: 0.001, @@ -617,7 +617,7 @@ let suites_1 = { tl: { hd: [ "sqrt", - ((param) => { + (param => { return { TAG: "ApproxThreshold", _0: 0.001, @@ -629,7 +629,7 @@ let suites_1 = { tl: { hd: [ "tan", - ((param) => { + (param => { return { TAG: "ApproxThreshold", _0: 0.001, @@ -641,7 +641,7 @@ let suites_1 = { tl: { hd: [ "tanh", - ((param) => { + (param => { return { TAG: "ApproxThreshold", _0: 0.001, @@ -653,7 +653,7 @@ let suites_1 = { tl: { hd: [ "unsafe_trunc", - ((param) => { + (param => { return { TAG: "Eq", _0: 4, @@ -664,7 +664,7 @@ let suites_1 = { tl: { hd: [ "trunc", - ((param) => { + (param => { return { TAG: "Eq", _0: 4, diff --git a/jscomp/test/js_null_test.js b/jscomp/test/js_null_test.js index bb4b0332856..c665ccc41c8 100644 --- a/jscomp/test/js_null_test.js +++ b/jscomp/test/js_null_test.js @@ -7,7 +7,7 @@ let Caml_option = require("../../lib/js/caml_option.js"); let suites_0 = [ "toOption - empty", - ((param) => { + (param => { return { TAG: "Eq", _0: undefined, @@ -19,7 +19,7 @@ let suites_0 = [ let suites_1 = { hd: [ "toOption - 'a", - ((param) => { + (param => { return { TAG: "Eq", _0: Caml_option.some(undefined), @@ -30,7 +30,7 @@ let suites_1 = { tl: { hd: [ "return", - ((param) => { + (param => { return { TAG: "Eq", _0: "something", @@ -41,7 +41,7 @@ let suites_1 = { tl: { hd: [ "test - empty", - ((param) => { + (param => { return { TAG: "Eq", _0: true, @@ -52,7 +52,7 @@ let suites_1 = { tl: { hd: [ "test - 'a", - ((param) => { + (param => { return { TAG: "Eq", _0: false, @@ -63,11 +63,11 @@ let suites_1 = { tl: { hd: [ "bind - empty", - ((param) => { + (param => { return { TAG: "StrictEq", _0: null, - _1: Js_null.bind(null, ((v) => { + _1: Js_null.bind(null, (v => { return v; })) }; @@ -76,11 +76,11 @@ let suites_1 = { tl: { hd: [ "bind - 'a", - ((param) => { + (param => { return { TAG: "StrictEq", _0: 4, - _1: Js_null.bind(2, ((n) => { + _1: Js_null.bind(2, (n => { return (n << 1); })) }; @@ -89,11 +89,11 @@ let suites_1 = { tl: { hd: [ "iter - empty", - ((param) => { + (param => { let hit = { contents: false }; - Js_null.iter(null, ((param) => { + Js_null.iter(null, (param => { hit.contents = true; })); return { @@ -106,11 +106,11 @@ let suites_1 = { tl: { hd: [ "iter - 'a", - ((param) => { + (param => { let hit = { contents: 0 }; - Js_null.iter(2, ((v) => { + Js_null.iter(2, (v => { hit.contents = v; })); return { @@ -123,7 +123,7 @@ let suites_1 = { tl: { hd: [ "fromOption - None", - ((param) => { + (param => { return { TAG: "Eq", _0: null, @@ -134,7 +134,7 @@ let suites_1 = { tl: { hd: [ "fromOption - Some", - ((param) => { + (param => { return { TAG: "Eq", _0: 2, diff --git a/jscomp/test/js_null_undefined_test.js b/jscomp/test/js_null_undefined_test.js index 3147a503f7e..46d6338d350 100644 --- a/jscomp/test/js_null_undefined_test.js +++ b/jscomp/test/js_null_undefined_test.js @@ -7,7 +7,7 @@ let Js_null_undefined = require("../../lib/js/js_null_undefined.js"); let suites_0 = [ "toOption - null", - ((param) => { + (param => { return { TAG: "Eq", _0: undefined, @@ -19,7 +19,7 @@ let suites_0 = [ let suites_1 = { hd: [ "toOption - undefined", - ((param) => { + (param => { return { TAG: "Eq", _0: undefined, @@ -30,7 +30,7 @@ let suites_1 = { tl: { hd: [ "toOption - empty", - ((param) => { + (param => { return { TAG: "Eq", _0: undefined, @@ -41,7 +41,7 @@ let suites_1 = { tl: { hd: [ "File \"js_null_undefined_test.res\", line 9, characters 5-12", - ((param) => { + (param => { return { TAG: "Eq", _0: "foo", @@ -52,7 +52,7 @@ let suites_1 = { tl: { hd: [ "return", - ((param) => { + (param => { return { TAG: "Eq", _0: "something", @@ -63,7 +63,7 @@ let suites_1 = { tl: { hd: [ "test - null", - ((param) => { + (param => { return { TAG: "Eq", _0: true, @@ -74,7 +74,7 @@ let suites_1 = { tl: { hd: [ "test - undefined", - ((param) => { + (param => { return { TAG: "Eq", _0: true, @@ -85,7 +85,7 @@ let suites_1 = { tl: { hd: [ "test - empty", - ((param) => { + (param => { return { TAG: "Eq", _0: true, @@ -96,7 +96,7 @@ let suites_1 = { tl: { hd: [ "File \"js_null_undefined_test.res\", line 14, characters 5-12", - ((param) => { + (param => { return { TAG: "Eq", _0: true, @@ -107,11 +107,11 @@ let suites_1 = { tl: { hd: [ "bind - null", - ((param) => { + (param => { return { TAG: "StrictEq", _0: null, - _1: Js_null_undefined.bind(null, ((v) => { + _1: Js_null_undefined.bind(null, (v => { return v; })) }; @@ -120,11 +120,11 @@ let suites_1 = { tl: { hd: [ "bind - undefined", - ((param) => { + (param => { return { TAG: "StrictEq", _0: undefined, - _1: Js_null_undefined.bind(undefined, ((v) => { + _1: Js_null_undefined.bind(undefined, (v => { return v; })) }; @@ -133,11 +133,11 @@ let suites_1 = { tl: { hd: [ "bind - empty", - ((param) => { + (param => { return { TAG: "StrictEq", _0: undefined, - _1: Js_null_undefined.bind(undefined, ((v) => { + _1: Js_null_undefined.bind(undefined, (v => { return v; })) }; @@ -146,11 +146,11 @@ let suites_1 = { tl: { hd: [ "bind - 'a", - ((param) => { + (param => { return { TAG: "Eq", _0: 4, - _1: Js_null_undefined.bind(2, ((n) => { + _1: Js_null_undefined.bind(2, (n => { return (n << 1); })) }; @@ -159,11 +159,11 @@ let suites_1 = { tl: { hd: [ "iter - null", - ((param) => { + (param => { let hit = { contents: false }; - Js_null_undefined.iter(null, ((param) => { + Js_null_undefined.iter(null, (param => { hit.contents = true; })); return { @@ -176,11 +176,11 @@ let suites_1 = { tl: { hd: [ "iter - undefined", - ((param) => { + (param => { let hit = { contents: false }; - Js_null_undefined.iter(undefined, ((param) => { + Js_null_undefined.iter(undefined, (param => { hit.contents = true; })); return { @@ -193,11 +193,11 @@ let suites_1 = { tl: { hd: [ "iter - empty", - ((param) => { + (param => { let hit = { contents: false }; - Js_null_undefined.iter(undefined, ((param) => { + Js_null_undefined.iter(undefined, (param => { hit.contents = true; })); return { @@ -210,11 +210,11 @@ let suites_1 = { tl: { hd: [ "iter - 'a", - ((param) => { + (param => { let hit = { contents: 0 }; - Js_null_undefined.iter(2, ((v) => { + Js_null_undefined.iter(2, (v => { hit.contents = v; })); return { @@ -227,7 +227,7 @@ let suites_1 = { tl: { hd: [ "fromOption - None", - ((param) => { + (param => { return { TAG: "Eq", _0: undefined, @@ -238,7 +238,7 @@ let suites_1 = { tl: { hd: [ "fromOption - Some", - ((param) => { + (param => { return { TAG: "Eq", _0: 2, @@ -249,7 +249,7 @@ let suites_1 = { tl: { hd: [ "null <> undefined", - ((param) => { + (param => { return { TAG: "Ok", _0: true @@ -259,7 +259,7 @@ let suites_1 = { tl: { hd: [ "null <> empty", - ((param) => { + (param => { return { TAG: "Ok", _0: true @@ -269,7 +269,7 @@ let suites_1 = { tl: { hd: [ "undefined = empty", - ((param) => { + (param => { return { TAG: "Ok", _0: true @@ -279,7 +279,7 @@ let suites_1 = { tl: { hd: [ "File \"js_null_undefined_test.res\", line 57, characters 6-13", - ((param) => { + (param => { return { TAG: "Ok", _0: true diff --git a/jscomp/test/js_obj_test.js b/jscomp/test/js_obj_test.js index 8819c681ca5..c5b5132d58f 100644 --- a/jscomp/test/js_obj_test.js +++ b/jscomp/test/js_obj_test.js @@ -5,7 +5,7 @@ let Mt = require("./mt.js"); let suites_0 = [ "empty", - ((param) => { + (param => { return { TAG: "Eq", _0: 0, @@ -17,7 +17,7 @@ let suites_0 = [ let suites_1 = { hd: [ "assign", - ((param) => { + (param => { return { TAG: "Eq", _0: { diff --git a/jscomp/test/js_option_test.js b/jscomp/test/js_option_test.js index c28f0198799..227251dc505 100644 --- a/jscomp/test/js_option_test.js +++ b/jscomp/test/js_option_test.js @@ -10,7 +10,7 @@ function simpleEq(a, b) { let option_suites_0 = [ "option_isSome_Some", - ((param) => { + (param => { return { TAG: "Eq", _0: true, @@ -22,7 +22,7 @@ let option_suites_0 = [ let option_suites_1 = { hd: [ "option_isSome_None", - ((param) => { + (param => { return { TAG: "Eq", _0: false, @@ -33,7 +33,7 @@ let option_suites_1 = { tl: { hd: [ "option_isNone_Some", - ((param) => { + (param => { return { TAG: "Eq", _0: false, @@ -44,7 +44,7 @@ let option_suites_1 = { tl: { hd: [ "option_isNone_None", - ((param) => { + (param => { return { TAG: "Eq", _0: true, @@ -55,7 +55,7 @@ let option_suites_1 = { tl: { hd: [ "option_isSomeValue_Eq", - ((param) => { + (param => { return { TAG: "Eq", _0: true, @@ -66,7 +66,7 @@ let option_suites_1 = { tl: { hd: [ "option_isSomeValue_Diff", - ((param) => { + (param => { return { TAG: "Eq", _0: false, @@ -77,7 +77,7 @@ let option_suites_1 = { tl: { hd: [ "option_isSomeValue_DiffNone", - ((param) => { + (param => { return { TAG: "Eq", _0: false, @@ -88,7 +88,7 @@ let option_suites_1 = { tl: { hd: [ "option_getExn_Some", - ((param) => { + (param => { return { TAG: "Eq", _0: 2, @@ -99,7 +99,7 @@ let option_suites_1 = { tl: { hd: [ "option_equal_Eq", - ((param) => { + (param => { return { TAG: "Eq", _0: true, @@ -110,7 +110,7 @@ let option_suites_1 = { tl: { hd: [ "option_equal_Diff", - ((param) => { + (param => { return { TAG: "Eq", _0: false, @@ -121,7 +121,7 @@ let option_suites_1 = { tl: { hd: [ "option_equal_DiffNone", - ((param) => { + (param => { return { TAG: "Eq", _0: false, @@ -132,11 +132,11 @@ let option_suites_1 = { tl: { hd: [ "option_andThen_SomeSome", - ((param) => { + (param => { return { TAG: "Eq", _0: true, - _1: Js_option.isSomeValue(simpleEq, 3, Js_option.andThen(((a) => { + _1: Js_option.isSomeValue(simpleEq, 3, Js_option.andThen((a => { return a + 1 | 0; }), 2)) }; @@ -145,11 +145,11 @@ let option_suites_1 = { tl: { hd: [ "option_andThen_SomeNone", - ((param) => { + (param => { return { TAG: "Eq", _0: false, - _1: Js_option.isSomeValue(simpleEq, 3, Js_option.andThen(((param) => { + _1: Js_option.isSomeValue(simpleEq, 3, Js_option.andThen((param => { }), 2)) }; @@ -158,11 +158,11 @@ let option_suites_1 = { tl: { hd: [ "option_map_Some", - ((param) => { + (param => { return { TAG: "Eq", _0: true, - _1: Js_option.isSomeValue(simpleEq, 3, Js_option.map(((a) => { + _1: Js_option.isSomeValue(simpleEq, 3, Js_option.map((a => { return a + 1 | 0; }), 2)) }; @@ -171,11 +171,11 @@ let option_suites_1 = { tl: { hd: [ "option_map_None", - ((param) => { + (param => { return { TAG: "Eq", _0: undefined, - _1: Js_option.map(((a) => { + _1: Js_option.map((a => { return a + 1 | 0; }), undefined) }; @@ -184,7 +184,7 @@ let option_suites_1 = { tl: { hd: [ "option_default_Some", - ((param) => { + (param => { return { TAG: "Eq", _0: 2, @@ -195,7 +195,7 @@ let option_suites_1 = { tl: { hd: [ "option_default_None", - ((param) => { + (param => { return { TAG: "Eq", _0: 3, @@ -206,11 +206,11 @@ let option_suites_1 = { tl: { hd: [ "option_filter_Pass", - ((param) => { + (param => { return { TAG: "Eq", _0: true, - _1: Js_option.isSomeValue(simpleEq, 2, Js_option.filter(((a) => { + _1: Js_option.isSomeValue(simpleEq, 2, Js_option.filter((a => { return a % 2 === 0; }), 2)) }; @@ -219,11 +219,11 @@ let option_suites_1 = { tl: { hd: [ "option_filter_Reject", - ((param) => { + (param => { return { TAG: "Eq", _0: undefined, - _1: Js_option.filter(((a) => { + _1: Js_option.filter((a => { return a % 3 === 0; }), 2) }; @@ -232,11 +232,11 @@ let option_suites_1 = { tl: { hd: [ "option_filter_None", - ((param) => { + (param => { return { TAG: "Eq", _0: undefined, - _1: Js_option.filter(((a) => { + _1: Js_option.filter((a => { return a % 3 === 0; }), undefined) }; @@ -245,7 +245,7 @@ let option_suites_1 = { tl: { hd: [ "option_firstSome_First", - ((param) => { + (param => { return { TAG: "Eq", _0: true, @@ -256,7 +256,7 @@ let option_suites_1 = { tl: { hd: [ "option_firstSome_First", - ((param) => { + (param => { return { TAG: "Eq", _0: true, @@ -267,7 +267,7 @@ let option_suites_1 = { tl: { hd: [ "option_firstSome_None", - ((param) => { + (param => { return { TAG: "Eq", _0: undefined, diff --git a/jscomp/test/js_re_test.js b/jscomp/test/js_re_test.js index ff3d0bdeaaa..ddaa4892f94 100644 --- a/jscomp/test/js_re_test.js +++ b/jscomp/test/js_re_test.js @@ -7,7 +7,7 @@ let Caml_option = require("../../lib/js/caml_option.js"); let suites_0 = [ "captures", - ((param) => { + (param => { let re = /(\d+)-(?:(\d+))?/g; let result = re.exec("3-"); if (result === null) { @@ -35,7 +35,7 @@ let suites_0 = [ let suites_1 = { hd: [ "fromString", - ((param) => { + (param => { let contentOf = (tag, xmlString) => { let x = Caml_option.null_to_opt(new RegExp("<" + (tag + (">(.*?)<\\/" + (tag + ">")))).exec(xmlString)); if (x !== undefined) { @@ -53,7 +53,7 @@ let suites_1 = { tl: { hd: [ "exec_literal", - ((param) => { + (param => { let res = /[^.]+/.exec("http://xxx.domain.com"); if (res !== null) { return { @@ -72,7 +72,7 @@ let suites_1 = { tl: { hd: [ "exec_no_match", - ((param) => { + (param => { let match = /https:\/\/(.*)/.exec("http://xxx.domain.com"); if (match !== null) { return { @@ -90,7 +90,7 @@ let suites_1 = { tl: { hd: [ "test_str", - ((param) => { + (param => { let res = new RegExp("foo").test("#foo#"); return { TAG: "Eq", @@ -102,7 +102,7 @@ let suites_1 = { tl: { hd: [ "fromStringWithFlags", - ((param) => { + (param => { let res = new RegExp("foo", "g"); return { TAG: "Eq", @@ -114,7 +114,7 @@ let suites_1 = { tl: { hd: [ "result_index", - ((param) => { + (param => { let res = new RegExp("zbar").exec("foobarbazbar"); if (res !== null) { return { @@ -133,7 +133,7 @@ let suites_1 = { tl: { hd: [ "result_input", - ((param) => { + (param => { let input = "foobar"; let res = /foo/g.exec(input); if (res !== null) { @@ -153,7 +153,7 @@ let suites_1 = { tl: { hd: [ "t_flags", - ((param) => { + (param => { return { TAG: "Eq", _0: "gi", @@ -164,7 +164,7 @@ let suites_1 = { tl: { hd: [ "t_global", - ((param) => { + (param => { return { TAG: "Eq", _0: true, @@ -175,7 +175,7 @@ let suites_1 = { tl: { hd: [ "t_ignoreCase", - ((param) => { + (param => { return { TAG: "Eq", _0: true, @@ -186,7 +186,7 @@ let suites_1 = { tl: { hd: [ "t_lastIndex", - ((param) => { + (param => { let re = /na/g; re.exec("banana"); return { @@ -199,7 +199,7 @@ let suites_1 = { tl: { hd: [ "t_setLastIndex", - ((param) => { + (param => { let re = /na/g; let before = re.lastIndex; re.lastIndex = 42; @@ -220,7 +220,7 @@ let suites_1 = { tl: { hd: [ "t_multiline", - ((param) => { + (param => { return { TAG: "Eq", _0: false, @@ -231,7 +231,7 @@ let suites_1 = { tl: { hd: [ "t_source", - ((param) => { + (param => { return { TAG: "Eq", _0: "f.+o", @@ -242,7 +242,7 @@ let suites_1 = { tl: { hd: [ "t_sticky", - ((param) => { + (param => { return { TAG: "Eq", _0: true, @@ -253,7 +253,7 @@ let suites_1 = { tl: { hd: [ "t_unicode", - ((param) => { + (param => { return { TAG: "Eq", _0: false, diff --git a/jscomp/test/js_string_test.js b/jscomp/test/js_string_test.js index cc808fc1df0..8826fa03c8b 100644 --- a/jscomp/test/js_string_test.js +++ b/jscomp/test/js_string_test.js @@ -7,7 +7,7 @@ let Caml_option = require("../../lib/js/caml_option.js"); let suites_0 = [ "make", - ((param) => { + (param => { return { TAG: "Eq", _0: "null", @@ -19,7 +19,7 @@ let suites_0 = [ let suites_1 = { hd: [ "fromCharCode", - ((param) => { + (param => { return { TAG: "Eq", _0: "a", @@ -30,7 +30,7 @@ let suites_1 = { tl: { hd: [ "fromCharCodeMany", - ((param) => { + (param => { return { TAG: "Eq", _0: "az", @@ -41,7 +41,7 @@ let suites_1 = { tl: { hd: [ "fromCodePoint", - ((param) => { + (param => { return { TAG: "Eq", _0: "a", @@ -52,7 +52,7 @@ let suites_1 = { tl: { hd: [ "fromCodePointMany", - ((param) => { + (param => { return { TAG: "Eq", _0: "az", @@ -63,7 +63,7 @@ let suites_1 = { tl: { hd: [ "length", - ((param) => { + (param => { return { TAG: "Eq", _0: 3, @@ -74,7 +74,7 @@ let suites_1 = { tl: { hd: [ "get", - ((param) => { + (param => { return { TAG: "Eq", _0: "a", @@ -85,7 +85,7 @@ let suites_1 = { tl: { hd: [ "charAt", - ((param) => { + (param => { return { TAG: "Eq", _0: "a", @@ -96,7 +96,7 @@ let suites_1 = { tl: { hd: [ "charCodeAt", - ((param) => { + (param => { return { TAG: "Eq", _0: 97, @@ -107,7 +107,7 @@ let suites_1 = { tl: { hd: [ "codePointAt", - ((param) => { + (param => { return { TAG: "Eq", _0: 97, @@ -118,7 +118,7 @@ let suites_1 = { tl: { hd: [ "codePointAt - out of bounds", - ((param) => { + (param => { return { TAG: "Eq", _0: undefined, @@ -129,7 +129,7 @@ let suites_1 = { tl: { hd: [ "concat", - ((param) => { + (param => { return { TAG: "Eq", _0: "foobar", @@ -140,7 +140,7 @@ let suites_1 = { tl: { hd: [ "concatMany", - ((param) => { + (param => { return { TAG: "Eq", _0: "foobarbaz", @@ -151,7 +151,7 @@ let suites_1 = { tl: { hd: [ "endsWith", - ((param) => { + (param => { return { TAG: "Eq", _0: true, @@ -162,7 +162,7 @@ let suites_1 = { tl: { hd: [ "endsWithFrom", - ((param) => { + (param => { return { TAG: "Eq", _0: false, @@ -173,7 +173,7 @@ let suites_1 = { tl: { hd: [ "includes", - ((param) => { + (param => { return { TAG: "Eq", _0: true, @@ -184,7 +184,7 @@ let suites_1 = { tl: { hd: [ "includesFrom", - ((param) => { + (param => { return { TAG: "Eq", _0: false, @@ -195,7 +195,7 @@ let suites_1 = { tl: { hd: [ "indexOf", - ((param) => { + (param => { return { TAG: "Eq", _0: 3, @@ -206,7 +206,7 @@ let suites_1 = { tl: { hd: [ "indexOfFrom", - ((param) => { + (param => { return { TAG: "Eq", _0: -1, @@ -217,7 +217,7 @@ let suites_1 = { tl: { hd: [ "lastIndexOf", - ((param) => { + (param => { return { TAG: "Eq", _0: 3, @@ -228,7 +228,7 @@ let suites_1 = { tl: { hd: [ "lastIndexOfFrom", - ((param) => { + (param => { return { TAG: "Eq", _0: 3, @@ -239,7 +239,7 @@ let suites_1 = { tl: { hd: [ "localeCompare", - ((param) => { + (param => { return { TAG: "Eq", _0: 0, @@ -250,7 +250,7 @@ let suites_1 = { tl: { hd: [ "match", - ((param) => { + (param => { return { TAG: "Eq", _0: [ @@ -264,7 +264,7 @@ let suites_1 = { tl: { hd: [ "match - no match", - ((param) => { + (param => { return { TAG: "Eq", _0: undefined, @@ -275,14 +275,14 @@ let suites_1 = { tl: { hd: [ "match - not found capture groups", - ((param) => { + (param => { return { TAG: "Eq", _0: [ "hello ", undefined ], - _1: Belt_Option.map(Caml_option.null_to_opt("hello word".match(/hello (world)?/)), ((prim) => { + _1: Belt_Option.map(Caml_option.null_to_opt("hello word".match(/hello (world)?/)), (prim => { return prim.slice(); })) }; @@ -291,7 +291,7 @@ let suites_1 = { tl: { hd: [ "normalize", - ((param) => { + (param => { return { TAG: "Eq", _0: "foo", @@ -302,7 +302,7 @@ let suites_1 = { tl: { hd: [ "normalizeByForm", - ((param) => { + (param => { return { TAG: "Eq", _0: "foo", @@ -313,7 +313,7 @@ let suites_1 = { tl: { hd: [ "repeat", - ((param) => { + (param => { return { TAG: "Eq", _0: "foofoofoo", @@ -324,7 +324,7 @@ let suites_1 = { tl: { hd: [ "replace", - ((param) => { + (param => { return { TAG: "Eq", _0: "fooBORKbaz", @@ -335,7 +335,7 @@ let suites_1 = { tl: { hd: [ "replaceByRe", - ((param) => { + (param => { return { TAG: "Eq", _0: "fooBORKBORK", @@ -346,7 +346,7 @@ let suites_1 = { tl: { hd: [ "unsafeReplaceBy0", - ((param) => { + (param => { let replace = (whole, offset, s) => { if (whole === "bar") { return "BORK"; @@ -364,7 +364,7 @@ let suites_1 = { tl: { hd: [ "unsafeReplaceBy1", - ((param) => { + (param => { let replace = (whole, p1, offset, s) => { if (whole === "bar") { return "BORK"; @@ -382,7 +382,7 @@ let suites_1 = { tl: { hd: [ "unsafeReplaceBy2", - ((param) => { + (param => { let replace = (whole, p1, p2, offset, s) => { if (whole === "bar") { return "BORK"; @@ -400,7 +400,7 @@ let suites_1 = { tl: { hd: [ "unsafeReplaceBy3", - ((param) => { + (param => { let replace = (whole, p1, p2, p3, offset, s) => { if (whole === "bar") { return "BORK"; @@ -418,7 +418,7 @@ let suites_1 = { tl: { hd: [ "search", - ((param) => { + (param => { return { TAG: "Eq", _0: 3, @@ -429,7 +429,7 @@ let suites_1 = { tl: { hd: [ "slice", - ((param) => { + (param => { return { TAG: "Eq", _0: "bar", @@ -440,7 +440,7 @@ let suites_1 = { tl: { hd: [ "sliceToEnd", - ((param) => { + (param => { return { TAG: "Eq", _0: "barbaz", @@ -451,7 +451,7 @@ let suites_1 = { tl: { hd: [ "split", - ((param) => { + (param => { return { TAG: "Eq", _0: [ @@ -466,7 +466,7 @@ let suites_1 = { tl: { hd: [ "splitAtMost", - ((param) => { + (param => { return { TAG: "Eq", _0: [ @@ -480,7 +480,7 @@ let suites_1 = { tl: { hd: [ "splitByRe", - ((param) => { + (param => { return { TAG: "Eq", _0: [ @@ -499,7 +499,7 @@ let suites_1 = { tl: { hd: [ "splitByReAtMost", - ((param) => { + (param => { return { TAG: "Eq", _0: [ @@ -514,7 +514,7 @@ let suites_1 = { tl: { hd: [ "startsWith", - ((param) => { + (param => { return { TAG: "Eq", _0: true, @@ -525,7 +525,7 @@ let suites_1 = { tl: { hd: [ "startsWithFrom", - ((param) => { + (param => { return { TAG: "Eq", _0: false, @@ -536,7 +536,7 @@ let suites_1 = { tl: { hd: [ "substr", - ((param) => { + (param => { return { TAG: "Eq", _0: "barbaz", @@ -547,7 +547,7 @@ let suites_1 = { tl: { hd: [ "substrAtMost", - ((param) => { + (param => { return { TAG: "Eq", _0: "bar", @@ -558,7 +558,7 @@ let suites_1 = { tl: { hd: [ "substring", - ((param) => { + (param => { return { TAG: "Eq", _0: "bar", @@ -569,7 +569,7 @@ let suites_1 = { tl: { hd: [ "substringToEnd", - ((param) => { + (param => { return { TAG: "Eq", _0: "barbaz", @@ -580,7 +580,7 @@ let suites_1 = { tl: { hd: [ "toLowerCase", - ((param) => { + (param => { return { TAG: "Eq", _0: "bork", @@ -591,7 +591,7 @@ let suites_1 = { tl: { hd: [ "toLocaleLowerCase", - ((param) => { + (param => { return { TAG: "Eq", _0: "bork", @@ -602,7 +602,7 @@ let suites_1 = { tl: { hd: [ "toUpperCase", - ((param) => { + (param => { return { TAG: "Eq", _0: "FUBAR", @@ -613,7 +613,7 @@ let suites_1 = { tl: { hd: [ "toLocaleUpperCase", - ((param) => { + (param => { return { TAG: "Eq", _0: "FUBAR", @@ -624,7 +624,7 @@ let suites_1 = { tl: { hd: [ "trim", - ((param) => { + (param => { return { TAG: "Eq", _0: "foo", @@ -635,7 +635,7 @@ let suites_1 = { tl: { hd: [ "anchor", - ((param) => { + (param => { return { TAG: "Eq", _0: "foo", @@ -646,7 +646,7 @@ let suites_1 = { tl: { hd: [ "link", - ((param) => { + (param => { return { TAG: "Eq", _0: "foo", @@ -657,7 +657,7 @@ let suites_1 = { tl: { hd: [ "File \"js_string_test.res\", line 138, characters 5-12", - ((param) => { + (param => { return { TAG: "Ok", _0: "ab".includes("a") diff --git a/jscomp/test/js_undefined_test.js b/jscomp/test/js_undefined_test.js index 364b8b106e7..3cd186f9353 100644 --- a/jscomp/test/js_undefined_test.js +++ b/jscomp/test/js_undefined_test.js @@ -7,7 +7,7 @@ let Js_undefined = require("../../lib/js/js_undefined.js"); let suites_0 = [ "toOption - empty", - ((param) => { + (param => { return { TAG: "Eq", _0: undefined, @@ -19,7 +19,7 @@ let suites_0 = [ let suites_1 = { hd: [ "File \"js_undefined_test.res\", line 7, characters 5-12", - ((param) => { + (param => { return { TAG: "Eq", _0: undefined, @@ -30,7 +30,7 @@ let suites_1 = { tl: { hd: [ "return", - ((param) => { + (param => { return { TAG: "Eq", _0: "something", @@ -41,7 +41,7 @@ let suites_1 = { tl: { hd: [ "test - empty", - ((param) => { + (param => { return { TAG: "Eq", _0: true, @@ -52,7 +52,7 @@ let suites_1 = { tl: { hd: [ "File \"js_undefined_test.res\", line 10, characters 5-12", - ((param) => { + (param => { return { TAG: "Eq", _0: true, @@ -63,11 +63,11 @@ let suites_1 = { tl: { hd: [ "bind - empty", - ((param) => { + (param => { return { TAG: "Eq", _0: undefined, - _1: Js_undefined.bind(undefined, ((v) => { + _1: Js_undefined.bind(undefined, (v => { return v; })) }; @@ -76,11 +76,11 @@ let suites_1 = { tl: { hd: [ "bind - 'a", - ((param) => { + (param => { return { TAG: "Eq", _0: 4, - _1: Js_undefined.bind(2, ((n) => { + _1: Js_undefined.bind(2, (n => { return (n << 1); })) }; @@ -89,11 +89,11 @@ let suites_1 = { tl: { hd: [ "iter - empty", - ((param) => { + (param => { let hit = { contents: false }; - Js_undefined.iter(undefined, ((param) => { + Js_undefined.iter(undefined, (param => { hit.contents = true; })); return { @@ -106,11 +106,11 @@ let suites_1 = { tl: { hd: [ "iter - 'a", - ((param) => { + (param => { let hit = { contents: 0 }; - Js_undefined.iter(2, ((v) => { + Js_undefined.iter(2, (v => { hit.contents = v; })); return { @@ -123,7 +123,7 @@ let suites_1 = { tl: { hd: [ "fromOption - None", - ((param) => { + (param => { return { TAG: "Eq", _0: undefined, @@ -134,7 +134,7 @@ let suites_1 = { tl: { hd: [ "fromOption - Some", - ((param) => { + (param => { return { TAG: "Eq", _0: 2, diff --git a/jscomp/test/lib_js_test.js b/jscomp/test/lib_js_test.js index 02848f68d76..dfd81f14c94 100644 --- a/jscomp/test/lib_js_test.js +++ b/jscomp/test/lib_js_test.js @@ -18,7 +18,7 @@ console.log("hey"); let suites_0 = [ "anything_to_string", - ((param) => { + (param => { return { TAG: "Eq", _0: "3", diff --git a/jscomp/test/libqueue_test.js b/jscomp/test/libqueue_test.js index ecc17c708ef..a5b4db1200f 100644 --- a/jscomp/test/libqueue_test.js +++ b/jscomp/test/libqueue_test.js @@ -865,7 +865,7 @@ let i$7 = { contents: 1 }; -Queue.iter(((j) => { +Queue.iter((j => { if (i$7.contents !== j) { throw new Error("Assert_failure", { cause: { diff --git a/jscomp/test/list_stack.js b/jscomp/test/list_stack.js index 174acc8ee5c..702f611f91e 100644 --- a/jscomp/test/list_stack.js +++ b/jscomp/test/list_stack.js @@ -3,7 +3,7 @@ let List = require("../../lib/js/list.js"); -List.find(((x) => { +List.find((x => { return x > 3; }), /* [] */0); diff --git a/jscomp/test/list_test.js b/jscomp/test/list_test.js index fa78ef49784..a70a346cac8 100644 --- a/jscomp/test/list_test.js +++ b/jscomp/test/list_test.js @@ -8,7 +8,7 @@ let $$Array = require("../../lib/js/array.js"); let list_suites_0 = [ "length", - ((param) => { + (param => { return { TAG: "Eq", _0: 1, @@ -29,7 +29,7 @@ let list_suites_0 = [ let list_suites_1 = { hd: [ "length2", - ((param) => { + (param => { return { TAG: "Eq", _0: 5, @@ -55,11 +55,11 @@ let list_suites_1 = { tl: { hd: [ "long_length", - ((param) => { + (param => { return { TAG: "Eq", _0: 30000, - _1: List.length($$Array.to_list($$Array.init(30000, ((param) => { + _1: List.length($$Array.to_list($$Array.init(30000, (param => { return 0; })))) }; @@ -68,7 +68,7 @@ let list_suites_1 = { tl: { hd: [ "sort", - ((param) => { + (param => { return { TAG: "Eq", _0: List.sort(Caml.int_compare, { @@ -103,7 +103,7 @@ let list_suites_1 = { tl: { hd: [ "File \"list_test.res\", line 20, characters 5-12", - ((param) => { + (param => { return { TAG: "Eq", _0: true, @@ -123,7 +123,7 @@ let list_suites_1 = { tl: { hd: [ "File \"list_test.res\", line 21, characters 5-12", - ((param) => { + (param => { return { TAG: "Eq", _0: false, @@ -143,7 +143,7 @@ let list_suites_1 = { tl: { hd: [ "File \"list_test.res\", line 22, characters 5-12", - ((param) => { + (param => { return { TAG: "Eq", _0: 9, diff --git a/jscomp/test/loop_regression_test.js b/jscomp/test/loop_regression_test.js index 0f73c388d82..d713e781d42 100644 --- a/jscomp/test/loop_regression_test.js +++ b/jscomp/test/loop_regression_test.js @@ -23,7 +23,7 @@ function f() { let suites_0 = [ "sum", - ((param) => { + (param => { return { TAG: "Eq", _0: 55, diff --git a/jscomp/test/map_test.js b/jscomp/test/map_test.js index 2b7569617d3..3468d3828bc 100644 --- a/jscomp/test/map_test.js +++ b/jscomp/test/map_test.js @@ -2008,7 +2008,7 @@ function of_list(kvs) { let int_map_suites_0 = [ "add", - ((param) => { + (param => { let v = of_list({ hd: [ 1, @@ -2039,7 +2039,7 @@ let int_map_suites_0 = [ let int_map_suites_1 = { hd: [ "equal", - ((param) => { + (param => { let v = of_list({ hd: [ 1, @@ -2088,7 +2088,7 @@ let int_map_suites_1 = { tl: { hd: [ "equal2", - ((param) => { + (param => { let v = of_list({ hd: [ 1, @@ -2139,7 +2139,7 @@ let int_map_suites_1 = { tl: { hd: [ "iteration", - ((param) => { + (param => { let m = "Empty"; for (let i = 0; i <= 10000; ++i) { m = add$1(String(i), String(i), m); diff --git a/jscomp/test/mario_game.js b/jscomp/test/mario_game.js index d09ae71238c..7e7a786225c 100644 --- a/jscomp/test/mario_game.js +++ b/jscomp/test/mario_game.js @@ -948,7 +948,7 @@ function update_player(player, keys, context) { let prev_jumping = player.jumping; let prev_dir = player.dir; let prev_vx = Math.abs(player.vel.x); - List.iter(((extra) => { + List.iter((extra => { let lr_acc = player.vel.x * 0.2; switch (extra) { case "CLeft" : @@ -2085,7 +2085,7 @@ function process_collision(dir, c1, c2, state) { function broad_phase(collid, all_collids, state) { let obj = collid._2; - return List.filter(((c) => { + return List.filter((c => { if (in_viewport(state.vpt, obj.pos) || is_player(collid)) { return true; } else { @@ -2299,10 +2299,10 @@ function update_loop(canvas, param, map_dim) { multiplier: state.multiplier, game_over: state.game_over }; - List.iter(((obj) => { + List.iter((obj => { run_update_collid(state$1, obj, objs); }), objs); - List.iter(((part) => { + List.iter((part => { process(part); let x = part.pos.x - state$1.vpt.pos.x; let y = part.pos.y - state$1.vpt.pos.y; @@ -2321,7 +2321,7 @@ function update_loop(canvas, param, map_dim) { }), parts); fps(canvas, fps$1); hud(canvas, state$1.score, state$1.coins); - requestAnimationFrame((t) => { + requestAnimationFrame(t => { update_helper(t, state$1, player$1, collid_objs.contents, particles.contents); }); }; @@ -3308,11 +3308,11 @@ function inc_counter(param) { } function preload(param) { - return List.map(((img_src) => { + return List.map((img_src => { let img_src$1 = "sprites/" + img_src; let img = document.createElement("img"); img.src = img_src$1; - img.addEventListener("load", ((ev) => { + img.addEventListener("load", (ev => { inc_counter(); return true; }), true); @@ -3331,7 +3331,7 @@ function preload(param) { }); } -window.onload = ((param) => { +window.onload = (param => { preload(); return true; }); diff --git a/jscomp/test/mock_mt.js b/jscomp/test/mock_mt.js index f70d5a2cef2..f5c1d4ffb20 100644 --- a/jscomp/test/mock_mt.js +++ b/jscomp/test/mock_mt.js @@ -8,7 +8,7 @@ function from_pair_suites(name, suites) { name, "testing" ]); - List.iter(((param) => { + List.iter((param => { let name = param[0]; let fn = param[1](); switch (fn.TAG) { diff --git a/jscomp/test/module_parameter_test.js b/jscomp/test/module_parameter_test.js index 604562402bc..9a1652a54b4 100644 --- a/jscomp/test/module_parameter_test.js +++ b/jscomp/test/module_parameter_test.js @@ -22,7 +22,7 @@ function v(x) { let suites_0 = [ "const", - ((param) => { + (param => { return { TAG: "Eq", _0: 1, @@ -34,7 +34,7 @@ let suites_0 = [ let suites_1 = { hd: [ "other", - ((param) => { + (param => { return { TAG: "Eq", _0: 3, diff --git a/jscomp/test/more_poly_variant_test.js b/jscomp/test/more_poly_variant_test.js index 44367dd1c68..e21d0d4b5c1 100644 --- a/jscomp/test/more_poly_variant_test.js +++ b/jscomp/test/more_poly_variant_test.js @@ -3,7 +3,7 @@ function map(f) { - return (x) => { + return x => { if (typeof x !== "object") { return "Nil"; } diff --git a/jscomp/test/mt.js b/jscomp/test/mt.js index bc239586f78..fbf0eeb5132 100644 --- a/jscomp/test/mt.js +++ b/jscomp/test/mt.js @@ -221,10 +221,10 @@ function old_from_promise_suites_donotuse(name, suites) { if (match) { if (is_mocha()) { describe(name, (() => { - List.iter(((param) => { + List.iter((param => { let code = param[1]; it(param[0], (() => { - return code.then((x) => { + return code.then(x => { handleCode(x); return val_unit; }); @@ -244,7 +244,7 @@ function eq_suites(test_id, suites, loc, x, y) { suites.contents = { hd: [ loc + (" id " + String(test_id.contents)), - ((param) => { + (param => { return { TAG: "Eq", _0: x, @@ -261,7 +261,7 @@ function bool_suites(test_id, suites, loc, x) { suites.contents = { hd: [ loc + (" id " + String(test_id.contents)), - ((param) => { + (param => { return { TAG: "Ok", _0: x @@ -277,7 +277,7 @@ function throw_suites(test_id, suites, loc, x) { suites.contents = { hd: [ loc + (" id " + String(test_id.contents)), - ((param) => { + (param => { return { TAG: "ThrowAny", _0: x diff --git a/jscomp/test/mt_global.js b/jscomp/test/mt_global.js index a23d9f49e3c..62e7a3d06c0 100644 --- a/jscomp/test/mt_global.js +++ b/jscomp/test/mt_global.js @@ -7,7 +7,7 @@ function collect_eq(test_id, suites, loc, x, y) { suites.contents = { hd: [ loc + (" id " + String(test_id.contents)), - ((param) => { + (param => { return { TAG: "Eq", _0: x, @@ -24,7 +24,7 @@ function collect_neq(test_id, suites, loc, x, y) { suites.contents = { hd: [ loc + (" id " + String(test_id.contents)), - ((param) => { + (param => { return { TAG: "Neq", _0: x, @@ -41,7 +41,7 @@ function collect_approx(test_id, suites, loc, x, y) { suites.contents = { hd: [ loc + (" id " + String(test_id.contents)), - ((param) => { + (param => { return { TAG: "Approx", _0: x, diff --git a/jscomp/test/mutable_obj_test.js b/jscomp/test/mutable_obj_test.js index 3ac60c3d19a..b6f6640bcc2 100644 --- a/jscomp/test/mutable_obj_test.js +++ b/jscomp/test/mutable_obj_test.js @@ -3,7 +3,7 @@ function f(x) { - x.dec = ((x) => { + x.dec = (x => { return { x: x, y: x diff --git a/jscomp/test/mutable_uncurry_test.js b/jscomp/test/mutable_uncurry_test.js index 6a48656f5a0..8aa2107971f 100644 --- a/jscomp/test/mutable_uncurry_test.js +++ b/jscomp/test/mutable_uncurry_test.js @@ -64,9 +64,9 @@ function t3(param, param$1, param$2) { function ut4(param, param$1, param$2, param$3) { let x0 = param.contents; let x1 = param$1.contents; - return ((param) => { + return (param => { let x2 = param.contents; - return (param) => { + return param => { let x3 = param.contents; return [ x0, @@ -81,9 +81,9 @@ function ut4(param, param$1, param$2, param$3) { function t4(param, param$1, param$2, param$3) { let x0 = param.contents; let x1 = param$1.contents; - return ((param) => { + return (param => { let x2 = param.contents; - return (param) => { + return param => { let x3 = param.contents; return [ x0, @@ -98,11 +98,11 @@ function t4(param, param$1, param$2, param$3) { function ut5(param, param$1, param$2, param$3, param$4) { let x0 = param.contents; let x1 = param$1.contents; - return ((param) => { + return (param => { let x2 = param.contents; - return (param) => { + return param => { let x3 = param.contents; - return (param) => { + return param => { let x4 = param.contents; return [ x0, @@ -119,11 +119,11 @@ function ut5(param, param$1, param$2, param$3, param$4) { function t5(param, param$1, param$2, param$3, param$4) { let x0 = param.contents; let x1 = param$1.contents; - return ((param) => { + return (param => { let x2 = param.contents; - return (param) => { + return param => { let x3 = param.contents; - return (param) => { + return param => { let x4 = param.contents; return [ x0, diff --git a/jscomp/test/obj_magic_test.js b/jscomp/test/obj_magic_test.js index 013342df3e9..4871a33694a 100644 --- a/jscomp/test/obj_magic_test.js +++ b/jscomp/test/obj_magic_test.js @@ -9,7 +9,7 @@ function is_block(x) { let suites_0 = [ "is_block_test1", - ((param) => { + (param => { return { TAG: "Eq", _0: false, @@ -21,7 +21,7 @@ let suites_0 = [ let suites_1 = { hd: [ "is_block_test2", - ((param) => { + (param => { return { TAG: "Eq", _0: true, @@ -35,7 +35,7 @@ let suites_1 = { tl: { hd: [ "is_block_test3", - ((param) => { + (param => { return { TAG: "Eq", _0: true, @@ -46,7 +46,7 @@ let suites_1 = { tl: { hd: [ "is_block_test4", - ((param) => { + (param => { return { TAG: "Eq", _0: false, diff --git a/jscomp/test/ocaml_re_test.js b/jscomp/test/ocaml_re_test.js index 996335e46d9..47c806a112c 100644 --- a/jscomp/test/ocaml_re_test.js +++ b/jscomp/test/ocaml_re_test.js @@ -790,7 +790,7 @@ function rename(ids, x) { case "Alt" : return mk_expr(ids, { TAG: "Alt", - _0: List.map(((extra) => { + _0: List.map((extra => { return rename(ids, extra); }), l._0) }); @@ -1001,8 +1001,8 @@ function reset_table(a) { } function mark_used_indices(tbl) { - return (extra) => { - return List.iter(((x) => { + return extra => { + return List.iter((x => { switch (x.TAG) { case "TSeq" : return mark_used_indices(tbl)(x._0); @@ -1010,7 +1010,7 @@ function mark_used_indices(tbl) { case "TMatch" : break; } - List.iter(((param) => { + List.iter((param => { let i = param[1]; if (i >= 0) { return Caml_array.set(tbl, i, true); @@ -1045,7 +1045,7 @@ function free_index(tbl_ref, l) { } function remove_matches(extra) { - return List.filter(((x) => { + return List.filter((x => { switch (x.TAG) { case "TSeq" : case "TExp" : @@ -1198,7 +1198,7 @@ function set_idx(idx, x) { function filter_marks(b, e, marks) { return { - marks: List.filter(((param) => { + marks: List.filter((param => { let i = param[0]; if (i < b) { return true; @@ -1243,7 +1243,7 @@ function delta_1(marks, c, next_cat, prev_cat, x, rem) { case "Rep" : let kind = s._1; let y$p$1 = delta_1(marks, c, next_cat, prev_cat, s._2, /* [] */0); - let marks$p = first(((x) => { + let marks$p = first((x => { switch (x.TAG) { case "TSeq" : case "TExp" : @@ -1356,7 +1356,7 @@ function delta_2(marks, c, next_cat, prev_cat, l, rem) { } function delta_seq(c, next_cat, prev_cat, kind, y, z, rem) { - let marks = first(((x) => { + let marks = first((x => { switch (x.TAG) { case "TSeq" : case "TExp" : @@ -1413,7 +1413,7 @@ function flatten_match(m) { return Caml.int_max(ma, param[0]); }), -1, m); let res = Caml_array.make(ma + 1 | 0, -1); - List.iter(((param) => { + List.iter((param => { Caml_array.set(res, param[0], param[1]); }), m); return res; @@ -1848,7 +1848,7 @@ function colorize(c, regexp) { let lnl = { contents: false }; - let colorize$1 = (_regexp) => { + let colorize$1 = _regexp => { while (true) { let regexp = _regexp; if (typeof regexp !== "object") { @@ -2408,7 +2408,7 @@ function translate(ids, kind, _ign_group, ign_case, _greedy, pos, cache, c, _x) ]; } return [ - alt(ids, List.map(((r$p) => { + alt(ids, List.map((r$p => { let match = translate(ids, kind, ign_group, ign_case, greedy, pos, cache, c, r$p); return enforce_kind(ids, kind, match[1], match[0]); }), merged_sequences)), @@ -2422,7 +2422,7 @@ function translate(ids, kind, _ign_group, ign_case, _greedy, pos, cache, c, _x) let cr = match$1[0]; let rem; if (j !== undefined) { - let f = greedy === "Non_greedy" ? ((rem) => { + let f = greedy === "Non_greedy" ? (rem => { return alt(ids, { hd: mk_expr(ids, "Eps"), tl: { @@ -2430,7 +2430,7 @@ function translate(ids, kind, _ign_group, ign_case, _greedy, pos, cache, c, _x) tl: /* [] */0 } }); - }) : ((rem) => { + }) : (rem => { return alt(ids, { hd: seq$1(ids, kind$p, rename(ids, cr), rem), tl: { @@ -2444,7 +2444,7 @@ function translate(ids, kind, _ign_group, ign_case, _greedy, pos, cache, c, _x) rem = rep(ids, greedy, kind$p, cr); } return [ - iter(i, ((rem) => { + iter(i, (rem => { return seq$1(ids, kind$p, rename(ids, cr), rem); }), rem), kind @@ -2596,12 +2596,12 @@ function handle_case(_ign_case, _x) { case "Sequence" : return { TAG: "Sequence", - _0: List.map(((extra) => { + _0: List.map((extra => { return handle_case(ign_case, extra); }), x._0) }; case "Alternative" : - let l$p = List.map(((extra) => { + let l$p = List.map((extra => { return handle_case(ign_case, extra); }), x._0); if (is_charset({ @@ -2683,7 +2683,7 @@ function handle_case(_ign_case, _x) { _ign_case = true; continue; case "Intersection" : - let l$p$1 = List.map(((r) => { + let l$p$1 = List.map((r => { return handle_case(ign_case, r); }), x._0); return { @@ -2693,7 +2693,7 @@ function handle_case(_ign_case, _x) { }), cany, l$p$1) }; case "Complement" : - let l$p$2 = List.map(((r) => { + let l$p$2 = List.map((r => { return handle_case(ign_case, r); }), x._0); return { @@ -3332,21 +3332,21 @@ function parse(multiline, dollar_endonly, dotall, ungreedy, s) { contents: 0 }; let l = s.length; - let test = (c) => { + let test = c => { if (i.contents !== l) { return Caml_string.get(s, i.contents) === c; } else { return false; } }; - let accept = (c) => { + let accept = c => { let r = test(c); if (r) { i.contents = i.contents + 1 | 0; } return r; }; - let accept_s = (s$p) => { + let accept_s = s$p => { let len = s$p.length; try { for (let j = 0; j < len; ++j) { @@ -3384,7 +3384,7 @@ function parse(multiline, dollar_endonly, dotall, ungreedy, s) { i.contents = i.contents + 1 | 0; return r; }; - let greedy_mod = (r) => { + let greedy_mod = r => { let gr = accept(/* '?' */63); let gr$1 = ungreedy ? !gr : gr; if (gr$1) { @@ -3401,7 +3401,7 @@ function parse(multiline, dollar_endonly, dotall, ungreedy, s) { }; } }; - let regexp$p = (_left) => { + let regexp$p = _left => { while (true) { let left = _left; if (!accept(/* '|' */124)) { @@ -3417,7 +3417,7 @@ function parse(multiline, dollar_endonly, dotall, ungreedy, s) { continue; }; }; - let branch$p = (_left) => { + let branch$p = _left => { while (true) { let left = _left; if (i.contents === l || test(/* '|' */124) || test(/* ')' */41)) { @@ -4066,7 +4066,7 @@ function parse(multiline, dollar_endonly, dotall, ungreedy, s) { }; } }; - let bracket = (_s) => { + let bracket = _s => { while (true) { let s = _s; if (s !== /* [] */0 && accept(/* ']' */93)) { @@ -4172,7 +4172,7 @@ function parse(multiline, dollar_endonly, dotall, ungreedy, s) { function re(flagsOpt, pat) { let flags = flagsOpt !== undefined ? flagsOpt : /* [] */0; - let opts = List.map(((x) => { + let opts = List.map((x => { if (x === "CASELESS") { return "Caseless"; } else if (x === "ANCHORED") { diff --git a/jscomp/test/of_string_test.js b/jscomp/test/of_string_test.js index 12147c44c6a..e01b8357462 100644 --- a/jscomp/test/of_string_test.js +++ b/jscomp/test/of_string_test.js @@ -6,7 +6,7 @@ let Pervasives = require("../../lib/js/pervasives.js"); let suites_0 = [ "string_of_float_1", - ((param) => { + (param => { return { TAG: "Eq", _0: "10.", @@ -18,7 +18,7 @@ let suites_0 = [ let suites_1 = { hd: [ "string_of_int", - ((param) => { + (param => { return { TAG: "Eq", _0: "10", @@ -29,7 +29,7 @@ let suites_1 = { tl: { hd: [ "valid_float_lexem", - ((param) => { + (param => { return { TAG: "Eq", _0: "10.", diff --git a/jscomp/test/option_repr_test.js b/jscomp/test/option_repr_test.js index a35d25a0633..90594a5f8c6 100644 --- a/jscomp/test/option_repr_test.js +++ b/jscomp/test/option_repr_test.js @@ -104,11 +104,11 @@ function f12(x) { return x; } -let length_8_id = Belt_List.makeBy(8, ((x) => { +let length_8_id = Belt_List.makeBy(8, (x => { return x; })); -let length_10_id = Belt_List.makeBy(10, ((x) => { +let length_10_id = Belt_List.makeBy(10, (x => { return x; })); @@ -170,7 +170,7 @@ function neqx(a, b) { } function all_true(xs) { - return Belt_List.every(xs, ((x) => { + return Belt_List.every(xs, (x => { return x; })); } @@ -182,7 +182,7 @@ let xs = { tl: /* [] */0 }; -b("File \"option_repr_test.res\", line 125, characters 8-15", Belt_List.every(xs, ((x) => { +b("File \"option_repr_test.res\", line 125, characters 8-15", Belt_List.every(xs, (x => { return x; }))); @@ -205,7 +205,7 @@ let xs_1 = { tl: { hd: ltx(undefined, null), tl: { - hd: ltx(undefined, ((x) => { + hd: ltx(undefined, (x => { return x; })), tl: { @@ -227,7 +227,7 @@ let xs$1 = { tl: xs_1 }; -b("File \"option_repr_test.res\", line 128, characters 4-11", Belt_List.every(xs$1, ((x) => { +b("File \"option_repr_test.res\", line 128, characters 4-11", Belt_List.every(xs$1, (x => { return x; }))); @@ -252,7 +252,7 @@ let xs$2 = { tl: xs_1$1 }; -b("File \"option_repr_test.res\", line 145, characters 4-11", Belt_List.every(xs$2, ((x) => { +b("File \"option_repr_test.res\", line 145, characters 4-11", Belt_List.every(xs$2, (x => { return x; }))); diff --git a/jscomp/test/pipe_send_readline.js b/jscomp/test/pipe_send_readline.js index 68be9839113..60f57ace99a 100644 --- a/jscomp/test/pipe_send_readline.js +++ b/jscomp/test/pipe_send_readline.js @@ -3,7 +3,7 @@ function u(rl) { - return rl.on("line", ((x) => { + return rl.on("line", (x => { console.log(x); })).on("close", (() => { console.log("finished"); diff --git a/jscomp/test/prepend_data_ffi.js b/jscomp/test/prepend_data_ffi.js index 0f1fcac8fe2..9fbe6e602db 100644 --- a/jscomp/test/prepend_data_ffi.js +++ b/jscomp/test/prepend_data_ffi.js @@ -12,19 +12,19 @@ let v2 = { v: 2 }; -process.on("exit", ((exit_code) => { +process.on("exit", (exit_code => { return String(exit_code); })); -process.on(1, ((param) => { +process.on(1, (param => { })); -process.on(((i) => { +process.on((i => { return String(i); }), "exit"); -process.on(((i) => { +process.on((i => { return String(i); }), 1); @@ -46,12 +46,12 @@ function f(x) { x.xx(76, 3, true, false, "你好", ["你好",1,2,3] , [{ "arr" : ["你好",1,2,3], "encoding" : "utf8"}] , [{ "arr" : ["你好",1,2,3], "encoding" : "utf8"}] , "xxx", 0, "yyy", "b", 1, 2, 3, 4, 5); } -process.on("exit", ((exit_code) => { +process.on("exit", (exit_code => { console.log("error code: " + String(exit_code)); })); function register(p) { - p.on("exit", ((i) => { + p.on("exit", (i => { console.log(i); })); } diff --git a/jscomp/test/queue_test.js b/jscomp/test/queue_test.js index 2578c1f8821..9d6e62b33b0 100644 --- a/jscomp/test/queue_test.js +++ b/jscomp/test/queue_test.js @@ -8,7 +8,7 @@ let Queue_402 = require("./queue_402.js"); let Caml_array = require("../../lib/js/caml_array.js"); function Test(Queue) { - let to_array = (q) => { + let to_array = q => { let v = Caml_array.make(Queue.length(q), 0); Queue.fold(((i, e) => { Caml_array.set(v, i, e); @@ -16,9 +16,9 @@ function Test(Queue) { }), 0, q); return v; }; - let queue_1 = (x) => { + let queue_1 = x => { let q = Queue.create(); - $$Array.iter(((x) => { + $$Array.iter((x => { Queue.add(x, q); }), x); return to_array(q); @@ -44,7 +44,7 @@ function queue_1(x) { first: "Nil", last: "Nil" }; - $$Array.iter(((x) => { + $$Array.iter((x => { Queue.add(x, q); }), x); return to_array(q); @@ -69,7 +69,7 @@ function queue_1$1(x) { length: 0, tail: undefined }; - $$Array.iter(((x) => { + $$Array.iter((x => { Queue_402.add(x, q); }), x); return to_array$1(q); @@ -82,7 +82,7 @@ let T2 = { let suites_0 = [ "File \"queue_test.res\", line 34, characters 6-13", - ((param) => { + (param => { let x = [ 3, 4, @@ -100,7 +100,7 @@ let suites_0 = [ let suites_1 = { hd: [ "File \"queue_test.res\", line 41, characters 6-13", - ((param) => { + (param => { let x = [ 3, 4, diff --git a/jscomp/test/reactTestUtils.js b/jscomp/test/reactTestUtils.js index dc7cacf0ce7..e329678e5a3 100644 --- a/jscomp/test/reactTestUtils.js +++ b/jscomp/test/reactTestUtils.js @@ -51,13 +51,13 @@ function findByAllSelector(element, selector) { } function findBySelectorAndTextContent(element, selector, content) { - return Belt_Array.getBy(Array.from(element.querySelectorAll(selector)), ((node) => { + return Belt_Array.getBy(Array.from(element.querySelectorAll(selector)), (node => { return node.textContent === content; })); } function findBySelectorAndPartialTextContent(element, selector, content) { - return Belt_Array.getBy(Array.from(element.querySelectorAll(selector)), ((node) => { + return Belt_Array.getBy(Array.from(element.querySelectorAll(selector)), (node => { return node.textContent.includes(content); })); } @@ -71,14 +71,14 @@ let DOM = { function prepareContainer(container, param) { let containerElement = document.createElement("div"); - Belt_Option.map(document.body, ((body) => { + Belt_Option.map(document.body, (body => { return body.appendChild(containerElement); })); container.contents = Caml_option.some(containerElement); } function cleanupContainer(container, param) { - Belt_Option.map(container.contents, ((prim) => { + Belt_Option.map(container.contents, (prim => { prim.remove(); })); container.contents = undefined; diff --git a/jscomp/test/reasonReact.js b/jscomp/test/reasonReact.js index b9463618919..00daab31f91 100644 --- a/jscomp/test/reasonReact.js +++ b/jscomp/test/reasonReact.js @@ -84,7 +84,7 @@ function element(keyOpt, refOpt, component) { } function wrapReasonForJs(component, jsPropsToReason) { - let uncurriedJsPropsToReason = (jsProps) => { + let uncurriedJsPropsToReason = jsProps => { return jsPropsToReason(jsProps); }; component.reactClassInternal.prototype.jsPropsToReason = uncurriedJsPropsToReason; diff --git a/jscomp/test/reasonReactRouter.js b/jscomp/test/reasonReactRouter.js index ca888ae6011..2ce9ba6669d 100644 --- a/jscomp/test/reasonReactRouter.js +++ b/jscomp/test/reasonReactRouter.js @@ -169,14 +169,14 @@ function useUrl(serverUrl, param) { let setUrl = match[1]; let url$1 = match[0]; React.useEffect((() => { - let watcherId = watchUrl((url) => { - setUrl((param) => { + let watcherId = watchUrl(url => { + setUrl(param => { return url; }); }); let newUrl = url(); if (urlNotEqual(newUrl, url$1)) { - setUrl((param) => { + setUrl(param => { return newUrl; }); } diff --git a/jscomp/test/rec_module_test.js b/jscomp/test/rec_module_test.js index bc72dc0fdf8..a81a93b48e3 100644 --- a/jscomp/test/rec_module_test.js +++ b/jscomp/test/rec_module_test.js @@ -1218,7 +1218,7 @@ Caml_module.update_mod({ let suites_0 = [ "test1", - ((param) => { + (param => { return { TAG: "Eq", _0: [ @@ -1240,7 +1240,7 @@ let suites_0 = [ let suites_1 = { hd: [ "test2", - ((param) => { + (param => { return { TAG: "Eq", _0: BB.y(), @@ -1251,7 +1251,7 @@ let suites_1 = { tl: { hd: [ "test3", - ((param) => { + (param => { return { TAG: "Eq", _0: AA.x(), @@ -1262,7 +1262,7 @@ let suites_1 = { tl: { hd: [ "test4", - ((param) => { + (param => { return { TAG: "Eq", _0: true, @@ -1273,7 +1273,7 @@ let suites_1 = { tl: { hd: [ "test4", - ((param) => { + (param => { return { TAG: "Eq", _0: true, @@ -1284,7 +1284,7 @@ let suites_1 = { tl: { hd: [ "test5", - ((param) => { + (param => { return { TAG: "Eq", _0: false, @@ -1295,7 +1295,7 @@ let suites_1 = { tl: { hd: [ "test6", - ((param) => { + (param => { return { TAG: "Eq", _0: 2, diff --git a/jscomp/test/recmodule.js b/jscomp/test/recmodule.js index 9c40e35c1eb..41c02166035 100644 --- a/jscomp/test/recmodule.js +++ b/jscomp/test/recmodule.js @@ -6,7 +6,7 @@ let Caml_module = require("../../lib/js/caml_module.js"); let Entity = {}; function MakeLayer(Deps) { - let getLight = (id) => { + let getLight = id => { return Deps.presentLight({ id: id, name: "Light 1" @@ -22,10 +22,10 @@ let UseCase = { }; function MakeLayer$1(Deps, UC) { - let presentLight = (light) => { + let presentLight = light => { return Deps.presentJson(light, 200); }; - let handleGetLight = (req) => { + let handleGetLight = req => { return UC.getLight(req.params.id); }; return { diff --git a/jscomp/test/record_with_test.js b/jscomp/test/record_with_test.js index 0fc3fd6c903..f64ab7d5a5a 100644 --- a/jscomp/test/record_with_test.js +++ b/jscomp/test/record_with_test.js @@ -38,7 +38,7 @@ function f(g, h) { let suites_0 = [ "eq_with", - ((param) => { + (param => { return { TAG: "Eq", _0: v, diff --git a/jscomp/test/res_debug.js b/jscomp/test/res_debug.js index e95f982bb5d..298be402863 100644 --- a/jscomp/test/res_debug.js +++ b/jscomp/test/res_debug.js @@ -33,7 +33,7 @@ function optionMap(x, f) { } -let ok_name = optionMap(undefined, ((x) => { +let ok_name = optionMap(undefined, (x => { return x; })); @@ -41,7 +41,7 @@ let ok = { name: ok_name }; -let bad_name = optionMap(undefined, ((x) => { +let bad_name = optionMap(undefined, (x => { return x; })); diff --git a/jscomp/test/set_gen.js b/jscomp/test/set_gen.js index 856955f92bf..d5e26c887a7 100644 --- a/jscomp/test/set_gen.js +++ b/jscomp/test/set_gen.js @@ -619,7 +619,7 @@ function of_sorted_array(l) { } function is_ordered(cmp, tree) { - let is_ordered_min_max = (tree) => { + let is_ordered_min_max = tree => { if (typeof tree !== "object") { return "Empty"; } diff --git a/jscomp/test/sexp.js b/jscomp/test/sexp.js index 23d7a61a9e4..12aa33fea60 100644 --- a/jscomp/test/sexp.js +++ b/jscomp/test/sexp.js @@ -136,7 +136,7 @@ function of_field(name, t) { function of_record(l) { return { NAME: "List", - VAL: List.map(((param) => { + VAL: List.map((param => { return of_field(param[0], param[1]); }), l) }; @@ -253,7 +253,7 @@ function to_float(e) { } function to_string(e) { - return _try_atom(e, ((x) => { + return _try_atom(e, (x => { return x; })); } @@ -280,11 +280,11 @@ function to_pair(e) { } function to_pair_with(f1, f2) { - return (e) => { - return $great$great$eq(to_pair(e), ((param) => { + return e => { + return $great$great$eq(to_pair(e), (param => { let y = param[1]; - return $great$great$eq(f1(param[0]), ((x) => { - return $great$great$eq(f2(y), ((y) => { + return $great$great$eq(f1(param[0]), (x => { + return $great$great$eq(f2(y), (y => { return [ x, y @@ -322,13 +322,13 @@ function to_triple(e) { } function to_triple_with(f1, f2, f3) { - return (e) => { - return $great$great$eq(to_triple(e), ((param) => { + return e => { + return $great$great$eq(to_triple(e), (param => { let z = param[2]; let y = param[1]; - return $great$great$eq(f1(param[0]), ((x) => { - return $great$great$eq(f2(y), ((y) => { - return $great$great$eq(f3(z), ((z) => { + return $great$great$eq(f1(param[0]), (x => { + return $great$great$eq(f2(y), (y => { + return $great$great$eq(f3(z), (z => { return [ x, y, @@ -349,7 +349,7 @@ function to_list(e) { } function to_list_with(f) { - return (e) => { + return e => { if (e.NAME === "List") { return map_opt(f, e.VAL); } @@ -358,7 +358,7 @@ function to_list_with(f) { } function get_field(name) { - return (e) => { + return e => { if (e.NAME === "List") { let _l = e.VAL; while (true) { @@ -410,7 +410,7 @@ function get_field(name) { } function field(name, f) { - return (e) => { + return e => { return $great$great$eq(get_field(name)(e), f); }; } @@ -453,7 +453,7 @@ function _get_field_list(name, _l) { } function field_list(name, f) { - return (e) => { + return e => { if (e.NAME === "List") { return $great$great$eq(_get_field_list(name, e.VAL), f); } @@ -477,7 +477,7 @@ function _get_variant(s, args, _l) { } function get_variant(l) { - return (e) => { + return e => { if (e.NAME !== "List") { return _get_variant(e.VAL, /* [] */0, l); } diff --git a/jscomp/test/sexpm.js b/jscomp/test/sexpm.js index 1c38161cd0e..88d082e7b03 100644 --- a/jscomp/test/sexpm.js +++ b/jscomp/test/sexpm.js @@ -203,7 +203,7 @@ function _error_eof(t) { function expr(k, t) { while (true) { if (t.i === t.len) { - return _refill(t, ((extra) => { + return _refill(t, (extra => { return expr(k, extra); }), _error_eof); } @@ -281,7 +281,7 @@ function expr_starting_with(c, k, t) { function expr_list(acc, k, t) { while (true) { if (t.i === t.len) { - return _refill(t, ((extra) => { + return _refill(t, (extra => { return expr_list(acc, k, extra); }), _error_eof); } @@ -344,9 +344,9 @@ function _return_atom(last, k, t) { function atom(k, t) { while (true) { if (t.i === t.len) { - return _refill(t, ((extra) => { + return _refill(t, (extra => { return atom(k, extra); - }), ((extra) => { + }), (extra => { return _return_atom(undefined, k, extra); })); } @@ -392,7 +392,7 @@ function atom(k, t) { function quoted(k, t) { while (true) { if (t.i === t.len) { - return _refill(t, ((extra) => { + return _refill(t, (extra => { return quoted(k, extra); }), _error_eof); } @@ -401,7 +401,7 @@ function quoted(k, t) { return _return_atom(undefined, k, t); } if (c === 92) { - return escaped(((c) => { + return escaped((c => { Buffer.add_char(t.atom, c); return quoted(k, t); }), t); @@ -413,7 +413,7 @@ function quoted(k, t) { function escaped(k, t) { if (t.i === t.len) { - return _refill(t, ((extra) => { + return _refill(t, (extra => { return escaped(k, extra); }), _error_eof); } @@ -459,7 +459,7 @@ function escaped(k, t) { return k(/* '"' */34); } if (_is_digit(c)) { - return read2int(c - /* '0' */48 | 0, ((n) => { + return read2int(c - /* '0' */48 | 0, (n => { return k(Char.chr(n)); }), t); } else { @@ -469,7 +469,7 @@ function escaped(k, t) { function read2int(i, k, t) { if (t.i === t.len) { - return _refill(t, ((extra) => { + return _refill(t, (extra => { return read2int(i, k, extra); }), _error_eof); } @@ -483,7 +483,7 @@ function read2int(i, k, t) { function read1int(i, k, t) { if (t.i === t.len) { - return _refill(t, ((extra) => { + return _refill(t, (extra => { return read1int(i, k, extra); }), _error_eof); } @@ -498,7 +498,7 @@ function read1int(i, k, t) { function skip_comment(k, t) { while (true) { if (t.i === t.len) { - return _refill(t, ((extra) => { + return _refill(t, (extra => { return skip_comment(k, extra); }), _error_eof); } @@ -513,9 +513,9 @@ function skip_comment(k, t) { function expr_or_end(k, t) { while (true) { if (t.i === t.len) { - return _refill(t, ((extra) => { + return _refill(t, (extra => { return expr_or_end(k, extra); - }), ((param) => { + }), (param => { return "End"; })); } diff --git a/jscomp/test/side_effect2.js b/jscomp/test/side_effect2.js index 45b7ead1443..c75b270f041 100644 --- a/jscomp/test/side_effect2.js +++ b/jscomp/test/side_effect2.js @@ -3,7 +3,7 @@ let Belt_Array = require("../../lib/js/belt_Array.js"); -let a = Belt_Array.map([1], ((x) => { +let a = Belt_Array.map([1], (x => { return x; })); diff --git a/jscomp/test/stack_comp_test.js b/jscomp/test/stack_comp_test.js index e00017aac12..9d05ffd7a43 100644 --- a/jscomp/test/stack_comp_test.js +++ b/jscomp/test/stack_comp_test.js @@ -31,7 +31,7 @@ function to_list(s) { let l = { contents: /* [] */0 }; - List.iter(((x) => { + List.iter((x => { l.contents = { hd: x, tl: l.contents @@ -358,7 +358,7 @@ let i$7 = { contents: 1 }; -List.iter(((j) => { +List.iter((j => { assert_("File \"stack_comp_test.res\", line 143, characters 12-19", i$7.contents === j); i$7.contents = i$7.contents + 1 | 0; }), s$5.c); diff --git a/jscomp/test/stack_test.js b/jscomp/test/stack_test.js index 1943d1f2cb6..4b750909c0c 100644 --- a/jscomp/test/stack_test.js +++ b/jscomp/test/stack_test.js @@ -29,7 +29,7 @@ function v() { let suites_0 = [ "push_test", - ((param) => { + (param => { return { TAG: "Eq", _0: { diff --git a/jscomp/test/stream_parser_test.js b/jscomp/test/stream_parser_test.js index 5999af969ed..82937db7e45 100644 --- a/jscomp/test/stream_parser_test.js +++ b/jscomp/test/stream_parser_test.js @@ -76,7 +76,7 @@ function parse(token) { let parse_term = () => { return parse_term_aux(parse_atom()); }; - let parse_expr_aux = (e1) => { + let parse_expr_aux = e1 => { let e = token$1(); if (e.TAG === "Kwd") { switch (e._0) { @@ -93,7 +93,7 @@ function parse(token) { return e1; } }; - let parse_term_aux = (e1) => { + let parse_term_aux = e1 => { let e = token$1(); if (e.TAG === "Kwd") { switch (e._0) { @@ -210,7 +210,7 @@ function l_parse(token) { }); } }; - let parse_f_aux = (_a) => { + let parse_f_aux = _a => { while (true) { let a = _a; let t = token$1(); @@ -232,7 +232,7 @@ function l_parse(token) { } }; }; - let parse_t_aux = (_a) => { + let parse_t_aux = _a => { while (true) { let a = _a; let t = token$1(); diff --git a/jscomp/test/string_runtime_test.js b/jscomp/test/string_runtime_test.js index d9dc85471c1..d2dde8a9b70 100644 --- a/jscomp/test/string_runtime_test.js +++ b/jscomp/test/string_runtime_test.js @@ -9,7 +9,7 @@ let Caml_bytes = require("../../lib/js/caml_bytes.js"); let suites_0 = [ "?is_printable", - ((param) => { + (param => { return { TAG: "Eq", _0: Test_char.caml_is_printable(/* 'a' */97), @@ -21,13 +21,13 @@ let suites_0 = [ let suites_1 = { hd: [ "?string_of_bytes", - ((param) => { - let match = List.split(List.map(((x) => { + (param => { + let match = List.split(List.map((x => { let b = Caml_bytes.create(x); Bytes.fill(b, 0, x, /* 'c' */99); return [ Bytes.to_string(b), - Bytes.unsafe_to_string(Bytes.init(x, ((param) => { + Bytes.unsafe_to_string(Bytes.init(x, (param => { return /* 'c' */99; }))) ]; diff --git a/jscomp/test/string_test.js b/jscomp/test/string_test.js index 52d5c0116e0..ce4db3e398b 100644 --- a/jscomp/test/string_test.js +++ b/jscomp/test/string_test.js @@ -125,7 +125,7 @@ function xsplit(delim, s) { } function string_of_chars(x) { - let xs = List.map(((prim) => { + let xs = List.map((prim => { return String.fromCharCode(prim); }), x); return $$Array.of_list(xs).join(""); diff --git a/jscomp/test/tailcall_inline_test.js b/jscomp/test/tailcall_inline_test.js index 54f68ecde8f..470787b1165 100644 --- a/jscomp/test/tailcall_inline_test.js +++ b/jscomp/test/tailcall_inline_test.js @@ -27,7 +27,7 @@ function f() { let suites_0 = [ "acc", - ((param) => { + (param => { return { TAG: "Eq", _0: f(), @@ -50,7 +50,7 @@ let suites_0 = [ let suites_1 = { hd: [ "array_to_list", - ((param) => { + (param => { return { TAG: "Eq", _0: { diff --git a/jscomp/test/test_closure.js b/jscomp/test/test_closure.js index b7edefb7414..c2f5f8fe07e 100644 --- a/jscomp/test/test_closure.js +++ b/jscomp/test/test_closure.js @@ -9,11 +9,11 @@ let v = { }; function f() { - let arr = Caml_array.make(10, ((param) => { + let arr = Caml_array.make(10, (param => { })); for (let i = 0; i <= 9; ++i) { - Caml_array.set(arr, i, ((param) => { + Caml_array.set(arr, i, (param => { v.contents = v.contents + i | 0; })); } @@ -22,7 +22,7 @@ function f() { let u = f(); -$$Array.iter(((x) => { +$$Array.iter((x => { x(); }), u); diff --git a/jscomp/test/test_cps.js b/jscomp/test/test_cps.js index f2642f8db3d..704aae39b74 100644 --- a/jscomp/test/test_cps.js +++ b/jscomp/test/test_cps.js @@ -20,11 +20,11 @@ function f(_n, _acc) { } function test_closure() { - let arr = Caml_array.make(6, ((x) => { + let arr = Caml_array.make(6, (x => { return x; })); for (let i = 0; i <= 6; ++i) { - Caml_array.set(arr, i, ((param) => { + Caml_array.set(arr, i, (param => { return i; })); } diff --git a/jscomp/test/test_demo.js b/jscomp/test/test_demo.js index 56b15dc7fd9..cf2aa94e1ed 100644 --- a/jscomp/test/test_demo.js +++ b/jscomp/test/test_demo.js @@ -45,7 +45,7 @@ function f(x, y, z) { function g(x, y) { let u = x + y | 0; - return (z) => { + return z => { return u + z | 0; }; } diff --git a/jscomp/test/test_for_loop.js b/jscomp/test/test_for_loop.js index ad4e670917f..18e017d4fe2 100644 --- a/jscomp/test/test_for_loop.js +++ b/jscomp/test/test_for_loop.js @@ -20,7 +20,7 @@ function for_3(x) { let v = { contents: 0 }; - let arr = $$Array.map(((param) => { + let arr = $$Array.map((param => { return () => { }; @@ -31,7 +31,7 @@ function for_3(x) { v.contents = v.contents + j | 0; })); } - $$Array.iter(((x) => { + $$Array.iter((x => { x(); }), arr); return v.contents; @@ -41,7 +41,7 @@ function for_4(x) { let v = { contents: 0 }; - let arr = $$Array.map(((param) => { + let arr = $$Array.map((param => { return () => { }; @@ -53,7 +53,7 @@ function for_4(x) { v.contents = v.contents + k | 0; })); } - $$Array.iter(((x) => { + $$Array.iter((x => { x(); }), arr); return v.contents; @@ -63,7 +63,7 @@ function for_5(x, u) { let v = { contents: 0 }; - let arr = $$Array.map(((param) => { + let arr = $$Array.map((param => { return () => { }; @@ -74,7 +74,7 @@ function for_5(x, u) { v.contents = v.contents + k | 0; })); } - $$Array.iter(((x) => { + $$Array.iter((x => { x(); }), arr); return v.contents; @@ -84,7 +84,7 @@ function for_6(x, u) { let v = { contents: 0 }; - let arr = $$Array.map(((param) => { + let arr = $$Array.map((param => { return () => { }; @@ -110,7 +110,7 @@ function for_6(x, u) { })); } } - $$Array.iter(((x) => { + $$Array.iter((x => { x(); }), arr); return v.contents; diff --git a/jscomp/test/test_google_closure.js b/jscomp/test/test_google_closure.js index 8078ee555d1..6e7c8049ffb 100644 --- a/jscomp/test/test_google_closure.js +++ b/jscomp/test/test_google_closure.js @@ -9,7 +9,7 @@ function f(a, b, param) { } function f2(a) { - return (extra) => { + return extra => { return a + 1 | 0; }; } @@ -22,12 +22,12 @@ function f3(extra) { let b = f3(2); -let arr = $$Array.init(2, ((param) => { +let arr = $$Array.init(2, (param => { return 0; })); for (let i = 0; i <= 1; ++i) { - let f3$1 = (extra) => { + let f3$1 = extra => { return i + 1 | 0; }; Caml_array.set(arr, i, f3$1(2)); diff --git a/jscomp/test/test_list.js b/jscomp/test/test_list.js index af80e575588..c40fc0b5570 100644 --- a/jscomp/test/test_list.js +++ b/jscomp/test/test_list.js @@ -584,7 +584,7 @@ function find(p, _x) { } function find_all(p) { - return (__x) => { + return __x => { let _accu = /* [] */0; let _x = __x; while (true) { diff --git a/jscomp/test/test_set.js b/jscomp/test/test_set.js index 81761c08b2a..96cb62d115d 100644 --- a/jscomp/test/test_set.js +++ b/jscomp/test/test_set.js @@ -4,7 +4,7 @@ let List = require("../../lib/js/list.js"); function Make(Ord) { - let height = (x) => { + let height = x => { if (typeof x !== "object") { return 0; } else { @@ -109,7 +109,7 @@ function Make(Ord) { return bal(l, v, add(x, r)); } }; - let singleton = (x) => { + let singleton = x => { return { TAG: "Node", _0: "Empty", @@ -149,7 +149,7 @@ function Make(Ord) { return create(l, v, r); } }; - let min_elt = (_x) => { + let min_elt = _x => { while (true) { let x = _x; if (typeof x !== "object") { @@ -167,7 +167,7 @@ function Make(Ord) { continue; }; }; - let max_elt = (_x) => { + let max_elt = _x => { while (true) { let x = _x; if (typeof x !== "object") { @@ -185,7 +185,7 @@ function Make(Ord) { continue; }; }; - let remove_min_elt = (x) => { + let remove_min_elt = x => { if (typeof x !== "object") { throw new Error("Invalid_argument", { cause: { @@ -253,7 +253,7 @@ function Make(Ord) { match$1[2] ]; }; - let is_empty = (x) => { + let is_empty = x => { if (typeof x !== "object") { return true; } else { @@ -543,7 +543,7 @@ function Make(Ord) { ]; } }; - let cardinal = (x) => { + let cardinal = x => { if (typeof x !== "object") { return 0; } else { @@ -565,7 +565,7 @@ function Make(Ord) { continue; }; }; - let elements = (s) => { + let elements = s => { return elements_aux(/* [] */0, s); }; let find = (x, _x_) => { @@ -587,7 +587,7 @@ function Make(Ord) { continue; }; }; - let of_sorted_list = (l) => { + let of_sorted_list = l => { let sub = (n, l) => { switch (n) { case 0 : @@ -691,7 +691,7 @@ function Make(Ord) { }; return sub(List.length(l), l)[0]; }; - let of_list = (l) => { + let of_list = l => { if (!l) { return "Empty"; } diff --git a/jscomp/test/test_while_closure.js b/jscomp/test/test_while_closure.js index 6b66ae1202e..82be816ae37 100644 --- a/jscomp/test/test_while_closure.js +++ b/jscomp/test/test_while_closure.js @@ -25,7 +25,7 @@ function f() { f(); -$$Array.iter(((x) => { +$$Array.iter((x => { x(); }), arr); diff --git a/jscomp/test/ticker.js b/jscomp/test/ticker.js index d3043e34f50..74ba62dbc01 100644 --- a/jscomp/test/ticker.js +++ b/jscomp/test/ticker.js @@ -80,13 +80,13 @@ function string_of_rank(x) { } function find_ticker_by_name(all_tickers, ticker) { - return List.find(((param) => { + return List.find((param => { return param.ticker_name === ticker; }), all_tickers); } function print_all_composite(all_tickers) { - List.iter(((x) => { + List.iter((x => { let tmp = x.type_; if (typeof tmp !== "object") { return; @@ -1201,7 +1201,7 @@ function compute_update_sequences(all_tickers) { function process_quote(ticker_map, new_ticker, new_value) { let update_sequence = find(new_ticker, ticker_map); - List.iter(((ticker) => { + List.iter((ticker => { let match = ticker.type_; if (typeof match !== "object") { if (ticker.ticker_name === new_ticker) { diff --git a/jscomp/test/topsort_test.js b/jscomp/test/topsort_test.js index 859890a559d..d947170a4eb 100644 --- a/jscomp/test/topsort_test.js +++ b/jscomp/test/topsort_test.js @@ -281,13 +281,13 @@ function dfs3(nodes, graph) { hd: node, tl: visited.contents }; - return List.iter(((x) => { + return List.iter((x => { aux(x, graph); }), nexts(node, graph)); } }; - List.iter(((node) => { + List.iter((node => { aux(node, graph); }), nodes); return List.rev(visited.contents); @@ -409,7 +409,7 @@ function unsafe_topsort(graph) { let visited = { contents: /* [] */0 }; - let sort_node = (node) => { + let sort_node = node => { if (List.mem(node, visited.contents)) { return; } @@ -420,7 +420,7 @@ function unsafe_topsort(graph) { tl: visited.contents }; }; - List.iter(((param) => { + List.iter((param => { sort_node(param[0]); }), graph); return visited.contents; @@ -1497,7 +1497,7 @@ function pathsort(graph) { ]; }; let sort_nodes = (path, nodes) => { - List.iter(((node) => { + List.iter((node => { sort_node(path, node); }), nodes); }; @@ -1512,7 +1512,7 @@ function pathsort(graph) { } }; - List.iter(((param) => { + List.iter((param => { sort_node(empty_path, param[0]); }), graph); return visited.contents; diff --git a/jscomp/test/tramp_fib.js b/jscomp/test/tramp_fib.js index fdba4313c1d..727a4ad150e 100644 --- a/jscomp/test/tramp_fib.js +++ b/jscomp/test/tramp_fib.js @@ -22,8 +22,8 @@ function fib(n, k) { return { TAG: "Suspend", _0: (() => { - return fib(n - 1 | 0, ((v0) => { - return fib(n - 2 | 0, ((v1) => { + return fib(n - 1 | 0, (v0 => { + return fib(n - 2 | 0, (v1 => { return k(v0 + v1 | 0); })); })); @@ -32,7 +32,7 @@ function fib(n, k) { } } -let u = fib(10, ((x) => { +let u = fib(10, (x => { return { TAG: "Continue", _0: x diff --git a/jscomp/test/tuple_alloc.js b/jscomp/test/tuple_alloc.js index 6acb1c2e706..7d7ca08a96b 100644 --- a/jscomp/test/tuple_alloc.js +++ b/jscomp/test/tuple_alloc.js @@ -39,7 +39,7 @@ function kf(cb, v) { } function ikf(v) { - return kf(((prim) => { + return kf((prim => { }), v); } diff --git a/jscomp/test/typeof_test.js b/jscomp/test/typeof_test.js index 3d0add055c3..4491674f251 100644 --- a/jscomp/test/typeof_test.js +++ b/jscomp/test/typeof_test.js @@ -33,7 +33,7 @@ function string_or_number(x) { let suites_0 = [ "int_type", - ((param) => { + (param => { return { TAG: "Eq", _0: "number", @@ -45,7 +45,7 @@ let suites_0 = [ let suites_1 = { hd: [ "string_type", - ((param) => { + (param => { return { TAG: "Eq", _0: "string", @@ -56,7 +56,7 @@ let suites_1 = { tl: { hd: [ "number_gadt_test", - ((param) => { + (param => { return { TAG: "Eq", _0: Js_types.test(3, "Number"), @@ -67,7 +67,7 @@ let suites_1 = { tl: { hd: [ "boolean_gadt_test", - ((param) => { + (param => { return { TAG: "Eq", _0: Js_types.test(true, "Boolean"), @@ -78,7 +78,7 @@ let suites_1 = { tl: { hd: [ "undefined_gadt_test", - ((param) => { + (param => { return { TAG: "Eq", _0: Js_types.test(undefined, "Undefined"), @@ -89,7 +89,7 @@ let suites_1 = { tl: { hd: [ "string_on_number1", - ((param) => { + (param => { return { TAG: "Eq", _0: string_or_number("xx"), @@ -100,7 +100,7 @@ let suites_1 = { tl: { hd: [ "string_on_number2", - ((param) => { + (param => { return { TAG: "Eq", _0: string_or_number(3.02), @@ -111,10 +111,10 @@ let suites_1 = { tl: { hd: [ "string_on_number3", - ((param) => { + (param => { return { TAG: "Eq", - _0: string_or_number((x) => { + _0: string_or_number(x => { return x; }), _1: false @@ -124,7 +124,7 @@ let suites_1 = { tl: { hd: [ "string_gadt_test", - ((param) => { + (param => { return { TAG: "Eq", _0: Js_types.test("3", "String"), @@ -135,7 +135,7 @@ let suites_1 = { tl: { hd: [ "string_gadt_test_neg", - ((param) => { + (param => { return { TAG: "Eq", _0: Js_types.test(3, "String"), @@ -146,10 +146,10 @@ let suites_1 = { tl: { hd: [ "function_gadt_test", - ((param) => { + (param => { return { TAG: "Eq", - _0: Js_types.test(((x) => { + _0: Js_types.test((x => { return x; }), "Function"), _1: true @@ -159,7 +159,7 @@ let suites_1 = { tl: { hd: [ "object_gadt_test", - ((param) => { + (param => { return { TAG: "Eq", _0: Js_types.test({ diff --git a/jscomp/test/uncurried_cast.js b/jscomp/test/uncurried_cast.js index 2698aec3807..0125360513d 100644 --- a/jscomp/test/uncurried_cast.js +++ b/jscomp/test/uncurried_cast.js @@ -37,7 +37,7 @@ let l = Belt_List.map({ hd: 2, tl: /* [] */0 } -}, ((x) => { +}, (x => { return x + 1 | 0; })); @@ -51,7 +51,7 @@ function partial(x) { }, x); } -let ll = partial((x) => { +let ll = partial(x => { return x + 1 | 0; }); @@ -83,7 +83,7 @@ let l$1 = Belt_List.map({ hd: 2, tl: /* [] */0 } -}, ((x) => { +}, (x => { return x + 1 | 0; })); @@ -97,7 +97,7 @@ function partial$1(extra) { }, extra); } -let ll$1 = partial$1((x) => { +let ll$1 = partial$1(x => { return x + 1 | 0; }); diff --git a/jscomp/test/unit_undefined_test.js b/jscomp/test/unit_undefined_test.js index f2148eb310e..6c5ea46ed63 100644 --- a/jscomp/test/unit_undefined_test.js +++ b/jscomp/test/unit_undefined_test.js @@ -17,7 +17,7 @@ function eq(loc, x, y) { } function f_01() { - return hi((x) => { + return hi(x => { if (x === undefined) { console.log("x"); return; diff --git a/jscomp/test/unsafe_ppx_test.js b/jscomp/test/unsafe_ppx_test.js index 0efa0739fdc..0a68dbcf670 100644 --- a/jscomp/test/unsafe_ppx_test.js +++ b/jscomp/test/unsafe_ppx_test.js @@ -26,7 +26,7 @@ function g(a) { regression(a, Pervasives.failwith); regression2(3, 2); regression3(3, 2); - regression4(3, ((x) => { + regression4(3, (x => { return x; })); } diff --git a/jscomp/test/variant.js b/jscomp/test/variant.js index a1e9ce0be3c..78b47ebe827 100644 --- a/jscomp/test/variant.js +++ b/jscomp/test/variant.js @@ -63,7 +63,7 @@ let Path = { }; function Make(M) { - let find = (x) => { + let find = x => { }; return { diff --git a/jscomp/test/webpack_config.js b/jscomp/test/webpack_config.js index ca165da21ae..96c4740dd16 100644 --- a/jscomp/test/webpack_config.js +++ b/jscomp/test/webpack_config.js @@ -39,16 +39,16 @@ let B = {}; function f() { return [ - ((prim) => { + (prim => { List$3.ff(); }), - ((prim) => { + (prim => { List$3.ff2(); }), - ((prim) => { + (prim => { List$2.ff(); }), - ((prim) => { + (prim => { List$2.ff2(); }) ]; diff --git a/lib/es6/arg.js b/lib/es6/arg.js index 485274c88a5..58a61ce5b54 100644 --- a/lib/es6/arg.js +++ b/lib/es6/arg.js @@ -124,7 +124,7 @@ function add_help(speclist) { function usage_b(buf, speclist, errmsg) { Buffer.add_string(buf, errmsg + "\n"); - List.iter(((x) => { + List.iter((x => { let doc = x[2]; if (doc.length === 0) { return; @@ -197,7 +197,7 @@ function float_of_string_opt(x) { function parse_and_expand_argv_dynamic_aux(allow_expand, current, argv, speclist, anonfun, errmsg) { let initpos = current.contents; - let convert_error = (error) => { + let convert_error = error => { let b = Buffer.create(200); let progname = initpos < argv.contents.length ? Caml_array.get(argv.contents, initpos) : "(?)"; switch (error.TAG) { @@ -325,7 +325,7 @@ function parse_and_expand_argv_dynamic_aux(allow_expand, current, argv, speclist return; } }; - let treat_action = (f) => { + let treat_action = f => { switch (f.TAG) { case "Unit" : return f._0(); @@ -609,7 +609,7 @@ function parse_expand(l, f, msg) { function second_word(s) { let len = s.length; - let loop = (_n) => { + let loop = _n => { while (true) { let n = _n; if (n >= len) { @@ -668,7 +668,7 @@ function replace_leading_tab(s) { let seen = { contents: false }; - return $$String.map(((c) => { + return $$String.map((c => { if (c !== 9 || seen.contents) { return c; } else { @@ -683,7 +683,7 @@ function align(limitOpt, speclist) { let completed = add_help(speclist); let len = List.fold_left(max_arg_len, 0, completed); let len$1 = len < limit ? len : limit; - return List.map(((x) => { + return List.map((x => { let spec = x[1]; let kwd = x[0]; if (x[2] === "") { diff --git a/lib/es6/belt_internalBuckets.js b/lib/es6/belt_internalBuckets.js index ba1c789f1cf..72ebdc5eeda 100644 --- a/lib/es6/belt_internalBuckets.js +++ b/lib/es6/belt_internalBuckets.js @@ -120,10 +120,10 @@ function getMaxBucketLength(h) { function getBucketHistogram(h) { let mbl = getMaxBucketLength(h); - let histo = Belt_Array.makeBy(mbl + 1 | 0, ((param) => { + let histo = Belt_Array.makeBy(mbl + 1 | 0, (param => { return 0; })); - Belt_Array.forEach(h.buckets, ((b) => { + Belt_Array.forEach(h.buckets, (b => { let l = bucketLength(0, b); histo[l] = histo[l] + 1 | 0; })); @@ -233,19 +233,19 @@ function linear(h, f) { } function keysToArray(h) { - return linear(h, ((x) => { + return linear(h, (x => { return x.key; })); } function valuesToArray(h) { - return linear(h, ((x) => { + return linear(h, (x => { return x.value; })); } function toArray(h) { - return linear(h, ((x) => { + return linear(h, (x => { return [ x.key, x.value diff --git a/lib/es6/belt_internalSetBuckets.js b/lib/es6/belt_internalSetBuckets.js index 61787bdc7da..3142eb3fb85 100644 --- a/lib/es6/belt_internalSetBuckets.js +++ b/lib/es6/belt_internalSetBuckets.js @@ -146,10 +146,10 @@ function getMaxBucketLength(h) { function getBucketHistogram(h) { let mbl = getMaxBucketLength(h); - let histo = Belt_Array.makeBy(mbl + 1 | 0, ((param) => { + let histo = Belt_Array.makeBy(mbl + 1 | 0, (param => { return 0; })); - Belt_Array.forEach(h.buckets, ((b) => { + Belt_Array.forEach(h.buckets, (b => { let l = bucketLength(0, b); histo[l] = histo[l] + 1 | 0; })); diff --git a/lib/es6/caml_hash.js b/lib/es6/caml_hash.js index 4bcb78d750a..e0c70256dd9 100644 --- a/lib/es6/caml_hash.js +++ b/lib/es6/caml_hash.js @@ -84,7 +84,7 @@ function hash(count, _limit, seed, obj) { ++ size } return size - })(obj$1, ((v) => { + })(obj$1, (v => { push_back(queue, v); })); s = Caml_hash_primitive.hash_mix_int(s, (size$1 << 10) | 0); diff --git a/lib/es6/caml_int64.js b/lib/es6/caml_int64.js index c4a9d0e0a2f..5220aad0486 100644 --- a/lib/es6/caml_int64.js +++ b/lib/es6/caml_int64.js @@ -527,7 +527,7 @@ function to_int32(x) { function to_hex(x) { let x_lo = x[1]; let x_hi = x[0]; - let aux = (v) => { + let aux = v => { return (v >>> 0).toString(16); }; if (x_hi === 0 && x_lo === 0) { diff --git a/lib/es6/caml_module.js b/lib/es6/caml_module.js index 6f579153d99..51988ea2541 100644 --- a/lib/es6/caml_module.js +++ b/lib/es6/caml_module.js @@ -3,7 +3,7 @@ import * as Caml_obj from "./caml_obj.js"; function init_mod(loc, shape) { - let undef_module = (param) => { + let undef_module = param => { throw new Error("Undefined_recursive_module", { cause: { RE_EXN_ID: "Undefined_recursive_module", diff --git a/lib/es6/caml_obj.js b/lib/es6/caml_obj.js index 8888a3b97ae..c6cf02bbc8d 100644 --- a/lib/es6/caml_obj.js +++ b/lib/es6/caml_obj.js @@ -225,14 +225,14 @@ function aux_obj_compare(a, b) { return; } }; - let do_key_a = (key) => { + let do_key_a = key => { do_key([ a, b, min_key_rhs ], key); }; - let do_key_b = (key) => { + let do_key_b = key => { do_key([ b, a, @@ -314,14 +314,14 @@ function equal(a, b) { let result = { contents: true }; - let do_key_a = (key) => { + let do_key_a = key => { if (!Object.prototype.hasOwnProperty.call(b, key)) { result.contents = false; return; } }; - let do_key_b = (key) => { + let do_key_b = key => { if (!Object.prototype.hasOwnProperty.call(a, key) || !equal(b[key], a[key])) { result.contents = false; return; diff --git a/lib/es6/curry.js b/lib/es6/curry.js index d5b7e9b9e85..82fa3891111 100644 --- a/lib/es6/curry.js +++ b/lib/es6/curry.js @@ -14,7 +14,7 @@ function app(_f, _args) { return f.apply(null, args); } if (d >= 0) { - return (x) => { + return x => { return app(f, args.concat([x])); }; } @@ -33,7 +33,7 @@ function _1(o, a0) { case 1 : return o(a0); case 2 : - return (param) => { + return param => { return o(a0, param); }; case 3 : @@ -67,7 +67,7 @@ function __1(o) { if (arity === 1) { return o; } else { - return (a0) => { + return a0 => { return _1(o, a0); }; } @@ -84,7 +84,7 @@ function _2(o, a0, a1) { case 2 : return o(a0, a1); case 3 : - return (param) => { + return param => { return o(a0, a1, param); }; case 4 : @@ -139,7 +139,7 @@ function _3(o, a0, a1, a2) { case 3 : return o(a0, a1, a2); case 4 : - return (param) => { + return param => { return o(a0, a1, a2, param); }; case 5 : @@ -197,7 +197,7 @@ function _4(o, a0, a1, a2, a3) { case 4 : return o(a0, a1, a2, a3); case 5 : - return (param) => { + return param => { return o(a0, a1, a2, a3, param); }; case 6 : @@ -259,7 +259,7 @@ function _5(o, a0, a1, a2, a3, a4) { case 5 : return o(a0, a1, a2, a3, a4); case 6 : - return (param) => { + return param => { return o(a0, a1, a2, a3, a4, param); }; case 7 : @@ -326,7 +326,7 @@ function _6(o, a0, a1, a2, a3, a4, a5) { case 6 : return o(a0, a1, a2, a3, a4, a5); case 7 : - return (param) => { + return param => { return o(a0, a1, a2, a3, a4, a5, param); }; default: diff --git a/lib/es6/digest.js b/lib/es6/digest.js index 20cc571fb3a..596279934da 100644 --- a/lib/es6/digest.js +++ b/lib/es6/digest.js @@ -64,7 +64,7 @@ function from_hex(s) { } }); } - let digit = (c) => { + let digit = c => { if (c >= 65) { if (c >= 97) { if (c >= 103) { @@ -97,7 +97,7 @@ function from_hex(s) { } return c - /* '0' */48 | 0; }; - let byte = (i) => { + let byte = i => { return (digit(Caml_string.get(s, i)) << 4) + digit(Caml_string.get(s, i + 1 | 0)) | 0; }; let result = Caml_bytes.create(16); diff --git a/lib/es6/filename.js b/lib/es6/filename.js index 050f322f7f8..38a82588784 100644 --- a/lib/es6/filename.js +++ b/lib/es6/filename.js @@ -215,7 +215,7 @@ function quote$1(s) { let l = s.length; let b = Buffer.create(l + 20 | 0); Buffer.add_char(b, /* '"' */34); - let loop = (_i) => { + let loop = _i => { while (true) { let i = _i; if (i === l) { @@ -256,7 +256,7 @@ function quote$1(s) { return loop(i + 1 | 0); }; }; - let add_bs = (n) => { + let add_bs = n => { for (let _j = 1; _j <= n; ++_j) { Buffer.add_char(b, /* '\\' */92); } @@ -266,7 +266,7 @@ function quote$1(s) { } function has_drive(s) { - let is_letter = (param) => { + let is_letter = param => { if (param >= 91) { return !(param > 122 || param < 97); } else { diff --git a/lib/es6/genlex.js b/lib/es6/genlex.js index f95ed73cdec..09440345c5e 100644 --- a/lib/es6/genlex.js +++ b/lib/es6/genlex.js @@ -43,13 +43,13 @@ function get_string() { function make_lexer(keywords) { let kwd_table = Hashtbl.create(undefined, 17); - List.iter(((s) => { + List.iter((s => { Hashtbl.add(kwd_table, s, { TAG: "Kwd", _0: s }); }), keywords); - let ident_or_keyword = (id) => { + let ident_or_keyword = id => { try { return Hashtbl.find(kwd_table, id); } catch (raw_exn) { @@ -65,7 +65,7 @@ function make_lexer(keywords) { }); } }; - let keyword_or_error = (c) => { + let keyword_or_error = c => { let s = Caml_string.make(1, c); try { return Hashtbl.find(kwd_table, s); @@ -84,7 +84,7 @@ function make_lexer(keywords) { }); } }; - let next_token = (strm__) => { + let next_token = strm__ => { while (true) { let c = Stream.peek(strm__); if (c === undefined) { @@ -310,7 +310,7 @@ function make_lexer(keywords) { } }; }; - let ident2 = (strm__) => { + let ident2 = strm__ => { while (true) { let c = Stream.peek(strm__); if (c === undefined) { @@ -377,7 +377,7 @@ function make_lexer(keywords) { continue; }; }; - let number = (strm__) => { + let number = strm__ => { while (true) { let c = Stream.peek(strm__); if (c !== undefined) { @@ -428,7 +428,7 @@ function make_lexer(keywords) { }; }; }; - let exponent_part = (strm__) => { + let exponent_part = strm__ => { let c = Stream.peek(strm__); if (c !== undefined && !(c !== 43 && c !== 45)) { Stream.junk(strm__); @@ -438,7 +438,7 @@ function make_lexer(keywords) { return end_exponent_part(strm__); } }; - let end_exponent_part = (strm__) => { + let end_exponent_part = strm__ => { while (true) { let c = Stream.peek(strm__); if (c === undefined) { @@ -458,7 +458,7 @@ function make_lexer(keywords) { continue; }; }; - let string = (strm__) => { + let string = strm__ => { while (true) { let c = Stream.peek(strm__); if (c !== undefined) { @@ -499,7 +499,7 @@ function make_lexer(keywords) { }); }; }; - let char = (strm__) => { + let char = strm__ => { let c = Stream.peek(strm__); if (c !== undefined) { if (c !== 92) { @@ -531,7 +531,7 @@ function make_lexer(keywords) { }); } }; - let escape = (strm__) => { + let escape = strm__ => { let c1 = Stream.peek(strm__); if (c1 !== undefined) { if (c1 >= 58) { @@ -601,7 +601,7 @@ function make_lexer(keywords) { }); } }; - let comment = (strm__) => { + let comment = strm__ => { while (true) { let match = Stream.peek(strm__); if (match !== undefined) { @@ -659,8 +659,8 @@ function make_lexer(keywords) { } }; }; - return (input) => { - return Stream.from((_count) => { + return input => { + return Stream.from(_count => { return next_token(input); }); }; diff --git a/lib/es6/hashtbl.js b/lib/es6/hashtbl.js index cbe38382933..7945c57bad3 100644 --- a/lib/es6/hashtbl.js +++ b/lib/es6/hashtbl.js @@ -162,7 +162,7 @@ function resize(indexfun, h) { let ndata_tail = Caml_array.make(nsize, "Empty"); let inplace = h.initial_size >= 0; h.data = ndata; - let insert_bucket = (_param) => { + let insert_bucket = _param => { while (true) { let param = _param; if (typeof param !== "object") { @@ -362,7 +362,7 @@ function find_opt(h, key) { } function find_all(h, key) { - let find_in_bucket = (_param) => { + let find_in_bucket = _param => { while (true) { let param = _param; if (typeof param !== "object") { @@ -440,7 +440,7 @@ function mem(h, key) { } function iter(f, h) { - let do_bucket = (_param) => { + let do_bucket = _param => { while (true) { let param = _param; if (typeof param !== "object") { @@ -600,7 +600,7 @@ function stats(h) { return Caml.int_max(m, bucket_length(0, b)); }), 0, h.data); let histo = Caml_array.make(mbl + 1 | 0, 0); - $$Array.iter(((b) => { + $$Array.iter((b => { let l = bucket_length(0, b); Caml_array.set(histo, l, Caml_array.get(histo, l) + 1 | 0); }), h.data); @@ -766,7 +766,7 @@ function MakeSeeded(H) { } }; let find_all = (h, key) => { - let find_in_bucket = (_param) => { + let find_in_bucket = _param => { while (true) { let param = _param; if (typeof param !== "object") { @@ -1014,7 +1014,7 @@ function Make(H) { } }; let find_all = (h, key) => { - let find_in_bucket = (_param) => { + let find_in_bucket = _param => { while (true) { let param = _param; if (typeof param !== "object") { @@ -1087,7 +1087,7 @@ function Make(H) { continue; }; }; - let create$1 = (sz) => { + let create$1 = sz => { return create(false, sz); }; return { diff --git a/lib/es6/hashtblLabels.js b/lib/es6/hashtblLabels.js index 1d3b1c360e9..f52c2197341 100644 --- a/lib/es6/hashtblLabels.js +++ b/lib/es6/hashtblLabels.js @@ -113,7 +113,7 @@ function Make(H) { return f(key, data, acc); }), tbl, init); }; - let create$1 = (sz) => { + let create$1 = sz => { return create(false, sz); }; return { diff --git a/lib/es6/lexing.js b/lib/es6/lexing.js index e654ef26b68..df2d0973773 100644 --- a/lib/es6/lexing.js +++ b/lib/es6/lexing.js @@ -44,7 +44,7 @@ let zero_pos = { function from_function(f) { return { - refill_buff: ((x) => { + refill_buff: (x => { let aux_buffer = Caml_bytes.create(512); let read = f(aux_buffer, aux_buffer.length); let n = read > 0 ? read : (x.lex_eof_reached = true, 0); @@ -99,7 +99,7 @@ function from_function(f) { function from_string(s) { return { - refill_buff: ((lexbuf) => { + refill_buff: (lexbuf => { lexbuf.lex_eof_reached = true; }), lex_buffer: Bytes.of_string(s), diff --git a/lib/es6/map.js b/lib/es6/map.js index f7de0c79654..a5c7435b600 100644 --- a/lib/es6/map.js +++ b/lib/es6/map.js @@ -3,7 +3,7 @@ import * as Caml_option from "./caml_option.js"; function Make(funarg) { - let height = (param) => { + let height = param => { if (typeof param !== "object") { return 0; } else { @@ -98,7 +98,7 @@ function Make(funarg) { } }); }; - let is_empty = (param) => { + let is_empty = param => { if (typeof param !== "object") { return true; } else { @@ -348,7 +348,7 @@ function Make(funarg) { continue; }; }; - let min_binding = (_param) => { + let min_binding = _param => { while (true) { let param = _param; if (typeof param !== "object") { @@ -369,7 +369,7 @@ function Make(funarg) { continue; }; }; - let min_binding_opt = (_param) => { + let min_binding_opt = _param => { while (true) { let param = _param; if (typeof param !== "object") { @@ -386,7 +386,7 @@ function Make(funarg) { continue; }; }; - let max_binding = (_param) => { + let max_binding = _param => { while (true) { let param = _param; if (typeof param !== "object") { @@ -407,7 +407,7 @@ function Make(funarg) { continue; }; }; - let max_binding_opt = (_param) => { + let max_binding_opt = _param => { while (true) { let param = _param; if (typeof param !== "object") { @@ -424,7 +424,7 @@ function Make(funarg) { continue; }; }; - let remove_min_binding = (param) => { + let remove_min_binding = param => { if (typeof param !== "object") { throw new Error("Invalid_argument", { cause: { @@ -889,7 +889,7 @@ function Make(funarg) { continue; }; }; - let cardinal = (param) => { + let cardinal = param => { if (typeof param !== "object") { return 0; } else { @@ -914,7 +914,7 @@ function Make(funarg) { continue; }; }; - let bindings = (s) => { + let bindings = s => { return bindings_aux(/* [] */0, s); }; return { diff --git a/lib/es6/mapLabels.js b/lib/es6/mapLabels.js index 1badc16d8d2..356c307e1ef 100644 --- a/lib/es6/mapLabels.js +++ b/lib/es6/mapLabels.js @@ -3,7 +3,7 @@ import * as Caml_option from "./caml_option.js"; function Make(Ord) { - let height = (param) => { + let height = param => { if (typeof param !== "object") { return 0; } else { @@ -98,7 +98,7 @@ function Make(Ord) { } }); }; - let is_empty = (param) => { + let is_empty = param => { if (typeof param !== "object") { return true; } else { @@ -348,7 +348,7 @@ function Make(Ord) { continue; }; }; - let min_binding = (_param) => { + let min_binding = _param => { while (true) { let param = _param; if (typeof param !== "object") { @@ -369,7 +369,7 @@ function Make(Ord) { continue; }; }; - let min_binding_opt = (_param) => { + let min_binding_opt = _param => { while (true) { let param = _param; if (typeof param !== "object") { @@ -386,7 +386,7 @@ function Make(Ord) { continue; }; }; - let max_binding = (_param) => { + let max_binding = _param => { while (true) { let param = _param; if (typeof param !== "object") { @@ -407,7 +407,7 @@ function Make(Ord) { continue; }; }; - let max_binding_opt = (_param) => { + let max_binding_opt = _param => { while (true) { let param = _param; if (typeof param !== "object") { @@ -424,7 +424,7 @@ function Make(Ord) { continue; }; }; - let remove_min_binding = (param) => { + let remove_min_binding = param => { if (typeof param !== "object") { throw new Error("Invalid_argument", { cause: { @@ -889,7 +889,7 @@ function Make(Ord) { continue; }; }; - let cardinal = (param) => { + let cardinal = param => { if (typeof param !== "object") { return 0; } else { @@ -914,7 +914,7 @@ function Make(Ord) { continue; }; }; - let bindings = (s) => { + let bindings = s => { return bindings_aux(/* [] */0, s); }; return { diff --git a/lib/es6/moreLabels.js b/lib/es6/moreLabels.js index 4e70e9869d9..d88d487e95f 100644 --- a/lib/es6/moreLabels.js +++ b/lib/es6/moreLabels.js @@ -32,8 +32,8 @@ let Hashtbl = { }; let $$Map = { - Make: ((funarg) => { - let height = (param) => { + Make: (funarg => { + let height = param => { if (typeof param !== "object") { return 0; } else { @@ -128,7 +128,7 @@ let $$Map = { } }); }; - let is_empty = (param) => { + let is_empty = param => { if (typeof param !== "object") { return true; } else { @@ -378,7 +378,7 @@ let $$Map = { continue; }; }; - let min_binding = (_param) => { + let min_binding = _param => { while (true) { let param = _param; if (typeof param !== "object") { @@ -399,7 +399,7 @@ let $$Map = { continue; }; }; - let min_binding_opt = (_param) => { + let min_binding_opt = _param => { while (true) { let param = _param; if (typeof param !== "object") { @@ -416,7 +416,7 @@ let $$Map = { continue; }; }; - let max_binding = (_param) => { + let max_binding = _param => { while (true) { let param = _param; if (typeof param !== "object") { @@ -437,7 +437,7 @@ let $$Map = { continue; }; }; - let max_binding_opt = (_param) => { + let max_binding_opt = _param => { while (true) { let param = _param; if (typeof param !== "object") { @@ -454,7 +454,7 @@ let $$Map = { continue; }; }; - let remove_min_binding = (param) => { + let remove_min_binding = param => { if (typeof param !== "object") { throw new Error("Invalid_argument", { cause: { @@ -919,7 +919,7 @@ let $$Map = { continue; }; }; - let cardinal = (param) => { + let cardinal = param => { if (typeof param !== "object") { return 0; } else { @@ -944,7 +944,7 @@ let $$Map = { continue; }; }; - let bindings = (s) => { + let bindings = s => { return bindings_aux(/* [] */0, s); }; return { @@ -987,8 +987,8 @@ let $$Map = { }; let $$Set = { - Make: ((funarg) => { - let height = (param) => { + Make: (funarg => { + let height = param => { if (typeof param !== "object") { return 0; } else { @@ -1103,7 +1103,7 @@ let $$Set = { return bal(l, v, rr); } }; - let singleton = (x) => { + let singleton = x => { return { TAG: "Node", l: "Empty", @@ -1143,7 +1143,7 @@ let $$Set = { return create(l, v, r); } }; - let min_elt = (_param) => { + let min_elt = _param => { while (true) { let param = _param; if (typeof param !== "object") { @@ -1161,7 +1161,7 @@ let $$Set = { continue; }; }; - let min_elt_opt = (_param) => { + let min_elt_opt = _param => { while (true) { let param = _param; if (typeof param !== "object") { @@ -1175,7 +1175,7 @@ let $$Set = { continue; }; }; - let max_elt = (_param) => { + let max_elt = _param => { while (true) { let param = _param; if (typeof param !== "object") { @@ -1193,7 +1193,7 @@ let $$Set = { continue; }; }; - let max_elt_opt = (_param) => { + let max_elt_opt = _param => { while (true) { let param = _param; if (typeof param !== "object") { @@ -1207,7 +1207,7 @@ let $$Set = { continue; }; }; - let remove_min_elt = (param) => { + let remove_min_elt = param => { if (typeof param !== "object") { throw new Error("Invalid_argument", { cause: { @@ -1275,7 +1275,7 @@ let $$Set = { match$1[2] ]; }; - let is_empty = (param) => { + let is_empty = param => { if (typeof param !== "object") { return true; } else { @@ -1581,7 +1581,7 @@ let $$Set = { ]; } }; - let cardinal = (param) => { + let cardinal = param => { if (typeof param !== "object") { return 0; } else { @@ -1603,7 +1603,7 @@ let $$Set = { continue; }; }; - let elements = (s) => { + let elements = s => { return elements_aux(/* [] */0, s); }; let find = (x, _param) => { @@ -1795,7 +1795,7 @@ let $$Set = { return try_join(l$p, v$p, r$p); } }; - let of_sorted_list = (l) => { + let of_sorted_list = l => { let sub = (n, l) => { switch (n) { case 0 : @@ -1899,7 +1899,7 @@ let $$Set = { }; return sub(List.length(l), l)[0]; }; - let of_list = (l) => { + let of_list = l => { if (!l) { return "Empty"; } diff --git a/lib/es6/parsing.js b/lib/es6/parsing.js index 32cb0b85c98..37cf4a69f71 100644 --- a/lib/es6/parsing.js +++ b/lib/es6/parsing.js @@ -55,7 +55,7 @@ function clear_parser() { } let current_lookahead_fun = { - contents: ((param) => { + contents: (param => { return false; }) }; @@ -145,7 +145,7 @@ function yyparse(tables, start, lexer, lexbuf) { if (exn$1.RE_EXN_ID === YYexit) { return exn$1._1; } - current_lookahead_fun.contents = ((tok) => { + current_lookahead_fun.contents = (tok => { if (typeof tok !== "number") { return Caml_array.get(tables.transl_block, tok.TAG) === curr_char; } else { diff --git a/lib/es6/pervasives.js b/lib/es6/pervasives.js index 106dc04c488..3a0b4735c4a 100644 --- a/lib/es6/pervasives.js +++ b/lib/es6/pervasives.js @@ -191,7 +191,7 @@ function print_string(prim) { } let exit_function = { - contents: ((prim) => { + contents: (prim => { }) }; diff --git a/lib/es6/random.js b/lib/es6/random.js index 9cfcb60be9b..13d20d242ac 100644 --- a/lib/es6/random.js +++ b/lib/es6/random.js @@ -22,7 +22,7 @@ function full_init(s, seed) { let combine = (accu, x) => { return Digest.string(accu + String(x)); }; - let extract = (d) => { + let extract = d => { return ((Caml_string.get(d, 0) + (Caml_string.get(d, 1) << 8) | 0) + (Caml_string.get(d, 2) << 16) | 0) + (Caml_string.get(d, 3) << 24) | 0; }; let seed$1 = seed.length === 0 ? [0] : seed; diff --git a/lib/es6/set.js b/lib/es6/set.js index c5adb9b9514..16b3a4ce289 100644 --- a/lib/es6/set.js +++ b/lib/es6/set.js @@ -4,7 +4,7 @@ import * as List from "./list.js"; import * as Caml_option from "./caml_option.js"; function Make(funarg) { - let height = (param) => { + let height = param => { if (typeof param !== "object") { return 0; } else { @@ -119,7 +119,7 @@ function Make(funarg) { return bal(l, v, rr); } }; - let singleton = (x) => { + let singleton = x => { return { TAG: "Node", l: "Empty", @@ -159,7 +159,7 @@ function Make(funarg) { return create(l, v, r); } }; - let min_elt = (_param) => { + let min_elt = _param => { while (true) { let param = _param; if (typeof param !== "object") { @@ -177,7 +177,7 @@ function Make(funarg) { continue; }; }; - let min_elt_opt = (_param) => { + let min_elt_opt = _param => { while (true) { let param = _param; if (typeof param !== "object") { @@ -191,7 +191,7 @@ function Make(funarg) { continue; }; }; - let max_elt = (_param) => { + let max_elt = _param => { while (true) { let param = _param; if (typeof param !== "object") { @@ -209,7 +209,7 @@ function Make(funarg) { continue; }; }; - let max_elt_opt = (_param) => { + let max_elt_opt = _param => { while (true) { let param = _param; if (typeof param !== "object") { @@ -223,7 +223,7 @@ function Make(funarg) { continue; }; }; - let remove_min_elt = (param) => { + let remove_min_elt = param => { if (typeof param !== "object") { throw new Error("Invalid_argument", { cause: { @@ -282,7 +282,7 @@ function Make(funarg) { match$1[2] ]; }; - let is_empty = (param) => { + let is_empty = param => { if (typeof param !== "object") { return true; } else { @@ -593,7 +593,7 @@ function Make(funarg) { ]; } }; - let cardinal = (param) => { + let cardinal = param => { if (typeof param !== "object") { return 0; } else { @@ -615,7 +615,7 @@ function Make(funarg) { continue; }; }; - let elements = (s) => { + let elements = s => { return elements_aux(/* [] */0, s); }; let find = (x, _param) => { @@ -798,7 +798,7 @@ function Make(funarg) { return union(l$p, add(v$p, r$p)); } }; - let of_list = (l) => { + let of_list = l => { if (!l) { return "Empty"; } diff --git a/lib/es6/setLabels.js b/lib/es6/setLabels.js index 876fc093755..47a320da7f3 100644 --- a/lib/es6/setLabels.js +++ b/lib/es6/setLabels.js @@ -4,7 +4,7 @@ import * as List from "./list.js"; import * as Caml_option from "./caml_option.js"; function Make(Ord) { - let height = (param) => { + let height = param => { if (typeof param !== "object") { return 0; } else { @@ -119,7 +119,7 @@ function Make(Ord) { return bal(l, v, rr); } }; - let singleton = (x) => { + let singleton = x => { return { TAG: "Node", l: "Empty", @@ -159,7 +159,7 @@ function Make(Ord) { return create(l, v, r); } }; - let min_elt = (_param) => { + let min_elt = _param => { while (true) { let param = _param; if (typeof param !== "object") { @@ -177,7 +177,7 @@ function Make(Ord) { continue; }; }; - let min_elt_opt = (_param) => { + let min_elt_opt = _param => { while (true) { let param = _param; if (typeof param !== "object") { @@ -191,7 +191,7 @@ function Make(Ord) { continue; }; }; - let max_elt = (_param) => { + let max_elt = _param => { while (true) { let param = _param; if (typeof param !== "object") { @@ -209,7 +209,7 @@ function Make(Ord) { continue; }; }; - let max_elt_opt = (_param) => { + let max_elt_opt = _param => { while (true) { let param = _param; if (typeof param !== "object") { @@ -223,7 +223,7 @@ function Make(Ord) { continue; }; }; - let remove_min_elt = (param) => { + let remove_min_elt = param => { if (typeof param !== "object") { throw new Error("Invalid_argument", { cause: { @@ -291,7 +291,7 @@ function Make(Ord) { match$1[2] ]; }; - let is_empty = (param) => { + let is_empty = param => { if (typeof param !== "object") { return true; } else { @@ -597,7 +597,7 @@ function Make(Ord) { ]; } }; - let cardinal = (param) => { + let cardinal = param => { if (typeof param !== "object") { return 0; } else { @@ -619,7 +619,7 @@ function Make(Ord) { continue; }; }; - let elements = (s) => { + let elements = s => { return elements_aux(/* [] */0, s); }; let find = (x, _param) => { @@ -811,7 +811,7 @@ function Make(Ord) { return try_join(l$p, v$p, r$p); } }; - let of_sorted_list = (l) => { + let of_sorted_list = l => { let sub = (n, l) => { switch (n) { case 0 : @@ -915,7 +915,7 @@ function Make(Ord) { }; return sub(List.length(l), l)[0]; }; - let of_list = (l) => { + let of_list = l => { if (!l) { return "Empty"; } diff --git a/lib/es6/sort.js b/lib/es6/sort.js index 83358bc64f0..98d609d6e5a 100644 --- a/lib/es6/sort.js +++ b/lib/es6/sort.js @@ -24,7 +24,7 @@ function merge(order, l1, l2) { } function list(order, l) { - let initlist = (param) => { + let initlist = param => { if (!param) { return /* [] */0; } @@ -57,7 +57,7 @@ function list(order, l) { tl: initlist(match.tl) }; }; - let merge2 = (param) => { + let merge2 = param => { if (!param) { return param; } diff --git a/lib/es6/stream.js b/lib/es6/stream.js index a26ebf6cf51..a4956466ef4 100644 --- a/lib/es6/stream.js +++ b/lib/es6/stream.js @@ -298,7 +298,7 @@ function of_string(s) { let count = { contents: 0 }; - return from((param) => { + return from(param => { let c = count.contents; if (c < s.length) { count.contents = count.contents + 1 | 0; @@ -312,7 +312,7 @@ function of_bytes(s) { let count = { contents: 0 }; - return from((param) => { + return from(param => { let c = count.contents; if (c < s.length) { count.contents = count.contents + 1 | 0; diff --git a/lib/es6/string.js b/lib/es6/string.js index d260d31410e..85e4d17c82a 100644 --- a/lib/es6/string.js +++ b/lib/es6/string.js @@ -55,7 +55,7 @@ function trim(s) { } function escaped(s) { - let needs_escape = (_i) => { + let needs_escape = _i => { while (true) { let i = _i; if (i >= s.length) { diff --git a/lib/es6/stringLabels.js b/lib/es6/stringLabels.js index c1df4983baa..72980fb1bb3 100644 --- a/lib/es6/stringLabels.js +++ b/lib/es6/stringLabels.js @@ -57,7 +57,7 @@ function trim(s) { } function escaped(s) { - let needs_escape = (_i) => { + let needs_escape = _i => { while (true) { let i = _i; if (i >= s.length) { diff --git a/lib/js/arg.js b/lib/js/arg.js index 08c73487596..78e88123b9d 100644 --- a/lib/js/arg.js +++ b/lib/js/arg.js @@ -124,7 +124,7 @@ function add_help(speclist) { function usage_b(buf, speclist, errmsg) { Buffer.add_string(buf, errmsg + "\n"); - List.iter(((x) => { + List.iter((x => { let doc = x[2]; if (doc.length === 0) { return; @@ -197,7 +197,7 @@ function float_of_string_opt(x) { function parse_and_expand_argv_dynamic_aux(allow_expand, current, argv, speclist, anonfun, errmsg) { let initpos = current.contents; - let convert_error = (error) => { + let convert_error = error => { let b = Buffer.create(200); let progname = initpos < argv.contents.length ? Caml_array.get(argv.contents, initpos) : "(?)"; switch (error.TAG) { @@ -325,7 +325,7 @@ function parse_and_expand_argv_dynamic_aux(allow_expand, current, argv, speclist return; } }; - let treat_action = (f) => { + let treat_action = f => { switch (f.TAG) { case "Unit" : return f._0(); @@ -609,7 +609,7 @@ function parse_expand(l, f, msg) { function second_word(s) { let len = s.length; - let loop = (_n) => { + let loop = _n => { while (true) { let n = _n; if (n >= len) { @@ -668,7 +668,7 @@ function replace_leading_tab(s) { let seen = { contents: false }; - return $$String.map(((c) => { + return $$String.map((c => { if (c !== 9 || seen.contents) { return c; } else { @@ -683,7 +683,7 @@ function align(limitOpt, speclist) { let completed = add_help(speclist); let len = List.fold_left(max_arg_len, 0, completed); let len$1 = len < limit ? len : limit; - return List.map(((x) => { + return List.map((x => { let spec = x[1]; let kwd = x[0]; if (x[2] === "") { diff --git a/lib/js/belt_internalBuckets.js b/lib/js/belt_internalBuckets.js index 2b4e3bc4e3a..e5e13b966fe 100644 --- a/lib/js/belt_internalBuckets.js +++ b/lib/js/belt_internalBuckets.js @@ -120,10 +120,10 @@ function getMaxBucketLength(h) { function getBucketHistogram(h) { let mbl = getMaxBucketLength(h); - let histo = Belt_Array.makeBy(mbl + 1 | 0, ((param) => { + let histo = Belt_Array.makeBy(mbl + 1 | 0, (param => { return 0; })); - Belt_Array.forEach(h.buckets, ((b) => { + Belt_Array.forEach(h.buckets, (b => { let l = bucketLength(0, b); histo[l] = histo[l] + 1 | 0; })); @@ -233,19 +233,19 @@ function linear(h, f) { } function keysToArray(h) { - return linear(h, ((x) => { + return linear(h, (x => { return x.key; })); } function valuesToArray(h) { - return linear(h, ((x) => { + return linear(h, (x => { return x.value; })); } function toArray(h) { - return linear(h, ((x) => { + return linear(h, (x => { return [ x.key, x.value diff --git a/lib/js/belt_internalSetBuckets.js b/lib/js/belt_internalSetBuckets.js index 88c3e29dc69..5547c7db46a 100644 --- a/lib/js/belt_internalSetBuckets.js +++ b/lib/js/belt_internalSetBuckets.js @@ -146,10 +146,10 @@ function getMaxBucketLength(h) { function getBucketHistogram(h) { let mbl = getMaxBucketLength(h); - let histo = Belt_Array.makeBy(mbl + 1 | 0, ((param) => { + let histo = Belt_Array.makeBy(mbl + 1 | 0, (param => { return 0; })); - Belt_Array.forEach(h.buckets, ((b) => { + Belt_Array.forEach(h.buckets, (b => { let l = bucketLength(0, b); histo[l] = histo[l] + 1 | 0; })); diff --git a/lib/js/caml_hash.js b/lib/js/caml_hash.js index 7447da09ab5..7bb90b757c5 100644 --- a/lib/js/caml_hash.js +++ b/lib/js/caml_hash.js @@ -84,7 +84,7 @@ function hash(count, _limit, seed, obj) { ++ size } return size - })(obj$1, ((v) => { + })(obj$1, (v => { push_back(queue, v); })); s = Caml_hash_primitive.hash_mix_int(s, (size$1 << 10) | 0); diff --git a/lib/js/caml_int64.js b/lib/js/caml_int64.js index d15fe6b9a04..ef504d11747 100644 --- a/lib/js/caml_int64.js +++ b/lib/js/caml_int64.js @@ -527,7 +527,7 @@ function to_int32(x) { function to_hex(x) { let x_lo = x[1]; let x_hi = x[0]; - let aux = (v) => { + let aux = v => { return (v >>> 0).toString(16); }; if (x_hi === 0 && x_lo === 0) { diff --git a/lib/js/caml_module.js b/lib/js/caml_module.js index 287f03e2230..b601cf66dd5 100644 --- a/lib/js/caml_module.js +++ b/lib/js/caml_module.js @@ -3,7 +3,7 @@ let Caml_obj = require("./caml_obj.js"); function init_mod(loc, shape) { - let undef_module = (param) => { + let undef_module = param => { throw new Error("Undefined_recursive_module", { cause: { RE_EXN_ID: "Undefined_recursive_module", diff --git a/lib/js/caml_obj.js b/lib/js/caml_obj.js index 2e79f5fbf0e..284e315fc32 100644 --- a/lib/js/caml_obj.js +++ b/lib/js/caml_obj.js @@ -225,14 +225,14 @@ function aux_obj_compare(a, b) { return; } }; - let do_key_a = (key) => { + let do_key_a = key => { do_key([ a, b, min_key_rhs ], key); }; - let do_key_b = (key) => { + let do_key_b = key => { do_key([ b, a, @@ -314,14 +314,14 @@ function equal(a, b) { let result = { contents: true }; - let do_key_a = (key) => { + let do_key_a = key => { if (!Object.prototype.hasOwnProperty.call(b, key)) { result.contents = false; return; } }; - let do_key_b = (key) => { + let do_key_b = key => { if (!Object.prototype.hasOwnProperty.call(a, key) || !equal(b[key], a[key])) { result.contents = false; return; diff --git a/lib/js/curry.js b/lib/js/curry.js index d35d7b7f74a..d78ca61ed78 100644 --- a/lib/js/curry.js +++ b/lib/js/curry.js @@ -14,7 +14,7 @@ function app(_f, _args) { return f.apply(null, args); } if (d >= 0) { - return (x) => { + return x => { return app(f, args.concat([x])); }; } @@ -33,7 +33,7 @@ function _1(o, a0) { case 1 : return o(a0); case 2 : - return (param) => { + return param => { return o(a0, param); }; case 3 : @@ -67,7 +67,7 @@ function __1(o) { if (arity === 1) { return o; } else { - return (a0) => { + return a0 => { return _1(o, a0); }; } @@ -84,7 +84,7 @@ function _2(o, a0, a1) { case 2 : return o(a0, a1); case 3 : - return (param) => { + return param => { return o(a0, a1, param); }; case 4 : @@ -139,7 +139,7 @@ function _3(o, a0, a1, a2) { case 3 : return o(a0, a1, a2); case 4 : - return (param) => { + return param => { return o(a0, a1, a2, param); }; case 5 : @@ -197,7 +197,7 @@ function _4(o, a0, a1, a2, a3) { case 4 : return o(a0, a1, a2, a3); case 5 : - return (param) => { + return param => { return o(a0, a1, a2, a3, param); }; case 6 : @@ -259,7 +259,7 @@ function _5(o, a0, a1, a2, a3, a4) { case 5 : return o(a0, a1, a2, a3, a4); case 6 : - return (param) => { + return param => { return o(a0, a1, a2, a3, a4, param); }; case 7 : @@ -326,7 +326,7 @@ function _6(o, a0, a1, a2, a3, a4, a5) { case 6 : return o(a0, a1, a2, a3, a4, a5); case 7 : - return (param) => { + return param => { return o(a0, a1, a2, a3, a4, a5, param); }; default: diff --git a/lib/js/digest.js b/lib/js/digest.js index a8ec47df8fc..fa6f5be545a 100644 --- a/lib/js/digest.js +++ b/lib/js/digest.js @@ -64,7 +64,7 @@ function from_hex(s) { } }); } - let digit = (c) => { + let digit = c => { if (c >= 65) { if (c >= 97) { if (c >= 103) { @@ -97,7 +97,7 @@ function from_hex(s) { } return c - /* '0' */48 | 0; }; - let byte = (i) => { + let byte = i => { return (digit(Caml_string.get(s, i)) << 4) + digit(Caml_string.get(s, i + 1 | 0)) | 0; }; let result = Caml_bytes.create(16); diff --git a/lib/js/filename.js b/lib/js/filename.js index 7e8140e9688..293fb0b7315 100644 --- a/lib/js/filename.js +++ b/lib/js/filename.js @@ -215,7 +215,7 @@ function quote$1(s) { let l = s.length; let b = Buffer.create(l + 20 | 0); Buffer.add_char(b, /* '"' */34); - let loop = (_i) => { + let loop = _i => { while (true) { let i = _i; if (i === l) { @@ -256,7 +256,7 @@ function quote$1(s) { return loop(i + 1 | 0); }; }; - let add_bs = (n) => { + let add_bs = n => { for (let _j = 1; _j <= n; ++_j) { Buffer.add_char(b, /* '\\' */92); } @@ -266,7 +266,7 @@ function quote$1(s) { } function has_drive(s) { - let is_letter = (param) => { + let is_letter = param => { if (param >= 91) { return !(param > 122 || param < 97); } else { diff --git a/lib/js/genlex.js b/lib/js/genlex.js index 6100065e379..fee85432f10 100644 --- a/lib/js/genlex.js +++ b/lib/js/genlex.js @@ -43,13 +43,13 @@ function get_string() { function make_lexer(keywords) { let kwd_table = Hashtbl.create(undefined, 17); - List.iter(((s) => { + List.iter((s => { Hashtbl.add(kwd_table, s, { TAG: "Kwd", _0: s }); }), keywords); - let ident_or_keyword = (id) => { + let ident_or_keyword = id => { try { return Hashtbl.find(kwd_table, id); } catch (raw_exn) { @@ -65,7 +65,7 @@ function make_lexer(keywords) { }); } }; - let keyword_or_error = (c) => { + let keyword_or_error = c => { let s = Caml_string.make(1, c); try { return Hashtbl.find(kwd_table, s); @@ -84,7 +84,7 @@ function make_lexer(keywords) { }); } }; - let next_token = (strm__) => { + let next_token = strm__ => { while (true) { let c = Stream.peek(strm__); if (c === undefined) { @@ -310,7 +310,7 @@ function make_lexer(keywords) { } }; }; - let ident2 = (strm__) => { + let ident2 = strm__ => { while (true) { let c = Stream.peek(strm__); if (c === undefined) { @@ -377,7 +377,7 @@ function make_lexer(keywords) { continue; }; }; - let number = (strm__) => { + let number = strm__ => { while (true) { let c = Stream.peek(strm__); if (c !== undefined) { @@ -428,7 +428,7 @@ function make_lexer(keywords) { }; }; }; - let exponent_part = (strm__) => { + let exponent_part = strm__ => { let c = Stream.peek(strm__); if (c !== undefined && !(c !== 43 && c !== 45)) { Stream.junk(strm__); @@ -438,7 +438,7 @@ function make_lexer(keywords) { return end_exponent_part(strm__); } }; - let end_exponent_part = (strm__) => { + let end_exponent_part = strm__ => { while (true) { let c = Stream.peek(strm__); if (c === undefined) { @@ -458,7 +458,7 @@ function make_lexer(keywords) { continue; }; }; - let string = (strm__) => { + let string = strm__ => { while (true) { let c = Stream.peek(strm__); if (c !== undefined) { @@ -499,7 +499,7 @@ function make_lexer(keywords) { }); }; }; - let char = (strm__) => { + let char = strm__ => { let c = Stream.peek(strm__); if (c !== undefined) { if (c !== 92) { @@ -531,7 +531,7 @@ function make_lexer(keywords) { }); } }; - let escape = (strm__) => { + let escape = strm__ => { let c1 = Stream.peek(strm__); if (c1 !== undefined) { if (c1 >= 58) { @@ -601,7 +601,7 @@ function make_lexer(keywords) { }); } }; - let comment = (strm__) => { + let comment = strm__ => { while (true) { let match = Stream.peek(strm__); if (match !== undefined) { @@ -659,8 +659,8 @@ function make_lexer(keywords) { } }; }; - return (input) => { - return Stream.from((_count) => { + return input => { + return Stream.from(_count => { return next_token(input); }); }; diff --git a/lib/js/hashtbl.js b/lib/js/hashtbl.js index 8cf0bb387d1..1c48973046e 100644 --- a/lib/js/hashtbl.js +++ b/lib/js/hashtbl.js @@ -162,7 +162,7 @@ function resize(indexfun, h) { let ndata_tail = Caml_array.make(nsize, "Empty"); let inplace = h.initial_size >= 0; h.data = ndata; - let insert_bucket = (_param) => { + let insert_bucket = _param => { while (true) { let param = _param; if (typeof param !== "object") { @@ -362,7 +362,7 @@ function find_opt(h, key) { } function find_all(h, key) { - let find_in_bucket = (_param) => { + let find_in_bucket = _param => { while (true) { let param = _param; if (typeof param !== "object") { @@ -440,7 +440,7 @@ function mem(h, key) { } function iter(f, h) { - let do_bucket = (_param) => { + let do_bucket = _param => { while (true) { let param = _param; if (typeof param !== "object") { @@ -600,7 +600,7 @@ function stats(h) { return Caml.int_max(m, bucket_length(0, b)); }), 0, h.data); let histo = Caml_array.make(mbl + 1 | 0, 0); - $$Array.iter(((b) => { + $$Array.iter((b => { let l = bucket_length(0, b); Caml_array.set(histo, l, Caml_array.get(histo, l) + 1 | 0); }), h.data); @@ -766,7 +766,7 @@ function MakeSeeded(H) { } }; let find_all = (h, key) => { - let find_in_bucket = (_param) => { + let find_in_bucket = _param => { while (true) { let param = _param; if (typeof param !== "object") { @@ -1014,7 +1014,7 @@ function Make(H) { } }; let find_all = (h, key) => { - let find_in_bucket = (_param) => { + let find_in_bucket = _param => { while (true) { let param = _param; if (typeof param !== "object") { @@ -1087,7 +1087,7 @@ function Make(H) { continue; }; }; - let create$1 = (sz) => { + let create$1 = sz => { return create(false, sz); }; return { diff --git a/lib/js/hashtblLabels.js b/lib/js/hashtblLabels.js index e2fd4caf86d..6112d7fb199 100644 --- a/lib/js/hashtblLabels.js +++ b/lib/js/hashtblLabels.js @@ -113,7 +113,7 @@ function Make(H) { return f(key, data, acc); }), tbl, init); }; - let create$1 = (sz) => { + let create$1 = sz => { return create(false, sz); }; return { diff --git a/lib/js/lexing.js b/lib/js/lexing.js index 833b477f3f6..0386e15071a 100644 --- a/lib/js/lexing.js +++ b/lib/js/lexing.js @@ -44,7 +44,7 @@ let zero_pos = { function from_function(f) { return { - refill_buff: ((x) => { + refill_buff: (x => { let aux_buffer = Caml_bytes.create(512); let read = f(aux_buffer, aux_buffer.length); let n = read > 0 ? read : (x.lex_eof_reached = true, 0); @@ -99,7 +99,7 @@ function from_function(f) { function from_string(s) { return { - refill_buff: ((lexbuf) => { + refill_buff: (lexbuf => { lexbuf.lex_eof_reached = true; }), lex_buffer: Bytes.of_string(s), diff --git a/lib/js/map.js b/lib/js/map.js index ce29b432ec3..93c7e65415b 100644 --- a/lib/js/map.js +++ b/lib/js/map.js @@ -3,7 +3,7 @@ let Caml_option = require("./caml_option.js"); function Make(funarg) { - let height = (param) => { + let height = param => { if (typeof param !== "object") { return 0; } else { @@ -98,7 +98,7 @@ function Make(funarg) { } }); }; - let is_empty = (param) => { + let is_empty = param => { if (typeof param !== "object") { return true; } else { @@ -348,7 +348,7 @@ function Make(funarg) { continue; }; }; - let min_binding = (_param) => { + let min_binding = _param => { while (true) { let param = _param; if (typeof param !== "object") { @@ -369,7 +369,7 @@ function Make(funarg) { continue; }; }; - let min_binding_opt = (_param) => { + let min_binding_opt = _param => { while (true) { let param = _param; if (typeof param !== "object") { @@ -386,7 +386,7 @@ function Make(funarg) { continue; }; }; - let max_binding = (_param) => { + let max_binding = _param => { while (true) { let param = _param; if (typeof param !== "object") { @@ -407,7 +407,7 @@ function Make(funarg) { continue; }; }; - let max_binding_opt = (_param) => { + let max_binding_opt = _param => { while (true) { let param = _param; if (typeof param !== "object") { @@ -424,7 +424,7 @@ function Make(funarg) { continue; }; }; - let remove_min_binding = (param) => { + let remove_min_binding = param => { if (typeof param !== "object") { throw new Error("Invalid_argument", { cause: { @@ -889,7 +889,7 @@ function Make(funarg) { continue; }; }; - let cardinal = (param) => { + let cardinal = param => { if (typeof param !== "object") { return 0; } else { @@ -914,7 +914,7 @@ function Make(funarg) { continue; }; }; - let bindings = (s) => { + let bindings = s => { return bindings_aux(/* [] */0, s); }; return { diff --git a/lib/js/mapLabels.js b/lib/js/mapLabels.js index 124a6bb6653..acbe9942ab6 100644 --- a/lib/js/mapLabels.js +++ b/lib/js/mapLabels.js @@ -3,7 +3,7 @@ let Caml_option = require("./caml_option.js"); function Make(Ord) { - let height = (param) => { + let height = param => { if (typeof param !== "object") { return 0; } else { @@ -98,7 +98,7 @@ function Make(Ord) { } }); }; - let is_empty = (param) => { + let is_empty = param => { if (typeof param !== "object") { return true; } else { @@ -348,7 +348,7 @@ function Make(Ord) { continue; }; }; - let min_binding = (_param) => { + let min_binding = _param => { while (true) { let param = _param; if (typeof param !== "object") { @@ -369,7 +369,7 @@ function Make(Ord) { continue; }; }; - let min_binding_opt = (_param) => { + let min_binding_opt = _param => { while (true) { let param = _param; if (typeof param !== "object") { @@ -386,7 +386,7 @@ function Make(Ord) { continue; }; }; - let max_binding = (_param) => { + let max_binding = _param => { while (true) { let param = _param; if (typeof param !== "object") { @@ -407,7 +407,7 @@ function Make(Ord) { continue; }; }; - let max_binding_opt = (_param) => { + let max_binding_opt = _param => { while (true) { let param = _param; if (typeof param !== "object") { @@ -424,7 +424,7 @@ function Make(Ord) { continue; }; }; - let remove_min_binding = (param) => { + let remove_min_binding = param => { if (typeof param !== "object") { throw new Error("Invalid_argument", { cause: { @@ -889,7 +889,7 @@ function Make(Ord) { continue; }; }; - let cardinal = (param) => { + let cardinal = param => { if (typeof param !== "object") { return 0; } else { @@ -914,7 +914,7 @@ function Make(Ord) { continue; }; }; - let bindings = (s) => { + let bindings = s => { return bindings_aux(/* [] */0, s); }; return { diff --git a/lib/js/moreLabels.js b/lib/js/moreLabels.js index c04ea3476cc..10b3c4839af 100644 --- a/lib/js/moreLabels.js +++ b/lib/js/moreLabels.js @@ -32,8 +32,8 @@ let Hashtbl = { }; let $$Map = { - Make: ((funarg) => { - let height = (param) => { + Make: (funarg => { + let height = param => { if (typeof param !== "object") { return 0; } else { @@ -128,7 +128,7 @@ let $$Map = { } }); }; - let is_empty = (param) => { + let is_empty = param => { if (typeof param !== "object") { return true; } else { @@ -378,7 +378,7 @@ let $$Map = { continue; }; }; - let min_binding = (_param) => { + let min_binding = _param => { while (true) { let param = _param; if (typeof param !== "object") { @@ -399,7 +399,7 @@ let $$Map = { continue; }; }; - let min_binding_opt = (_param) => { + let min_binding_opt = _param => { while (true) { let param = _param; if (typeof param !== "object") { @@ -416,7 +416,7 @@ let $$Map = { continue; }; }; - let max_binding = (_param) => { + let max_binding = _param => { while (true) { let param = _param; if (typeof param !== "object") { @@ -437,7 +437,7 @@ let $$Map = { continue; }; }; - let max_binding_opt = (_param) => { + let max_binding_opt = _param => { while (true) { let param = _param; if (typeof param !== "object") { @@ -454,7 +454,7 @@ let $$Map = { continue; }; }; - let remove_min_binding = (param) => { + let remove_min_binding = param => { if (typeof param !== "object") { throw new Error("Invalid_argument", { cause: { @@ -919,7 +919,7 @@ let $$Map = { continue; }; }; - let cardinal = (param) => { + let cardinal = param => { if (typeof param !== "object") { return 0; } else { @@ -944,7 +944,7 @@ let $$Map = { continue; }; }; - let bindings = (s) => { + let bindings = s => { return bindings_aux(/* [] */0, s); }; return { @@ -987,8 +987,8 @@ let $$Map = { }; let $$Set = { - Make: ((funarg) => { - let height = (param) => { + Make: (funarg => { + let height = param => { if (typeof param !== "object") { return 0; } else { @@ -1103,7 +1103,7 @@ let $$Set = { return bal(l, v, rr); } }; - let singleton = (x) => { + let singleton = x => { return { TAG: "Node", l: "Empty", @@ -1143,7 +1143,7 @@ let $$Set = { return create(l, v, r); } }; - let min_elt = (_param) => { + let min_elt = _param => { while (true) { let param = _param; if (typeof param !== "object") { @@ -1161,7 +1161,7 @@ let $$Set = { continue; }; }; - let min_elt_opt = (_param) => { + let min_elt_opt = _param => { while (true) { let param = _param; if (typeof param !== "object") { @@ -1175,7 +1175,7 @@ let $$Set = { continue; }; }; - let max_elt = (_param) => { + let max_elt = _param => { while (true) { let param = _param; if (typeof param !== "object") { @@ -1193,7 +1193,7 @@ let $$Set = { continue; }; }; - let max_elt_opt = (_param) => { + let max_elt_opt = _param => { while (true) { let param = _param; if (typeof param !== "object") { @@ -1207,7 +1207,7 @@ let $$Set = { continue; }; }; - let remove_min_elt = (param) => { + let remove_min_elt = param => { if (typeof param !== "object") { throw new Error("Invalid_argument", { cause: { @@ -1275,7 +1275,7 @@ let $$Set = { match$1[2] ]; }; - let is_empty = (param) => { + let is_empty = param => { if (typeof param !== "object") { return true; } else { @@ -1581,7 +1581,7 @@ let $$Set = { ]; } }; - let cardinal = (param) => { + let cardinal = param => { if (typeof param !== "object") { return 0; } else { @@ -1603,7 +1603,7 @@ let $$Set = { continue; }; }; - let elements = (s) => { + let elements = s => { return elements_aux(/* [] */0, s); }; let find = (x, _param) => { @@ -1795,7 +1795,7 @@ let $$Set = { return try_join(l$p, v$p, r$p); } }; - let of_sorted_list = (l) => { + let of_sorted_list = l => { let sub = (n, l) => { switch (n) { case 0 : @@ -1899,7 +1899,7 @@ let $$Set = { }; return sub(List.length(l), l)[0]; }; - let of_list = (l) => { + let of_list = l => { if (!l) { return "Empty"; } diff --git a/lib/js/parsing.js b/lib/js/parsing.js index 902226151ef..6fe73fbeeda 100644 --- a/lib/js/parsing.js +++ b/lib/js/parsing.js @@ -55,7 +55,7 @@ function clear_parser() { } let current_lookahead_fun = { - contents: ((param) => { + contents: (param => { return false; }) }; @@ -145,7 +145,7 @@ function yyparse(tables, start, lexer, lexbuf) { if (exn$1.RE_EXN_ID === YYexit) { return exn$1._1; } - current_lookahead_fun.contents = ((tok) => { + current_lookahead_fun.contents = (tok => { if (typeof tok !== "number") { return Caml_array.get(tables.transl_block, tok.TAG) === curr_char; } else { diff --git a/lib/js/pervasives.js b/lib/js/pervasives.js index 67886f01ca7..a981e2d60f2 100644 --- a/lib/js/pervasives.js +++ b/lib/js/pervasives.js @@ -191,7 +191,7 @@ function print_string(prim) { } let exit_function = { - contents: ((prim) => { + contents: (prim => { }) }; diff --git a/lib/js/random.js b/lib/js/random.js index 907bc10ce53..cbb0df589c2 100644 --- a/lib/js/random.js +++ b/lib/js/random.js @@ -22,7 +22,7 @@ function full_init(s, seed) { let combine = (accu, x) => { return Digest.string(accu + String(x)); }; - let extract = (d) => { + let extract = d => { return ((Caml_string.get(d, 0) + (Caml_string.get(d, 1) << 8) | 0) + (Caml_string.get(d, 2) << 16) | 0) + (Caml_string.get(d, 3) << 24) | 0; }; let seed$1 = seed.length === 0 ? [0] : seed; diff --git a/lib/js/set.js b/lib/js/set.js index 4c1668fbf16..3662ac51be3 100644 --- a/lib/js/set.js +++ b/lib/js/set.js @@ -4,7 +4,7 @@ let List = require("./list.js"); let Caml_option = require("./caml_option.js"); function Make(funarg) { - let height = (param) => { + let height = param => { if (typeof param !== "object") { return 0; } else { @@ -119,7 +119,7 @@ function Make(funarg) { return bal(l, v, rr); } }; - let singleton = (x) => { + let singleton = x => { return { TAG: "Node", l: "Empty", @@ -159,7 +159,7 @@ function Make(funarg) { return create(l, v, r); } }; - let min_elt = (_param) => { + let min_elt = _param => { while (true) { let param = _param; if (typeof param !== "object") { @@ -177,7 +177,7 @@ function Make(funarg) { continue; }; }; - let min_elt_opt = (_param) => { + let min_elt_opt = _param => { while (true) { let param = _param; if (typeof param !== "object") { @@ -191,7 +191,7 @@ function Make(funarg) { continue; }; }; - let max_elt = (_param) => { + let max_elt = _param => { while (true) { let param = _param; if (typeof param !== "object") { @@ -209,7 +209,7 @@ function Make(funarg) { continue; }; }; - let max_elt_opt = (_param) => { + let max_elt_opt = _param => { while (true) { let param = _param; if (typeof param !== "object") { @@ -223,7 +223,7 @@ function Make(funarg) { continue; }; }; - let remove_min_elt = (param) => { + let remove_min_elt = param => { if (typeof param !== "object") { throw new Error("Invalid_argument", { cause: { @@ -282,7 +282,7 @@ function Make(funarg) { match$1[2] ]; }; - let is_empty = (param) => { + let is_empty = param => { if (typeof param !== "object") { return true; } else { @@ -593,7 +593,7 @@ function Make(funarg) { ]; } }; - let cardinal = (param) => { + let cardinal = param => { if (typeof param !== "object") { return 0; } else { @@ -615,7 +615,7 @@ function Make(funarg) { continue; }; }; - let elements = (s) => { + let elements = s => { return elements_aux(/* [] */0, s); }; let find = (x, _param) => { @@ -798,7 +798,7 @@ function Make(funarg) { return union(l$p, add(v$p, r$p)); } }; - let of_list = (l) => { + let of_list = l => { if (!l) { return "Empty"; } diff --git a/lib/js/setLabels.js b/lib/js/setLabels.js index bb9f2ad5ce0..7a2006b5d71 100644 --- a/lib/js/setLabels.js +++ b/lib/js/setLabels.js @@ -4,7 +4,7 @@ let List = require("./list.js"); let Caml_option = require("./caml_option.js"); function Make(Ord) { - let height = (param) => { + let height = param => { if (typeof param !== "object") { return 0; } else { @@ -119,7 +119,7 @@ function Make(Ord) { return bal(l, v, rr); } }; - let singleton = (x) => { + let singleton = x => { return { TAG: "Node", l: "Empty", @@ -159,7 +159,7 @@ function Make(Ord) { return create(l, v, r); } }; - let min_elt = (_param) => { + let min_elt = _param => { while (true) { let param = _param; if (typeof param !== "object") { @@ -177,7 +177,7 @@ function Make(Ord) { continue; }; }; - let min_elt_opt = (_param) => { + let min_elt_opt = _param => { while (true) { let param = _param; if (typeof param !== "object") { @@ -191,7 +191,7 @@ function Make(Ord) { continue; }; }; - let max_elt = (_param) => { + let max_elt = _param => { while (true) { let param = _param; if (typeof param !== "object") { @@ -209,7 +209,7 @@ function Make(Ord) { continue; }; }; - let max_elt_opt = (_param) => { + let max_elt_opt = _param => { while (true) { let param = _param; if (typeof param !== "object") { @@ -223,7 +223,7 @@ function Make(Ord) { continue; }; }; - let remove_min_elt = (param) => { + let remove_min_elt = param => { if (typeof param !== "object") { throw new Error("Invalid_argument", { cause: { @@ -291,7 +291,7 @@ function Make(Ord) { match$1[2] ]; }; - let is_empty = (param) => { + let is_empty = param => { if (typeof param !== "object") { return true; } else { @@ -597,7 +597,7 @@ function Make(Ord) { ]; } }; - let cardinal = (param) => { + let cardinal = param => { if (typeof param !== "object") { return 0; } else { @@ -619,7 +619,7 @@ function Make(Ord) { continue; }; }; - let elements = (s) => { + let elements = s => { return elements_aux(/* [] */0, s); }; let find = (x, _param) => { @@ -811,7 +811,7 @@ function Make(Ord) { return try_join(l$p, v$p, r$p); } }; - let of_sorted_list = (l) => { + let of_sorted_list = l => { let sub = (n, l) => { switch (n) { case 0 : @@ -915,7 +915,7 @@ function Make(Ord) { }; return sub(List.length(l), l)[0]; }; - let of_list = (l) => { + let of_list = l => { if (!l) { return "Empty"; } diff --git a/lib/js/sort.js b/lib/js/sort.js index 4e4679faf07..d4556f5ccda 100644 --- a/lib/js/sort.js +++ b/lib/js/sort.js @@ -24,7 +24,7 @@ function merge(order, l1, l2) { } function list(order, l) { - let initlist = (param) => { + let initlist = param => { if (!param) { return /* [] */0; } @@ -57,7 +57,7 @@ function list(order, l) { tl: initlist(match.tl) }; }; - let merge2 = (param) => { + let merge2 = param => { if (!param) { return param; } diff --git a/lib/js/stream.js b/lib/js/stream.js index 60cce80afe7..eb60504e7e9 100644 --- a/lib/js/stream.js +++ b/lib/js/stream.js @@ -298,7 +298,7 @@ function of_string(s) { let count = { contents: 0 }; - return from((param) => { + return from(param => { let c = count.contents; if (c < s.length) { count.contents = count.contents + 1 | 0; @@ -312,7 +312,7 @@ function of_bytes(s) { let count = { contents: 0 }; - return from((param) => { + return from(param => { let c = count.contents; if (c < s.length) { count.contents = count.contents + 1 | 0; diff --git a/lib/js/string.js b/lib/js/string.js index 20caecfd98f..7a0052196d2 100644 --- a/lib/js/string.js +++ b/lib/js/string.js @@ -55,7 +55,7 @@ function trim(s) { } function escaped(s) { - let needs_escape = (_i) => { + let needs_escape = _i => { while (true) { let i = _i; if (i >= s.length) { diff --git a/lib/js/stringLabels.js b/lib/js/stringLabels.js index 20c6506e582..40f76f7f904 100644 --- a/lib/js/stringLabels.js +++ b/lib/js/stringLabels.js @@ -57,7 +57,7 @@ function trim(s) { } function escaped(s) { - let needs_escape = (_i) => { + let needs_escape = _i => { while (true) { let i = _i; if (i >= s.length) { From d717fa7d9e1ad5e4963c20a34dba4251f19a0781 Mon Sep 17 00:00:00 2001 From: Hyeseong Kim Date: Wed, 21 Aug 2024 04:57:18 +0900 Subject: [PATCH 5/8] skip return clause where possible --- jscomp/core/js_dump.ml | 15 +- .../src/ErrorHandler.res.js | 4 +- .../typescript-react-example/src/Hooks.res.js | 30 +- .../src/ImmutableArray.res.js | 76 +- .../src/ImportJsValue.res.js | 4 +- .../src/Records.res.js | 54 +- .../src/TestPromise.res.js | 8 +- .../src/nested/Tuples.res.js | 8 +- .../src/nested/Types.res.js | 4 +- jscomp/test/Import.js | 10 +- .../test/PartialApplicationNoRuntimeCurry.js | 8 +- jscomp/test/SafePromises.js | 8 +- jscomp/test/UncurriedAlways.js | 4 +- jscomp/test/UncurriedExternals.js | 12 +- jscomp/test/UntaggedVariants.js | 12 +- jscomp/test/a_filename_test.js | 12 +- jscomp/test/a_list_test.js | 124 +- jscomp/test/a_string_test.js | 114 +- jscomp/test/and_or_tailcall_test.js | 24 +- jscomp/test/ari_regress_test.js | 52 +- jscomp/test/arith_parser.js | 8 +- jscomp/test/arity_deopt.js | 24 +- jscomp/test/arity_infer.js | 20 +- jscomp/test/array_data_util.js | 8 +- jscomp/test/array_subtle_test.js | 12 +- jscomp/test/array_test.js | 190 +- jscomp/test/ast_abstract_test.js | 12 +- jscomp/test/async_await.js | 4 +- jscomp/test/async_inline.js | 12 +- jscomp/test/belt_result_alias_test.js | 8 +- jscomp/test/bench.js | 24 +- jscomp/test/bs_abstract_test.js | 8 +- jscomp/test/bs_array_test.js | 200 +- jscomp/test/bs_auto_uncurry.js | 32 +- jscomp/test/bs_auto_uncurry_test.js | 36 +- jscomp/test/bs_hashmap_test.js | 4 +- jscomp/test/bs_ignore_effect.js | 12 +- jscomp/test/bs_list_test.js | 292 +-- jscomp/test/bs_map_set_dict_test.js | 60 +- jscomp/test/bs_map_test.js | 36 +- jscomp/test/bs_mutable_set_test.js | 90 +- jscomp/test/bs_poly_map_test.js | 88 +- jscomp/test/bs_poly_mutable_map_test.js | 18 +- jscomp/test/bs_poly_mutable_set_test.js | 50 +- jscomp/test/bs_poly_set_test.js | 60 +- jscomp/test/bs_queue_test.js | 14 +- jscomp/test/bs_set_int_test.js | 26 +- jscomp/test/bs_sort_test.js | 24 +- jscomp/test/bs_string_test.js | 16 +- jscomp/test/buffer_test.js | 24 +- jscomp/test/bytes_split_gpr_743_test.js | 12 +- jscomp/test/caml_compare_bigint_test.js | 408 ++-- jscomp/test/caml_compare_test.js | 1188 +++++------ jscomp/test/caml_format_test.js | 150 +- jscomp/test/chain_code_test.js | 12 +- jscomp/test/chn_test.js | 12 +- jscomp/test/class_type_ffi_test.js | 4 +- jscomp/test/coercion_module_alias_test.js | 4 +- jscomp/test/complex_if_test.js | 12 +- jscomp/test/complex_test.js | 18 +- jscomp/test/condition_compilation_test.js | 12 +- jscomp/test/cps_test.js | 56 +- jscomp/test/demo_page.js | 8 +- jscomp/test/digest_test.js | 92 +- jscomp/test/div_by_zero_test.js | 108 +- jscomp/test/dollar_escape_test.js | 12 +- jscomp/test/earger_curry_test.js | 44 +- jscomp/test/epsilon_test.js | 24 +- jscomp/test/es6_module_test.js | 36 +- jscomp/test/event_ffi.js | 8 +- jscomp/test/exception_raise_test.js | 32 +- jscomp/test/exception_rebound_err_test.js | 12 +- jscomp/test/ext_array_test.js | 8 +- jscomp/test/ext_bytes_test.js | 8 +- jscomp/test/ext_filename_test.js | 20 +- jscomp/test/ext_list_test.js | 8 +- jscomp/test/ext_string_test.js | 8 +- jscomp/test/extensible_variant_test.js | 58 +- jscomp/test/ffi_arity_test.js | 80 +- jscomp/test/ffi_array_test.js | 16 +- jscomp/test/ffi_js_test.js | 12 +- jscomp/test/ffi_splice_test.js | 12 +- jscomp/test/flexible_array_test.js | 16 +- jscomp/test/float_of_bits_test.js | 48 +- jscomp/test/float_test.js | 64 +- jscomp/test/for_loop_test.js | 184 +- jscomp/test/for_side_effect_test.js | 12 +- jscomp/test/format_test.js | 24 +- jscomp/test/functor_app_test.js | 12 +- jscomp/test/functor_ffi.js | 4 +- jscomp/test/functors.js | 28 +- jscomp/test/genlex_test.js | 50 +- .../test/global_exception_regression_test.js | 24 +- jscomp/test/global_module_alias_test.js | 12 +- jscomp/test/google_closure_test.js | 32 +- jscomp/test/gpr496_test.js | 12 +- jscomp/test/gpr_1154_test.js | 12 +- jscomp/test/gpr_1409_test.js | 16 +- jscomp/test/gpr_1423_app_test.js | 16 +- jscomp/test/gpr_1438.js | 4 +- jscomp/test/gpr_1503_test.js | 12 +- jscomp/test/gpr_1539_test.js | 4 +- jscomp/test/gpr_1658_test.js | 12 +- jscomp/test/gpr_1667_test.js | 12 +- jscomp/test/gpr_1692_test.js | 4 +- jscomp/test/gpr_1716_test.js | 12 +- jscomp/test/gpr_1728_test.js | 12 +- jscomp/test/gpr_1749_test.js | 12 +- jscomp/test/gpr_1760_test.js | 12 +- jscomp/test/gpr_1762_test.js | 12 +- jscomp/test/gpr_1817_test.js | 12 +- jscomp/test/gpr_1822_test.js | 12 +- jscomp/test/gpr_1943_test.js | 12 +- jscomp/test/gpr_2316_test.js | 12 +- jscomp/test/gpr_2487.js | 4 +- jscomp/test/gpr_2608_test.js | 8 +- jscomp/test/gpr_3536_test.js | 8 +- jscomp/test/gpr_3566_test.js | 16 +- jscomp/test/gpr_3697_test.js | 4 +- jscomp/test/gpr_3875_test.js | 4 +- jscomp/test/gpr_4274_test.js | 4 +- jscomp/test/gpr_459_test.js | 12 +- jscomp/test/gpr_858_unit2_test.js | 4 +- jscomp/test/gpr_904_test.js | 12 +- jscomp/test/gpr_977_test.js | 12 +- jscomp/test/hash_test.js | 4 +- jscomp/test/hashtbl_test.js | 76 +- jscomp/test/ignore_test.js | 12 +- jscomp/test/import2.js | 4 +- jscomp/test/import_external.js | 4 +- jscomp/test/import_side_effect.js | 4 +- jscomp/test/import_side_effect_free.js | 4 +- jscomp/test/inline_map2_test.js | 54 +- jscomp/test/inline_map_demo.js | 16 +- jscomp/test/inline_map_test.js | 16 +- jscomp/test/inline_record_test.js | 8 +- jscomp/test/inline_regression_test.js | 16 +- jscomp/test/inner_unused.js | 4 +- jscomp/test/installation_test.js | 12 +- jscomp/test/int32_test.js | 92 +- jscomp/test/int64_mul_div_test.js | 126 +- jscomp/test/int64_test.js | 1774 ++++++++--------- jscomp/test/int_hashtbl_test.js | 92 +- jscomp/test/int_overflow_test.js | 168 +- jscomp/test/int_switch_test.js | 20 +- jscomp/test/js_array_test.js | 1104 +++++----- jscomp/test/js_bool_test.js | 36 +- jscomp/test/js_cast_test.js | 12 +- jscomp/test/js_date_test.js | 306 ++- jscomp/test/js_dict_test.js | 286 ++- jscomp/test/js_exception_catch_test.js | 56 +- jscomp/test/js_float_test.js | 534 +++-- jscomp/test/js_global_test.js | 56 +- jscomp/test/js_int_test.js | 242 +-- jscomp/test/js_json_test.js | 442 ++-- jscomp/test/js_math_test.js | 732 +++---- jscomp/test/js_null_test.js | 112 +- jscomp/test/js_null_undefined_test.js | 228 +-- jscomp/test/js_nullable_test.js | 12 +- jscomp/test/js_obj_test.js | 32 +- jscomp/test/js_option_test.js | 290 ++- jscomp/test/js_re_test.js | 84 +- jscomp/test/js_string_test.js | 660 +++--- jscomp/test/js_undefined_test.js | 112 +- jscomp/test/jsoo_400_test.js | 14 +- jscomp/test/key_word_property_plus_test.js | 16 +- jscomp/test/lazy_demo.js | 4 +- jscomp/test/lazy_test.js | 158 +- jscomp/test/lib_js_test.js | 12 +- jscomp/test/libqueue_test.js | 10 +- jscomp/test/limits_test.js | 12 +- jscomp/test/list_stack.js | 4 +- jscomp/test/list_test.js | 196 +- jscomp/test/loop_regression_test.js | 12 +- jscomp/test/map_find_test.js | 32 +- jscomp/test/map_test.js | 8 +- jscomp/test/mario_game.js | 4 +- jscomp/test/method_name_test.js | 12 +- jscomp/test/module_alias_test.js | 12 +- jscomp/test/module_parameter_test.js | 24 +- jscomp/test/module_splice_test.js | 12 +- jscomp/test/mpr_6033_test.js | 16 +- jscomp/test/mt.js | 50 +- jscomp/test/mt_global.js | 36 +- jscomp/test/mutable_obj_test.js | 10 +- jscomp/test/name_mangle_test.js | 12 +- jscomp/test/obj_literal_ppx.js | 4 +- jscomp/test/obj_magic_test.js | 54 +- jscomp/test/ocaml_re_test.js | 124 +- jscomp/test/of_string_test.js | 36 +- jscomp/test/option_repr_test.js | 28 +- jscomp/test/optional_ffi_test.js | 12 +- jscomp/test/poly_variant_test.js | 12 +- jscomp/test/polymorphic_raw_test.js | 12 +- jscomp/test/ppx_apply_test.js | 12 +- jscomp/test/prepend_data_ffi.js | 16 +- jscomp/test/print_alpha_test.js | 18 +- jscomp/test/queue_test.js | 12 +- jscomp/test/random_test.js | 12 +- jscomp/test/reactTestUtils.js | 16 +- jscomp/test/reasonReact.js | 4 +- jscomp/test/reasonReactRouter.js | 22 +- jscomp/test/rec_fun_test.js | 12 +- jscomp/test/rec_module_test.js | 124 +- jscomp/test/recmodule.js | 28 +- jscomp/test/record_with_test.js | 12 +- jscomp/test/recursive_module.js | 20 +- jscomp/test/recursive_module_test.js | 26 +- jscomp/test/recursive_unbound_module_test.js | 4 +- jscomp/test/res_debug.js | 8 +- jscomp/test/sexp.js | 58 +- jscomp/test/sexpm.js | 68 +- jscomp/test/sexpm_test.js | 12 +- jscomp/test/side_effect2.js | 4 +- jscomp/test/stack_test.js | 26 +- jscomp/test/stream_parser_test.js | 44 +- jscomp/test/string_get_set_test.js | 12 +- jscomp/test/string_runtime_test.js | 16 +- jscomp/test/string_set.js | 4 +- jscomp/test/string_set_test.js | 12 +- jscomp/test/string_test.js | 272 ++- jscomp/test/string_unicode_test.js | 12 +- jscomp/test/switch_case_test.js | 12 +- jscomp/test/tagged_template_test.js | 72 +- jscomp/test/tailcall_inline_test.js | 68 +- jscomp/test/test_closure.js | 8 +- jscomp/test/test_cps.js | 12 +- jscomp/test/test_demo.js | 8 +- jscomp/test/test_for_loop.js | 40 +- jscomp/test/test_google_closure.js | 12 +- jscomp/test/test_int_map_find.js | 4 +- jscomp/test/test_react.js | 8 +- jscomp/test/test_set.js | 28 +- jscomp/test/test_while_closure.js | 8 +- jscomp/test/test_zero_nullable.js | 12 +- jscomp/test/ticker.js | 4 +- jscomp/test/to_string_test.js | 24 +- jscomp/test/topsort_test.js | 22 +- jscomp/test/tramp_fib.js | 22 +- jscomp/test/tuple_alloc.js | 4 +- jscomp/test/typeof_test.js | 152 +- jscomp/test/uncurried_cast.js | 16 +- jscomp/test/uncurry_external_test.js | 12 +- jscomp/test/unsafe_ppx_test.js | 52 +- jscomp/test/update_record_test.js | 12 +- jscomp/test/variant.js | 4 +- lib/es6/arg.js | 4 +- lib/es6/belt_Array.js | 4 +- lib/es6/belt_MapDict.js | 8 +- lib/es6/belt_internalAVLset.js | 4 +- lib/es6/belt_internalAVLtree.js | 4 +- lib/es6/belt_internalBuckets.js | 22 +- lib/es6/belt_internalMapInt.js | 4 +- lib/es6/belt_internalMapString.js | 4 +- lib/es6/belt_internalSetBuckets.js | 4 +- lib/es6/caml_hash.js | 4 +- lib/es6/caml_int64.js | 4 +- lib/es6/caml_obj.js | 24 +- lib/es6/curry.js | 120 +- lib/es6/digest.js | 4 +- lib/es6/genlex.js | 16 +- lib/es6/hashtbl.js | 20 +- lib/es6/hashtblLabels.js | 72 +- lib/es6/lazy.js | 4 +- lib/es6/map.js | 22 +- lib/es6/mapLabels.js | 22 +- lib/es6/moreLabels.js | 50 +- lib/es6/parsing.js | 4 +- lib/es6/pervasives.js | 4 +- lib/es6/random.js | 8 +- lib/es6/set.js | 24 +- lib/es6/setLabels.js | 28 +- lib/es6/stream.js | 60 +- lib/js/arg.js | 4 +- lib/js/belt_Array.js | 4 +- lib/js/belt_MapDict.js | 8 +- lib/js/belt_internalAVLset.js | 4 +- lib/js/belt_internalAVLtree.js | 4 +- lib/js/belt_internalBuckets.js | 22 +- lib/js/belt_internalMapInt.js | 4 +- lib/js/belt_internalMapString.js | 4 +- lib/js/belt_internalSetBuckets.js | 4 +- lib/js/caml_hash.js | 4 +- lib/js/caml_int64.js | 4 +- lib/js/caml_obj.js | 24 +- lib/js/curry.js | 120 +- lib/js/digest.js | 4 +- lib/js/genlex.js | 16 +- lib/js/hashtbl.js | 20 +- lib/js/hashtblLabels.js | 72 +- lib/js/lazy.js | 4 +- lib/js/map.js | 22 +- lib/js/mapLabels.js | 22 +- lib/js/moreLabels.js | 50 +- lib/js/parsing.js | 4 +- lib/js/pervasives.js | 4 +- lib/js/random.js | 8 +- lib/js/set.js | 24 +- lib/js/setLabels.js | 28 +- lib/js/stream.js | 60 +- 300 files changed, 6668 insertions(+), 10019 deletions(-) diff --git a/jscomp/core/js_dump.ml b/jscomp/core/js_dump.ml index 6d52ef7524f..a01bfc0aca0 100644 --- a/jscomp/core/js_dump.ml +++ b/jscomp/core/js_dump.ml @@ -402,7 +402,20 @@ and pp_function ~return_unit ~async ~is_method ~need_paren ?directive cxt (f : P P.string f (L.arrow); P.space f; ); - P.brace_vgroup f 1 (fun _ -> function_body ?directive ~return_unit cxt f b) + match b with + | [ { statement_desc = Return { expression_desc = Undefined _ } } ] + when arrow + -> + P.string f "{"; + P.string f "}"; + + | [ { statement_desc = Return e } ] | [ { statement_desc = Exp e } ] + when arrow && directive == None + -> (if exp_need_paren e then P.paren_group f 0 else P.group f 0) + (fun _ -> ignore (expression ~level:0 cxt f e)) + + | _ -> + P.brace_vgroup f 1 (fun _ -> function_body ?directive ~return_unit cxt f b) in let enclose () = let handle () = diff --git a/jscomp/gentype_tests/typescript-react-example/src/ErrorHandler.res.js b/jscomp/gentype_tests/typescript-react-example/src/ErrorHandler.res.js index 9b6c8d14422..da238ff4d4b 100644 --- a/jscomp/gentype_tests/typescript-react-example/src/ErrorHandler.res.js +++ b/jscomp/gentype_tests/typescript-react-example/src/ErrorHandler.res.js @@ -2,9 +2,7 @@ function Make($$Error) { - let notify = x => { - return $$Error.notification(x); - }; + let notify = x => $$Error.notification(x); return { notify: notify }; diff --git a/jscomp/gentype_tests/typescript-react-example/src/Hooks.res.js b/jscomp/gentype_tests/typescript-react-example/src/Hooks.res.js index 51644f0e304..39155944655 100644 --- a/jscomp/gentype_tests/typescript-react-example/src/Hooks.res.js +++ b/jscomp/gentype_tests/typescript-react-example/src/Hooks.res.js @@ -6,35 +6,25 @@ import * as ImportHookDefault from "./ImportHookDefault.res.js"; function Hooks(Props) { let vehicle = Props.vehicle; - let match = React.useState(() => { - return 0; - }); + let match = React.useState(() => 0); let setCount = match[1]; let count = match[0]; return React.createElement("div", undefined, React.createElement("p", undefined, "Hooks example " + (vehicle.name + (" clicked " + (String(count) + " times")))), React.createElement("button", { - onClick: (param => { - setCount(param => { - return count + 1 | 0; - }); - }) + onClick: (param => setCount(param => count + 1 | 0)) }, "Click me"), React.createElement(ImportHooks.make, { person: { name: "Mary", age: 71 }, children: null, - renderMe: (x => { - return x.randomString; - }) + renderMe: (x => x.randomString) }, "child1", "child2"), React.createElement(ImportHookDefault.make, { person: { name: "DefaultImport", age: 42 }, children: null, - renderMe: (x => { - return x.randomString; - }) + renderMe: (x => x.randomString) }, "child1", "child2")); } @@ -133,15 +123,11 @@ let WithRef = { makeWithRef: Hooks$WithRef$makeWithRef }; -let testForwardRef = React.forwardRef((x, y) => { - return makeWithRef(x.vehicle)(y); -}); +let testForwardRef = React.forwardRef((x, y) => makeWithRef(x.vehicle)(y)); -let input = React.forwardRef((r, ref) => { - return React.createElement("div", { - ref: ref - }, r.x); -}); +let input = React.forwardRef((r, ref) => React.createElement("div", { + ref: ref +}, r.x)); let ForwardRef = { input: input diff --git a/jscomp/gentype_tests/typescript-react-example/src/ImmutableArray.res.js b/jscomp/gentype_tests/typescript-react-example/src/ImmutableArray.res.js index dcfb5a814d2..e7f7da18d88 100644 --- a/jscomp/gentype_tests/typescript-react-example/src/ImmutableArray.res.js +++ b/jscomp/gentype_tests/typescript-react-example/src/ImmutableArray.res.js @@ -51,17 +51,13 @@ let rangeBy = Belt_Array.rangeBy; let makeByU = Belt_Array.makeByU; function makeBy(c, f) { - return Belt_Array.makeBy(c, (x => { - return f(x); - })); + return Belt_Array.makeBy(c, (x => f(x))); } let makeByAndShuffleU = Belt_Array.makeByAndShuffleU; function makeByAndShuffle(c, f) { - return Belt_Array.makeByAndShuffle(c, (x => { - return f(x); - })); + return Belt_Array.makeByAndShuffle(c, (x => f(x))); } let zip = Belt_Array.zip; @@ -69,9 +65,7 @@ let zip = Belt_Array.zip; let zipByU = Belt_Array.zipByU; function zipBy(a1, a2, f) { - return Belt_Array.zipBy(a1, a2, ((x, y) => { - return f(x, y); - })); + return Belt_Array.zipBy(a1, a2, ((x, y) => f(x, y))); } let unzip = Belt_Array.unzip; @@ -91,129 +85,97 @@ function copy(a) { let forEachU = Belt_Array.forEachU; function forEach(a, f) { - Belt_Array.forEach(a, (x => { - f(x); - })); + Belt_Array.forEach(a, (x => f(x))); } let mapU = Belt_Array.mapU; function map(a, f) { - return Belt_Array.map(a, (x => { - return f(x); - })); + return Belt_Array.map(a, (x => f(x))); } let keepWithIndexU = Belt_Array.keepWithIndexU; function keepWithIndex(a, f) { - return Belt_Array.keepWithIndex(a, ((x, y) => { - return f(x, y); - })); + return Belt_Array.keepWithIndex(a, ((x, y) => f(x, y))); } let keepMapU = Belt_Array.keepMapU; function keepMap(a, f) { - return Belt_Array.keepMap(a, (x => { - return f(x); - })); + return Belt_Array.keepMap(a, (x => f(x))); } let forEachWithIndexU = Belt_Array.forEachWithIndexU; function forEachWithIndex(a, f) { - Belt_Array.forEachWithIndex(a, ((x, y) => { - f(x, y); - })); + Belt_Array.forEachWithIndex(a, ((x, y) => f(x, y))); } let mapWithIndexU = Belt_Array.mapWithIndexU; function mapWithIndex(a, f) { - return Belt_Array.mapWithIndex(a, ((x, y) => { - return f(x, y); - })); + return Belt_Array.mapWithIndex(a, ((x, y) => f(x, y))); } let partitionU = Belt_Array.partitionU; function partition(a, f) { - return Belt_Array.partition(a, (x => { - return f(x); - })); + return Belt_Array.partition(a, (x => f(x))); } let reduceU = Belt_Array.reduceU; function reduce(a, b, f) { - return Belt_Array.reduce(a, b, ((x, y) => { - return f(x, y); - })); + return Belt_Array.reduce(a, b, ((x, y) => f(x, y))); } let reduceReverseU = Belt_Array.reduceReverseU; function reduceReverse(a, b, f) { - return Belt_Array.reduceReverse(a, b, ((x, y) => { - return f(x, y); - })); + return Belt_Array.reduceReverse(a, b, ((x, y) => f(x, y))); } let reduceReverse2U = Belt_Array.reduceReverse2U; function reduceReverse2(a1, a2, c, f) { - return Belt_Array.reduceReverse2(a1, a2, c, ((x, y, z) => { - return f(x, y, z); - })); + return Belt_Array.reduceReverse2(a1, a2, c, ((x, y, z) => f(x, y, z))); } let someU = Belt_Array.someU; function some(a, f) { - return Belt_Array.some(a, (x => { - return f(x); - })); + return Belt_Array.some(a, (x => f(x))); } let everyU = Belt_Array.everyU; function every(a, f) { - return Belt_Array.every(a, (x => { - return f(x); - })); + return Belt_Array.every(a, (x => f(x))); } let every2U = Belt_Array.every2U; function every2(a1, a2, f) { - return Belt_Array.every2(a1, a2, ((x, y) => { - return f(x, y); - })); + return Belt_Array.every2(a1, a2, ((x, y) => f(x, y))); } let some2U = Belt_Array.some2U; function some2(a1, a2, f) { - return Belt_Array.some2(a1, a2, ((x, y) => { - return f(x, y); - })); + return Belt_Array.some2(a1, a2, ((x, y) => f(x, y))); } let cmpU = Belt_Array.cmpU; function cmp(a1, a2, f) { - return Belt_Array.cmp(a1, a2, ((x, y) => { - return f(x, y); - })); + return Belt_Array.cmp(a1, a2, ((x, y) => f(x, y))); } let eqU = Belt_Array.eqU; function eq(a1, a2, f) { - return Belt_Array.eq(a1, a2, ((x, y) => { - return f(x, y); - })); + return Belt_Array.eq(a1, a2, ((x, y) => f(x, y))); } let $$Array$1 = { diff --git a/jscomp/gentype_tests/typescript-react-example/src/ImportJsValue.res.js b/jscomp/gentype_tests/typescript-react-example/src/ImportJsValue.res.js index 1adf55b9242..6e617f004d5 100644 --- a/jscomp/gentype_tests/typescript-react-example/src/ImportJsValue.res.js +++ b/jscomp/gentype_tests/typescript-react-example/src/ImportJsValue.res.js @@ -51,9 +51,7 @@ function higherOrder(prim) { return ImportJsValueGen$1.higherOrder(prim); } -let returnedFromHigherOrder = ImportJsValueGen$1.higherOrder((prim0, prim1) => { - return prim0 + prim1 | 0; -}); +let returnedFromHigherOrder = ImportJsValueGen$1.higherOrder((prim0, prim1) => prim0 + prim1 | 0); function convertVariant(prim) { return ImportJsValueGen$1.convertVariant(prim); diff --git a/jscomp/gentype_tests/typescript-react-example/src/Records.res.js b/jscomp/gentype_tests/typescript-react-example/src/Records.res.js index df7c5e02e64..9a7084d7701 100644 --- a/jscomp/gentype_tests/typescript-react-example/src/Records.res.js +++ b/jscomp/gentype_tests/typescript-react-example/src/Records.res.js @@ -6,9 +6,7 @@ import * as Belt_Option from "rescript/lib/es6/belt_Option.js"; import * as Caml_option from "rescript/lib/es6/caml_option.js"; function computeArea(param) { - return Math.imul(Math.imul(param.x, param.y), Belt_Option.mapWithDefault(param.z, 1, (n => { - return n; - }))); + return Math.imul(Math.imul(param.x, param.y), Belt_Option.mapWithDefault(param.z, 1, (n => n))); } function coord2d(x, y) { @@ -22,30 +20,20 @@ function coord2d(x, y) { let getOpt = Belt_Option.mapWithDefault; function findAddress(business) { - return Belt_Option.mapWithDefault(business.address, /* [] */0, (a => { - return { - hd: a, - tl: /* [] */0 - }; - })); + return Belt_Option.mapWithDefault(business.address, /* [] */0, (a => ({ + hd: a, + tl: /* [] */0 + }))); } function findAllAddresses(businesses) { - return Belt_List.toArray(Belt_List.flatten(Belt_List.fromArray(Belt_Array.map(businesses, (business => { - return Belt_List.concat(Belt_Option.mapWithDefault(business.address, /* [] */0, (a => { - return { - hd: a, - tl: /* [] */0 - }; - })), Belt_Option.mapWithDefault(business.owner, /* [] */0, (p => { - return Belt_Option.mapWithDefault(p.address, /* [] */0, (a => { - return { - hd: a, - tl: /* [] */0 - }; - })); - }))); - }))))); + return Belt_List.toArray(Belt_List.flatten(Belt_List.fromArray(Belt_Array.map(businesses, (business => Belt_List.concat(Belt_Option.mapWithDefault(business.address, /* [] */0, (a => ({ + hd: a, + tl: /* [] */0 + }))), Belt_Option.mapWithDefault(business.owner, /* [] */0, (p => Belt_Option.mapWithDefault(p.address, /* [] */0, (a => ({ + hd: a, + tl: /* [] */0 + }))))))))))); } function getPayload(param) { @@ -75,12 +63,10 @@ function getPayloadRecordPlusOne(param) { } function findAddress2(business) { - return Belt_Option.mapWithDefault(Caml_option.nullable_to_opt(business.address2), /* [] */0, (a => { - return { - hd: a, - tl: /* [] */0 - }; - })); + return Belt_Option.mapWithDefault(Caml_option.nullable_to_opt(business.address2), /* [] */0, (a => ({ + hd: a, + tl: /* [] */0 + }))); } let someBusiness2_owner = null; @@ -94,15 +80,11 @@ let someBusiness2 = { }; function computeArea3(o) { - return Math.imul(Math.imul(o.x, o.y), Belt_Option.mapWithDefault(Caml_option.nullable_to_opt(o.z), 1, (n => { - return n; - }))); + return Math.imul(Math.imul(o.x, o.y), Belt_Option.mapWithDefault(Caml_option.nullable_to_opt(o.z), 1, (n => n))); } function computeArea4(o) { - return Math.imul(Math.imul(o.x, o.y), Belt_Option.mapWithDefault(o.z, 1, (n => { - return n; - }))); + return Math.imul(Math.imul(o.x, o.y), Belt_Option.mapWithDefault(o.z, 1, (n => n))); } function testMyRec(x) { diff --git a/jscomp/gentype_tests/typescript-react-example/src/TestPromise.res.js b/jscomp/gentype_tests/typescript-react-example/src/TestPromise.res.js index 3a1b1dacbc1..ddbae407af3 100644 --- a/jscomp/gentype_tests/typescript-react-example/src/TestPromise.res.js +++ b/jscomp/gentype_tests/typescript-react-example/src/TestPromise.res.js @@ -5,11 +5,9 @@ import * as Js_promise from "rescript/lib/es6/js_promise.js"; import * as Caml_option from "rescript/lib/es6/caml_option.js"; function convert(p) { - return Js_promise.then_((param => { - return Promise.resolve({ - result: param.s - }); - }), p); + return Js_promise.then_((param => Promise.resolve({ + result: param.s + })), p); } function barx(xOpt, param) { diff --git a/jscomp/gentype_tests/typescript-react-example/src/nested/Tuples.res.js b/jscomp/gentype_tests/typescript-react-example/src/nested/Tuples.res.js index 0beaac87fec..63527fc787d 100644 --- a/jscomp/gentype_tests/typescript-react-example/src/nested/Tuples.res.js +++ b/jscomp/gentype_tests/typescript-react-example/src/nested/Tuples.res.js @@ -7,15 +7,11 @@ function testTuple(param) { } function computeArea(param) { - return Math.imul(Math.imul(param[0], param[1]), Belt_Option.mapWithDefault(param[2], 1, (n => { - return n; - }))); + return Math.imul(Math.imul(param[0], param[1]), Belt_Option.mapWithDefault(param[2], 1, (n => n))); } function computeAreaWithIdent(param) { - return Math.imul(Math.imul(param[0], param[1]), Belt_Option.mapWithDefault(param[2], 1, (n => { - return n; - }))); + return Math.imul(Math.imul(param[0], param[1]), Belt_Option.mapWithDefault(param[2], 1, (n => n))); } function computeAreaNoConverters(param) { diff --git a/jscomp/gentype_tests/typescript-react-example/src/nested/Types.res.js b/jscomp/gentype_tests/typescript-react-example/src/nested/Types.res.js index 6c59cc6b332..3b1def4885a 100644 --- a/jscomp/gentype_tests/typescript-react-example/src/nested/Types.res.js +++ b/jscomp/gentype_tests/typescript-react-example/src/nested/Types.res.js @@ -57,9 +57,7 @@ function testInstantiateTypeParameter(x) { let currentTime = new Date(); -let optFunction = (() => { - return 3; -}); +let optFunction = (() => 3); let ObjectId = {}; diff --git a/jscomp/test/Import.js b/jscomp/test/Import.js index 7b250960b08..bc3190de151 100644 --- a/jscomp/test/Import.js +++ b/jscomp/test/Import.js @@ -3,17 +3,11 @@ async function eachIntAsync(list, f) { - return (await import("../../lib/js/belt_List.js").then(m => { - return m.forEach; - }))(list, f); + return (await import("../../lib/js/belt_List.js").then(m => m.forEach))(list, f); } function eachIntLazy(list, f) { - return import("../../lib/js/belt_List.js").then(m => { - return m.forEach; - }).then(each => { - return Promise.resolve(each(list, f)); - }); + return import("../../lib/js/belt_List.js").then(m => m.forEach).then(each => Promise.resolve(each(list, f))); } eachIntLazy({ diff --git a/jscomp/test/PartialApplicationNoRuntimeCurry.js b/jscomp/test/PartialApplicationNoRuntimeCurry.js index 385f6cc36a5..1a69368f5f6 100644 --- a/jscomp/test/PartialApplicationNoRuntimeCurry.js +++ b/jscomp/test/PartialApplicationNoRuntimeCurry.js @@ -3,16 +3,12 @@ function add(x) { - return (y, z) => { - return (x + y | 0) + z | 0; - }; + return (y, z) => (x + y | 0) + z | 0; } function f(u) { let f$1 = add(u); - return extra => { - return f$1(1, extra); - }; + return extra => f$1(1, extra); } exports.add = add; diff --git a/jscomp/test/SafePromises.js b/jscomp/test/SafePromises.js index d97fb8ef1de..1d6bf5dec81 100644 --- a/jscomp/test/SafePromises.js +++ b/jscomp/test/SafePromises.js @@ -5,16 +5,12 @@ let Js_promise2 = require("../../lib/js/js_promise2.js"); async function nestedPromise(xxx) { let xx = await xxx; - Js_promise2.then(xx, (x => { - return Promise.resolve((console.log("Promise2.then", x), undefined)); - })); + Js_promise2.then(xx, (x => Promise.resolve((console.log("Promise2.then", x), undefined)))); Js_promise2.$$catch(xx, (x => { console.log("Promise2.catch_", x); return Promise.resolve(0); })); - xx.then(x => { - return Promise.resolve((console.log("Promise.then_", x), undefined)); - }); + xx.then(x => Promise.resolve((console.log("Promise.then_", x), undefined))); } async function create(x) { diff --git a/jscomp/test/UncurriedAlways.js b/jscomp/test/UncurriedAlways.js index 9ea002f7c7d..601d3bfe3af 100644 --- a/jscomp/test/UncurriedAlways.js +++ b/jscomp/test/UncurriedAlways.js @@ -20,9 +20,7 @@ let a = 7; console.log(a); -[1].map(x => { - return x + 1 | 0; -}); +[1].map(x => x + 1 | 0); function ptl(extra) { return 10 + extra | 0; diff --git a/jscomp/test/UncurriedExternals.js b/jscomp/test/UncurriedExternals.js index 9ffb5d3d0cf..4d44e40dcaa 100644 --- a/jscomp/test/UncurriedExternals.js +++ b/jscomp/test/UncurriedExternals.js @@ -14,9 +14,7 @@ function dd() { let h = sum(1.0, 2.0); let M = { - sum: ((prim0, prim1) => { - return sum(prim0, prim1); - }) + sum: ((prim0, prim1) => sum(prim0, prim1)) }; let hh = M.sum(1.0, 2.0); @@ -49,9 +47,7 @@ function tsiU(c) { }); } -let match = React.useState(() => { - return 3; -}); +let match = React.useState(() => 3); let StandardNotation_get = match[0]; @@ -75,9 +71,7 @@ let StandardNotation = { function methodWithAsync() { let $$this = this ; - return async arg => { - return $$this + arg | 0; - }; + return async arg => $$this + arg | 0; } exports.StandardNotation = StandardNotation; diff --git a/jscomp/test/UntaggedVariants.js b/jscomp/test/UntaggedVariants.js index 0435531e4b0..399d6a5ca48 100644 --- a/jscomp/test/UntaggedVariants.js +++ b/jscomp/test/UntaggedVariants.js @@ -367,9 +367,7 @@ function classify$9(v) { } } -let ff = (x => { - return x + 1 | 0; -}); +let ff = (x => x + 1 | 0); let TestFunctionCase = { classify: classify$9, @@ -488,9 +486,7 @@ async function classify$10(a) { return; } else { if (Array.isArray(a)) { - console.log(Belt_Array.joinWith(a, "-", (x => { - return x; - }))); + console.log(Belt_Array.joinWith(a, "-", (x => x))); return; } if (a instanceof Promise) { @@ -514,9 +510,7 @@ let Arr = { async function classifyAll(t) { if (Array.isArray(t)) { - console.log(Belt_Array.joinWith(t, "-", (x => { - return x; - }))); + console.log(Belt_Array.joinWith(t, "-", (x => x))); return; } if (t instanceof Promise) { diff --git a/jscomp/test/a_filename_test.js b/jscomp/test/a_filename_test.js index bf31d4354f4..1acd60ec615 100644 --- a/jscomp/test/a_filename_test.js +++ b/jscomp/test/a_filename_test.js @@ -18,13 +18,11 @@ function eq(loc, x, y) { suites.contents = { hd: [ loc + (" id " + String(test_id.contents)), - (() => { - return { - TAG: "Eq", - _0: x, - _1: y - }; - }) + (() => ({ + TAG: "Eq", + _0: x, + _1: y + })) ], tl: suites.contents }; diff --git a/jscomp/test/a_list_test.js b/jscomp/test/a_list_test.js index 678e8e54e8d..bc2560ebc12 100644 --- a/jscomp/test/a_list_test.js +++ b/jscomp/test/a_list_test.js @@ -6,99 +6,93 @@ let Ext_list_test = require("./ext_list_test.js"); let suites_0 = [ "drop", - (param => { - return { - TAG: "Eq", - _0: Ext_list_test.drop(3, { - hd: 0, + (param => ({ + TAG: "Eq", + _0: Ext_list_test.drop(3, { + hd: 0, + tl: { + hd: 1, tl: { - hd: 1, - tl: { - hd: 2, - tl: /* [] */0 - } + hd: 2, + tl: /* [] */0 } - }), - _1: /* [] */0 - }; - }) + } + }), + _1: /* [] */0 + })) ]; let suites_1 = { hd: [ "drop1", - (param => { - return { - TAG: "Eq", - _0: Ext_list_test.drop(2, { - hd: 0, + (param => ({ + TAG: "Eq", + _0: Ext_list_test.drop(2, { + hd: 0, + tl: { + hd: 1, tl: { - hd: 1, - tl: { - hd: 2, - tl: /* [] */0 - } + hd: 2, + tl: /* [] */0 } - }), - _1: { - hd: 2, - tl: /* [] */0 } - }; - }) + }), + _1: { + hd: 2, + tl: /* [] */0 + } + })) ], tl: { hd: [ "flat_map", - (param => { - return { - TAG: "Eq", - _0: { + (param => ({ + TAG: "Eq", + _0: { + hd: 0, + tl: { hd: 0, tl: { - hd: 0, + hd: 1, tl: { hd: 1, tl: { - hd: 1, - tl: { - hd: 0, - tl: /* [] */0 - } + hd: 0, + tl: /* [] */0 } } } - }, - _1: Ext_list_test.flat_map((x => { - if (x % 2 === 0) { - return { - hd: 0, - tl: /* [] */0 - }; - } else { - return { + } + }, + _1: Ext_list_test.flat_map((x => { + if (x % 2 === 0) { + return { + hd: 0, + tl: /* [] */0 + }; + } else { + return { + hd: 1, + tl: { hd: 1, - tl: { - hd: 1, - tl: /* [] */0 - } - }; - } - }), { + tl: /* [] */0 + } + }; + } + }), { + hd: 0, + tl: { hd: 0, tl: { - hd: 0, + hd: 3, tl: { - hd: 3, - tl: { - hd: 0, - tl: /* [] */0 - } + hd: 0, + tl: /* [] */0 } } - }) - }; - }) + } + }) + })) ], tl: /* [] */0 } diff --git a/jscomp/test/a_string_test.js b/jscomp/test/a_string_test.js index 0be90ebc3b0..159d973ba30 100644 --- a/jscomp/test/a_string_test.js +++ b/jscomp/test/a_string_test.js @@ -7,102 +7,90 @@ let Ext_string_test = require("./ext_string_test.js"); let suites_0 = [ "split", - (param => { - return { - TAG: "Eq", - _0: Ext_string_test.split(true, "hihi", /* 'i' */105), - _1: { + (param => ({ + TAG: "Eq", + _0: Ext_string_test.split(true, "hihi", /* 'i' */105), + _1: { + hd: "h", + tl: { hd: "h", tl: { - hd: "h", - tl: { - hd: "", - tl: /* [] */0 - } + hd: "", + tl: /* [] */0 } } - }; - }) + } + })) ]; let suites_1 = { hd: [ "split_non_empty", - (param => { - return { - TAG: "Eq", - _0: Ext_string_test.split(undefined, "hihi", /* 'i' */105), - _1: { + (param => ({ + TAG: "Eq", + _0: Ext_string_test.split(undefined, "hihi", /* 'i' */105), + _1: { + hd: "h", + tl: { hd: "h", - tl: { - hd: "h", - tl: /* [] */0 - } + tl: /* [] */0 } - }; - }) + } + })) ], tl: { hd: [ "split_empty", - (param => { - return { - TAG: "Eq", - _0: Ext_string_test.split(true, "", /* 'i' */105), - _1: /* [] */0 - }; - }) + (param => ({ + TAG: "Eq", + _0: Ext_string_test.split(true, "", /* 'i' */105), + _1: /* [] */0 + })) ], tl: { hd: [ "split_normal", - (param => { - return { - TAG: "Eq", - _0: Ext_string_test.split(true, "h i i", /* ' ' */32), - _1: { - hd: "h", + (param => ({ + TAG: "Eq", + _0: Ext_string_test.split(true, "h i i", /* ' ' */32), + _1: { + hd: "h", + tl: { + hd: "i", tl: { hd: "i", - tl: { - hd: "i", - tl: /* [] */0 - } + tl: /* [] */0 } } - }; - }) + } + })) ], tl: { hd: [ "split_by", - (param => { - return { - TAG: "Eq", - _0: List.filter((s => { - return s !== ""; - }), Ext_string_test.split_by(undefined, (x => { - if (x === /* ' ' */32) { - return true; - } else { - return x === /* '\t' */9; - } - }), "h hgso hgso \t hi")), - _1: { - hd: "h", + (param => ({ + TAG: "Eq", + _0: List.filter((s => s !== ""), Ext_string_test.split_by(undefined, (x => { + if (x === /* ' ' */32) { + return true; + } else { + return x === /* '\t' */9; + } + }), "h hgso hgso \t hi")), + _1: { + hd: "h", + tl: { + hd: "hgso", tl: { hd: "hgso", tl: { - hd: "hgso", - tl: { - hd: "hi", - tl: /* [] */0 - } + hd: "hi", + tl: /* [] */0 } } } - }; - }) + } + })) ], tl: /* [] */0 } diff --git a/jscomp/test/and_or_tailcall_test.js b/jscomp/test/and_or_tailcall_test.js index db53a2bc3a2..a5352f2c0a9 100644 --- a/jscomp/test/and_or_tailcall_test.js +++ b/jscomp/test/and_or_tailcall_test.js @@ -33,25 +33,21 @@ function or_f(b, x, _n) { let suites_0 = [ "and_tail", - (param => { - return { - TAG: "Eq", - _0: false, - _1: f(true, 1, 0) - }; - }) + (param => ({ + TAG: "Eq", + _0: false, + _1: f(true, 1, 0) + })) ]; let suites_1 = { hd: [ "or_tail", - (param => { - return { - TAG: "Eq", - _0: false, - _1: or_f(false, 1, 0) - }; - }) + (param => ({ + TAG: "Eq", + _0: false, + _1: or_f(false, 1, 0) + })) ], tl: /* [] */0 }; diff --git a/jscomp/test/ari_regress_test.js b/jscomp/test/ari_regress_test.js index a0a8de3331b..089dd39d88e 100644 --- a/jscomp/test/ari_regress_test.js +++ b/jscomp/test/ari_regress_test.js @@ -12,9 +12,7 @@ let h = { function g1(x, y) { let u = x + y | 0; h.contents = h.contents + 1 | 0; - return (xx, yy) => { - return (xx + yy | 0) + u | 0; - }; + return (xx, yy) => (xx + yy | 0) + u | 0; } let u = 8; @@ -27,47 +25,39 @@ function v(__x) { let suites_0 = [ "curry", - (param => { - return { - TAG: "Eq", - _0: g, - _1: 7 - }; - }) + (param => ({ + TAG: "Eq", + _0: g, + _1: 7 + })) ]; let suites_1 = { hd: [ "curry2", - (param => { - return { - TAG: "Eq", - _0: 14, - _1: (v(1), v(1)) - }; - }) + (param => ({ + TAG: "Eq", + _0: 14, + _1: (v(1), v(1)) + })) ], tl: { hd: [ "curry3", - (param => { - return { - TAG: "Eq", - _0: x, - _1: 14 - }; - }) + (param => ({ + TAG: "Eq", + _0: x, + _1: 14 + })) ], tl: { hd: [ "File \"ari_regress_test.res\", line 35, characters 5-12", - (param => { - return { - TAG: "Eq", - _0: h.contents, - _1: 2 - }; - }) + (param => ({ + TAG: "Eq", + _0: h.contents, + _1: 2 + })) ], tl: /* [] */0 } diff --git a/jscomp/test/arith_parser.js b/jscomp/test/arith_parser.js index 7da412c6d77..c13f393f534 100644 --- a/jscomp/test/arith_parser.js +++ b/jscomp/test/arith_parser.js @@ -147,9 +147,7 @@ let yyact = [ } }); }), - (__caml_parser_env => { - return Parsing.peek_val(__caml_parser_env, 1); - }), + (__caml_parser_env => Parsing.peek_val(__caml_parser_env, 1)), (__caml_parser_env => { let _1 = Parsing.peek_val(__caml_parser_env, 0); return { @@ -207,9 +205,7 @@ let yyact = [ _0: _2 }; }), - (__caml_parser_env => { - return Parsing.peek_val(__caml_parser_env, 1); - }), + (__caml_parser_env => Parsing.peek_val(__caml_parser_env, 1)), (__caml_parser_env => { throw new Error(Parsing.YYexit, { cause: { diff --git a/jscomp/test/arity_deopt.js b/jscomp/test/arity_deopt.js index cedaca47b5a..aefb476f331 100644 --- a/jscomp/test/arity_deopt.js +++ b/jscomp/test/arity_deopt.js @@ -16,13 +16,11 @@ function eq(loc, x, y) { suites.contents = { hd: [ loc + (" id " + String(test_id.contents)), - (() => { - return { - TAG: "Eq", - _0: x, - _1: y - }; - }) + (() => ({ + TAG: "Eq", + _0: x, + _1: y + })) ], tl: suites.contents }; @@ -33,21 +31,15 @@ function f0(x, y, z) { } function f1(x) { - return (y, z) => { - return (x + y | 0) + z | 0; - }; + return (y, z) => (x + y | 0) + z | 0; } function f2(x, y) { - return z => { - return (x + y | 0) + z | 0; - }; + return z => (x + y | 0) + z | 0; } function f3(x) { - return (y, z) => { - return (x + y | 0) + z | 0; - }; + return (y, z) => (x + y | 0) + z | 0; } eq("File \"arity_deopt.res\", line 47, characters 11-18", 6, 6); diff --git a/jscomp/test/arity_infer.js b/jscomp/test/arity_infer.js index 58055009250..87b96264a46 100644 --- a/jscomp/test/arity_infer.js +++ b/jscomp/test/arity_infer.js @@ -5,9 +5,7 @@ function f0(x) { let tmp; if (x > 3) { - tmp = (x => { - return x + 1 | 0; - }); + tmp = (x => x + 1 | 0); } else { throw new Error("Not_found", { cause: { @@ -31,24 +29,16 @@ function f3(x) { let tmp; switch (x) { case 0 : - tmp = (x => { - return x + 1 | 0; - }); + tmp = (x => x + 1 | 0); break; case 1 : - tmp = (x => { - return x + 2 | 0; - }); + tmp = (x => x + 2 | 0); break; case 2 : - tmp = (x => { - return x + 3 | 0; - }); + tmp = (x => x + 3 | 0); break; case 3 : - tmp = (x => { - return x + 4 | 0; - }); + tmp = (x => x + 4 | 0); break; default: throw new Error("Not_found", { diff --git a/jscomp/test/array_data_util.js b/jscomp/test/array_data_util.js index 8fb5c1bcdb3..ff74d0ad4af 100644 --- a/jscomp/test/array_data_util.js +++ b/jscomp/test/array_data_util.js @@ -4,15 +4,11 @@ let Belt_Array = require("../../lib/js/belt_Array.js"); function range(i, j) { - return Belt_Array.makeBy((j - i | 0) + 1 | 0, (k => { - return k + i | 0; - })); + return Belt_Array.makeBy((j - i | 0) + 1 | 0, (k => k + i | 0)); } function randomRange(i, j) { - let v = Belt_Array.makeBy((j - i | 0) + 1 | 0, (k => { - return k + i | 0; - })); + let v = Belt_Array.makeBy((j - i | 0) + 1 | 0, (k => k + i | 0)); Belt_Array.shuffleInPlace(v); return v; } diff --git a/jscomp/test/array_subtle_test.js b/jscomp/test/array_subtle_test.js index 84f7ab3f9ee..f94d4bc6432 100644 --- a/jscomp/test/array_subtle_test.js +++ b/jscomp/test/array_subtle_test.js @@ -19,13 +19,11 @@ function eq(loc, param) { suites.contents = { hd: [ loc + (" id " + String(test_id.contents)), - (() => { - return { - TAG: "Eq", - _0: x, - _1: y - }; - }) + (() => ({ + TAG: "Eq", + _0: x, + _1: y + })) ], tl: suites.contents }; diff --git a/jscomp/test/array_test.js b/jscomp/test/array_test.js index 11076a9d069..53b64b07281 100644 --- a/jscomp/test/array_test.js +++ b/jscomp/test/array_test.js @@ -58,38 +58,30 @@ function is_sorted(x) { let array_suites_0 = [ "init", - (param => { - return { - TAG: "Eq", - _0: $$Array.init(5, (x => { - return x; - })), - _1: [ - 0, - 1, - 2, - 3, - 4 - ] - }; - }) + (param => ({ + TAG: "Eq", + _0: $$Array.init(5, (x => x)), + _1: [ + 0, + 1, + 2, + 3, + 4 + ] + })) ]; let array_suites_1 = { hd: [ "toList", (param => { - let aux = xs => { - return List.fold_left(((acc, param) => { - return { - hd: [ - $$Array.to_list(param[0]), - param[1] - ], - tl: acc - }; - }), /* [] */0, xs); - }; + let aux = xs => List.fold_left(((acc, param) => ({ + hd: [ + $$Array.to_list(param[0]), + param[1] + ], + tl: acc + })), /* [] */0, xs); let match = List.split(aux({ hd: [ [], @@ -107,80 +99,70 @@ let array_suites_1 = { tl: { hd: [ "concat", - (param => { - return { - TAG: "Eq", - _0: [ + (param => ({ + TAG: "Eq", + _0: [ + 0, + 1, + 2, + 3, + 4, + 5 + ], + _1: Caml_array.concat({ + hd: [ 0, 1, - 2, - 3, - 4, - 5 + 2 ], - _1: Caml_array.concat({ + tl: { hd: [ - 0, - 1, - 2 + 3, + 4 ], tl: { - hd: [ - 3, - 4 - ], + hd: [], tl: { - hd: [], - tl: { - hd: [5], - tl: /* [] */0 - } + hd: [5], + tl: /* [] */0 } } - }) - }; - }) + } + }) + })) ], tl: { hd: [ "make", - (param => { - return { - TAG: "Eq", - _0: [ - Caml_array.make(100, /* 'a' */97), - Caml_array.make_float(100) - ], - _1: [ - $$Array.init(100, (param => { - return /* 'a' */97; - })), - $$Array.init(100, (param => { - return 0; - })) - ] - }; - }) + (param => ({ + TAG: "Eq", + _0: [ + Caml_array.make(100, /* 'a' */97), + Caml_array.make_float(100) + ], + _1: [ + $$Array.init(100, (param => /* 'a' */97)), + $$Array.init(100, (param => 0)) + ] + })) ], tl: { hd: [ "sub", - (param => { - return { - TAG: "Eq", - _0: $$Array.sub([ - 0, - 1, - 2, - 3, - 4 - ], 2, 2), - _1: [ - 2, - 3 - ] - }; - }) + (param => ({ + TAG: "Eq", + _0: $$Array.sub([ + 0, + 1, + 2, + 3, + 4 + ], 2, 2), + _1: [ + 2, + 3 + ] + })) ], tl: { hd: [ @@ -191,9 +173,7 @@ let array_suites_1 = { 0, 0 ]; - let v = $$Array.init(3, (x => { - return (x << 1); - })); + let v = $$Array.init(3, (x => (x << 1))); $$Array.blit(v, 1, u, 1, 2); return { TAG: "Eq", @@ -220,9 +200,7 @@ let array_suites_1 = { hd: [ "File \"array_test.res\", line 75, characters 8-15", (param => { - let a0 = $$Array.init(100, (i => { - return (i << 0); - })); + let a0 = $$Array.init(100, (i => (i << 0))); $$Array.blit(a0, 10, a0, 5, 20); return { TAG: "Eq", @@ -252,9 +230,7 @@ let array_suites_1 = { 26, 27, 28 - ], ((prim0, prim1) => { - return prim0 === prim1; - })) + ], ((prim0, prim1) => prim0 === prim1)) }; }) ], @@ -262,9 +238,7 @@ let array_suites_1 = { hd: [ "File \"array_test.res\", line 118, characters 8-15", (param => { - let a0 = $$Array.init(100, (i => { - return (i << 0); - })); + let a0 = $$Array.init(100, (i => (i << 0))); $$Array.blit(a0, 5, a0, 10, 20); return { TAG: "Eq", @@ -296,25 +270,21 @@ let array_suites_1 = { 18, 19, 20 - ], ((prim0, prim1) => { - return prim0 === prim1; - })) + ], ((prim0, prim1) => prim0 === prim1)) }; }) ], tl: { hd: [ "make", - (param => { - return { - TAG: "Eq", - _0: Caml_array.make(2, 1), - _1: [ - 1, - 1 - ] - }; - }) + (param => ({ + TAG: "Eq", + _0: Caml_array.make(2, 1), + _1: [ + 1, + 1 + ] + })) ], tl: { hd: [ @@ -341,9 +311,7 @@ let array_suites_1 = { hd: [ "sort_large", (param => { - let v = $$Array.init(4, (i => { - return i % 17; - })); + let v = $$Array.init(4, (i => i % 17)); $$Array.sort(Caml.int_compare, v); return { TAG: "Eq", diff --git a/jscomp/test/ast_abstract_test.js b/jscomp/test/ast_abstract_test.js index 9acc7fa5cf3..d3fd140d208 100644 --- a/jscomp/test/ast_abstract_test.js +++ b/jscomp/test/ast_abstract_test.js @@ -17,13 +17,11 @@ function eq(loc, x, y) { suites.contents = { hd: [ loc + (" id " + String(test_id.contents)), - (() => { - return { - TAG: "Eq", - _0: x, - _1: y - }; - }) + (() => ({ + TAG: "Eq", + _0: x, + _1: y + })) ], tl: suites.contents }; diff --git a/jscomp/test/async_await.js b/jscomp/test/async_await.js index 748bb18cc85..3bdca2ae5dc 100644 --- a/jscomp/test/async_await.js +++ b/jscomp/test/async_await.js @@ -12,9 +12,7 @@ async function useNext() { } function Make(I) { - let get = async key => { - return await I.get(key); - }; + let get = async key => await I.get(key); return { get: get }; diff --git a/jscomp/test/async_inline.js b/jscomp/test/async_inline.js index c45d110ef9d..247e22bdffd 100644 --- a/jscomp/test/async_inline.js +++ b/jscomp/test/async_inline.js @@ -64,21 +64,15 @@ let tui = 3; let tuia = uncurriedIdAsync(3); function nested1() { - return async y => { - return await y; - }; + return async y => await y; } async function nested2() { - return async y => { - return await y; - }; + return async y => await y; } function onSubmit() { - return React.useCallback(async b => { - return await b; - }); + return React.useCallback(async b => await b); } exports.willBeInlined = willBeInlined; diff --git a/jscomp/test/belt_result_alias_test.js b/jscomp/test/belt_result_alias_test.js index d8bd1771cf1..a8d01baab6d 100644 --- a/jscomp/test/belt_result_alias_test.js +++ b/jscomp/test/belt_result_alias_test.js @@ -6,15 +6,11 @@ let Belt_Result = require("../../lib/js/belt_Result.js"); Belt_Result.map({ TAG: "Ok", _0: "Test" -}, (r => { - return "Value: " + r; -})); +}, (r => "Value: " + r)); Belt_Result.getWithDefault(Belt_Result.map({ TAG: "Error", _0: "error" -}, (r => { - return "Value: " + r; -})), "success"); +}, (r => "Value: " + r)), "success"); /* Not a pure module */ diff --git a/jscomp/test/bench.js b/jscomp/test/bench.js index facbe613f44..6fcee9bdb5e 100644 --- a/jscomp/test/bench.js +++ b/jscomp/test/bench.js @@ -5,9 +5,7 @@ let Caml_array = require("../../lib/js/caml_array.js"); let Pervasives = require("../../lib/js/pervasives.js"); function map(f, a) { - let f$1 = x => { - return f(x); - }; + let f$1 = x => f(x); let l = a.length; if (l === 0) { return []; @@ -20,9 +18,7 @@ function map(f, a) { } function init(l, f) { - let f$1 = x => { - return f(x); - }; + let f$1 = x => f(x); if (l === 0) { return []; } @@ -42,9 +38,7 @@ function init(l, f) { } function fold_left(f, x, a) { - let f$1 = (x, y) => { - return f(x, y); - }; + let f$1 = (x, y) => f(x, y); let r = x; for (let i = 0, i_finish = a.length; i < i_finish; ++i) { r = f$1(r, a[i]); @@ -53,15 +47,9 @@ function fold_left(f, x, a) { } function f2() { - let arr = init(3000000, (i => { - return i; - })); - let b = map((i => { - return i + i - 1; - }), arr); - let v = fold_left(((prim0, prim1) => { - return prim0 + prim1; - }), 0, b); + let arr = init(3000000, (i => i)); + let b = map((i => i + i - 1), arr); + let v = fold_left(((prim0, prim1) => prim0 + prim1), 0, b); console.log(Pervasives.string_of_float(v)); } diff --git a/jscomp/test/bs_abstract_test.js b/jscomp/test/bs_abstract_test.js index 4b9a341ad9e..000d990d458 100644 --- a/jscomp/test/bs_abstract_test.js +++ b/jscomp/test/bs_abstract_test.js @@ -10,9 +10,7 @@ let v = { v.tl = v; let f = { - k: ((x, y) => { - return x === y; - }), + k: ((x, y) => x === y), y: "x" }; @@ -21,9 +19,7 @@ function uf(u) { } function uf1(u) { - return extra => { - return u.y1(1, extra); - }; + return extra => u.y1(1, extra); } function uf2(u) { diff --git a/jscomp/test/bs_array_test.js b/jscomp/test/bs_array_test.js index 7ed476ea94b..81a93b18953 100644 --- a/jscomp/test/bs_array_test.js +++ b/jscomp/test/bs_array_test.js @@ -32,13 +32,11 @@ function neq(loc, x, y) { suites.contents = { hd: [ loc + (" id " + String(test_id.contents)), - (() => { - return { - TAG: "Neq", - _0: x, - _1: y - }; - }) + (() => ({ + TAG: "Neq", + _0: x, + _1: y + })) ], tl: suites.contents }; @@ -53,13 +51,7 @@ console.log([ 2, 3, 4 -].filter(x => { - return x > 2; -}).map((x, i) => { - return x + i | 0; -}).reduce(((x, y) => { - return x + y | 0; -}), 0)); +].filter(x => x > 2).map((x, i) => x + i | 0).reduce(((x, y) => x + y | 0), 0)); let v = [ 1, @@ -109,19 +101,15 @@ b("File \"bs_array_test.res\", line 38, characters 4-11", Caml_obj.equal([ 1 ])); -$$throw("File \"bs_array_test.res\", line 44, characters 8-15", (() => { - Belt_Array.setExn([ - 0, - 1 - ], -1, 0); -})); +$$throw("File \"bs_array_test.res\", line 44, characters 8-15", (() => Belt_Array.setExn([ + 0, + 1 +], -1, 0))); -$$throw("File \"bs_array_test.res\", line 45, characters 8-15", (() => { - Belt_Array.setExn([ - 0, - 1 - ], 2, 0); -})); +$$throw("File \"bs_array_test.res\", line 45, characters 8-15", (() => Belt_Array.setExn([ + 0, + 1 +], 2, 0))); b("File \"bs_array_test.res\", line 46, characters 4-11", !Belt_Array.set([ 1, @@ -186,9 +174,7 @@ function add(x, y) { return x + y | 0; } -let v$5 = Belt_Array.makeBy(3000, (i => { - return i; -})); +let v$5 = Belt_Array.makeBy(3000, (i => i)); let u = Belt_Array.shuffle(v$5); @@ -232,34 +218,26 @@ b("File \"bs_array_test.res\", line 101, characters 4-11", Caml_obj.equal(Belt_A b("File \"bs_array_test.res\", line 102, characters 4-11", Caml_obj.equal(Belt_Array.rangeBy(3, 3, 1), [3])); -eq("File \"bs_array_test.res\", line 106, characters 5-12", Belt_Array.reduceReverse([], 100, ((prim0, prim1) => { - return prim0 - prim1 | 0; -})), 100); +eq("File \"bs_array_test.res\", line 106, characters 5-12", Belt_Array.reduceReverse([], 100, ((prim0, prim1) => prim0 - prim1 | 0)), 100); eq("File \"bs_array_test.res\", line 107, characters 5-12", Belt_Array.reduceReverse([ 1, 2 -], 100, ((prim0, prim1) => { - return prim0 - prim1 | 0; -})), 97); +], 100, ((prim0, prim1) => prim0 - prim1 | 0)), 97); eq("File \"bs_array_test.res\", line 108, characters 5-12", Belt_Array.reduceReverse([ 1, 2, 3, 4 -], 100, ((prim0, prim1) => { - return prim0 - prim1 | 0; -})), 90); +], 100, ((prim0, prim1) => prim0 - prim1 | 0)), 90); eq("File \"bs_array_test.res\", line 109, characters 5-12", Belt_Array.reduceWithIndex([ 1, 2, 3, 4 -], 0, ((acc, x, i) => { - return (acc + x | 0) + i | 0; -})), 16); +], 0, ((acc, x, i) => (acc + x | 0) + i | 0)), 16); b("File \"bs_array_test.res\", line 110, characters 4-11", Belt_Array.reduceReverse2([ 1, @@ -268,9 +246,7 @@ b("File \"bs_array_test.res\", line 110, characters 4-11", Belt_Array.reduceReve ], [ 1, 2 -], 0, ((acc, x, y) => { - return (acc + x | 0) + y | 0; -})) === 6); +], 0, ((acc, x, y) => (acc + x | 0) + y | 0)) === 6); function addone(x) { return x + 1 | 0; @@ -300,13 +276,9 @@ function makeMatrixExn(sx, sy, init) { return res; } -eq("File \"bs_array_test.res\", line 129, characters 5-12", Belt_Array.makeBy(0, (param => { - return 1; -})), []); +eq("File \"bs_array_test.res\", line 129, characters 5-12", Belt_Array.makeBy(0, (param => 1)), []); -eq("File \"bs_array_test.res\", line 130, characters 5-12", Belt_Array.makeBy(3, (i => { - return i; -})), [ +eq("File \"bs_array_test.res\", line 130, characters 5-12", Belt_Array.makeBy(3, (i => i)), [ 0, 1, 2 @@ -345,9 +317,7 @@ eq("File \"bs_array_test.res\", line 134, characters 5-12", makeMatrixExn(1, 1, eq("File \"bs_array_test.res\", line 135, characters 5-12", [].slice(0), []); -eq("File \"bs_array_test.res\", line 136, characters 5-12", Belt_Array.map([], (prim => { - return prim + 1 | 0; -})), []); +eq("File \"bs_array_test.res\", line 136, characters 5-12", Belt_Array.map([], (prim => prim + 1 | 0)), []); eq("File \"bs_array_test.res\", line 137, characters 5-12", Belt_Array.mapWithIndex([], add), []); @@ -387,9 +357,7 @@ eq("File \"bs_array_test.res\", line 142, characters 5-12", Belt_Array.map([ 1, 2, 3 -], (prim => { - return prim + 1 | 0; -})), [ +], (prim => prim + 1 | 0)), [ 2, 3, 4 @@ -428,17 +396,11 @@ eq("File \"bs_array_test.res\", line 146, characters 5-12", Belt_List.toArray({ 3 ]); -let v$6 = Belt_Array.makeBy(10, (i => { - return i; -})); +let v$6 = Belt_Array.makeBy(10, (i => i)); -let v0 = Belt_Array.keep(v$6, (x => { - return x % 2 === 0; -})); +let v0 = Belt_Array.keep(v$6, (x => x % 2 === 0)); -let v1 = Belt_Array.keep(v$6, (x => { - return x % 3 === 0; -})); +let v1 = Belt_Array.keep(v$6, (x => x % 3 === 0)); let v2 = Belt_Array.keepMap(v$6, (x => { if (x % 2 === 0) { @@ -478,9 +440,7 @@ let a = [ 5 ]; -let match = Belt_Array.partition(a, (x => { - return x % 2 === 0; -})); +let match = Belt_Array.partition(a, (x => x % 2 === 0)); eq("File \"bs_array_test.res\", line 168, characters 5-12", match[0], [ 2, @@ -493,9 +453,7 @@ eq("File \"bs_array_test.res\", line 169, characters 5-12", match[1], [ 5 ]); -let match$1 = Belt_Array.partition(a, (x => { - return x === 2; -})); +let match$1 = Belt_Array.partition(a, (x => x === 2)); eq("File \"bs_array_test.res\", line 171, characters 5-12", match$1[0], [2]); @@ -506,9 +464,7 @@ eq("File \"bs_array_test.res\", line 172, characters 5-12", match$1[1], [ 5 ]); -let match$2 = Belt_Array.partition([], (x => { - return false; -})); +let match$2 = Belt_Array.partition([], (x => false)); eq("File \"bs_array_test.res\", line 174, characters 5-12", match$2[0], []); @@ -633,9 +589,7 @@ eq("File \"bs_array_test.res\", line 205, characters 5-12", Belt_Array.sliceToEn eq("File \"bs_array_test.res\", line 206, characters 5-12", Belt_Array.sliceToEnd(a$2, 6), []); -let a$3 = Belt_Array.makeBy(10, (x => { - return x; -})); +let a$3 = Belt_Array.makeBy(10, (x => x)); Belt_Array.fill(a$3, 0, 3, 0); @@ -802,9 +756,7 @@ eq("File \"bs_array_test.res\", line 236, characters 5-12", b$1, [ 3 ]); -let a0 = Belt_Array.makeBy(10, (x => { - return x; -})); +let a0 = Belt_Array.makeBy(10, (x => x)); let b0 = Belt_Array.make(10, 3); @@ -876,9 +828,7 @@ Belt_Array.blit(a0, -11, b0, -11, 2); eq("File \"bs_array_test.res\", line 253, characters 5-12", b0.slice(0), a0); -let aa = Belt_Array.makeBy(10, (x => { - return x; -})); +let aa = Belt_Array.makeBy(10, (x => x)); Belt_Array.blit(aa, -1, aa, 1, 2); @@ -1015,9 +965,7 @@ eq("File \"bs_array_test.res\", line 273, characters 5-12", Belt_Array.zipBy([ 1, 2, 3 -], ((prim0, prim1) => { - return prim0 - prim1 | 0; -})), [ +], ((prim0, prim1) => prim0 - prim1 | 0)), [ 1, 1, 1 @@ -1032,15 +980,11 @@ eq("File \"bs_array_test.res\", line 274, characters 5-12", Belt_Array.zipBy([ 3, 4, 1 -], ((prim0, prim1) => { - return prim0 - prim1 | 0; -})), Belt_Array.map([ +], ((prim0, prim1) => prim0 - prim1 | 0)), Belt_Array.map([ 1, 1, 1 -], (x => { - return -x | 0; -}))); +], (x => -x | 0))); eq("File \"bs_array_test.res\", line 275, characters 5-12", Belt_Array.unzip([ [ @@ -1092,33 +1036,25 @@ b("File \"bs_array_test.res\", line 288, characters 4-11", !Belt_Array.every([ 2, 3, 4 -], (x => { - return x > 2; -}))); +], (x => x > 2))); b("File \"bs_array_test.res\", line 289, characters 4-11", Belt_Array.some([ 1, 3, 7, 8 -], (x => { - return x % 2 === 0; -}))); +], (x => x % 2 === 0))); b("File \"bs_array_test.res\", line 290, characters 4-11", !Belt_Array.some([ 1, 3, 7 -], (x => { - return x % 2 === 0; -}))); +], (x => x % 2 === 0))); b("File \"bs_array_test.res\", line 291, characters 4-11", !Belt_Array.eq([ 0, 1 -], [1], ((prim0, prim1) => { - return prim0 === prim1; -}))); +], [1], ((prim0, prim1) => prim0 === prim1))); let c$1 = { contents: 0 @@ -1170,9 +1106,7 @@ function some2(xs, ys, x) { eq("File \"bs_array_test.res\", line 326, characters 5-12", every2(/* [] */0, { hd: 1, tl: /* [] */0 -}, ((x, y) => { - return x > y; -})), true); +}, ((x, y) => x > y)), true); eq("File \"bs_array_test.res\", line 327, characters 5-12", every2({ hd: 2, @@ -1183,9 +1117,7 @@ eq("File \"bs_array_test.res\", line 327, characters 5-12", every2({ }, { hd: 1, tl: /* [] */0 -}, ((x, y) => { - return x > y; -})), true); +}, ((x, y) => x > y)), true); eq("File \"bs_array_test.res\", line 328, characters 5-12", every2({ hd: 2, @@ -1193,9 +1125,7 @@ eq("File \"bs_array_test.res\", line 328, characters 5-12", every2({ }, { hd: 1, tl: /* [] */0 -}, ((x, y) => { - return x > y; -})), true); +}, ((x, y) => x > y)), true); eq("File \"bs_array_test.res\", line 329, characters 5-12", every2({ hd: 2, @@ -1209,9 +1139,7 @@ eq("File \"bs_array_test.res\", line 329, characters 5-12", every2({ hd: 4, tl: /* [] */0 } -}, ((x, y) => { - return x > y; -})), false); +}, ((x, y) => x > y)), false); eq("File \"bs_array_test.res\", line 330, characters 5-12", every2({ hd: 2, @@ -1225,16 +1153,12 @@ eq("File \"bs_array_test.res\", line 330, characters 5-12", every2({ hd: 0, tl: /* [] */0 } -}, ((x, y) => { - return x > y; -})), true); +}, ((x, y) => x > y)), true); eq("File \"bs_array_test.res\", line 331, characters 5-12", some2(/* [] */0, { hd: 1, tl: /* [] */0 -}, ((x, y) => { - return x > y; -})), false); +}, ((x, y) => x > y)), false); eq("File \"bs_array_test.res\", line 332, characters 5-12", some2({ hd: 2, @@ -1245,9 +1169,7 @@ eq("File \"bs_array_test.res\", line 332, characters 5-12", some2({ }, { hd: 1, tl: /* [] */0 -}, ((x, y) => { - return x > y; -})), true); +}, ((x, y) => x > y)), true); eq("File \"bs_array_test.res\", line 333, characters 5-12", some2({ hd: 2, @@ -1261,9 +1183,7 @@ eq("File \"bs_array_test.res\", line 333, characters 5-12", some2({ hd: 4, tl: /* [] */0 } -}, ((x, y) => { - return x > y; -})), true); +}, ((x, y) => x > y)), true); eq("File \"bs_array_test.res\", line 334, characters 5-12", some2({ hd: 0, @@ -1277,9 +1197,7 @@ eq("File \"bs_array_test.res\", line 334, characters 5-12", some2({ hd: 4, tl: /* [] */0 } -}, ((x, y) => { - return x > y; -})), false); +}, ((x, y) => x > y)), false); eq("File \"bs_array_test.res\", line 335, characters 5-12", some2({ hd: 0, @@ -1293,9 +1211,7 @@ eq("File \"bs_array_test.res\", line 335, characters 5-12", some2({ hd: 2, tl: /* [] */0 } -}, ((x, y) => { - return x > y; -})), true); +}, ((x, y) => x > y)), true); eq("File \"bs_array_test.res\", line 339, characters 5-12", Belt_Array.concat([], [ 1, @@ -1446,33 +1362,25 @@ eq("File \"bs_array_test.res\", line 357, characters 5-12", Belt_Array.getBy([ 1, 2, 3 -], (x => { - return x > 1; -})), 2); +], (x => x > 1)), 2); eq("File \"bs_array_test.res\", line 358, characters 5-12", Belt_Array.getBy([ 1, 2, 3 -], (x => { - return x > 3; -})), undefined); +], (x => x > 3)), undefined); eq("File \"bs_array_test.res\", line 362, characters 5-12", Belt_Array.getIndexBy([ 1, 2, 3 -], (x => { - return x > 1; -})), 1); +], (x => x > 1)), 1); eq("File \"bs_array_test.res\", line 363, characters 5-12", Belt_Array.getIndexBy([ 1, 2, 3 -], (x => { - return x > 3; -})), undefined); +], (x => x > 3)), undefined); let arr = []; diff --git a/jscomp/test/bs_auto_uncurry.js b/jscomp/test/bs_auto_uncurry.js index 52d88d14bed..29bf2d44b06 100644 --- a/jscomp/test/bs_auto_uncurry.js +++ b/jscomp/test/bs_auto_uncurry.js @@ -12,9 +12,7 @@ let xbs = Array.prototype.map.call([ 2, 3, 5 -], (x => { - return x + 1 | 0; -})); +], (x => x + 1 | 0)); function f(cb) { return Array.prototype.map.call([ @@ -38,14 +36,10 @@ let xs = Array.prototype.map.call([ 2, 1 ] -], (param => { - return (param[1] + param[0] | 0) + 1 | 0; -})); +], (param => (param[1] + param[0] | 0) + 1 | 0)); function f_0() { - return hi(() => { - - }); + return hi(() => {}); } function f_01() { @@ -78,33 +72,23 @@ function h1(x, y, u, z) { } function add3(x) { - return (y, z) => { - return (x + y | 0) + z | 0; - }; + return (y, z) => (x + y | 0) + z | 0; } function h2(x) { - return ff(x, ((prim0, prim1) => { - return prim0 + prim1 | 0; - })); + return ff(x, ((prim0, prim1) => prim0 + prim1 | 0)); } function h3(x) { - return ff(x, ((y, z) => { - return (1 + y | 0) + z | 0; - })); + return ff(x, ((y, z) => (1 + y | 0) + z | 0)); } function h4(x) { - return ff1(x, 3, ((y, z) => { - return (1 + y | 0) + z | 0; - })); + return ff1(x, 3, ((y, z) => (1 + y | 0) + z | 0)); } function h5(x) { - return ff2(x, "3", ((y, z) => { - return (2 + y | 0) + z | 0; - })); + return ff2(x, "3", ((y, z) => (2 + y | 0) + z | 0)); } function add(x, y) { diff --git a/jscomp/test/bs_auto_uncurry_test.js b/jscomp/test/bs_auto_uncurry_test.js index f2b31f6d436..d53f97dcf56 100644 --- a/jscomp/test/bs_auto_uncurry_test.js +++ b/jscomp/test/bs_auto_uncurry_test.js @@ -16,13 +16,11 @@ function eq(loc, x, y) { suites.contents = { hd: [ loc + (" id " + String(test_id.contents)), - (() => { - return { - TAG: "Eq", - _0: x, - _1: y - }; - }) + (() => ({ + TAG: "Eq", + _0: x, + _1: y + })) ], tl: suites.contents }; @@ -64,9 +62,7 @@ eq("File \"bs_auto_uncurry_test.res\", line 28, characters 5-12", [ 1, 2, 3 -].map(x => { - return x + 1 | 0; -}), [ +].map(x => x + 1 | 0), [ 2, 3, 4 @@ -76,9 +72,7 @@ eq("File \"bs_auto_uncurry_test.res\", line 29, characters 5-12", [ 1, 2, 3 -].map(x => { - return x + 1 | 0; -}), [ +].map(x => x + 1 | 0), [ 2, 3, 4 @@ -88,33 +82,25 @@ eq("File \"bs_auto_uncurry_test.res\", line 31, characters 5-12", [ 1, 2, 3 -].reduce(((prim0, prim1) => { - return prim0 + prim1 | 0; -}), 0), 6); +].reduce(((prim0, prim1) => prim0 + prim1 | 0), 0), 6); eq("File \"bs_auto_uncurry_test.res\", line 33, characters 5-12", [ 1, 2, 3 -].reduce(((x, y, i) => { - return (x + y | 0) + i | 0; -}), 0), 9); +].reduce(((x, y, i) => (x + y | 0) + i | 0), 0), 9); eq("File \"bs_auto_uncurry_test.res\", line 35, characters 5-12", [ 1, 2, 3 -].some(x => { - return x < 1; -}), false); +].some(x => x < 1), false); eq("File \"bs_auto_uncurry_test.res\", line 37, characters 5-12", [ 1, 2, 3 -].every(x => { - return x > 0; -}), true); +].every(x => x > 0), true); Mt.from_pair_suites("Bs_auto_uncurry_test", suites.contents); diff --git a/jscomp/test/bs_hashmap_test.js b/jscomp/test/bs_hashmap_test.js index 22849363487..6f395f89a52 100644 --- a/jscomp/test/bs_hashmap_test.js +++ b/jscomp/test/bs_hashmap_test.js @@ -98,9 +98,7 @@ for (let i$1 = 0; i$1 <= 2000; ++i$1) { eqx("File \"bs_hashmap_test.res\", line 57, characters 6-13", v$1.size, 98000); -b("File \"bs_hashmap_test.res\", line 58, characters 4-11", Belt_Array.every(Array_data_util.range(2001, 100000), (x => { - return Belt_HashMap.has(v$1, x); -}))); +b("File \"bs_hashmap_test.res\", line 58, characters 4-11", Belt_Array.every(Array_data_util.range(2001, 100000), (x => Belt_HashMap.has(v$1, x)))); Mt.from_pair_suites("Bs_hashmap_test", suites.contents); diff --git a/jscomp/test/bs_ignore_effect.js b/jscomp/test/bs_ignore_effect.js index 835d0222a16..37d1e9bd5c3 100644 --- a/jscomp/test/bs_ignore_effect.js +++ b/jscomp/test/bs_ignore_effect.js @@ -16,13 +16,11 @@ function eq(loc, x, y) { suites.contents = { hd: [ loc + (" id " + String(test_id.contents)), - (() => { - return { - TAG: "Eq", - _0: x, - _1: y - }; - }) + (() => ({ + TAG: "Eq", + _0: x, + _1: y + })) ], tl: suites.contents }; diff --git a/jscomp/test/bs_list_test.js b/jscomp/test/bs_list_test.js index af9de56cd7d..aa2a480c9a4 100644 --- a/jscomp/test/bs_list_test.js +++ b/jscomp/test/bs_list_test.js @@ -47,9 +47,7 @@ function sum2(xs, ys) { return v.contents; } -let u = Belt_List.makeBy(5, (i => { - return Math.imul(i, i); -})); +let u = Belt_List.makeBy(5, (i => Math.imul(i, i))); function f(i) { eq("File \"bs_list_test.res\", line 27, characters 18-25", Belt_List.getExn(u, i), Math.imul(i, i)); @@ -59,9 +57,7 @@ for (let i = 0; i <= 4; ++i) { f(i); } -eq("File \"bs_list_test.res\", line 31, characters 5-12", Belt_List.map(u, (i => { - return i + 1 | 0; -})), { +eq("File \"bs_list_test.res\", line 31, characters 5-12", Belt_List.map(u, (i => i + 1 | 0)), { hd: 1, tl: { hd: 2, @@ -90,9 +86,7 @@ eq("File \"bs_list_test.res\", line 32, characters 5-12", Belt_List.getBy({ } } } -}, (x => { - return x % 2 === 0; -})), 4); +}, (x => x % 2 === 0)), 4); eq("File \"bs_list_test.res\", line 33, characters 5-12", Belt_List.getBy({ hd: 1, @@ -106,9 +100,7 @@ eq("File \"bs_list_test.res\", line 33, characters 5-12", Belt_List.getBy({ } } } -}, (x => { - return x % 5 === 0; -})), undefined); +}, (x => x % 5 === 0)), undefined); eq("FLATTEN", Belt_List.flatten({ hd: { @@ -128,9 +120,7 @@ eq("FLATTEN", Belt_List.flatten({ tl: { hd: /* [] */0, tl: { - hd: Belt_List.makeBy(4, (i => { - return i; - })), + hd: Belt_List.makeBy(4, (i => i)), tl: /* [] */0 } } @@ -213,9 +203,7 @@ eq("CONCATMANY", Belt_List.concatMany([ tl: /* [] */0 }, /* [] */0, - Belt_List.makeBy(4, (i => { - return i; - })) + Belt_List.makeBy(4, (i => i)) ]), { hd: 1, tl: { @@ -321,15 +309,7 @@ eq("CONCATMANY", Belt_List.concatMany([{ } }); -eq("File \"bs_list_test.res\", line 66, characters 2-9", Belt_List.toArray(Belt_List.concat(Belt_List.makeBy(100, (i => { - return i; -})), Belt_List.makeBy(100, (i => { - return i; -})))), Belt_Array.concat(Belt_Array.makeBy(100, (i => { - return i; -})), Belt_Array.makeBy(100, (i => { - return i; -})))); +eq("File \"bs_list_test.res\", line 66, characters 2-9", Belt_List.toArray(Belt_List.concat(Belt_List.makeBy(100, (i => i)), Belt_List.makeBy(100, (i => i)))), Belt_Array.concat(Belt_Array.makeBy(100, (i => i)), Belt_Array.makeBy(100, (i => i)))); eq("APPEND", Belt_List.concat({ hd: 1, @@ -522,9 +502,7 @@ eq("PARTITION", Belt_List.partition({ } } } -}, (x => { - return !mod2(x); -})), [ +}, (x => !mod2(x))), [ /* [] */0, { hd: 2, @@ -726,9 +704,7 @@ function id(x) { return x; } -eq("MAP", Belt_List.map(Belt_List.makeBy(5, id), (x => { - return (x << 1); -})), { +eq("MAP", Belt_List.map(Belt_List.makeBy(5, id), (x => (x << 1))), { hd: 0, tl: { hd: 2, @@ -750,9 +726,7 @@ eq("MAP", Belt_List.map(/* [] */0, id), /* [] */0); eq("MAP", Belt_List.map({ hd: 1, tl: /* [] */0 -}, (x => { - return -x | 0; -})), { +}, (x => -x | 0)), { hd: -1, tl: /* [] */0 }); @@ -765,9 +739,7 @@ let length_10_id = Belt_List.makeBy(10, id); let length_8_id = Belt_List.makeBy(8, id); -let d = Belt_List.makeBy(10, (x => { - return (x << 1); -})); +let d = Belt_List.makeBy(10, (x => (x << 1))); eq("MAP2", Belt_List.zipBy(length_10_id, length_10_id, add), d); @@ -783,9 +755,7 @@ eq("MAP2", Belt_List.zipBy({ eq("MAP2", Belt_List.zipBy(/* [] */0, /* [] */0, add), /* [] */0); -eq("MAP2", Belt_List.zipBy(length_10_id, length_10_id, add), Belt_List.concat(Belt_List.map(length_8_id, (x => { - return (x << 1); -})), { +eq("MAP2", Belt_List.zipBy(length_10_id, length_10_id, add), Belt_List.concat(Belt_List.map(length_8_id, (x => (x << 1))), { hd: 16, tl: { hd: 18, @@ -793,13 +763,9 @@ eq("MAP2", Belt_List.zipBy(length_10_id, length_10_id, add), Belt_List.concat(Be } })); -eq("MAP2", Belt_List.zipBy(length_10_id, length_8_id, add), Belt_List.mapWithIndex(length_8_id, ((i, x) => { - return i + x | 0; -}))); +eq("MAP2", Belt_List.zipBy(length_10_id, length_8_id, add), Belt_List.mapWithIndex(length_8_id, ((i, x) => i + x | 0))); -eq("MAP2", Belt_List.reverse(Belt_List.mapReverse2(length_10_id, length_10_id, add)), Belt_List.map(length_10_id, (x => { - return (x << 1); -}))); +eq("MAP2", Belt_List.reverse(Belt_List.mapReverse2(length_10_id, length_10_id, add)), Belt_List.map(length_10_id, (x => (x << 1)))); let xs = Belt_List.reverse(Belt_List.mapReverse2(length_8_id, length_10_id, add)); @@ -822,9 +788,7 @@ eq("MAP2", Belt_List.mapReverse2({ hd: 2, tl: /* [] */0 } -}, ((x, y) => { - return x + y | 0; -})), { +}, ((x, y) => x + y | 0)), { hd: 4, tl: { hd: 2, @@ -1017,9 +981,7 @@ b("File \"bs_list_test.res\", line 205, characters 4-11", Belt_List.hasAssoc({ tl: /* [] */0 } } -}, 2, ((prim0, prim1) => { - return prim0 === prim1; -}))); +}, 2, ((prim0, prim1) => prim0 === prim1))); b("File \"bs_list_test.res\", line 206, characters 4-11", !Belt_List.hasAssoc({ hd: [ @@ -1039,9 +1001,7 @@ b("File \"bs_list_test.res\", line 206, characters 4-11", !Belt_List.hasAssoc({ tl: /* [] */0 } } -}, 4, ((prim0, prim1) => { - return prim0 === prim1; -}))); +}, 4, ((prim0, prim1) => prim0 === prim1))); b("File \"bs_list_test.res\", line 207, characters 4-11", Belt_List.hasAssoc({ hd: [ @@ -1061,9 +1021,7 @@ b("File \"bs_list_test.res\", line 207, characters 4-11", Belt_List.hasAssoc({ tl: /* [] */0 } } -}, 4, ((x, y) => { - return (x + 1 | 0) === y; -}))); +}, 4, ((x, y) => (x + 1 | 0) === y))); eq("REMOVEASSOQ", Belt_List.removeAssoc({ hd: [ @@ -1083,9 +1041,7 @@ eq("REMOVEASSOQ", Belt_List.removeAssoc({ tl: /* [] */0 } } -}, 3, ((prim0, prim1) => { - return prim0 === prim1; -})), { +}, 3, ((prim0, prim1) => prim0 === prim1)), { hd: [ 1, "1" @@ -1117,9 +1073,7 @@ eq("REMOVEASSOQ", Belt_List.removeAssoc({ tl: /* [] */0 } } -}, 1, ((prim0, prim1) => { - return prim0 === prim1; -})), { +}, 1, ((prim0, prim1) => prim0 === prim1)), { hd: [ 2, "2" @@ -1151,9 +1105,7 @@ eq("REMOVEASSOQ", Belt_List.removeAssoc({ tl: /* [] */0 } } -}, 2, ((prim0, prim1) => { - return prim0 === prim1; -})), { +}, 2, ((prim0, prim1) => prim0 === prim1)), { hd: [ 1, "1" @@ -1185,9 +1137,7 @@ eq("REMOVEASSOQ", Belt_List.removeAssoc({ tl: /* [] */0 } } -}, 0, ((prim0, prim1) => { - return prim0 === prim1; -})), { +}, 0, ((prim0, prim1) => prim0 === prim1)), { hd: [ 1, "1" @@ -1329,9 +1279,7 @@ let ll0 = Belt_List.removeAssoc(ll, 0, eqx); b("File \"bs_list_test.res\", line 222, characters 4-11", ll === ll0); -let ll1 = Belt_List.setAssoc(ll, 2, "22", ((prim0, prim1) => { - return prim0 === prim1; -})); +let ll1 = Belt_List.setAssoc(ll, 2, "22", ((prim0, prim1) => prim0 === prim1)); eq("File \"bs_list_test.res\", line 224, characters 5-12", ll1, { hd: [ @@ -1353,9 +1301,7 @@ eq("File \"bs_list_test.res\", line 224, characters 5-12", ll1, { } }); -let ll2 = Belt_List.setAssoc(ll1, 22, "2", ((prim0, prim1) => { - return prim0 === prim1; -})); +let ll2 = Belt_List.setAssoc(ll1, 22, "2", ((prim0, prim1) => prim0 === prim1)); b("File \"bs_list_test.res\", line 226, characters 4-11", Caml_obj.equal(ll2, { hd: [ @@ -1385,9 +1331,7 @@ b("File \"bs_list_test.res\", line 229, characters 4-11", Caml_obj.equal(Belt_Li tl: /* [] */0 } } -}, 2, "x", ((prim0, prim1) => { - return prim0 === prim1; -})), { +}, 2, "x", ((prim0, prim1) => prim0 === prim1)), { hd: [ 1, "a" @@ -1419,9 +1363,7 @@ b("File \"bs_list_test.res\", line 234, characters 4-11", Caml_obj.equal(Belt_Li ], tl: /* [] */0 } -}, 2, "2", ((prim0, prim1) => { - return prim0 === prim1; -})), { +}, 2, "2", ((prim0, prim1) => prim0 === prim1)), { hd: [ 2, "2" @@ -1441,9 +1383,7 @@ b("File \"bs_list_test.res\", line 234, characters 4-11", Caml_obj.equal(Belt_Li } })); -eq("File \"bs_list_test.res\", line 237, characters 5-12", Belt_List.setAssoc(/* [] */0, 1, "1", ((prim0, prim1) => { - return prim0 === prim1; -})), { +eq("File \"bs_list_test.res\", line 237, characters 5-12", Belt_List.setAssoc(/* [] */0, 1, "1", ((prim0, prim1) => prim0 === prim1)), { hd: [ 1, "1" @@ -1459,9 +1399,7 @@ eq("File \"bs_list_test.res\", line 239, characters 5-12", Belt_List.setAssoc({ "2" ], tl: /* [] */0 -}, 1, "1", ((prim0, prim1) => { - return prim0 === prim1; -})), { +}, 1, "1", ((prim0, prim1) => prim0 === prim1)), { hd: [ 1, "1" @@ -1481,9 +1419,7 @@ eq("File \"bs_list_test.res\", line 241, characters 5-12", Belt_List.setAssoc({ ], tl: /* [] */0 } -}, 1, "1", ((prim0, prim1) => { - return prim0 === prim1; -})), { +}, 1, "1", ((prim0, prim1) => prim0 === prim1)), { hd: [ 0, "0" @@ -1515,9 +1451,7 @@ b("File \"bs_list_test.res\", line 242, characters 4-11", Caml_obj.equal(Belt_Li tl: /* [] */0 } } -}, 2, ((prim0, prim1) => { - return prim0 === prim1; -})), "b")); +}, 2, ((prim0, prim1) => prim0 === prim1)), "b")); b("File \"bs_list_test.res\", line 243, characters 4-11", Belt_List.getAssoc({ hd: [ @@ -1537,9 +1471,7 @@ b("File \"bs_list_test.res\", line 243, characters 4-11", Belt_List.getAssoc({ tl: /* [] */0 } } -}, 4, ((prim0, prim1) => { - return prim0 === prim1; -})) === undefined); +}, 4, ((prim0, prim1) => prim0 === prim1)) === undefined); eq("File \"bs_list_test.res\", line 248, characters 4-11", [ Belt_List.head(length_10_id), @@ -1551,9 +1483,7 @@ eq("File \"bs_list_test.res\", line 248, characters 4-11", [ eq("File \"bs_list_test.res\", line 255, characters 5-12", Belt_List.head(/* [] */0), undefined); -$$throw("File \"bs_list_test.res\", line 256, characters 8-15", (() => { - Belt_List.headExn(/* [] */0); -})); +$$throw("File \"bs_list_test.res\", line 256, characters 8-15", (() => Belt_List.headExn(/* [] */0))); $$throw("File \"bs_list_test.res\", line 257, characters 8-15", (() => { Belt_List.tailExn(/* [] */0); @@ -1585,15 +1515,13 @@ eq("File \"bs_list_test.res\", line 260, characters 5-12", Belt_List.map({ hd: 1, tl: /* [] */0 } -}, (i => { - return Belt_List.getExn({ - hd: 0, - tl: { - hd: 1, - tl: /* [] */0 - } - }, i); -})), { +}, (i => Belt_List.getExn({ + hd: 0, + tl: { + hd: 1, + tl: /* [] */0 + } +}, i))), { hd: 0, tl: { hd: 1, @@ -1611,17 +1539,13 @@ eq("File \"bs_list_test.res\", line 262, characters 5-12", Belt_List.tailExn({ tl: /* [] */0 }), /* [] */0); -Belt_List.forEachWithIndex(length_10_id, ((i, x) => { - eq("File \"bs_list_test.res\", line 263, characters 48-55", Belt_List.get(length_10_id, i), x); -})); +Belt_List.forEachWithIndex(length_10_id, ((i, x) => eq("File \"bs_list_test.res\", line 263, characters 48-55", Belt_List.get(length_10_id, i), x))); eq("File \"bs_list_test.res\", line 264, characters 5-12", Belt_List.tail(/* [] */0), undefined); eq("File \"bs_list_test.res\", line 265, characters 5-12", Belt_List.drop(/* [] */0, 3), undefined); -eq("File \"bs_list_test.res\", line 266, characters 5-12", Belt_List.mapWithIndex(/* [] */0, ((i, x) => { - return i + x | 0; -})), /* [] */0); +eq("File \"bs_list_test.res\", line 266, characters 5-12", Belt_List.mapWithIndex(/* [] */0, ((i, x) => i + x | 0)), /* [] */0); eq("File \"bs_list_test.res\", line 267, characters 5-12", Belt_List.get(length_10_id, -1), undefined); @@ -1645,11 +1569,7 @@ eq("File \"bs_list_test.res\", line 290, characters 5-12", Belt_List.reduce(leng eq("File \"bs_list_test.res\", line 291, characters 5-12", Belt_List.reduceReverse(length_10_id, 0, add), 45); -eq("File \"bs_list_test.res\", line 292, characters 5-12", Belt_List.reduceReverse(Belt_List.makeBy(10000, (i => { - return i; -})), 0, ((prim0, prim1) => { - return prim0 + prim1 | 0; -})), 49995000); +eq("File \"bs_list_test.res\", line 292, characters 5-12", Belt_List.reduceReverse(Belt_List.makeBy(10000, (i => i)), 0, ((prim0, prim1) => prim0 + prim1 | 0)), 49995000); eq("File \"bs_list_test.res\", line 295, characters 5-12", sum2(length_10_id, length_10_id), 90); @@ -1657,9 +1577,7 @@ eq("File \"bs_list_test.res\", line 296, characters 5-12", sum2(length_8_id, len eq("File \"bs_list_test.res\", line 297, characters 5-12", sum2(length_10_id, length_8_id), 56); -eq("File \"bs_list_test.res\", line 298, characters 5-12", Belt_List.reduce2(length_10_id, length_8_id, 0, ((acc, x, y) => { - return (acc + x | 0) + y | 0; -})), 56); +eq("File \"bs_list_test.res\", line 298, characters 5-12", Belt_List.reduce2(length_10_id, length_8_id, 0, ((acc, x, y) => (acc + x | 0) + y | 0)), 56); eq("File \"bs_list_test.res\", line 299, characters 5-12", Belt_List.reduce2({ hd: 1, @@ -1679,17 +1597,11 @@ eq("File \"bs_list_test.res\", line 299, characters 5-12", Belt_List.reduce2({ tl: /* [] */0 } } -}, 0, ((a, b, c) => { - return (a + b | 0) + c | 0; -})), 18); +}, 0, ((a, b, c) => (a + b | 0) + c | 0)), 18); -eq("File \"bs_list_test.res\", line 300, characters 5-12", Belt_List.reduceReverse2(length_10_id, length_8_id, 0, ((acc, x, y) => { - return (acc + x | 0) + y | 0; -})), 56); +eq("File \"bs_list_test.res\", line 300, characters 5-12", Belt_List.reduceReverse2(length_10_id, length_8_id, 0, ((acc, x, y) => (acc + x | 0) + y | 0)), 56); -eq("File \"bs_list_test.res\", line 301, characters 5-12", Belt_List.reduceReverse2(length_10_id, length_10_id, 0, ((acc, x, y) => { - return (acc + x | 0) + y | 0; -})), 90); +eq("File \"bs_list_test.res\", line 301, characters 5-12", Belt_List.reduceReverse2(length_10_id, length_10_id, 0, ((acc, x, y) => (acc + x | 0) + y | 0)), 90); eq("File \"bs_list_test.res\", line 302, characters 5-12", Belt_List.reduceReverse2({ hd: 1, @@ -1706,9 +1618,7 @@ eq("File \"bs_list_test.res\", line 302, characters 5-12", Belt_List.reduceRever hd: 2, tl: /* [] */0 } -}, 0, ((acc, x, y) => { - return (acc + x | 0) + y | 0; -})), 6); +}, 0, ((acc, x, y) => (acc + x | 0) + y | 0)), 6); eq("File \"bs_list_test.res\", line 303, characters 5-12", Belt_List.every({ hd: 2, @@ -1761,9 +1671,7 @@ eq("File \"bs_list_test.res\", line 309, characters 5-12", Belt_List.has({ tl: /* [] */0 } } -}, "2", ((x, s) => { - return String(x) === s; -})), true); +}, "2", ((x, s) => String(x) === s)), true); eq("File \"bs_list_test.res\", line 310, characters 5-12", Belt_List.has({ hd: 1, @@ -1774,9 +1682,7 @@ eq("File \"bs_list_test.res\", line 310, characters 5-12", Belt_List.has({ tl: /* [] */0 } } -}, "0", ((x, s) => { - return String(x) === s; -})), false); +}, "0", ((x, s) => String(x) === s)), false); b("File \"bs_list_test.res\", line 312, characters 4-11", Belt_List.reduceReverse({ hd: 1, @@ -1790,9 +1696,7 @@ b("File \"bs_list_test.res\", line 312, characters 4-11", Belt_List.reduceRevers } } } -}, 0, ((prim0, prim1) => { - return prim0 + prim1 | 0; -})) === 10); +}, 0, ((prim0, prim1) => prim0 + prim1 | 0)) === 10); b("File \"bs_list_test.res\", line 313, characters 4-11", Belt_List.reduceReverse({ hd: 1, @@ -1806,9 +1710,7 @@ b("File \"bs_list_test.res\", line 313, characters 4-11", Belt_List.reduceRevers } } } -}, 10, ((prim0, prim1) => { - return prim0 - prim1 | 0; -})) === 0); +}, 10, ((prim0, prim1) => prim0 - prim1 | 0)) === 0); b("File \"bs_list_test.res\", line 314, characters 4-11", Caml_obj.equal(Belt_List.reduceReverse({ hd: 1, @@ -1848,9 +1750,7 @@ b("File \"bs_list_test.res\", line 315, characters 4-11", Belt_List.reduce({ } } } -}, 0, ((prim0, prim1) => { - return prim0 + prim1 | 0; -})) === 10); +}, 0, ((prim0, prim1) => prim0 + prim1 | 0)) === 10); b("File \"bs_list_test.res\", line 316, characters 4-11", Belt_List.reduce({ hd: 1, @@ -1864,9 +1764,7 @@ b("File \"bs_list_test.res\", line 316, characters 4-11", Belt_List.reduce({ } } } -}, 10, ((prim0, prim1) => { - return prim0 - prim1 | 0; -})) === 0); +}, 10, ((prim0, prim1) => prim0 - prim1 | 0)) === 0); b("File \"bs_list_test.res\", line 317, characters 4-11", Caml_obj.equal(Belt_List.reduce({ hd: 1, @@ -1906,9 +1804,7 @@ b("File \"bs_list_test.res\", line 318, characters 4-11", Belt_List.reduceWithIn } } } -}, 0, ((acc, x, i) => { - return (acc + x | 0) + i | 0; -})) === 16); +}, 0, ((acc, x, i) => (acc + x | 0) + i | 0)) === 16); b("File \"bs_list_test.res\", line 319, characters 4-11", Belt_List.reduceReverse2({ hd: 1, @@ -1925,27 +1821,19 @@ b("File \"bs_list_test.res\", line 319, characters 4-11", Belt_List.reduceRevers hd: 2, tl: /* [] */0 } -}, 0, ((acc, x, y) => { - return (acc + x | 0) + y | 0; -})) === 6); +}, 0, ((acc, x, y) => (acc + x | 0) + y | 0)) === 6); -let a$1 = Belt_List.makeBy(10000, (i => { - return i; -})); +let a$1 = Belt_List.makeBy(10000, (i => i)); b("File \"bs_list_test.res\", line 322, characters 4-11", Belt_List.reduceReverse2(a$1, { hd: 0, tl: a$1 -}, 0, ((acc, x, y) => { - return (acc + x | 0) + y | 0; -})) === 99980001); +}, 0, ((acc, x, y) => (acc + x | 0) + y | 0)) === 99980001); eq("File \"bs_list_test.res\", line 328, characters 5-12", Belt_List.every2(/* [] */0, { hd: 1, tl: /* [] */0 -}, ((x, y) => { - return x > y; -})), true); +}, ((x, y) => x > y)), true); eq("File \"bs_list_test.res\", line 329, characters 5-12", Belt_List.every2({ hd: 2, @@ -1956,9 +1844,7 @@ eq("File \"bs_list_test.res\", line 329, characters 5-12", Belt_List.every2({ }, { hd: 1, tl: /* [] */0 -}, ((x, y) => { - return x > y; -})), true); +}, ((x, y) => x > y)), true); eq("File \"bs_list_test.res\", line 330, characters 5-12", Belt_List.every2({ hd: 2, @@ -1966,9 +1852,7 @@ eq("File \"bs_list_test.res\", line 330, characters 5-12", Belt_List.every2({ }, { hd: 1, tl: /* [] */0 -}, ((x, y) => { - return x > y; -})), true); +}, ((x, y) => x > y)), true); eq("File \"bs_list_test.res\", line 331, characters 5-12", Belt_List.every2({ hd: 2, @@ -1982,9 +1866,7 @@ eq("File \"bs_list_test.res\", line 331, characters 5-12", Belt_List.every2({ hd: 4, tl: /* [] */0 } -}, ((x, y) => { - return x > y; -})), false); +}, ((x, y) => x > y)), false); eq("File \"bs_list_test.res\", line 332, characters 5-12", Belt_List.every2({ hd: 2, @@ -1998,16 +1880,12 @@ eq("File \"bs_list_test.res\", line 332, characters 5-12", Belt_List.every2({ hd: 0, tl: /* [] */0 } -}, ((x, y) => { - return x > y; -})), true); +}, ((x, y) => x > y)), true); eq("File \"bs_list_test.res\", line 333, characters 5-12", Belt_List.some2(/* [] */0, { hd: 1, tl: /* [] */0 -}, ((x, y) => { - return x > y; -})), false); +}, ((x, y) => x > y)), false); eq("File \"bs_list_test.res\", line 334, characters 5-12", Belt_List.some2({ hd: 2, @@ -2018,9 +1896,7 @@ eq("File \"bs_list_test.res\", line 334, characters 5-12", Belt_List.some2({ }, { hd: 1, tl: /* [] */0 -}, ((x, y) => { - return x > y; -})), true); +}, ((x, y) => x > y)), true); eq("File \"bs_list_test.res\", line 335, characters 5-12", Belt_List.some2({ hd: 2, @@ -2034,9 +1910,7 @@ eq("File \"bs_list_test.res\", line 335, characters 5-12", Belt_List.some2({ hd: 4, tl: /* [] */0 } -}, ((x, y) => { - return x > y; -})), true); +}, ((x, y) => x > y)), true); eq("File \"bs_list_test.res\", line 336, characters 5-12", Belt_List.some2({ hd: 0, @@ -2050,9 +1924,7 @@ eq("File \"bs_list_test.res\", line 336, characters 5-12", Belt_List.some2({ hd: 4, tl: /* [] */0 } -}, ((x, y) => { - return x > y; -})), false); +}, ((x, y) => x > y)), false); eq("File \"bs_list_test.res\", line 337, characters 5-12", Belt_List.some2({ hd: 0, @@ -2066,9 +1938,7 @@ eq("File \"bs_list_test.res\", line 337, characters 5-12", Belt_List.some2({ hd: 2, tl: /* [] */0 } -}, ((x, y) => { - return x > y; -})), true); +}, ((x, y) => x > y)), true); eq("File \"bs_list_test.res\", line 338, characters 5-12", Belt_List.some2({ hd: 1, @@ -2085,14 +1955,10 @@ eq("File \"bs_list_test.res\", line 338, characters 5-12", Belt_List.some2({ hd: -2, tl: /* [] */0 } -}, ((x, y) => { - return x === y; -})), false); +}, ((x, y) => x === y)), false); function makeTest(n) { - eq("File \"bs_list_test.res\", line 341, characters 23-30", Belt_List.make(n, 3), Belt_List.makeBy(n, (param => { - return 3; - }))); + eq("File \"bs_list_test.res\", line 341, characters 23-30", Belt_List.make(n, 3), Belt_List.makeBy(n, (param => 3))); } eq("File \"bs_list_test.res\", line 343, characters 12-19", { @@ -2371,9 +2237,7 @@ b("File \"bs_list_test.res\", line 374, characters 4-11", !Belt_List.eq({ hd: 2, tl: /* [] */0 } -}, ((x, y) => { - return x === y; -}))); +}, ((x, y) => x === y))); b("File \"bs_list_test.res\", line 375, characters 4-11", Belt_List.eq({ hd: 1, @@ -2393,9 +2257,7 @@ b("File \"bs_list_test.res\", line 375, characters 4-11", Belt_List.eq({ tl: /* [] */0 } } -}, ((x, y) => { - return x === y; -}))); +}, ((x, y) => x === y))); b("File \"bs_list_test.res\", line 376, characters 4-11", !Belt_List.eq({ hd: 1, @@ -2415,9 +2277,7 @@ b("File \"bs_list_test.res\", line 376, characters 4-11", !Belt_List.eq({ tl: /* [] */0 } } -}, ((x, y) => { - return x === y; -}))); +}, ((x, y) => x === y))); b("File \"bs_list_test.res\", line 377, characters 4-11", !Belt_List.eq({ hd: 1, @@ -2440,13 +2300,9 @@ b("File \"bs_list_test.res\", line 377, characters 4-11", !Belt_List.eq({ } } } -}, ((prim0, prim1) => { - return prim0 === prim1; -}))); +}, ((prim0, prim1) => prim0 === prim1))); -let u0 = Belt_List.makeBy(20, (x => { - return x; -})); +let u0 = Belt_List.makeBy(20, (x => x)); let u1 = Belt_List.keepMap(u0, (x => { if (x % 7 === 0) { diff --git a/jscomp/test/bs_map_set_dict_test.js b/jscomp/test/bs_map_set_dict_test.js index d85cd134920..fcd75b390ec 100644 --- a/jscomp/test/bs_map_set_dict_test.js +++ b/jscomp/test/bs_map_set_dict_test.js @@ -53,9 +53,7 @@ let m00 = { }; let I2 = { - cmp: ((x, y) => { - return Caml.int_compare(y, x); - }) + cmp: ((x, y) => Caml.int_compare(y, x)) }; let m_cmp = Icmp2.cmp; @@ -114,26 +112,20 @@ function f(none) { } function $eq$tilde(a, b) { - return extra => { - return Belt_Map.eq(a, b, extra); - }; + return extra => Belt_Map.eq(a, b, extra); } -let u0 = Belt_Map.fromArray(Belt_Array.map(Array_data_util.randomRange(0, 39), (x => { - return [ - x, - x - ]; -})), Icmp); +let u0 = Belt_Map.fromArray(Belt_Array.map(Array_data_util.randomRange(0, 39), (x => [ + x, + x +])), Icmp); let u1 = Belt_Map.set(u0, 39, 120); -b("File \"bs_map_set_dict_test.res\", line 72, characters 4-11", Belt_Array.every2(Belt_MapDict.toArray(u0.data), Belt_Array.map(Array_data_util.range(0, 39), (x => { - return [ - x, - x - ]; -})), ((param, param$1) => { +b("File \"bs_map_set_dict_test.res\", line 72, characters 4-11", Belt_Array.every2(Belt_MapDict.toArray(u0.data), Belt_Array.map(Array_data_util.range(0, 39), (x => [ + x, + x +])), ((param, param$1) => { if (param[0] === param$1[0]) { return param[1] === param$1[1]; } else { @@ -141,12 +133,10 @@ b("File \"bs_map_set_dict_test.res\", line 72, characters 4-11", Belt_Array.ever } }))); -b("File \"bs_map_set_dict_test.res\", line 79, characters 4-11", Belt_List.every2(Belt_MapDict.toList(u0.data), Belt_List.fromArray(Belt_Array.map(Array_data_util.range(0, 39), (x => { - return [ - x, - x - ]; -}))), ((param, param$1) => { +b("File \"bs_map_set_dict_test.res\", line 79, characters 4-11", Belt_List.every2(Belt_MapDict.toList(u0.data), Belt_List.fromArray(Belt_Array.map(Array_data_util.range(0, 39), (x => [ + x, + x +]))), ((param, param$1) => { if (param[0] === param$1[0]) { return param[1] === param$1[1]; } else { @@ -158,19 +148,15 @@ eq("File \"bs_map_set_dict_test.res\", line 84, characters 5-12", Belt_Map.get(u eq("File \"bs_map_set_dict_test.res\", line 85, characters 5-12", Belt_Map.get(u1, 39), 120); -let u = Belt_Map.fromArray(Belt_Array.makeByAndShuffle(10000, (x => { - return [ - x, - x - ]; -})), Icmp); - -eq("File \"bs_map_set_dict_test.res\", line 90, characters 5-12", Belt_Array.makeBy(10000, (x => { - return [ - x, - x - ]; -})), Belt_MapDict.toArray(u.data)); +let u = Belt_Map.fromArray(Belt_Array.makeByAndShuffle(10000, (x => [ + x, + x +])), Icmp); + +eq("File \"bs_map_set_dict_test.res\", line 90, characters 5-12", Belt_Array.makeBy(10000, (x => [ + x, + x +])), Belt_MapDict.toArray(u.data)); Mt.from_pair_suites("Bs_map_set_dict_test", suites.contents); diff --git a/jscomp/test/bs_map_test.js b/jscomp/test/bs_map_test.js index cae7732411a..d2c39887d72 100644 --- a/jscomp/test/bs_map_test.js +++ b/jscomp/test/bs_map_test.js @@ -19,13 +19,11 @@ function eq(loc, x, y) { suites.contents = { hd: [ loc + (" id " + String(test_id.contents)), - (() => { - return { - TAG: "Eq", - _0: x, - _1: y - }; - }) + (() => ({ + TAG: "Eq", + _0: x, + _1: y + })) ], tl: suites.contents }; @@ -36,12 +34,10 @@ function b(loc, v) { suites.contents = { hd: [ loc + (" id " + String(test_id.contents)), - (() => { - return { - TAG: "Ok", - _0: v - }; - }) + (() => ({ + TAG: "Ok", + _0: v + })) ], tl: suites.contents }; @@ -55,12 +51,10 @@ function emptyMap() { } -let v = Belt_Array.makeByAndShuffle(1000000, (i => { - return [ - i, - i - ]; -})); +let v = Belt_Array.makeByAndShuffle(1000000, (i => [ + i, + i +])); let u = Belt_MapInt.fromArray(v); @@ -68,9 +62,7 @@ Belt_MapInt.checkInvariantInternal(u); let firstHalf = Belt_Array.slice(v, 0, 2000); -let xx = Belt_Array.reduce(firstHalf, u, ((acc, param) => { - return Belt_MapInt.remove(acc, param[0]); -})); +let xx = Belt_Array.reduce(firstHalf, u, ((acc, param) => Belt_MapInt.remove(acc, param[0]))); Belt_MapInt.checkInvariantInternal(u); diff --git a/jscomp/test/bs_mutable_set_test.js b/jscomp/test/bs_mutable_set_test.js index f99272ce4a5..df324b23ed2 100644 --- a/jscomp/test/bs_mutable_set_test.js +++ b/jscomp/test/bs_mutable_set_test.js @@ -113,9 +113,7 @@ let v = { data: Belt_internalSetInt.fromArray(xs$1) }; -let bs = Belt_Array.map(Array_data_util.randomRange(500, 1499), (x => { - return Belt_MutableSetInt.removeCheck(v, x); -})); +let bs = Belt_Array.map(Array_data_util.randomRange(500, 1499), (x => Belt_MutableSetInt.removeCheck(v, x))); let indeedRemoved = Belt_Array.reduce(bs, 0, ((acc, x) => { if (x) { @@ -129,9 +127,7 @@ eq("File \"bs_mutable_set_test.res\", line 72, characters 9-16", indeedRemoved, eq("File \"bs_mutable_set_test.res\", line 73, characters 9-16", Belt_internalAVLset.size(v.data), 501); -let cs = Belt_Array.map(Array_data_util.randomRange(500, 2000), (x => { - return Belt_MutableSetInt.addCheck(v, x); -})); +let cs = Belt_Array.map(Array_data_util.randomRange(500, 2000), (x => Belt_MutableSetInt.addCheck(v, x))); let indeedAded = Belt_Array.reduce(cs, 0, ((acc, x) => { if (x) { @@ -157,15 +153,9 @@ eq("File \"bs_mutable_set_test.res\", line 87, characters 9-16", Belt_internalAV eq("File \"bs_mutable_set_test.res\", line 88, characters 9-16", Belt_internalAVLset.maxUndefined(v.data), 2000); -eq("File \"bs_mutable_set_test.res\", line 89, characters 9-16", Belt_MutableSetInt.reduce(v, 0, ((x, y) => { - return x + y | 0; -})), 1876250); +eq("File \"bs_mutable_set_test.res\", line 89, characters 9-16", Belt_MutableSetInt.reduce(v, 0, ((x, y) => x + y | 0)), 1876250); -b("File \"bs_mutable_set_test.res\", line 90, characters 8-15", Belt_List.eq(Belt_internalAVLset.toList(v.data), Belt_List.makeBy(1501, (i => { - return i + 500 | 0; -})), ((x, y) => { - return x === y; -}))); +b("File \"bs_mutable_set_test.res\", line 90, characters 8-15", Belt_List.eq(Belt_internalAVLset.toList(v.data), Belt_List.makeBy(1501, (i => i + 500 | 0)), ((x, y) => x === y))); eq("File \"bs_mutable_set_test.res\", line 91, characters 9-16", Belt_internalAVLset.toArray(v.data), Array_data_util.range(500, 2000)); @@ -185,13 +175,9 @@ let aa = match$1[0]; b("File \"bs_mutable_set_test.res\", line 96, characters 8-15", match[1]); -b("File \"bs_mutable_set_test.res\", line 97, characters 8-15", Belt_Array.eq(Belt_internalAVLset.toArray(aa.data), Array_data_util.range(500, 999), ((x, y) => { - return x === y; -}))); +b("File \"bs_mutable_set_test.res\", line 97, characters 8-15", Belt_Array.eq(Belt_internalAVLset.toArray(aa.data), Array_data_util.range(500, 999), ((x, y) => x === y))); -b("File \"bs_mutable_set_test.res\", line 98, characters 8-15", Belt_Array.eq(Belt_internalAVLset.toArray(bb.data), Array_data_util.range(1001, 2000), ((prim0, prim1) => { - return prim0 === prim1; -}))); +b("File \"bs_mutable_set_test.res\", line 98, characters 8-15", Belt_Array.eq(Belt_internalAVLset.toArray(bb.data), Array_data_util.range(1001, 2000), ((prim0, prim1) => prim0 === prim1))); b("File \"bs_mutable_set_test.res\", line 99, characters 8-15", Belt_MutableSetInt.subset(aa, v)); @@ -213,13 +199,9 @@ let aa$1 = match$3[0]; b("File \"bs_mutable_set_test.res\", line 105, characters 8-15", !match$2[1]); -b("File \"bs_mutable_set_test.res\", line 106, characters 8-15", Belt_Array.eq(Belt_internalAVLset.toArray(aa$1.data), Array_data_util.range(500, 999), ((prim0, prim1) => { - return prim0 === prim1; -}))); +b("File \"bs_mutable_set_test.res\", line 106, characters 8-15", Belt_Array.eq(Belt_internalAVLset.toArray(aa$1.data), Array_data_util.range(500, 999), ((prim0, prim1) => prim0 === prim1))); -b("File \"bs_mutable_set_test.res\", line 107, characters 8-15", Belt_Array.eq(Belt_internalAVLset.toArray(bb$1.data), Array_data_util.range(1001, 2000), ((prim0, prim1) => { - return prim0 === prim1; -}))); +b("File \"bs_mutable_set_test.res\", line 107, characters 8-15", Belt_Array.eq(Belt_internalAVLset.toArray(bb$1.data), Array_data_util.range(1001, 2000), ((prim0, prim1) => prim0 === prim1))); b("File \"bs_mutable_set_test.res\", line 108, characters 8-15", Belt_MutableSetInt.subset(aa$1, v)); @@ -378,17 +360,11 @@ let a0 = { data: Belt_internalSetInt.fromArray(xs$24) }; -let a1 = Belt_MutableSetInt.keep(a0, (x => { - return x % 2 === 0; -})); +let a1 = Belt_MutableSetInt.keep(a0, (x => x % 2 === 0)); -let a2 = Belt_MutableSetInt.keep(a0, (x => { - return x % 2 !== 0; -})); +let a2 = Belt_MutableSetInt.keep(a0, (x => x % 2 !== 0)); -let match$4 = Belt_MutableSetInt.partition(a0, (x => { - return x % 2 === 0; -})); +let match$4 = Belt_MutableSetInt.partition(a0, (x => x % 2 === 0)); let a4 = match$4[1]; @@ -413,9 +389,7 @@ Belt_List.forEach({ } } } -}, (x => { - Belt_internalAVLset.checkInvariantInternal(x.data); -})); +}, (x => Belt_internalAVLset.checkInvariantInternal(x.data))); let v$1 = { data: undefined @@ -427,9 +401,7 @@ for (let i$2 = 0; i$2 <= 100000; ++i$2) { Belt_internalAVLset.checkInvariantInternal(v$1.data); -b("File \"bs_mutable_set_test.res\", line 188, characters 10-17", Belt_Range.every(0, 100000, (i => { - return Belt_internalSetInt.has(v$1.data, i); -}))); +b("File \"bs_mutable_set_test.res\", line 188, characters 10-17", Belt_Range.every(0, 100000, (i => Belt_internalSetInt.has(v$1.data, i)))); eq("File \"bs_mutable_set_test.res\", line 189, characters 5-12", Belt_internalAVLset.size(v$1.data), 100001); @@ -471,9 +443,7 @@ eq("File \"bs_mutable_set_test.res\", line 216, characters 5-12", Belt_internalA b("File \"bs_mutable_set_test.res\", line 217, characters 4-11", Belt_MutableSetInt.isEmpty(v$3)); -let xs$25 = Belt_Array.makeBy(30, (i => { - return i; -})); +let xs$25 = Belt_Array.makeBy(30, (i => i)); let v$4 = { data: Belt_internalSetInt.fromArray(xs$25) @@ -504,9 +474,7 @@ function id(loc, x) { data: Belt_internalAVLset.fromSortedArrayUnsafe(x) }; Belt_internalAVLset.checkInvariantInternal(u.data); - b(loc, Belt_Array.every2(Belt_internalAVLset.toArray(u.data), x, ((prim0, prim1) => { - return prim0 === prim1; - }))); + b(loc, Belt_Array.every2(Belt_internalAVLset.toArray(u.data), x, ((prim0, prim1) => prim0 === prim1))); } id("File \"bs_mutable_set_test.res\", line 242, characters 5-12", []); @@ -598,17 +566,11 @@ let v$5 = { data: Belt_internalSetInt.fromArray(xs$26) }; -let copyV = Belt_MutableSetInt.keep(v$5, (x => { - return x % 8 === 0; -})); +let copyV = Belt_MutableSetInt.keep(v$5, (x => x % 8 === 0)); -let match$5 = Belt_MutableSetInt.partition(v$5, (x => { - return x % 8 === 0; -})); +let match$5 = Belt_MutableSetInt.partition(v$5, (x => x % 8 === 0)); -let cc$1 = Belt_MutableSetInt.keep(v$5, (x => { - return x % 8 !== 0; -})); +let cc$1 = Belt_MutableSetInt.keep(v$5, (x => x % 8 !== 0)); for (let i$6 = 0; i$6 <= 200; ++i$6) { Belt_MutableSetInt.remove(v$5, i$6); @@ -616,9 +578,7 @@ for (let i$6 = 0; i$6 <= 200; ++i$6) { eq("File \"bs_mutable_set_test.res\", line 264, characters 5-12", Belt_internalAVLset.size(copyV.data), 126); -eq("File \"bs_mutable_set_test.res\", line 265, characters 5-12", Belt_internalAVLset.toArray(copyV.data), Belt_Array.makeBy(126, (i => { - return (i << 3); -}))); +eq("File \"bs_mutable_set_test.res\", line 265, characters 5-12", Belt_internalAVLset.toArray(copyV.data), Belt_Array.makeBy(126, (i => (i << 3)))); eq("File \"bs_mutable_set_test.res\", line 266, characters 5-12", Belt_internalAVLset.size(v$5.data), 800); @@ -648,9 +608,7 @@ b("File \"bs_mutable_set_test.res\", line 275, characters 4-11", Belt_MutableSet data: Belt_internalSetInt.fromArray(xs$29) })); -let xs$30 = Belt_Array.map(Array_data_util.randomRange(0, 1000), (x => { - return (x << 1); -})); +let xs$30 = Belt_Array.map(Array_data_util.randomRange(0, 1000), (x => (x << 1))); let d = { data: Belt_internalSetInt.fromArray(xs$30) @@ -660,17 +618,13 @@ let match$8 = Belt_MutableSetInt.split(d, 1001); let match$9 = match$8[0]; -let xs$31 = Belt_Array.makeBy(501, (x => { - return (x << 1); -})); +let xs$31 = Belt_Array.makeBy(501, (x => (x << 1))); b("File \"bs_mutable_set_test.res\", line 278, characters 4-11", Belt_MutableSetInt.eq(match$9[0], { data: Belt_internalSetInt.fromArray(xs$31) })); -let xs$32 = Belt_Array.makeBy(500, (x => { - return 1002 + (x << 1) | 0; -})); +let xs$32 = Belt_Array.makeBy(500, (x => 1002 + (x << 1) | 0)); b("File \"bs_mutable_set_test.res\", line 279, characters 4-11", Belt_MutableSetInt.eq(match$9[1], { data: Belt_internalSetInt.fromArray(xs$32) diff --git a/jscomp/test/bs_poly_map_test.js b/jscomp/test/bs_poly_map_test.js index 2b36e09e309..1f5475162ae 100644 --- a/jscomp/test/bs_poly_map_test.js +++ b/jscomp/test/bs_poly_map_test.js @@ -76,12 +76,10 @@ function mergeDiff(s1, s2) { } function randomRange(i, j) { - return Belt_Array.map(Array_data_util.randomRange(i, j), (x => { - return [ - x, - x - ]; - })); + return Belt_Array.map(Array_data_util.randomRange(i, j), (x => [ + x, + x + ])); } let u0 = Belt_Map.fromArray(randomRange(0, 100), Icmp); @@ -169,15 +167,13 @@ eq("File \"bs_poly_map_test.res\", line 108, characters 5-12", Belt_Map.get(u1$1 eq("File \"bs_poly_map_test.res\", line 109, characters 5-12", Belt_Map.get(u0$1, 3), 3); function acc(m, is) { - return Belt_Array.reduce(is, m, ((a, i) => { - return Belt_Map.update(a, i, (n => { - if (n !== undefined) { - return n + 1 | 0; - } else { - return 1; - } - })); - })); + return Belt_Array.reduce(is, m, ((a, i) => Belt_Map.update(a, i, (n => { + if (n !== undefined) { + return n + 1 | 0; + } else { + return 1; + } + })))); } let m_cmp = Icmp.cmp; @@ -189,14 +185,10 @@ let m = { let m1 = acc(m, Belt_Array.concat(Array_data_util.randomRange(0, 20), Array_data_util.randomRange(10, 30))); -b("File \"bs_poly_map_test.res\", line 126, characters 4-11", Belt_Map.eq(m1, Belt_Map.fromArray(Belt_Array.makeBy(31, (i => { - return [ - i, - i >= 10 && i <= 20 ? 2 : 1 - ]; -})), Icmp), ((x, y) => { - return x === y; -}))); +b("File \"bs_poly_map_test.res\", line 126, characters 4-11", Belt_Map.eq(m1, Belt_Map.fromArray(Belt_Array.makeBy(31, (i => [ + i, + i >= 10 && i <= 20 ? 2 : 1 +])), Icmp), ((x, y) => x === y))); let v0_cmp = Icmp.cmp; @@ -205,23 +197,17 @@ let v0 = { data: undefined }; -let v1 = Belt_Map.mergeMany(v0, Belt_Array.map(Array_data_util.randomRange(0, 10000), (x => { - return [ - x, - x - ]; -}))); +let v1 = Belt_Map.mergeMany(v0, Belt_Array.map(Array_data_util.randomRange(0, 10000), (x => [ + x, + x +]))); -let v2 = Belt_Map.fromArray(Belt_Array.map(Array_data_util.randomRange(0, 10000), (x => { - return [ - x, - x - ]; -})), Icmp); +let v2 = Belt_Map.fromArray(Belt_Array.map(Array_data_util.randomRange(0, 10000), (x => [ + x, + x +])), Icmp); -b("File \"bs_poly_map_test.res\", line 150, characters 4-11", Belt_Map.eq(v1, v2, ((x, y) => { - return x === y; -}))); +b("File \"bs_poly_map_test.res\", line 150, characters 4-11", Belt_Map.eq(v1, v2, ((x, y) => x === y))); function inc(x) { if (x !== undefined) { @@ -269,17 +255,9 @@ b("File \"bs_poly_map_test.res\", line 182, characters 4-11", Belt_MapDict.isEmp b("File \"bs_poly_map_test.res\", line 184, characters 4-11", pres !== undefined ? pres === 5000 : false); -b("File \"bs_poly_map_test.res\", line 190, characters 4-11", Belt_Array.eq(Belt_MapDict.keysToArray(match$1[0].data), Belt_Array.makeBy(5000, (i => { - return i; -})), ((prim0, prim1) => { - return prim0 === prim1; -}))); +b("File \"bs_poly_map_test.res\", line 190, characters 4-11", Belt_Array.eq(Belt_MapDict.keysToArray(match$1[0].data), Belt_Array.makeBy(5000, (i => i)), ((prim0, prim1) => prim0 === prim1))); -b("File \"bs_poly_map_test.res\", line 191, characters 4-11", Belt_Array.eq(Belt_MapDict.keysToArray(match$1[1].data), Belt_Array.makeBy(5000, (i => { - return 5001 + i | 0; -})), ((prim0, prim1) => { - return prim0 === prim1; -}))); +b("File \"bs_poly_map_test.res\", line 191, characters 4-11", Belt_Array.eq(Belt_MapDict.keysToArray(match$1[1].data), Belt_Array.makeBy(5000, (i => 5001 + i | 0)), ((prim0, prim1) => prim0 === prim1))); let v7 = Belt_Map.remove(v3, 5000); @@ -289,17 +267,9 @@ let match$6 = match$5[0]; b("File \"bs_poly_map_test.res\", line 196, characters 4-11", match$5[1] === undefined); -b("File \"bs_poly_map_test.res\", line 202, characters 4-11", Belt_Array.eq(Belt_MapDict.keysToArray(match$6[0].data), Belt_Array.makeBy(5000, (i => { - return i; -})), ((prim0, prim1) => { - return prim0 === prim1; -}))); - -b("File \"bs_poly_map_test.res\", line 203, characters 4-11", Belt_Array.eq(Belt_MapDict.keysToArray(match$6[1].data), Belt_Array.makeBy(5000, (i => { - return 5001 + i | 0; -})), ((prim0, prim1) => { - return prim0 === prim1; -}))); +b("File \"bs_poly_map_test.res\", line 202, characters 4-11", Belt_Array.eq(Belt_MapDict.keysToArray(match$6[0].data), Belt_Array.makeBy(5000, (i => i)), ((prim0, prim1) => prim0 === prim1))); + +b("File \"bs_poly_map_test.res\", line 203, characters 4-11", Belt_Array.eq(Belt_MapDict.keysToArray(match$6[1].data), Belt_Array.makeBy(5000, (i => 5001 + i | 0)), ((prim0, prim1) => prim0 === prim1))); Mt.from_pair_suites("Bs_poly_map_test", suites.contents); diff --git a/jscomp/test/bs_poly_mutable_map_test.js b/jscomp/test/bs_poly_mutable_map_test.js index 84bb84d290a..5fdbb8f04c3 100644 --- a/jscomp/test/bs_poly_mutable_map_test.js +++ b/jscomp/test/bs_poly_mutable_map_test.js @@ -38,12 +38,10 @@ function ff(x) { } function randomRange(i, j) { - return Belt_Array.map(Array_data_util.randomRange(i, j), (x => { - return [ - x, - x - ]; - })); + return Belt_Array.map(Array_data_util.randomRange(i, j), (x => [ + x, + x + ])); } let a0 = Belt_MutableMap.fromArray(randomRange(0, 10), Icmp); @@ -79,13 +77,9 @@ let a0$1 = Belt_MutableMap.fromArray(randomRange(0, 10000), Icmp); Belt_MutableMap.set(a0$1, 2000, 33); -Belt_MutableMap.removeMany(a0$1, Belt_Array.map(randomRange(0, 1998), (prim => { - return prim[0]; -}))); +Belt_MutableMap.removeMany(a0$1, Belt_Array.map(randomRange(0, 1998), (prim => prim[0]))); -Belt_MutableMap.removeMany(a0$1, Belt_Array.map(randomRange(2002, 11000), (prim => { - return prim[0]; -}))); +Belt_MutableMap.removeMany(a0$1, Belt_Array.map(randomRange(2002, 11000), (prim => prim[0]))); eq("File \"bs_poly_mutable_map_test.res\", line 39, characters 5-12", Belt_internalAVLtree.toArray(a0$1.data), [ [ diff --git a/jscomp/test/bs_poly_mutable_set_test.js b/jscomp/test/bs_poly_mutable_set_test.js index 674b0726b9b..fb51a8dda49 100644 --- a/jscomp/test/bs_poly_mutable_set_test.js +++ b/jscomp/test/bs_poly_mutable_set_test.js @@ -118,9 +118,7 @@ b("File \"bs_poly_mutable_set_test.res\", line 54, characters 4-11", Belt_Mutabl let v = Belt_MutableSet.fromArray(Array_data_util.randomRange(1000, 2000), IntCmp); -let bs = Belt_Array.map(Array_data_util.randomRange(500, 1499), (x => { - return Belt_MutableSet.removeCheck(v, x); -})); +let bs = Belt_Array.map(Array_data_util.randomRange(500, 1499), (x => Belt_MutableSet.removeCheck(v, x))); let indeedRemoved = Belt_Array.reduce(bs, 0, ((acc, x) => { if (x) { @@ -134,9 +132,7 @@ eq("File \"bs_poly_mutable_set_test.res\", line 67, characters 5-12", indeedRemo eq("File \"bs_poly_mutable_set_test.res\", line 68, characters 5-12", Belt_internalAVLset.size(v.data), 501); -let cs = Belt_Array.map(Array_data_util.randomRange(500, 2000), (x => { - return Belt_MutableSet.addCheck(v, x); -})); +let cs = Belt_Array.map(Array_data_util.randomRange(500, 2000), (x => Belt_MutableSet.addCheck(v, x))); let indeedAded = Belt_Array.reduce(cs, 0, ((acc, x) => { if (x) { @@ -163,15 +159,9 @@ eq("File \"bs_poly_mutable_set_test.res\", line 82, characters 5-12", Belt_inter eq("File \"bs_poly_mutable_set_test.res\", line 83, characters 5-12", Belt_internalAVLset.maxUndefined(v.data), 2000); -eq("File \"bs_poly_mutable_set_test.res\", line 84, characters 5-12", Belt_MutableSet.reduce(v, 0, ((x, y) => { - return x + y | 0; -})), 1876250); +eq("File \"bs_poly_mutable_set_test.res\", line 84, characters 5-12", Belt_MutableSet.reduce(v, 0, ((x, y) => x + y | 0)), 1876250); -b("File \"bs_poly_mutable_set_test.res\", line 85, characters 4-11", Belt_List.eq(Belt_internalAVLset.toList(v.data), Belt_List.makeBy(1501, (i => { - return i + 500 | 0; -})), ((x, y) => { - return x === y; -}))); +b("File \"bs_poly_mutable_set_test.res\", line 85, characters 4-11", Belt_List.eq(Belt_internalAVLset.toList(v.data), Belt_List.makeBy(1501, (i => i + 500 | 0)), ((x, y) => x === y))); eq("File \"bs_poly_mutable_set_test.res\", line 86, characters 5-12", Belt_internalAVLset.toArray(v.data), Array_data_util.range(500, 2000)); @@ -191,13 +181,9 @@ let aa = match$1[0]; b("File \"bs_poly_mutable_set_test.res\", line 91, characters 4-11", match[1]); -b("File \"bs_poly_mutable_set_test.res\", line 92, characters 4-11", Belt_Array.eq(Belt_internalAVLset.toArray(aa.data), Array_data_util.range(500, 999), ((prim0, prim1) => { - return prim0 === prim1; -}))); +b("File \"bs_poly_mutable_set_test.res\", line 92, characters 4-11", Belt_Array.eq(Belt_internalAVLset.toArray(aa.data), Array_data_util.range(500, 999), ((prim0, prim1) => prim0 === prim1))); -b("File \"bs_poly_mutable_set_test.res\", line 93, characters 4-11", Belt_Array.eq(Belt_internalAVLset.toArray(bb.data), Array_data_util.range(1001, 2000), ((prim0, prim1) => { - return prim0 === prim1; -}))); +b("File \"bs_poly_mutable_set_test.res\", line 93, characters 4-11", Belt_Array.eq(Belt_internalAVLset.toArray(bb.data), Array_data_util.range(1001, 2000), ((prim0, prim1) => prim0 === prim1))); b("File \"bs_poly_mutable_set_test.res\", line 94, characters 4-11", Belt_MutableSet.subset(aa, v)); @@ -219,13 +205,9 @@ let aa$1 = match$3[0]; b("File \"bs_poly_mutable_set_test.res\", line 100, characters 4-11", !match$2[1]); -b("File \"bs_poly_mutable_set_test.res\", line 101, characters 4-11", Belt_Array.eq(Belt_internalAVLset.toArray(aa$1.data), Array_data_util.range(500, 999), ((prim0, prim1) => { - return prim0 === prim1; -}))); +b("File \"bs_poly_mutable_set_test.res\", line 101, characters 4-11", Belt_Array.eq(Belt_internalAVLset.toArray(aa$1.data), Array_data_util.range(500, 999), ((prim0, prim1) => prim0 === prim1))); -b("File \"bs_poly_mutable_set_test.res\", line 102, characters 4-11", Belt_Array.eq(Belt_internalAVLset.toArray(bb$1.data), Array_data_util.range(1001, 2000), ((prim0, prim1) => { - return prim0 === prim1; -}))); +b("File \"bs_poly_mutable_set_test.res\", line 102, characters 4-11", Belt_Array.eq(Belt_internalAVLset.toArray(bb$1.data), Array_data_util.range(1001, 2000), ((prim0, prim1) => prim0 === prim1))); b("File \"bs_poly_mutable_set_test.res\", line 103, characters 4-11", Belt_MutableSet.subset(aa$1, v)); @@ -288,17 +270,11 @@ b("File \"bs_poly_mutable_set_test.res\", line 150, characters 4-11", Belt_Mutab let a0 = Belt_MutableSet.fromArray(Array_data_util.randomRange(0, 1000), IntCmp); -let a1 = Belt_MutableSet.keep(a0, (x => { - return x % 2 === 0; -})); +let a1 = Belt_MutableSet.keep(a0, (x => x % 2 === 0)); -let a2 = Belt_MutableSet.keep(a0, (x => { - return x % 2 !== 0; -})); +let a2 = Belt_MutableSet.keep(a0, (x => x % 2 !== 0)); -let match$4 = Belt_MutableSet.partition(a0, (x => { - return x % 2 === 0; -})); +let match$4 = Belt_MutableSet.partition(a0, (x => x % 2 === 0)); let a4 = match$4[1]; @@ -323,9 +299,7 @@ Belt_List.forEach({ } } } -}, (x => { - Belt_internalAVLset.checkInvariantInternal(x.data); -})); +}, (x => Belt_internalAVLset.checkInvariantInternal(x.data))); Mt.from_pair_suites("Bs_poly_mutable_set_test", suites.contents); diff --git a/jscomp/test/bs_poly_set_test.js b/jscomp/test/bs_poly_set_test.js index 9b19fa2db3f..637fe6e6d7a 100644 --- a/jscomp/test/bs_poly_set_test.js +++ b/jscomp/test/bs_poly_set_test.js @@ -146,9 +146,7 @@ let u26 = Belt_Set.add({ data: undefined }, 3); -let ss = Belt_Array.makeByAndShuffle(100, (i => { - return (i << 1); -})); +let ss = Belt_Array.makeByAndShuffle(100, (i => (i << 1))); let u27 = Belt_Set.fromArray(ss, IntCmp); @@ -228,21 +226,11 @@ let u1$1 = Belt_Set.remove(u0$1, 17); let u2$1 = Belt_Set.add(u1$1, 33); -b("File \"bs_poly_set_test.res\", line 110, characters 4-11", Belt_List.every2(testIterToList(u0$1), Belt_List.makeBy(21, (i => { - return i; -})), ((x, y) => { - return x === y; -}))); +b("File \"bs_poly_set_test.res\", line 110, characters 4-11", Belt_List.every2(testIterToList(u0$1), Belt_List.makeBy(21, (i => i)), ((x, y) => x === y))); -b("File \"bs_poly_set_test.res\", line 111, characters 4-11", Belt_List.every2(testIterToList2(u0$1), Belt_List.makeBy(21, (i => { - return i; -})), ((x, y) => { - return x === y; -}))); +b("File \"bs_poly_set_test.res\", line 111, characters 4-11", Belt_List.every2(testIterToList2(u0$1), Belt_List.makeBy(21, (i => i)), ((x, y) => x === y))); -b("File \"bs_poly_set_test.res\", line 112, characters 4-11", Belt_List.every2(testIterToList(u0$1), Belt_SetDict.toList(u0$1.data), ((x, y) => { - return x === y; -}))); +b("File \"bs_poly_set_test.res\", line 112, characters 4-11", Belt_List.every2(testIterToList(u0$1), Belt_SetDict.toList(u0$1.data), ((x, y) => x === y))); function f(x) { return x === 17; @@ -262,9 +250,7 @@ function f$2(x) { b("File \"bs_poly_set_test.res\", line 115, characters 4-11", Belt_SetDict.every(u0$1.data, f$2)); -b("File \"bs_poly_set_test.res\", line 116, characters 4-11", Belt_SetDict.every(u0$1.data, (x => { - return x < 24; -}))); +b("File \"bs_poly_set_test.res\", line 116, characters 4-11", Belt_SetDict.every(u0$1.data, (x => x < 24))); function f$3(x) { return x < 24; @@ -290,17 +276,11 @@ b("File \"bs_poly_set_test.res\", line 120, characters 4-11", Belt_Set.cmp(u0$1, let a0 = Belt_Set.fromArray(Array_data_util.randomRange(0, 1000), IntCmp); -let a1 = Belt_Set.keep(a0, (x => { - return x % 2 === 0; -})); +let a1 = Belt_Set.keep(a0, (x => x % 2 === 0)); -let a2 = Belt_Set.keep(a0, (x => { - return x % 2 !== 0; -})); +let a2 = Belt_Set.keep(a0, (x => x % 2 !== 0)); -let match = Belt_Set.partition(a0, (x => { - return x % 2 === 0; -})); +let match = Belt_Set.partition(a0, (x => x % 2 === 0)); let a4 = match[1]; @@ -332,13 +312,9 @@ let match$2 = match$1[0]; b("File \"bs_poly_set_test.res\", line 136, characters 4-11", match$1[1]); -eq("File \"bs_poly_set_test.res\", line 137, characters 5-12", Belt_SetDict.toArray(match$2[0].data), Belt_Array.makeBy(200, (i => { - return i; -}))); +eq("File \"bs_poly_set_test.res\", line 137, characters 5-12", Belt_SetDict.toArray(match$2[0].data), Belt_Array.makeBy(200, (i => i))); -eq("File \"bs_poly_set_test.res\", line 138, characters 5-12", Belt_SetDict.toList(match$2[1].data), Belt_List.makeBy(800, (i => { - return i + 201 | 0; -}))); +eq("File \"bs_poly_set_test.res\", line 138, characters 5-12", Belt_SetDict.toList(match$2[1].data), Belt_List.makeBy(800, (i => i + 201 | 0))); let a7 = Belt_Set.remove(a0, 200); @@ -352,13 +328,9 @@ let a8 = match$4[0]; b("File \"bs_poly_set_test.res\", line 141, characters 4-11", !match$3[1]); -eq("File \"bs_poly_set_test.res\", line 142, characters 5-12", Belt_SetDict.toArray(a8.data), Belt_Array.makeBy(200, (i => { - return i; -}))); +eq("File \"bs_poly_set_test.res\", line 142, characters 5-12", Belt_SetDict.toArray(a8.data), Belt_Array.makeBy(200, (i => i))); -eq("File \"bs_poly_set_test.res\", line 143, characters 5-12", Belt_SetDict.toList(a9.data), Belt_List.makeBy(800, (i => { - return i + 201 | 0; -}))); +eq("File \"bs_poly_set_test.res\", line 143, characters 5-12", Belt_SetDict.toList(a9.data), Belt_List.makeBy(800, (i => i + 201 | 0))); eq("File \"bs_poly_set_test.res\", line 144, characters 5-12", Belt_SetDict.minimum(a8.data), 0); @@ -379,15 +351,11 @@ Belt_List.forEach({ } } } -}, (x => { - Belt_SetDict.checkInvariantInternal(x.data); -})); +}, (x => Belt_SetDict.checkInvariantInternal(x.data))); let a = Belt_Set.fromArray([], IntCmp); -let m$1 = Belt_Set.keep(a, (x => { - return x % 2 === 0; -})); +let m$1 = Belt_Set.keep(a, (x => x % 2 === 0)); b("File \"bs_poly_set_test.res\", line 151, characters 4-11", Belt_SetDict.isEmpty(m$1.data)); diff --git a/jscomp/test/bs_queue_test.js b/jscomp/test/bs_queue_test.js index 2c643235258..d295d4b0a00 100644 --- a/jscomp/test/bs_queue_test.js +++ b/jscomp/test/bs_queue_test.js @@ -1312,11 +1312,7 @@ if (!Caml_obj.equal(Belt_MutableQueue.toArray(q2$4), v)) { }); } -if (Belt_MutableQueue.reduce(q2$4, 0, ((x, y) => { - return x - y | 0; - })) !== Belt_Array.reduce(v, 0, ((x, y) => { - return x - y | 0; - }))) { +if (Belt_MutableQueue.reduce(q2$4, 0, ((x, y) => x - y | 0)) !== Belt_Array.reduce(v, 0, ((x, y) => x - y | 0))) { throw new Error("Assert_failure", { cause: { RE_EXN_ID: "Assert_failure", @@ -1338,9 +1334,7 @@ let q$6 = Belt_MutableQueue.fromArray([ 4 ]); -let q1$5 = Belt_MutableQueue.map(q$6, (x => { - return x - 1 | 0; -})); +let q1$5 = Belt_MutableQueue.map(q$6, (x => x - 1 | 0)); eq("File \"bs_queue_test.res\", line 197, characters 5-12", Belt_MutableQueue.toArray(q1$5), [ 0, @@ -1353,9 +1347,7 @@ let q$7 = Belt_MutableQueue.fromArray([]); b("File \"bs_queue_test.res\", line 198, characters 4-11", q$7.length === 0); -let q$8 = Belt_MutableQueue.map(Belt_MutableQueue.fromArray([]), (x => { - return x + 1 | 0; -})); +let q$8 = Belt_MutableQueue.map(Belt_MutableQueue.fromArray([]), (x => x + 1 | 0)); b("File \"bs_queue_test.res\", line 199, characters 4-11", q$8.length === 0); diff --git a/jscomp/test/bs_set_int_test.js b/jscomp/test/bs_set_int_test.js index cf215fc6af8..f9b4c4e954c 100644 --- a/jscomp/test/bs_set_int_test.js +++ b/jscomp/test/bs_set_int_test.js @@ -55,15 +55,11 @@ let u = Belt_SetInt.intersect(Belt_SetInt.fromArray([ b("File \"bs_set_int_test.res\", line 27, characters 11-18", Belt_SetInt.eq(Belt_SetInt.fromArray([3]), u)); function range(i, j) { - return $$Array.init((j - i | 0) + 1 | 0, (k => { - return k + i | 0; - })); + return $$Array.init((j - i | 0) + 1 | 0, (k => k + i | 0)); } function revRange(i, j) { - return $$Array.of_list(List.rev($$Array.to_list($$Array.init((j - i | 0) + 1 | 0, (k => { - return k + i | 0; - }))))); + return $$Array.of_list(List.rev($$Array.to_list($$Array.init((j - i | 0) + 1 | 0, (k => k + i | 0))))); } let v = Belt_SetInt.fromArray($$Array.append(range(100, 1000), revRange(400, 1500))); @@ -72,9 +68,7 @@ let i = range(100, 1500); b("File \"bs_set_int_test.res\", line 37, characters 4-11", Belt_SetInt.eq(Belt_SetInt.fromArray(i), v)); -let match = Belt_SetInt.partition(v, (x => { - return x % 3 === 0; -})); +let match = Belt_SetInt.partition(v, (x => x % 3 === 0)); let l; @@ -162,11 +156,7 @@ function approx(loc, x, y) { b(loc, x === y); } -eq("File \"bs_set_int_test.res\", line 125, characters 5-12", Belt_SetInt.reduce(v$1, 0, ((x, y) => { - return x + y | 0; -})), Belt_Array.reduce(ss, 0, ((prim0, prim1) => { - return prim0 + prim1 | 0; -}))); +eq("File \"bs_set_int_test.res\", line 125, characters 5-12", Belt_SetInt.reduce(v$1, 0, ((x, y) => x + y | 0)), Belt_Array.reduce(ss, 0, ((prim0, prim1) => prim0 + prim1 | 0))); approx("File \"bs_set_int_test.res\", line 126, characters 9-16", -1, minv); @@ -216,9 +206,7 @@ let v$10 = Belt_SetInt.remove(v$9, 1); b("File \"bs_set_int_test.res\", line 146, characters 4-11", Belt_SetInt.isEmpty(v$10)); -let v$11 = Belt_Array.makeByAndShuffle(1000000, (i => { - return i; -})); +let v$11 = Belt_Array.makeByAndShuffle(1000000, (i => i)); let u$1 = Belt_SetInt.fromArray(v$11); @@ -341,9 +329,7 @@ let v3 = Belt_SetInt.removeMany(v2, [ 2001 ]); -let us = Belt_Array.map(Array_data_util.randomRange(1000, 3000), (x => { - return Belt_SetInt.has(v$12, x); -})); +let us = Belt_Array.map(Array_data_util.randomRange(1000, 3000), (x => Belt_SetInt.has(v$12, x))); let counted = Belt_Array.reduce(us, 0, ((acc, x) => { if (x) { diff --git a/jscomp/test/bs_sort_test.js b/jscomp/test/bs_sort_test.js index 783755c7c86..03a7b15cd67 100644 --- a/jscomp/test/bs_sort_test.js +++ b/jscomp/test/bs_sort_test.js @@ -151,9 +151,7 @@ let u$1 = [ ] ]; -eq("File \"bs_sort_test.res\", line 95, characters 5-12", Belt_SortArray.stableSortBy(u$1, ((param, param$1) => { - return param[0] - param$1[0] | 0; -})), [ +eq("File \"bs_sort_test.res\", line 95, characters 5-12", Belt_SortArray.stableSortBy(u$1, ((param, param$1) => param[0] - param$1[0] | 0)), [ [ 1, "a" @@ -187,9 +185,7 @@ let u$2 = [ ] ]; -eq("File \"bs_sort_test.res\", line 98, characters 4-11", Belt_SortArray.stableSortBy(u$2, ((param, param$1) => { - return param[0] - param$1[0] | 0; -})), [ +eq("File \"bs_sort_test.res\", line 98, characters 4-11", Belt_SortArray.stableSortBy(u$2, ((param, param$1) => param[0] - param$1[0] | 0)), [ [ 1, "b" @@ -235,9 +231,7 @@ let u$3 = [ ] ]; -eq("File \"bs_sort_test.res\", line 104, characters 4-11", Belt_SortArray.stableSortBy(u$3, ((param, param$1) => { - return param[0] - param$1[0] | 0; -})), [ +eq("File \"bs_sort_test.res\", line 104, characters 4-11", Belt_SortArray.stableSortBy(u$3, ((param, param$1) => param[0] - param$1[0] | 0)), [ [ 1, "c" @@ -323,13 +317,9 @@ eq("File \"bs_sort_test.res\", line 116, characters 5-12", Belt_SortArray.binary let aa = Array_data_util.range(0, 1000); -b("File \"bs_sort_test.res\", line 118, characters 4-11", Belt_Range.every(0, 1000, (i => { - return Belt_SortArray.binarySearchBy(aa, i, cmp) === i; -}))); +b("File \"bs_sort_test.res\", line 118, characters 4-11", Belt_Range.every(0, 1000, (i => Belt_SortArray.binarySearchBy(aa, i, cmp) === i))); -let cc = Belt_Array.map(Array_data_util.range(0, 2000), (x => { - return (x << 1); -})); +let cc = Belt_Array.map(Array_data_util.range(0, 2000), (x => (x << 1))); eq("File \"bs_sort_test.res\", line 121, characters 5-12", Belt_SortArray.binarySearchBy(cc, 5000, cmp) ^ -1, 2001); @@ -339,9 +329,7 @@ eq("File \"bs_sort_test.res\", line 123, characters 5-12", Belt_SortArray.binary eq("File \"bs_sort_test.res\", line 125, characters 5-12", Belt_SortArray.binarySearchBy(cc, 1, cmp) ^ -1, 1); -b("File \"bs_sort_test.res\", line 126, characters 6-13", Belt_Range.every(0, 1999, (i => { - return (Belt_SortArray.binarySearchBy(cc, (i << 1) + 1 | 0, cmp) ^ -1) === (i + 1 | 0); -}))); +b("File \"bs_sort_test.res\", line 126, characters 6-13", Belt_Range.every(0, 1999, (i => (Belt_SortArray.binarySearchBy(cc, (i << 1) + 1 | 0, cmp) ^ -1) === (i + 1 | 0)))); function lt(x, y) { return x < y; diff --git a/jscomp/test/bs_string_test.js b/jscomp/test/bs_string_test.js index 10a6d1b8e6e..3a6d4cf1a55 100644 --- a/jscomp/test/bs_string_test.js +++ b/jscomp/test/bs_string_test.js @@ -16,21 +16,17 @@ function eq(loc, x, y) { suites.contents = { hd: [ loc + (" id " + String(test_id.contents)), - (() => { - return { - TAG: "Eq", - _0: x, - _1: y - }; - }) + (() => ({ + TAG: "Eq", + _0: x, + _1: y + })) ], tl: suites.contents }; } -eq("File \"bs_string_test.res\", line 10, characters 2-9", "ghso ghso g".split(" ").reduce(((x, y) => { - return x + ("-" + y); -}), ""), "-ghso-ghso-g"); +eq("File \"bs_string_test.res\", line 10, characters 2-9", "ghso ghso g".split(" ").reduce(((x, y) => x + ("-" + y)), ""), "-ghso-ghso-g"); Mt.from_pair_suites("Bs_string_test", suites.contents); diff --git a/jscomp/test/buffer_test.js b/jscomp/test/buffer_test.js index 685c3b5b147..e6d20605bd0 100644 --- a/jscomp/test/buffer_test.js +++ b/jscomp/test/buffer_test.js @@ -11,19 +11,17 @@ let v = "gso"; let suites_0 = [ "equal", - (param => { - return { - TAG: "Eq", - _0: [ - Caml_bytes.get(Bytes.make(3, /* 'a' */97), 0), - Bytes.make(3, /* 'a' */97)[0] - ], - _1: [ - /* 'a' */97, - /* 'a' */97 - ] - }; - }) + (param => ({ + TAG: "Eq", + _0: [ + Caml_bytes.get(Bytes.make(3, /* 'a' */97), 0), + Bytes.make(3, /* 'a' */97)[0] + ], + _1: [ + /* 'a' */97, + /* 'a' */97 + ] + })) ]; let suites_1 = { diff --git a/jscomp/test/bytes_split_gpr_743_test.js b/jscomp/test/bytes_split_gpr_743_test.js index b92203941e8..cdcc342a375 100644 --- a/jscomp/test/bytes_split_gpr_743_test.js +++ b/jscomp/test/bytes_split_gpr_743_test.js @@ -20,13 +20,11 @@ function eq(loc, param) { suites.contents = { hd: [ loc + (" id " + String(test_id.contents)), - (() => { - return { - TAG: "Eq", - _0: x, - _1: y - }; - }) + (() => ({ + TAG: "Eq", + _0: x, + _1: y + })) ], tl: suites.contents }; diff --git a/jscomp/test/caml_compare_bigint_test.js b/jscomp/test/caml_compare_bigint_test.js index c5d05dfb9ba..43b91c846f7 100644 --- a/jscomp/test/caml_compare_bigint_test.js +++ b/jscomp/test/caml_compare_bigint_test.js @@ -9,200 +9,164 @@ function isLessThan(title, small, big) { return { hd: [ "compare: " + title, - (param => { - return { - TAG: "Eq", - _0: true, - _1: Caml_obj.compare(big, small) > 0 - }; - }) + (param => ({ + TAG: "Eq", + _0: true, + _1: Caml_obj.compare(big, small) > 0 + })) ], tl: { hd: [ "compare: " + title, - (param => { - return { - TAG: "Eq", - _0: true, - _1: Caml_obj.compare(small, big) < 0 - }; - }) + (param => ({ + TAG: "Eq", + _0: true, + _1: Caml_obj.compare(small, big) < 0 + })) ], tl: { hd: [ "< operator: " + title, - (param => { - return { - TAG: "Eq", - _0: true, - _1: Caml_obj.lessthan(small, big) - }; - }) + (param => ({ + TAG: "Eq", + _0: true, + _1: Caml_obj.lessthan(small, big) + })) ], tl: { hd: [ "<= operator: " + title, - (param => { - return { - TAG: "Eq", - _0: true, - _1: Caml_obj.lessequal(small, big) - }; - }) + (param => ({ + TAG: "Eq", + _0: true, + _1: Caml_obj.lessequal(small, big) + })) ], tl: { hd: [ "> operator: " + title, - (param => { - return { - TAG: "Eq", - _0: true, - _1: Caml_obj.greaterthan(big, small) - }; - }) + (param => ({ + TAG: "Eq", + _0: true, + _1: Caml_obj.greaterthan(big, small) + })) ], tl: { hd: [ ">= operator: " + title, - (param => { - return { - TAG: "Eq", - _0: true, - _1: Caml_obj.greaterequal(big, small) - }; - }) + (param => ({ + TAG: "Eq", + _0: true, + _1: Caml_obj.greaterequal(big, small) + })) ], tl: { hd: [ "min: " + title, - (param => { - return { - TAG: "Eq", - _0: small, - _1: Caml_obj.min(big, small) - }; - }) + (param => ({ + TAG: "Eq", + _0: small, + _1: Caml_obj.min(big, small) + })) ], tl: { hd: [ "min: " + title, - (param => { - return { - TAG: "Eq", - _0: small, - _1: Caml_obj.min(small, big) - }; - }) + (param => ({ + TAG: "Eq", + _0: small, + _1: Caml_obj.min(small, big) + })) ], tl: { hd: [ "max: " + title, - (param => { - return { - TAG: "Eq", - _0: big, - _1: Caml_obj.max(big, small) - }; - }) + (param => ({ + TAG: "Eq", + _0: big, + _1: Caml_obj.max(big, small) + })) ], tl: { hd: [ "max: " + title, - (param => { - return { - TAG: "Eq", - _0: big, - _1: Caml_obj.max(small, big) - }; - }) + (param => ({ + TAG: "Eq", + _0: big, + _1: Caml_obj.max(small, big) + })) ], tl: { hd: [ "!== operator: " + title, - (param => { - return { - TAG: "Eq", - _0: true, - _1: big !== small - }; - }) + (param => ({ + TAG: "Eq", + _0: true, + _1: big !== small + })) ], tl: { hd: [ "!== operator: " + title, - (param => { - return { - TAG: "Eq", - _0: true, - _1: small !== big - }; - }) + (param => ({ + TAG: "Eq", + _0: true, + _1: small !== big + })) ], tl: { hd: [ "!= operator: " + title, - (param => { - return { - TAG: "Eq", - _0: true, - _1: Caml_obj.notequal(big, small) - }; - }) + (param => ({ + TAG: "Eq", + _0: true, + _1: Caml_obj.notequal(big, small) + })) ], tl: { hd: [ "!= operator: " + title, - (param => { - return { - TAG: "Eq", - _0: true, - _1: Caml_obj.notequal(small, big) - }; - }) + (param => ({ + TAG: "Eq", + _0: true, + _1: Caml_obj.notequal(small, big) + })) ], tl: { hd: [ "== operator: " + title, - (param => { - return { - TAG: "Eq", - _0: false, - _1: Caml_obj.equal(big, small) - }; - }) + (param => ({ + TAG: "Eq", + _0: false, + _1: Caml_obj.equal(big, small) + })) ], tl: { hd: [ "== operator: " + title, - (param => { - return { - TAG: "Eq", - _0: false, - _1: Caml_obj.equal(small, big) - }; - }) + (param => ({ + TAG: "Eq", + _0: false, + _1: Caml_obj.equal(small, big) + })) ], tl: { hd: [ "=== operator: " + title, - (param => { - return { - TAG: "Eq", - _0: false, - _1: big === small - }; - }) + (param => ({ + TAG: "Eq", + _0: false, + _1: big === small + })) ], tl: { hd: [ "=== operator: " + title, - (param => { - return { - TAG: "Eq", - _0: false, - _1: small === big - }; - }) + (param => ({ + TAG: "Eq", + _0: false, + _1: small === big + })) ], tl: /* [] */0 } @@ -229,178 +193,146 @@ function isEqual(title, num1, num2) { return { hd: [ "< operator: " + title, - (param => { - return { - TAG: "Eq", - _0: false, - _1: Caml_obj.lessthan(num2, num1) - }; - }) + (param => ({ + TAG: "Eq", + _0: false, + _1: Caml_obj.lessthan(num2, num1) + })) ], tl: { hd: [ "<= operator: " + title, - (param => { - return { - TAG: "Eq", - _0: true, - _1: Caml_obj.lessequal(num2, num1) - }; - }) + (param => ({ + TAG: "Eq", + _0: true, + _1: Caml_obj.lessequal(num2, num1) + })) ], tl: { hd: [ "> operator: " + title, - (param => { - return { - TAG: "Eq", - _0: false, - _1: Caml_obj.greaterthan(num1, num2) - }; - }) + (param => ({ + TAG: "Eq", + _0: false, + _1: Caml_obj.greaterthan(num1, num2) + })) ], tl: { hd: [ ">= operator: " + title, - (param => { - return { - TAG: "Eq", - _0: true, - _1: Caml_obj.greaterequal(num1, num2) - }; - }) + (param => ({ + TAG: "Eq", + _0: true, + _1: Caml_obj.greaterequal(num1, num2) + })) ], tl: { hd: [ "min: " + title, - (param => { - return { - TAG: "Eq", - _0: num1, - _1: Caml_obj.min(num1, num2) - }; - }) + (param => ({ + TAG: "Eq", + _0: num1, + _1: Caml_obj.min(num1, num2) + })) ], tl: { hd: [ "max: " + title, - (param => { - return { - TAG: "Eq", - _0: num1, - _1: Caml_obj.max(num1, num2) - }; - }) + (param => ({ + TAG: "Eq", + _0: num1, + _1: Caml_obj.max(num1, num2) + })) ], tl: { hd: [ "compare: " + title, - (param => { - return { - TAG: "Eq", - _0: 0, - _1: Caml_obj.compare(num1, num2) - }; - }) + (param => ({ + TAG: "Eq", + _0: 0, + _1: Caml_obj.compare(num1, num2) + })) ], tl: { hd: [ "compare: " + title, - (param => { - return { - TAG: "Eq", - _0: 0, - _1: Caml_obj.compare(num2, num1) - }; - }) + (param => ({ + TAG: "Eq", + _0: 0, + _1: Caml_obj.compare(num2, num1) + })) ], tl: { hd: [ "!= operator: " + title, - (param => { - return { - TAG: "Eq", - _0: false, - _1: num1 !== num2 - }; - }) + (param => ({ + TAG: "Eq", + _0: false, + _1: num1 !== num2 + })) ], tl: { hd: [ "!= operator: " + title, - (param => { - return { - TAG: "Eq", - _0: false, - _1: num2 !== num1 - }; - }) + (param => ({ + TAG: "Eq", + _0: false, + _1: num2 !== num1 + })) ], tl: { hd: [ "!= operator: " + title, - (param => { - return { - TAG: "Eq", - _0: false, - _1: Caml_obj.notequal(num1, num2) - }; - }) + (param => ({ + TAG: "Eq", + _0: false, + _1: Caml_obj.notequal(num1, num2) + })) ], tl: { hd: [ "!= operator: " + title, - (param => { - return { - TAG: "Eq", - _0: false, - _1: Caml_obj.notequal(num2, num1) - }; - }) + (param => ({ + TAG: "Eq", + _0: false, + _1: Caml_obj.notequal(num2, num1) + })) ], tl: { hd: [ "== operator: " + title, - (param => { - return { - TAG: "Eq", - _0: true, - _1: Caml_obj.equal(num1, num2) - }; - }) + (param => ({ + TAG: "Eq", + _0: true, + _1: Caml_obj.equal(num1, num2) + })) ], tl: { hd: [ "== operator: " + title, - (param => { - return { - TAG: "Eq", - _0: true, - _1: Caml_obj.equal(num2, num1) - }; - }) + (param => ({ + TAG: "Eq", + _0: true, + _1: Caml_obj.equal(num2, num1) + })) ], tl: { hd: [ "=== operator: " + title, - (param => { - return { - TAG: "Eq", - _0: true, - _1: num1 === num2 - }; - }) + (param => ({ + TAG: "Eq", + _0: true, + _1: num1 === num2 + })) ], tl: { hd: [ "=== operator: " + title, - (param => { - return { - TAG: "Eq", - _0: true, - _1: num2 === num1 - }; - }) + (param => ({ + TAG: "Eq", + _0: true, + _1: num2 === num1 + })) ], tl: /* [] */0 } diff --git a/jscomp/test/caml_compare_test.js b/jscomp/test/caml_compare_test.js index 5d149c4a978..475b5f291f0 100644 --- a/jscomp/test/caml_compare_test.js +++ b/jscomp/test/caml_compare_test.js @@ -8,11 +8,7 @@ let Caml_js_exceptions = require("../../lib/js/caml_js_exceptions.js"); let function_equal_test; try { - function_equal_test = Caml_obj.equal((x => { - return x + 1 | 0; - }), (x => { - return x + 2 | 0; - })); + function_equal_test = Caml_obj.equal((x => x + 1 | 0), (x => x + 2 | 0)); } catch (raw_exn) { let exn = Caml_js_exceptions.internalToOCamlException(raw_exn); function_equal_test = exn.RE_EXN_ID === "Invalid_argument" && exn._1 === "equal: functional value" ? true : false; @@ -22,47 +18,67 @@ let suites = { contents: { hd: [ "File \"caml_compare_test.res\", line 12, characters 5-12", - (() => { - return { - TAG: "Eq", - _0: true, - _1: Caml_obj.lessthan(undefined, 1) - }; - }) + (() => ({ + TAG: "Eq", + _0: true, + _1: Caml_obj.lessthan(undefined, 1) + })) ], tl: { hd: [ "option2", - (() => { - return { - TAG: "Eq", - _0: true, - _1: Caml_obj.lessthan(1, 2) - }; - }) + (() => ({ + TAG: "Eq", + _0: true, + _1: Caml_obj.lessthan(1, 2) + })) ], tl: { hd: [ "File \"caml_compare_test.res\", line 14, characters 5-12", - (() => { - return { - TAG: "Eq", - _0: true, - _1: Caml_obj.greaterthan({ - hd: 1, - tl: /* [] */0 - }, /* [] */0) - }; - }) + (() => ({ + TAG: "Eq", + _0: true, + _1: Caml_obj.greaterthan({ + hd: 1, + tl: /* [] */0 + }, /* [] */0) + })) ], tl: { hd: [ "listeq", - (() => { - return { + (() => ({ + TAG: "Eq", + _0: true, + _1: Caml_obj.equal({ + hd: 1, + tl: { + hd: 2, + tl: { + hd: 3, + tl: /* [] */0 + } + } + }, { + hd: 1, + tl: { + hd: 2, + tl: { + hd: 3, + tl: /* [] */0 + } + } + }) + })) + ], + tl: { + hd: [ + "listneq", + (() => ({ TAG: "Eq", _0: true, - _1: Caml_obj.equal({ + _1: Caml_obj.greaterthan({ hd: 1, tl: { hd: 2, @@ -76,51 +92,57 @@ let suites = { tl: { hd: 2, tl: { - hd: 3, + hd: 2, tl: /* [] */0 } } }) - }; - }) - ], - tl: { - hd: [ - "listneq", - (() => { - return { - TAG: "Eq", - _0: true, - _1: Caml_obj.greaterthan({ - hd: 1, - tl: { - hd: 2, - tl: { - hd: 3, - tl: /* [] */0 - } - } - }, { - hd: 1, - tl: { - hd: 2, - tl: { - hd: 2, - tl: /* [] */0 - } - } - }) - }; - }) + })) ], tl: { hd: [ "custom_u", - (() => { - return { + (() => ({ + TAG: "Eq", + _0: true, + _1: Caml_obj.greaterthan([ + { + TAG: "A", + _0: 3 + }, + { + TAG: "B", + _0: 2, + _1: false + }, + { + TAG: "C", + _0: 1 + } + ], [ + { + TAG: "A", + _0: 3 + }, + { + TAG: "B", + _0: 2, + _1: false + }, + { + TAG: "C", + _0: 0 + } + ]) + })) + ], + tl: { + hd: [ + "custom_u2", + (() => ({ TAG: "Eq", _0: true, - _1: Caml_obj.greaterthan([ + _1: Caml_obj.equal([ { TAG: "A", _0: 3 @@ -146,128 +168,78 @@ let suites = { }, { TAG: "C", - _0: 0 + _0: 1 } ]) - }; - }) - ], - tl: { - hd: [ - "custom_u2", - (() => { - return { - TAG: "Eq", - _0: true, - _1: Caml_obj.equal([ - { - TAG: "A", - _0: 3 - }, - { - TAG: "B", - _0: 2, - _1: false - }, - { - TAG: "C", - _0: 1 - } - ], [ - { - TAG: "A", - _0: 3 - }, - { - TAG: "B", - _0: 2, - _1: false - }, - { - TAG: "C", - _0: 1 - } - ]) - }; - }) + })) ], tl: { hd: [ "function", - (() => { - return { - TAG: "Eq", - _0: true, - _1: function_equal_test - }; - }) + (() => ({ + TAG: "Eq", + _0: true, + _1: function_equal_test + })) ], tl: { hd: [ "File \"caml_compare_test.res\", line 20, characters 5-12", - (() => { - return { - TAG: "Eq", - _0: true, - _1: Caml_obj.lessthan(undefined, 1) - }; - }) + (() => ({ + TAG: "Eq", + _0: true, + _1: Caml_obj.lessthan(undefined, 1) + })) ], tl: { hd: [ "File \"caml_compare_test.res\", line 21, characters 5-12", - (() => { - return { - TAG: "Eq", - _0: true, - _1: Caml_obj.lessthan(undefined, [ - 1, - 30 - ]) - }; - }) + (() => ({ + TAG: "Eq", + _0: true, + _1: Caml_obj.lessthan(undefined, [ + 1, + 30 + ]) + })) ], tl: { hd: [ "File \"caml_compare_test.res\", line 22, characters 5-12", - (() => { - return { - TAG: "Eq", - _0: true, - _1: Caml_obj.greaterthan([ - 1, - 30 - ], undefined) - }; - }) + (() => ({ + TAG: "Eq", + _0: true, + _1: Caml_obj.greaterthan([ + 1, + 30 + ], undefined) + })) ], tl: { hd: [ "File \"caml_compare_test.res\", line 24, characters 6-13", - (() => { - return { - TAG: "Eq", - _0: true, - _1: Caml_obj.lessthan({ - hd: 2, + (() => ({ + TAG: "Eq", + _0: true, + _1: Caml_obj.lessthan({ + hd: 2, + tl: { + hd: 6, tl: { - hd: 6, + hd: 1, tl: { hd: 1, tl: { - hd: 1, + hd: 2, tl: { - hd: 2, + hd: 1, tl: { - hd: 1, + hd: 4, tl: { - hd: 4, + hd: 2, tl: { - hd: 2, - tl: { - hd: 1, - tl: /* [] */0 - } + hd: 1, + tl: /* [] */0 } } } @@ -275,28 +247,28 @@ let suites = { } } } - }, { - hd: 2, + } + }, { + hd: 2, + tl: { + hd: 6, tl: { - hd: 6, + hd: 1, tl: { hd: 1, tl: { - hd: 1, + hd: 2, tl: { - hd: 2, + hd: 1, tl: { - hd: 1, + hd: 4, tl: { - hd: 4, + hd: 2, tl: { - hd: 2, + hd: 1, tl: { - hd: 1, - tl: { - hd: 409, - tl: /* [] */0 - } + hd: 409, + tl: /* [] */0 } } } @@ -305,73 +277,67 @@ let suites = { } } } - }) - }; - }) + } + }) + })) ], tl: { hd: [ "File \"caml_compare_test.res\", line 27, characters 5-12", - (() => { - return { - TAG: "Eq", - _0: true, - _1: Caml_obj.lessthan({ - hd: 1, + (() => ({ + TAG: "Eq", + _0: true, + _1: Caml_obj.lessthan({ + hd: 1, + tl: /* [] */0 + }, { + hd: 1, + tl: { + hd: 409, tl: /* [] */0 - }, { - hd: 1, - tl: { - hd: 409, - tl: /* [] */0 - } - }) - }; - }) + } + }) + })) ], tl: { hd: [ "File \"caml_compare_test.res\", line 28, characters 5-12", - (() => { - return { - TAG: "Eq", - _0: true, - _1: Caml_obj.lessthan(/* [] */0, { - hd: 409, - tl: /* [] */0 - }) - }; - }) + (() => ({ + TAG: "Eq", + _0: true, + _1: Caml_obj.lessthan(/* [] */0, { + hd: 409, + tl: /* [] */0 + }) + })) ], tl: { hd: [ "File \"caml_compare_test.res\", line 30, characters 6-13", - (() => { - return { - TAG: "Eq", - _0: true, - _1: Caml_obj.greaterthan({ - hd: 2, + (() => ({ + TAG: "Eq", + _0: true, + _1: Caml_obj.greaterthan({ + hd: 2, + tl: { + hd: 6, tl: { - hd: 6, + hd: 1, tl: { hd: 1, tl: { - hd: 1, + hd: 2, tl: { - hd: 2, + hd: 1, tl: { - hd: 1, + hd: 4, tl: { - hd: 4, + hd: 2, tl: { - hd: 2, + hd: 1, tl: { - hd: 1, - tl: { - hd: 409, - tl: /* [] */0 - } + hd: 409, + tl: /* [] */0 } } } @@ -380,26 +346,26 @@ let suites = { } } } - }, { - hd: 2, + } + }, { + hd: 2, + tl: { + hd: 6, tl: { - hd: 6, + hd: 1, tl: { hd: 1, tl: { - hd: 1, + hd: 2, tl: { - hd: 2, + hd: 1, tl: { - hd: 1, + hd: 4, tl: { - hd: 4, + hd: 2, tl: { - hd: 2, - tl: { - hd: 1, - tl: /* [] */0 - } + hd: 1, + tl: /* [] */0 } } } @@ -407,59 +373,53 @@ let suites = { } } } - }) - }; - }) + } + }) + })) ], tl: { hd: [ "File \"caml_compare_test.res\", line 33, characters 5-12", - (() => { - return { - TAG: "Eq", - _0: false, - _1: false - }; - }) + (() => ({ + TAG: "Eq", + _0: false, + _1: false + })) ], tl: { hd: [ "File \"caml_compare_test.res\", line 34, characters 5-12", - (() => { - return { - TAG: "Eq", - _0: false, - _1: false - }; - }) + (() => ({ + TAG: "Eq", + _0: false, + _1: false + })) ], tl: { hd: [ "File \"caml_compare_test.res\", line 36, characters 6-13", - (() => { - return { - TAG: "Eq", - _0: false, - _1: Caml_obj.equal({ - hd: 2, + (() => ({ + TAG: "Eq", + _0: false, + _1: Caml_obj.equal({ + hd: 2, + tl: { + hd: 6, tl: { - hd: 6, + hd: 1, tl: { hd: 1, tl: { - hd: 1, + hd: 2, tl: { - hd: 2, + hd: 1, tl: { - hd: 1, + hd: 4, tl: { - hd: 4, + hd: 2, tl: { - hd: 2, - tl: { - hd: 1, - tl: /* [] */0 - } + hd: 1, + tl: /* [] */0 } } } @@ -467,28 +427,28 @@ let suites = { } } } - }, { - hd: 2, + } + }, { + hd: 2, + tl: { + hd: 6, tl: { - hd: 6, + hd: 1, tl: { hd: 1, tl: { - hd: 1, + hd: 2, tl: { - hd: 2, + hd: 1, tl: { - hd: 1, + hd: 4, tl: { - hd: 4, + hd: 2, tl: { - hd: 2, + hd: 1, tl: { - hd: 1, - tl: { - hd: 409, - tl: /* [] */0 - } + hd: 409, + tl: /* [] */0 } } } @@ -497,39 +457,37 @@ let suites = { } } } - }) - }; - }) + } + }) + })) ], tl: { hd: [ "File \"caml_compare_test.res\", line 40, characters 6-13", - (() => { - return { - TAG: "Eq", - _0: false, - _1: Caml_obj.equal({ - hd: 2, + (() => ({ + TAG: "Eq", + _0: false, + _1: Caml_obj.equal({ + hd: 2, + tl: { + hd: 6, tl: { - hd: 6, + hd: 1, tl: { hd: 1, tl: { - hd: 1, + hd: 2, tl: { - hd: 2, + hd: 1, tl: { - hd: 1, + hd: 4, tl: { - hd: 4, + hd: 2, tl: { - hd: 2, + hd: 1, tl: { - hd: 1, - tl: { - hd: 409, - tl: /* [] */0 - } + hd: 409, + tl: /* [] */0 } } } @@ -538,26 +496,26 @@ let suites = { } } } - }, { - hd: 2, + } + }, { + hd: 2, + tl: { + hd: 6, tl: { - hd: 6, + hd: 1, tl: { hd: 1, tl: { - hd: 1, + hd: 2, tl: { - hd: 2, + hd: 1, tl: { - hd: 1, + hd: 4, tl: { - hd: 4, + hd: 2, tl: { - hd: 2, - tl: { - hd: 1, - tl: /* [] */0 - } + hd: 1, + tl: /* [] */0 } } } @@ -565,351 +523,325 @@ let suites = { } } } - }) - }; - }) + } + }) + })) ], tl: { hd: [ "cmp_id", - (() => { - return { - TAG: "Eq", - _0: Caml_obj.compare({ - x: 1, - y: 2 - }, { - x: 1, - y: 2 - }), - _1: 0 - }; - }) + (() => ({ + TAG: "Eq", + _0: Caml_obj.compare({ + x: 1, + y: 2 + }, { + x: 1, + y: 2 + }), + _1: 0 + })) ], tl: { hd: [ "cmp_val", - (() => { - return { - TAG: "Eq", - _0: Caml_obj.compare({ - x: 1 - }, { - x: 2 - }), - _1: -1 - }; - }) + (() => ({ + TAG: "Eq", + _0: Caml_obj.compare({ + x: 1 + }, { + x: 2 + }), + _1: -1 + })) ], tl: { hd: [ "cmp_val2", - (() => { - return { - TAG: "Eq", - _0: Caml_obj.compare({ - x: 2 - }, { - x: 1 - }), - _1: 1 - }; - }) + (() => ({ + TAG: "Eq", + _0: Caml_obj.compare({ + x: 2 + }, { + x: 1 + }), + _1: 1 + })) ], tl: { hd: [ "cmp_empty", - (() => { - return { - TAG: "Eq", - _0: Caml_obj.compare({}, {}), - _1: 0 - }; - }) + (() => ({ + TAG: "Eq", + _0: Caml_obj.compare({}, {}), + _1: 0 + })) ], tl: { hd: [ "cmp_empty2", - (() => { - return { - TAG: "Eq", - _0: Caml_obj.compare({}, {x:1}), - _1: -1 - }; - }) + (() => ({ + TAG: "Eq", + _0: Caml_obj.compare({}, {x:1}), + _1: -1 + })) ], tl: { hd: [ "cmp_swap", - (() => { - return { - TAG: "Eq", - _0: Caml_obj.compare({ - x: 1, - y: 2 - }, { - y: 2, - x: 1 - }), - _1: 0 - }; - }) + (() => ({ + TAG: "Eq", + _0: Caml_obj.compare({ + x: 1, + y: 2 + }, { + y: 2, + x: 1 + }), + _1: 0 + })) ], tl: { hd: [ "cmp_size", - (() => { - return { - TAG: "Eq", - _0: Caml_obj.compare({x:1}, {x:1, y:2}), - _1: -1 - }; - }) + (() => ({ + TAG: "Eq", + _0: Caml_obj.compare({x:1}, {x:1, y:2}), + _1: -1 + })) ], tl: { hd: [ "cmp_size2", - (() => { - return { - TAG: "Eq", - _0: Caml_obj.compare({x:1, y:2}, {x:1}), - _1: 1 - }; - }) + (() => ({ + TAG: "Eq", + _0: Caml_obj.compare({x:1, y:2}, {x:1}), + _1: 1 + })) ], tl: { hd: [ "cmp_order", - (() => { - return { + (() => ({ + TAG: "Eq", + _0: Caml_obj.compare({ + x: 0, + y: 1 + }, { + x: 1, + y: 0 + }), + _1: -1 + })) + ], + tl: { + hd: [ + "cmp_order2", + (() => ({ TAG: "Eq", _0: Caml_obj.compare({ - x: 0, - y: 1 - }, { x: 1, y: 0 + }, { + x: 0, + y: 1 }), - _1: -1 - }; - }) - ], - tl: { - hd: [ - "cmp_order2", - (() => { - return { - TAG: "Eq", - _0: Caml_obj.compare({ - x: 1, - y: 0 - }, { - x: 0, - y: 1 - }), - _1: 1 - }; - }) + _1: 1 + })) ], tl: { hd: [ "cmp_in_list", - (() => { - return { + (() => ({ + TAG: "Eq", + _0: Caml_obj.compare({ + hd: { + x: 1 + }, + tl: /* [] */0 + }, { + hd: { + x: 2 + }, + tl: /* [] */0 + }), + _1: -1 + })) + ], + tl: { + hd: [ + "cmp_in_list2", + (() => ({ TAG: "Eq", _0: Caml_obj.compare({ hd: { - x: 1 + x: 2 }, tl: /* [] */0 }, { hd: { - x: 2 + x: 1 }, tl: /* [] */0 }), - _1: -1 - }; - }) - ], - tl: { - hd: [ - "cmp_in_list2", - (() => { - return { - TAG: "Eq", - _0: Caml_obj.compare({ - hd: { - x: 2 - }, - tl: /* [] */0 - }, { - hd: { - x: 1 - }, - tl: /* [] */0 - }), - _1: 1 - }; - }) + _1: 1 + })) ], tl: { hd: [ "cmp_with_list", - (() => { - return { + (() => ({ + TAG: "Eq", + _0: Caml_obj.compare({ + x: { + hd: 0, + tl: /* [] */0 + } + }, { + x: { + hd: 1, + tl: /* [] */0 + } + }), + _1: -1 + })) + ], + tl: { + hd: [ + "cmp_with_list2", + (() => ({ TAG: "Eq", _0: Caml_obj.compare({ x: { - hd: 0, + hd: 1, tl: /* [] */0 } }, { x: { - hd: 1, + hd: 0, tl: /* [] */0 } }), - _1: -1 - }; - }) - ], - tl: { - hd: [ - "cmp_with_list2", - (() => { - return { - TAG: "Eq", - _0: Caml_obj.compare({ - x: { - hd: 1, - tl: /* [] */0 - } - }, { - x: { - hd: 0, - tl: /* [] */0 - } - }), - _1: 1 - }; - }) + _1: 1 + })) ], tl: { hd: [ "eq_id", - (() => { - return { - TAG: "Ok", - _0: Caml_obj.equal({ - x: 1, - y: 2 - }, { - x: 1, - y: 2 - }) - }; - }) + (() => ({ + TAG: "Ok", + _0: Caml_obj.equal({ + x: 1, + y: 2 + }, { + x: 1, + y: 2 + }) + })) ], tl: { hd: [ "eq_val", - (() => { - return { + (() => ({ + TAG: "Eq", + _0: Caml_obj.equal({ + x: 1 + }, { + x: 2 + }), + _1: false + })) + ], + tl: { + hd: [ + "eq_val2", + (() => ({ TAG: "Eq", _0: Caml_obj.equal({ - x: 1 - }, { x: 2 + }, { + x: 1 }), _1: false - }; - }) - ], - tl: { - hd: [ - "eq_val2", - (() => { - return { - TAG: "Eq", - _0: Caml_obj.equal({ - x: 2 - }, { - x: 1 - }), - _1: false - }; - }) + })) ], tl: { hd: [ "eq_empty", - (() => { - return { - TAG: "Eq", - _0: Caml_obj.equal({}, {}), - _1: true - }; - }) + (() => ({ + TAG: "Eq", + _0: Caml_obj.equal({}, {}), + _1: true + })) ], tl: { hd: [ "eq_empty2", - (() => { - return { - TAG: "Eq", - _0: Caml_obj.equal({}, {x:1}), - _1: false - }; - }) + (() => ({ + TAG: "Eq", + _0: Caml_obj.equal({}, {x:1}), + _1: false + })) ], tl: { hd: [ "eq_swap", - (() => { - return { - TAG: "Ok", - _0: Caml_obj.equal({ - x: 1, - y: 2 - }, { - y: 2, - x: 1 - }) - }; - }) + (() => ({ + TAG: "Ok", + _0: Caml_obj.equal({ + x: 1, + y: 2 + }, { + y: 2, + x: 1 + }) + })) ], tl: { hd: [ "eq_size", - (() => { - return { - TAG: "Eq", - _0: Caml_obj.equal({x:1}, {x:1, y:2}), - _1: false - }; - }) + (() => ({ + TAG: "Eq", + _0: Caml_obj.equal({x:1}, {x:1, y:2}), + _1: false + })) ], tl: { hd: [ "eq_size2", - (() => { - return { - TAG: "Eq", - _0: Caml_obj.equal({x:1, y:2}, {x:1}), - _1: false - }; - }) + (() => ({ + TAG: "Eq", + _0: Caml_obj.equal({x:1, y:2}, {x:1}), + _1: false + })) ], tl: { hd: [ "eq_in_list", - (() => { - return { + (() => ({ + TAG: "Eq", + _0: Caml_obj.equal({ + hd: { + x: 1 + }, + tl: /* [] */0 + }, { + hd: { + x: 2 + }, + tl: /* [] */0 + }), + _1: false + })) + ], + tl: { + hd: [ + "eq_in_list2", + (() => ({ TAG: "Eq", _0: Caml_obj.equal({ hd: { - x: 1 + x: 2 }, tl: /* [] */0 }, { @@ -918,36 +850,32 @@ let suites = { }, tl: /* [] */0 }), - _1: false - }; - }) - ], - tl: { - hd: [ - "eq_in_list2", - (() => { - return { + _1: true + })) + ], + tl: { + hd: [ + "eq_with_list", + (() => ({ TAG: "Eq", _0: Caml_obj.equal({ - hd: { - x: 2 - }, - tl: /* [] */0 + x: { + hd: 0, + tl: /* [] */0 + } }, { - hd: { - x: 2 - }, - tl: /* [] */0 + x: { + hd: 0, + tl: /* [] */0 + } }), _1: true - }; - }) - ], - tl: { - hd: [ - "eq_with_list", - (() => { - return { + })) + ], + tl: { + hd: [ + "eq_with_list2", + (() => ({ TAG: "Eq", _0: Caml_obj.equal({ x: { @@ -956,117 +884,81 @@ let suites = { } }, { x: { - hd: 0, + hd: 1, tl: /* [] */0 } }), - _1: true - }; - }) - ], - tl: { - hd: [ - "eq_with_list2", - (() => { - return { - TAG: "Eq", - _0: Caml_obj.equal({ - x: { - hd: 0, - tl: /* [] */0 - } - }, { - x: { - hd: 1, - tl: /* [] */0 - } - }), - _1: false - }; - }) + _1: false + })) ], tl: { hd: [ "eq_no_prototype", - (() => { - return { - TAG: "Eq", - _0: Caml_obj.equal({x:1}, ((function(){let o = Object.create(null);o.x = 1;return o;})())), - _1: true - }; - }) + (() => ({ + TAG: "Eq", + _0: Caml_obj.equal({x:1}, ((function(){let o = Object.create(null);o.x = 1;return o;})())), + _1: true + })) ], tl: { hd: [ "File \"caml_compare_test.res\", line 76, characters 5-12", - (() => { - return { - TAG: "Eq", - _0: Caml_obj.compare(null, { - hd: 3, - tl: /* [] */0 - }), - _1: -1 - }; - }) + (() => ({ + TAG: "Eq", + _0: Caml_obj.compare(null, { + hd: 3, + tl: /* [] */0 + }), + _1: -1 + })) ], tl: { hd: [ "File \"caml_compare_test.res\", line 77, characters 5-12", - (() => { - return { - TAG: "Eq", - _0: Caml_obj.compare({ - hd: 3, - tl: /* [] */0 - }, null), - _1: 1 - }; - }) + (() => ({ + TAG: "Eq", + _0: Caml_obj.compare({ + hd: 3, + tl: /* [] */0 + }, null), + _1: 1 + })) ], tl: { hd: [ "File \"caml_compare_test.res\", line 78, characters 5-12", - (() => { - return { - TAG: "Eq", - _0: Caml_obj.compare(null, 0), - _1: -1 - }; - }) + (() => ({ + TAG: "Eq", + _0: Caml_obj.compare(null, 0), + _1: -1 + })) ], tl: { hd: [ "File \"caml_compare_test.res\", line 79, characters 5-12", - (() => { - return { - TAG: "Eq", - _0: Caml_obj.compare(0, null), - _1: 1 - }; - }) + (() => ({ + TAG: "Eq", + _0: Caml_obj.compare(0, null), + _1: 1 + })) ], tl: { hd: [ "File \"caml_compare_test.res\", line 80, characters 5-12", - (() => { - return { - TAG: "Eq", - _0: Caml_obj.compare(undefined, 0), - _1: -1 - }; - }) + (() => ({ + TAG: "Eq", + _0: Caml_obj.compare(undefined, 0), + _1: -1 + })) ], tl: { hd: [ "File \"caml_compare_test.res\", line 81, characters 5-12", - (() => { - return { - TAG: "Eq", - _0: Caml_obj.compare(0, undefined), - _1: 1 - }; - }) + (() => ({ + TAG: "Eq", + _0: Caml_obj.compare(0, undefined), + _1: 1 + })) ], tl: /* [] */0 } diff --git a/jscomp/test/caml_format_test.js b/jscomp/test/caml_format_test.js index 69551f8a363..d112a8fc4e9 100644 --- a/jscomp/test/caml_format_test.js +++ b/jscomp/test/caml_format_test.js @@ -79,9 +79,7 @@ let of_string = [ ]; function from_float_of_string(xs) { - return $$Array.mapi(((i, param) => { - return Pervasives.string_of_float; - }), xs); + return $$Array.mapi(((i, param) => Pervasives.string_of_float), xs); } function from_of_string(xs) { @@ -90,13 +88,11 @@ function from_of_string(xs) { let a = param[0]; return [ "of_string " + String(i), - (param => { - return { - TAG: "Eq", - _0: Caml_format.int_of_string(b), - _1: a - }; - }) + (param => ({ + TAG: "Eq", + _0: Caml_format.int_of_string(b), + _1: a + })) ]; }), of_string)); } @@ -144,13 +140,11 @@ let pairs$1 = [ let suites = Pervasives.$at(from_of_string(of_string), Pervasives.$at({ hd: [ "isnan_of_string", - (() => { - return { - TAG: "Eq", - _0: true, - _1: Pervasives.classify_float(Caml_format.float_of_string("nan")) === "FP_nan" - }; - }) + (() => ({ + TAG: "Eq", + _0: true, + _1: Pervasives.classify_float(Caml_format.float_of_string("nan")) === "FP_nan" + })) ], tl: /* [] */0 }, Pervasives.$at($$Array.to_list($$Array.mapi(((i, param) => { @@ -158,36 +152,30 @@ let suites = Pervasives.$at(from_of_string(of_string), Pervasives.$at({ let a = param[0]; return [ "infinity_of_string " + String(i), - (() => { - return { - TAG: "Eq", - _0: a, - _1: Pervasives.classify_float(Caml_format.float_of_string(b)) - }; - }) + (() => ({ + TAG: "Eq", + _0: a, + _1: Pervasives.classify_float(Caml_format.float_of_string(b)) + })) ]; }), pairs)), Pervasives.$at({ hd: [ "throw", - (() => { - return { - TAG: "ThrowAny", - _0: (() => { - Caml_format.float_of_string(""); - }) - }; - }) + (() => ({ + TAG: "ThrowAny", + _0: (() => { + Caml_format.float_of_string(""); + }) + })) ], tl: { hd: [ "format_int", - (() => { - return { - TAG: "Eq", - _0: " 33", - _1: Caml_format.format_int("%32d", 33) - }; - }) + (() => ({ + TAG: "Eq", + _0: " 33", + _1: Caml_format.format_int("%32d", 33) + })) ], tl: /* [] */0 } @@ -196,13 +184,11 @@ let suites = Pervasives.$at(from_of_string(of_string), Pervasives.$at({ let a = param[0]; return [ "normal_float_of_string " + String(i), - (() => { - return { - TAG: "Eq", - _0: a, - _1: Caml_format.float_of_string(b) - }; - }) + (() => ({ + TAG: "Eq", + _0: a, + _1: Caml_format.float_of_string(b) + })) ]; }), pairs$1)))))); @@ -320,42 +306,36 @@ let float_data = [ let int64_suites_0 = [ "i64_simple7", - (param => { - return { - TAG: "Eq", - _0: Caml_int64.to_string([ - 0, - 3333 - ]), - _1: "3333" - }; - }) + (param => ({ + TAG: "Eq", + _0: Caml_int64.to_string([ + 0, + 3333 + ]), + _1: "3333" + })) ]; let int64_suites_1 = { hd: [ "i64_simple15", - (param => { - return { - TAG: "Eq", - _0: Caml_int64.to_string(Caml_int64.neg_one), - _1: "-1" - }; - }) + (param => ({ + TAG: "Eq", + _0: Caml_int64.to_string(Caml_int64.neg_one), + _1: "-1" + })) ], tl: { hd: [ "i64_simple16", - (param => { - return { - TAG: "Eq", - _0: Caml_int64.to_string([ - -1, - 4294956185 - ]), - _1: "-11111" - }; - }) + (param => ({ + TAG: "Eq", + _0: Caml_int64.to_string([ + -1, + 4294956185 + ]), + _1: "-11111" + })) ], tl: /* [] */0 } @@ -429,26 +409,22 @@ Mt.from_pair_suites("Caml_format_test", Pervasives.$at(suites, Pervasives.$at($$ let fmt = param[0]; return [ "loat_format " + String(i), - (() => { - return { - TAG: "Eq", - _0: Caml_format.format_float(fmt, f), - _1: str_result - }; - }) + (() => ({ + TAG: "Eq", + _0: Caml_format.format_float(fmt, f), + _1: str_result + })) ]; }), float_data)), Pervasives.$at(int64_suites, $$Array.to_list($$Array.mapi(((i, param) => { let b = param[1]; let a = param[0]; return [ "int64_of_string " + String(i) + " ", - (() => { - return { - TAG: "Eq", - _0: Caml_format.int64_of_string(b), - _1: a - }; - }) + (() => ({ + TAG: "Eq", + _0: Caml_format.int64_of_string(b), + _1: a + })) ]; }), of_string_data)))))); diff --git a/jscomp/test/chain_code_test.js b/jscomp/test/chain_code_test.js index b663f91d564..461d59ba4b0 100644 --- a/jscomp/test/chain_code_test.js +++ b/jscomp/test/chain_code_test.js @@ -16,13 +16,11 @@ function eq(loc, x, y) { suites.contents = { hd: [ loc + (" id " + String(test_id.contents)), - (() => { - return { - TAG: "Eq", - _0: x, - _1: y - }; - }) + (() => ({ + TAG: "Eq", + _0: x, + _1: y + })) ], tl: suites.contents }; diff --git a/jscomp/test/chn_test.js b/jscomp/test/chn_test.js index b75c36db0e9..262a90dcdfc 100644 --- a/jscomp/test/chn_test.js +++ b/jscomp/test/chn_test.js @@ -18,13 +18,11 @@ function eq(loc, x, y) { suites.contents = { hd: [ loc + (" id " + String(test_id.contents)), - (() => { - return { - TAG: "Eq", - _0: x, - _1: y - }; - }) + (() => ({ + TAG: "Eq", + _0: x, + _1: y + })) ], tl: suites.contents }; diff --git a/jscomp/test/class_type_ffi_test.js b/jscomp/test/class_type_ffi_test.js index b2fea69bc85..ad02e32fbcb 100644 --- a/jscomp/test/class_type_ffi_test.js +++ b/jscomp/test/class_type_ffi_test.js @@ -19,9 +19,7 @@ function off2(o, a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12) { } function mk_f() { - return (a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12) => { - return a0(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12); - }; + return (a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12) => a0(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12); } exports.test_set = test_set; diff --git a/jscomp/test/coercion_module_alias_test.js b/jscomp/test/coercion_module_alias_test.js index f08f262e3b0..eeb1cbc20e4 100644 --- a/jscomp/test/coercion_module_alias_test.js +++ b/jscomp/test/coercion_module_alias_test.js @@ -27,9 +27,7 @@ console.log(prim$2); let f = List.length; function g(x) { - return List.length(List.map((prim => { - return prim + 1 | 0; - }), x)); + return List.length(List.map((prim => prim + 1 | 0), x)); } function F(X) { diff --git a/jscomp/test/complex_if_test.js b/jscomp/test/complex_if_test.js index dd489b6705b..59a7fd3a100 100644 --- a/jscomp/test/complex_if_test.js +++ b/jscomp/test/complex_if_test.js @@ -122,13 +122,11 @@ function string_escaped(s) { let suites_0 = [ "complete_escape", - (param => { - return { - TAG: "Eq", - _0: Bytes.to_string(escaped(Bytes.of_string("\x00\x01\x02\x03\x04\x05\x06\x07\b\t\n\x0b\x0c\r\x0e\x0f\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\x7f\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xaa\xab\xac\xad\xae\xaf\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff"))), - _1: "\\000\\001\\002\\003\\004\\005\\006\\007\\b\\t\\n\\011\\012\\r\\014\\015\\016\\017\\018\\019\\020\\021\\022\\023\\024\\025\\026\\027\\028\\029\\030\\031 !\\\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\\127\\128\\129\\130\\131\\132\\133\\134\\135\\136\\137\\138\\139\\140\\141\\142\\143\\144\\145\\146\\147\\148\\149\\150\\151\\152\\153\\154\\155\\156\\157\\158\\159\\160\\161\\162\\163\\164\\165\\166\\167\\168\\169\\170\\171\\172\\173\\174\\175\\176\\177\\178\\179\\180\\181\\182\\183\\184\\185\\186\\187\\188\\189\\190\\191\\192\\193\\194\\195\\196\\197\\198\\199\\200\\201\\202\\203\\204\\205\\206\\207\\208\\209\\210\\211\\212\\213\\214\\215\\216\\217\\218\\219\\220\\221\\222\\223\\224\\225\\226\\227\\228\\229\\230\\231\\232\\233\\234\\235\\236\\237\\238\\239\\240\\241\\242\\243\\244\\245\\246\\247\\248\\249\\250\\251\\252\\253\\254\\255" - }; - }) + (param => ({ + TAG: "Eq", + _0: Bytes.to_string(escaped(Bytes.of_string("\x00\x01\x02\x03\x04\x05\x06\x07\b\t\n\x0b\x0c\r\x0e\x0f\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\x7f\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xaa\xab\xac\xad\xae\xaf\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff"))), + _1: "\\000\\001\\002\\003\\004\\005\\006\\007\\b\\t\\n\\011\\012\\r\\014\\015\\016\\017\\018\\019\\020\\021\\022\\023\\024\\025\\026\\027\\028\\029\\030\\031 !\\\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\\127\\128\\129\\130\\131\\132\\133\\134\\135\\136\\137\\138\\139\\140\\141\\142\\143\\144\\145\\146\\147\\148\\149\\150\\151\\152\\153\\154\\155\\156\\157\\158\\159\\160\\161\\162\\163\\164\\165\\166\\167\\168\\169\\170\\171\\172\\173\\174\\175\\176\\177\\178\\179\\180\\181\\182\\183\\184\\185\\186\\187\\188\\189\\190\\191\\192\\193\\194\\195\\196\\197\\198\\199\\200\\201\\202\\203\\204\\205\\206\\207\\208\\209\\210\\211\\212\\213\\214\\215\\216\\217\\218\\219\\220\\221\\222\\223\\224\\225\\226\\227\\228\\229\\230\\231\\232\\233\\234\\235\\236\\237\\238\\239\\240\\241\\242\\243\\244\\245\\246\\247\\248\\249\\250\\251\\252\\253\\254\\255" + })) ]; let suites = { diff --git a/jscomp/test/complex_test.js b/jscomp/test/complex_test.js index b37c4a45a71..3d18a006e46 100644 --- a/jscomp/test/complex_test.js +++ b/jscomp/test/complex_test.js @@ -6,16 +6,14 @@ let Complex = require("../../lib/js/complex.js"); let suites_0 = [ "basic_add", - (param => { - return { - TAG: "Eq", - _0: { - re: 2, - im: 2 - }, - _1: Complex.add(Complex.add(Complex.add(Complex.one, Complex.one), Complex.i), Complex.i) - }; - }) + (param => ({ + TAG: "Eq", + _0: { + re: 2, + im: 2 + }, + _1: Complex.add(Complex.add(Complex.add(Complex.one, Complex.one), Complex.i), Complex.i) + })) ]; let suites = { diff --git a/jscomp/test/condition_compilation_test.js b/jscomp/test/condition_compilation_test.js index 8429994f682..b5898d6574f 100644 --- a/jscomp/test/condition_compilation_test.js +++ b/jscomp/test/condition_compilation_test.js @@ -24,13 +24,11 @@ function eq(loc, x, y) { suites.contents = { hd: [ loc + (" id " + String(test_id.contents)), - (() => { - return { - TAG: "Eq", - _0: x, - _1: y - }; - }) + (() => ({ + TAG: "Eq", + _0: x, + _1: y + })) ], tl: suites.contents }; diff --git a/jscomp/test/cps_test.js b/jscomp/test/cps_test.js index 775475b3711..959b4371773 100644 --- a/jscomp/test/cps_test.js +++ b/jscomp/test/cps_test.js @@ -24,9 +24,7 @@ function test() { continue; }; }; - f(10, (() => { - - })); + f(10, (() => {})); return v.contents; } @@ -34,13 +32,9 @@ function test_closure() { let v = { contents: 0 }; - let arr = Caml_array.make(6, (x => { - return x; - })); + let arr = Caml_array.make(6, (x => x)); for (let i = 0; i <= 5; ++i) { - Caml_array.set(arr, i, (param => { - return i; - })); + Caml_array.set(arr, i, (param => i)); } $$Array.iter((i => { v.contents = v.contents + i(0) | 0; @@ -52,14 +46,10 @@ function test_closure2() { let v = { contents: 0 }; - let arr = Caml_array.make(6, (x => { - return x; - })); + let arr = Caml_array.make(6, (x => x)); for (let i = 0; i <= 5; ++i) { let j = i + i | 0; - Caml_array.set(arr, i, (param => { - return j; - })); + Caml_array.set(arr, i, (param => j)); } $$Array.iter((i => { v.contents = v.contents + i(0) | 0; @@ -70,35 +60,29 @@ function test_closure2() { Mt.from_pair_suites("Cps_test", { hd: [ "cps_test_sum", - (() => { - return { - TAG: "Eq", - _0: 55, - _1: test() - }; - }) + (() => ({ + TAG: "Eq", + _0: 55, + _1: test() + })) ], tl: { hd: [ "cps_test_closure", - (() => { - return { - TAG: "Eq", - _0: 15, - _1: test_closure() - }; - }) + (() => ({ + TAG: "Eq", + _0: 15, + _1: test_closure() + })) ], tl: { hd: [ "cps_test_closure2", - (() => { - return { - TAG: "Eq", - _0: 30, - _1: test_closure2() - }; - }) + (() => ({ + TAG: "Eq", + _0: 30, + _1: test_closure2() + })) ], tl: /* [] */0 } diff --git a/jscomp/test/demo_page.js b/jscomp/test/demo_page.js index 9a967984408..09eeb60a783 100644 --- a/jscomp/test/demo_page.js +++ b/jscomp/test/demo_page.js @@ -41,11 +41,9 @@ function f(extra) { } ReactDom.render(React.createClass({ - render: (() => { - return React.DOM.div({ - alt: "pic" - }, React.DOM.h1(undefined, "hello react"), React.DOM.h2(undefined, "type safe!")); - }) + render: (() => React.DOM.div({ + alt: "pic" + }, React.DOM.h1(undefined, "hello react"), React.DOM.h2(undefined, "type safe!"))) }), document.getElementById("hi")); exports.fib = fib; diff --git a/jscomp/test/digest_test.js b/jscomp/test/digest_test.js index 50fddfb30ae..6820085cd45 100644 --- a/jscomp/test/digest_test.js +++ b/jscomp/test/digest_test.js @@ -148,68 +148,56 @@ let ref = [ Mt.from_pair_suites("Digest_test", Pervasives.$at({ hd: [ "File \"digest_test.res\", line 9, characters 9-16", - (() => { - return { - TAG: "Eq", - _0: Digest.to_hex(Digest.string("value")), - _1: "2063c1608d6e0baf80249c42e2be5804" - }; - }) + (() => ({ + TAG: "Eq", + _0: Digest.to_hex(Digest.string("value")), + _1: "2063c1608d6e0baf80249c42e2be5804" + })) ], tl: { hd: [ "File \"digest_test.res\", line 11, characters 10-17", - (() => { - return { - TAG: "Eq", - _0: Digest.to_hex(Digest.string("The quick brown fox jumps over the lazy dog")), - _1: "9e107d9d372bb6826bd81d3542a419d6" - }; - }) + (() => ({ + TAG: "Eq", + _0: Digest.to_hex(Digest.string("The quick brown fox jumps over the lazy dog")), + _1: "9e107d9d372bb6826bd81d3542a419d6" + })) ], tl: { hd: [ "File \"digest_test.res\", line 18, characters 10-17", - (() => { - return { - TAG: "Eq", - _0: Digest.to_hex(Digest.string("The quick brown fox jumps over the lazy dog.")), - _1: "e4d909c290d0fb1ca068ffaddf22cbd0" - }; - }) + (() => ({ + TAG: "Eq", + _0: Digest.to_hex(Digest.string("The quick brown fox jumps over the lazy dog.")), + _1: "e4d909c290d0fb1ca068ffaddf22cbd0" + })) ], tl: { hd: [ "File \"digest_test.res\", line 24, characters 9-16", - (() => { - return { - TAG: "Eq", - _0: Digest.to_hex(Digest.string("")), - _1: "d41d8cd98f00b204e9800998ecf8427e" - }; - }) + (() => ({ + TAG: "Eq", + _0: Digest.to_hex(Digest.string("")), + _1: "d41d8cd98f00b204e9800998ecf8427e" + })) ], tl: { hd: [ "File \"digest_test.res\", line 26, characters 10-17", - (() => { - return { - TAG: "Eq", - _0: Digest.to_hex(Digest.string("The quick brown fox jumps over the lazy dog.The quick brown fox jumps over the lazy dog.The quick brown fox jumps over the lazy dog.The quick brown fox jumps over the lazy dog.The quick brown fox jumps over the lazy dog.The quick brown fox jumps over the lazy dog.The quick brown fox jumps over the lazy dog.The quick brown fox jumps over the lazy dog.The quick brown fox jumps over the lazy dog.The quick brown fox jumps over the lazy dog.The quick brown fox jumps over the lazy dog.The quick brown fox jumps over the lazy dog.")), - _1: "7065cc36bba1d155fb09f9d02f22e8bf" - }; - }) + (() => ({ + TAG: "Eq", + _0: Digest.to_hex(Digest.string("The quick brown fox jumps over the lazy dog.The quick brown fox jumps over the lazy dog.The quick brown fox jumps over the lazy dog.The quick brown fox jumps over the lazy dog.The quick brown fox jumps over the lazy dog.The quick brown fox jumps over the lazy dog.The quick brown fox jumps over the lazy dog.The quick brown fox jumps over the lazy dog.The quick brown fox jumps over the lazy dog.The quick brown fox jumps over the lazy dog.The quick brown fox jumps over the lazy dog.The quick brown fox jumps over the lazy dog.")), + _1: "7065cc36bba1d155fb09f9d02f22e8bf" + })) ], tl: { hd: [ "File \"digest_test.res\", line 45, characters 10-17", - (() => { - return { - TAG: "Eq", - _0: Digest.to_hex(Digest.string("The quick brown fox jumps over the lazy dog.The quick brown fox jumps over the lazy dog.The quick brown fox jumps over the lazy dog.")), - _1: "b9193d1df4b7a8f0a25ffdd1005c5b2b" - }; - }) + (() => ({ + TAG: "Eq", + _0: Digest.to_hex(Digest.string("The quick brown fox jumps over the lazy dog.The quick brown fox jumps over the lazy dog.The quick brown fox jumps over the lazy dog.")), + _1: "b9193d1df4b7a8f0a25ffdd1005c5b2b" + })) ], tl: /* [] */0 } @@ -217,18 +205,14 @@ Mt.from_pair_suites("Digest_test", Pervasives.$at({ } } } -}, $$Array.to_list($$Array.map((i => { - return [ - String(i), - (() => { - return { - TAG: "Eq", - _0: Digest.to_hex(Digest.string("a".repeat(i))), - _1: Caml_array.get(ref, i) - }; - }) - ]; -}), Ext_array_test.range(0, 129))))); +}, $$Array.to_list($$Array.map((i => [ + String(i), + (() => ({ + TAG: "Eq", + _0: Digest.to_hex(Digest.string("a".repeat(i))), + _1: Caml_array.get(ref, i) + })) +]), Ext_array_test.range(0, 129))))); exports.f = f; /* Not a pure module */ diff --git a/jscomp/test/div_by_zero_test.js b/jscomp/test/div_by_zero_test.js index 99d983b7f93..4eb69bbc30b 100644 --- a/jscomp/test/div_by_zero_test.js +++ b/jscomp/test/div_by_zero_test.js @@ -18,13 +18,11 @@ function eq(loc, x, y) { suites.contents = { hd: [ loc + (" id " + String(test_id.contents)), - (() => { - return { - TAG: "Eq", - _0: x, - _1: y - }; - }) + (() => ({ + TAG: "Eq", + _0: x, + _1: y + })) ], tl: suites.contents }; @@ -39,80 +37,68 @@ function add(suite) { add([ "File \"div_by_zero_test.res\", line 11, characters 7-14", - (() => { - return { - TAG: "ThrowAny", - _0: (() => { - Caml_int32.div(3, 0); - }) - }; - }) + (() => ({ + TAG: "ThrowAny", + _0: (() => { + Caml_int32.div(3, 0); + }) + })) ]); add([ "File \"div_by_zero_test.res\", line 12, characters 7-14", - (() => { - return { - TAG: "ThrowAny", - _0: (() => { - Caml_int32.mod_(3, 0); - }) - }; - }) + (() => ({ + TAG: "ThrowAny", + _0: (() => { + Caml_int32.mod_(3, 0); + }) + })) ]); add([ "File \"div_by_zero_test.res\", line 13, characters 7-14", - (() => { - return { - TAG: "ThrowAny", - _0: (() => { - Caml_int32.div(3, 0); - }) - }; - }) + (() => ({ + TAG: "ThrowAny", + _0: (() => { + Caml_int32.div(3, 0); + }) + })) ]); add([ "File \"div_by_zero_test.res\", line 14, characters 7-14", - (() => { - return { - TAG: "ThrowAny", - _0: (() => { - Caml_int32.mod_(3, 0); - }) - }; - }) + (() => ({ + TAG: "ThrowAny", + _0: (() => { + Caml_int32.mod_(3, 0); + }) + })) ]); add([ "File \"div_by_zero_test.res\", line 15, characters 7-14", - (() => { - return { - TAG: "ThrowAny", - _0: (() => { - Caml_int64.div([ - 0, - 3 - ], Caml_int64.zero); - }) - }; - }) + (() => ({ + TAG: "ThrowAny", + _0: (() => { + Caml_int64.div([ + 0, + 3 + ], Caml_int64.zero); + }) + })) ]); add([ "File \"div_by_zero_test.res\", line 16, characters 7-14", - (() => { - return { - TAG: "ThrowAny", - _0: (() => { - Caml_int64.mod_([ - 0, - 3 - ], Caml_int64.zero); - }) - }; - }) + (() => ({ + TAG: "ThrowAny", + _0: (() => { + Caml_int64.mod_([ + 0, + 3 + ], Caml_int64.zero); + }) + })) ]); function div(x, y) { diff --git a/jscomp/test/dollar_escape_test.js b/jscomp/test/dollar_escape_test.js index 695fa5b07b4..3d9ae3fde4b 100644 --- a/jscomp/test/dollar_escape_test.js +++ b/jscomp/test/dollar_escape_test.js @@ -16,13 +16,11 @@ function eq(loc, x, y) { suites.contents = { hd: [ loc + (" id " + String(test_id.contents)), - (() => { - return { - TAG: "Eq", - _0: x, - _1: y - }; - }) + (() => ({ + TAG: "Eq", + _0: x, + _1: y + })) ], tl: suites.contents }; diff --git a/jscomp/test/earger_curry_test.js b/jscomp/test/earger_curry_test.js index d04d8386032..c830edf9afa 100644 --- a/jscomp/test/earger_curry_test.js +++ b/jscomp/test/earger_curry_test.js @@ -6,9 +6,7 @@ let Caml_array = require("../../lib/js/caml_array.js"); let Pervasives = require("../../lib/js/pervasives.js"); function map(f, a) { - let f$1 = x => { - return f(x); - }; + let f$1 = x => f(x); let l = a.length; if (l === 0) { return []; @@ -21,9 +19,7 @@ function map(f, a) { } function init(l, f) { - let f$1 = x => { - return f(x); - }; + let f$1 = x => f(x); if (l === 0) { return []; } @@ -43,9 +39,7 @@ function init(l, f) { } function fold_left(f, x, a) { - let f$1 = (x, y) => { - return f(x, y); - }; + let f$1 = (x, y) => f(x, y); let r = x; for (let i = 0, i_finish = a.length; i < i_finish; ++i) { r = f$1(r, a[i]); @@ -54,15 +48,9 @@ function fold_left(f, x, a) { } function f2() { - let arr = init(30000000, (i => { - return i; - })); - let b = map((i => { - return i + i - 1; - }), arr); - let v = fold_left(((prim0, prim1) => { - return prim0 + prim1; - }), 0, b); + let arr = init(30000000, (i => i)); + let b = map((i => i + i - 1), arr); + let v = fold_left(((prim0, prim1) => prim0 + prim1), 0, b); console.log(Pervasives.string_of_float(v)); } @@ -81,13 +69,11 @@ function eq(loc, x, y) { suites.contents = { hd: [ loc + (" id " + String(test_id.contents)), - (() => { - return { - TAG: "Eq", - _0: x, - _1: y - }; - }) + (() => ({ + TAG: "Eq", + _0: x, + _1: y + })) ], tl: suites.contents }; @@ -117,15 +103,11 @@ function add5(a0, a1, a2, a3, a4) { } function f(x) { - return (extra, extra$1) => { - return add5(x, (v.contents = v.contents + 1 | 0, 1), (v.contents = v.contents + 1 | 0, 2), extra, extra$1); - }; + return (extra, extra$1) => add5(x, (v.contents = v.contents + 1 | 0, 1), (v.contents = v.contents + 1 | 0, 2), extra, extra$1); } function g(x) { - let u = (a, b) => { - return add5(x, (v.contents = v.contents + 1 | 0, 1), (v.contents = v.contents + 1 | 0, 2), a, b); - }; + let u = (a, b) => add5(x, (v.contents = v.contents + 1 | 0, 1), (v.contents = v.contents + 1 | 0, 2), a, b); all_v.contents = { hd: v.contents, tl: all_v.contents diff --git a/jscomp/test/epsilon_test.js b/jscomp/test/epsilon_test.js index 7766655f571..a524211b937 100644 --- a/jscomp/test/epsilon_test.js +++ b/jscomp/test/epsilon_test.js @@ -8,25 +8,21 @@ let v = (Number.EPSILON?Number.EPSILON:2.220446049250313e-16); let suites_0 = [ "epsilon", - (param => { - return { - TAG: "Eq", - _0: Pervasives.epsilon_float, - _1: v - }; - }) + (param => ({ + TAG: "Eq", + _0: Pervasives.epsilon_float, + _1: v + })) ]; let suites_1 = { hd: [ "raw_epsilon", - (param => { - return { - TAG: "Eq", - _0: 2.220446049250313e-16, - _1: v - }; - }) + (param => ({ + TAG: "Eq", + _0: 2.220446049250313e-16, + _1: v + })) ], tl: /* [] */0 }; diff --git a/jscomp/test/es6_module_test.js b/jscomp/test/es6_module_test.js index 449421dd482..7d53747f7be 100644 --- a/jscomp/test/es6_module_test.js +++ b/jscomp/test/es6_module_test.js @@ -11,30 +11,26 @@ function length(param) { Mt.from_pair_suites("Es6_module_test", { hd: [ "list_length", - (() => { - return { - TAG: "Eq", - _0: List.length({ - hd: 1, - tl: { - hd: 2, - tl: /* [] */0 - } - }), - _1: 2 - }; - }) + (() => ({ + TAG: "Eq", + _0: List.length({ + hd: 1, + tl: { + hd: 2, + tl: /* [] */0 + } + }), + _1: 2 + })) ], tl: { hd: [ "length", - (() => { - return { - TAG: "Eq", - _0: 3, - _1: 3 - }; - }) + (() => ({ + TAG: "Eq", + _0: 3, + _1: 3 + })) ], tl: /* [] */0 } diff --git a/jscomp/test/event_ffi.js b/jscomp/test/event_ffi.js index 4a0472be91a..55421f3adb5 100644 --- a/jscomp/test/event_ffi.js +++ b/jscomp/test/event_ffi.js @@ -20,9 +20,7 @@ function h10(x) { } function h30(x) { - return a => { - return x(3, 3, a); - }; + return a => x(3, 3, a); } function h33(x) { @@ -42,9 +40,7 @@ function a0() { } function a1() { - return x => { - return x; - }; + return x => x; } function a2(x, y) { diff --git a/jscomp/test/exception_raise_test.js b/jscomp/test/exception_raise_test.js index 765e0cb2f8b..01ccdad8b6f 100644 --- a/jscomp/test/exception_raise_test.js +++ b/jscomp/test/exception_raise_test.js @@ -127,23 +127,21 @@ let suites = { contents: { hd: [ "File \"exception_raise_test.res\", line 120, characters 5-12", - (() => { - return { - TAG: "Eq", - _0: [ - f, - ff, - fff, - a0 - ], - _1: [ - 2, - 2, - 2, - 2 - ] - }; - }) + (() => ({ + TAG: "Eq", + _0: [ + f, + ff, + fff, + a0 + ], + _1: [ + 2, + 2, + 2, + 2 + ] + })) ], tl: { hd: [ diff --git a/jscomp/test/exception_rebound_err_test.js b/jscomp/test/exception_rebound_err_test.js index ad59a802b8a..cbf37fae66b 100644 --- a/jscomp/test/exception_rebound_err_test.js +++ b/jscomp/test/exception_rebound_err_test.js @@ -18,13 +18,11 @@ function eq(loc, x, y) { suites.contents = { hd: [ loc + (" id " + String(test_id.contents)), - (() => { - return { - TAG: "Eq", - _0: x, - _1: y - }; - }) + (() => ({ + TAG: "Eq", + _0: x, + _1: y + })) ], tl: suites.contents }; diff --git a/jscomp/test/ext_array_test.js b/jscomp/test/ext_array_test.js index f7aef56e879..154cca7dc64 100644 --- a/jscomp/test/ext_array_test.js +++ b/jscomp/test/ext_array_test.js @@ -112,9 +112,7 @@ function range(from, to_) { } }); } - return $$Array.init((to_ - from | 0) + 1 | 0, (i => { - return i + from | 0; - })); + return $$Array.init((to_ - from | 0) + 1 | 0, (i => i + from | 0)); } function map2i(f, a, b) { @@ -127,9 +125,7 @@ function map2i(f, a, b) { } }); } - return $$Array.mapi(((i, a) => { - return f(i, a, b[i]); - }), a); + return $$Array.mapi(((i, a) => f(i, a, b[i])), a); } function tolist_aux(a, f, _i, _res) { diff --git a/jscomp/test/ext_bytes_test.js b/jscomp/test/ext_bytes_test.js index 08dea9cca83..d7a2f849154 100644 --- a/jscomp/test/ext_bytes_test.js +++ b/jscomp/test/ext_bytes_test.js @@ -170,17 +170,13 @@ let f = Char.chr; let a$2 = Bytes.unsafe_to_string(Bytes.init(100, f)); -let b = Bytes.init(100, (i => { - return /* '\000' */0; -})); +let b = Bytes.init(100, (i => /* '\000' */0)); Bytes.blit_string(a$2, 10, b, 5, 10); eq("File \"ext_bytes_test.res\", line 141, characters 4-11", b, Bytes.of_string("\x00\x00\x00\x00\x00\n\x0b\x0c\r\x0e\x0f\x10\x11\x12\x13\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00")); -let s = Bytes.init(50000, (i => { - return Char.chr(i % 137); -})); +let s = Bytes.init(50000, (i => Char.chr(i % 137))); let s1 = Bytes.to_string(s); diff --git a/jscomp/test/ext_filename_test.js b/jscomp/test/ext_filename_test.js index f9bce06151f..997953fb770 100644 --- a/jscomp/test/ext_filename_test.js +++ b/jscomp/test/ext_filename_test.js @@ -19,9 +19,7 @@ let node_parent = ".."; let node_current = "."; -let cwd = CamlinternalLazy.from_fun(() => { - return Caml_sys.sys_getcwd(); -}); +let cwd = CamlinternalLazy.from_fun(() => Caml_sys.sys_getcwd()); function path_as_directory(x) { if (x === "" || Ext_string_test.ends_with(x, Filename.dir_sep)) { @@ -106,9 +104,7 @@ function relative_path(file_or_dir_1, file_or_dir_2) { _dir1 = dir1.tl; continue; } - return Pervasives.$at(List.map((param => { - return node_parent; - }), dir2), dir1); + return Pervasives.$at(List.map((param => node_parent), dir2), dir1); }; }; let ys = go(dir1, dir2); @@ -264,18 +260,14 @@ function rel_normalized_absolute_path(from, to_) { } let xs = xss.tl; if (!yss) { - return List.fold_left(((acc, param) => { - return Filename.concat(acc, Ext_string_test.parent_dir_lit); - }), Ext_string_test.parent_dir_lit, xs); + return List.fold_left(((acc, param) => Filename.concat(acc, Ext_string_test.parent_dir_lit)), Ext_string_test.parent_dir_lit, xs); } if (xss.hd === yss.hd) { _yss = yss.tl; _xss = xs; continue; } - let start = List.fold_left(((acc, param) => { - return Filename.concat(acc, Ext_string_test.parent_dir_lit); - }), Ext_string_test.parent_dir_lit, xs); + let start = List.fold_left(((acc, param) => Filename.concat(acc, Ext_string_test.parent_dir_lit)), Ext_string_test.parent_dir_lit, xs); return List.fold_left(Filename.concat, start, yss); }; } @@ -347,9 +339,7 @@ function get_extension(x) { let simple_convert_node_path_to_os_path; if (Sys.unix) { - simple_convert_node_path_to_os_path = (x => { - return x; - }); + simple_convert_node_path_to_os_path = (x => x); } else if (Sys.win32 || false) { simple_convert_node_path_to_os_path = Ext_string_test.replace_slash_backward; } else { diff --git a/jscomp/test/ext_list_test.js b/jscomp/test/ext_list_test.js index 14edc5bf682..92d855a990f 100644 --- a/jscomp/test/ext_list_test.js +++ b/jscomp/test/ext_list_test.js @@ -648,9 +648,7 @@ function for_all_opt(p, _x) { } function fold(f, l, init) { - return List.fold_left(((acc, i) => { - return f(i, init); - }), init, l); + return List.fold_left(((acc, i) => f(i, init)), init, l); } function rev_map_acc(acc, f, l) { @@ -774,9 +772,7 @@ function split_map(f, xs) { function reduce_from_right(fn, lst) { let match = List.rev(lst); if (match) { - return List.fold_left(((x, y) => { - return fn(y, x); - }), match.hd, match.tl); + return List.fold_left(((x, y) => fn(y, x)), match.hd, match.tl); } throw new Error("Invalid_argument", { cause: { diff --git a/jscomp/test/ext_string_test.js b/jscomp/test/ext_string_test.js index 5f906c7919c..43d475e72d7 100644 --- a/jscomp/test/ext_string_test.js +++ b/jscomp/test/ext_string_test.js @@ -82,9 +82,7 @@ function split(keep_empty, str, on) { if (str === "") { return /* [] */0; } else { - return split_by(keep_empty, (x => { - return x === on; - }), str); + return split_by(keep_empty, (x => x === on), str); } } @@ -147,9 +145,7 @@ function ends_with_then_chop(s, beg) { } function check_any_suffix_case(s, suffixes) { - return List.exists((x => { - return ends_with(s, x); - }), suffixes); + return List.exists((x => ends_with(s, x)), suffixes); } function check_any_suffix_case_then_chop(s, suffixes) { diff --git a/jscomp/test/extensible_variant_test.js b/jscomp/test/extensible_variant_test.js index 29905fc5a32..5c5d571d311 100644 --- a/jscomp/test/extensible_variant_test.js +++ b/jscomp/test/extensible_variant_test.js @@ -38,47 +38,41 @@ function to_int(x) { let suites_0 = [ "test_int", - (param => { - return { - TAG: "Eq", - _0: 3, - _1: to_int({ - RE_EXN_ID: Int, - _1: 3, - _2: 0 - }) - }; - }) + (param => ({ + TAG: "Eq", + _0: 3, + _1: to_int({ + RE_EXN_ID: Int, + _1: 3, + _2: 0 + }) + })) ]; let suites_1 = { hd: [ "test_int2", - (param => { - return { - TAG: "Eq", - _0: 0, - _1: to_int({ - RE_EXN_ID: Int$1, - _1: 3, - _2: 0 - }) - }; - }) + (param => ({ + TAG: "Eq", + _0: 0, + _1: to_int({ + RE_EXN_ID: Int$1, + _1: 3, + _2: 0 + }) + })) ], tl: { hd: [ "test_string", - (param => { - return { - TAG: "Eq", - _0: -1, - _1: to_int({ - RE_EXN_ID: Str, - _1: "x" - }) - }; - }) + (param => ({ + TAG: "Eq", + _0: -1, + _1: to_int({ + RE_EXN_ID: Str, + _1: "x" + }) + })) ], tl: /* [] */0 } diff --git a/jscomp/test/ffi_arity_test.js b/jscomp/test/ffi_arity_test.js index a47b3770cc3..b22cee3c8bf 100644 --- a/jscomp/test/ffi_arity_test.js +++ b/jscomp/test/ffi_arity_test.js @@ -5,13 +5,9 @@ let Mt = require("./mt.js"); function f(v) { if (v % 2 === 0) { - return v => { - return Math.imul(v, v); - }; + return v => Math.imul(v, v); } else { - return v => { - return v + v | 0; - }; + return v => v + v | 0; } } @@ -19,25 +15,19 @@ let v = [ 1, 2, 3 -].map((a, b) => { - return f(a)(b); -}); +].map((a, b) => f(a)(b)); let vv = [ 1, 2, 3 -].map((a, b) => { - return a + b | 0; -}); +].map((a, b) => a + b | 0); let hh = [ "1", "2", "3" -].map(x => { - return parseInt(x); -}); +].map(x => parseInt(x)); function u() { return 3; @@ -70,47 +60,41 @@ fff(); Mt.from_pair_suites("Ffi_arity_test", { hd: [ "File \"ffi_arity_test.res\", line 51, characters 7-14", - (() => { - return { - TAG: "Eq", - _0: v, - _1: [ - 0, - 1, - 4 - ] - }; - }) + (() => ({ + TAG: "Eq", + _0: v, + _1: [ + 0, + 1, + 4 + ] + })) ], tl: { hd: [ "File \"ffi_arity_test.res\", line 52, characters 7-14", - (() => { - return { - TAG: "Eq", - _0: vv, - _1: [ - 1, - 3, - 5 - ] - }; - }) + (() => ({ + TAG: "Eq", + _0: vv, + _1: [ + 1, + 3, + 5 + ] + })) ], tl: { hd: [ "File \"ffi_arity_test.res\", line 53, characters 7-14", - (() => { - return { - TAG: "Eq", - _0: hh, - _1: [ - 1, - 2, - 3 - ] - }; - }) + (() => ({ + TAG: "Eq", + _0: hh, + _1: [ + 1, + 2, + 3 + ] + })) ], tl: /* [] */0 } diff --git a/jscomp/test/ffi_array_test.js b/jscomp/test/ffi_array_test.js index 3946ce8764b..3c67221ad07 100644 --- a/jscomp/test/ffi_array_test.js +++ b/jscomp/test/ffi_array_test.js @@ -16,13 +16,11 @@ function eq(loc, x, y) { suites.contents = { hd: [ loc + (" id " + String(test_id.contents)), - (() => { - return { - TAG: "Eq", - _0: x, - _1: y - }; - }) + (() => ({ + TAG: "Eq", + _0: x, + _1: y + })) ], tl: suites.contents }; @@ -33,9 +31,7 @@ eq("File \"ffi_array_test.res\", line 11, characters 12-19", [ 2, 3, 4 -].map(x => { - return x + 1 | 0; -}), [ +].map(x => x + 1 | 0), [ 2, 3, 4, diff --git a/jscomp/test/ffi_js_test.js b/jscomp/test/ffi_js_test.js index 6aedb7d4216..c70965c6f0d 100644 --- a/jscomp/test/ffi_js_test.js +++ b/jscomp/test/ffi_js_test.js @@ -27,13 +27,11 @@ function eq(loc, param) { suites.contents = { hd: [ loc + (" id " + String(test_id.contents)), - (() => { - return { - TAG: "Eq", - _0: x, - _1: y - }; - }) + (() => ({ + TAG: "Eq", + _0: x, + _1: y + })) ], tl: suites.contents }; diff --git a/jscomp/test/ffi_splice_test.js b/jscomp/test/ffi_splice_test.js index f888b374a27..d42e7cd1d04 100644 --- a/jscomp/test/ffi_splice_test.js +++ b/jscomp/test/ffi_splice_test.js @@ -16,13 +16,11 @@ function eq(loc, x, y) { suites.contents = { hd: [ loc + (" id " + String(test_id.contents)), - (() => { - return { - TAG: "Eq", - _0: x, - _1: y - }; - }) + (() => ({ + TAG: "Eq", + _0: x, + _1: y + })) ], tl: suites.contents }; diff --git a/jscomp/test/flexible_array_test.js b/jscomp/test/flexible_array_test.js index 1cf78048a4f..ddb7f45a572 100644 --- a/jscomp/test/flexible_array_test.js +++ b/jscomp/test/flexible_array_test.js @@ -269,12 +269,8 @@ function sort(s) { return s; } let head = get(s, 0); - let larger = sort(filter_from(1, (x => { - return Caml_obj.greaterthan(x, head); - }), s)); - let smaller = sort(filter_from(1, (x => { - return Caml_obj.lessequal(x, head); - }), s)); + let larger = sort(filter_from(1, (x => Caml_obj.greaterthan(x, head)), s)); + let smaller = sort(filter_from(1, (x => Caml_obj.lessequal(x, head)), s)); return append(smaller, push_front(larger, head)); } @@ -335,13 +331,9 @@ if (!$eq$tilde(sort(u), [ }); } -let v = $$Array.init(500, (i => { - return 500 - i | 0; -})); +let v = $$Array.init(500, (i => 500 - i | 0)); -$eq$tilde(sort(of_array(v)), $$Array.init(500, (i => { - return i + 1 | 0; -}))); +$eq$tilde(sort(of_array(v)), $$Array.init(500, (i => i + 1 | 0))); exports.sub = sub; exports.update = update; diff --git a/jscomp/test/float_of_bits_test.js b/jscomp/test/float_of_bits_test.js index 40b698b9436..4d8f89d3ce5 100644 --- a/jscomp/test/float_of_bits_test.js +++ b/jscomp/test/float_of_bits_test.js @@ -31,24 +31,20 @@ function from_pairs(pair) { return { hd: [ "int32_float_of_bits " + i, - (param => { - return { - TAG: "Eq", - _0: Caml_float.int_float_of_bits(i32), - _1: f - }; - }) + (param => ({ + TAG: "Eq", + _0: Caml_float.int_float_of_bits(i32), + _1: f + })) ], tl: { hd: [ "int32_bits_of_float " + i, - (param => { - return { - TAG: "Eq", - _0: Caml_float.int_bits_of_float(f), - _1: i32 - }; - }) + (param => ({ + TAG: "Eq", + _0: Caml_float.int_bits_of_float(f), + _1: i32 + })) ], tl: /* [] */0 } @@ -59,24 +55,20 @@ function from_pairs(pair) { let suites = Pervasives.$at({ hd: [ "one", - (() => { - return { - TAG: "Eq", - _0: Caml_int64.bits_of_float(1.0), - _1: one_float - }; - }) + (() => ({ + TAG: "Eq", + _0: Caml_int64.bits_of_float(1.0), + _1: one_float + })) ], tl: { hd: [ "two", - (() => { - return { - TAG: "Eq", - _0: Caml_int64.float_of_bits(one_float), - _1: 1.0 - }; - }) + (() => ({ + TAG: "Eq", + _0: Caml_int64.float_of_bits(one_float), + _1: 1.0 + })) ], tl: /* [] */0 } diff --git a/jscomp/test/float_test.js b/jscomp/test/float_test.js index 236150f421f..87516dde675 100644 --- a/jscomp/test/float_test.js +++ b/jscomp/test/float_test.js @@ -123,13 +123,11 @@ function from_pairs(ps) { let a = param[0]; return [ "pair " + i, - (param => { - return { - TAG: "Approx", - _0: a, - _1: b - }; - }) + (param => ({ + TAG: "Approx", + _0: a, + _1: b + })) ]; }), ps)); } @@ -199,9 +197,7 @@ eq("File \"float_test.res\", line 71, characters 4-11", $$Array.map((x => { } else { return 0; } -}), $$Array.map((param => { - return Caml.float_compare(param[0], param[1]); -}), [ +}), $$Array.map((param => Caml.float_compare(param[0], param[1])), [ [ 1, 3 @@ -325,46 +321,38 @@ let a = match$4[0]; Mt.from_pair_suites("Float_test", Pervasives.$at({ hd: [ "mod_float", - (() => { - return { - TAG: "Approx", - _0: 3.2 % 0.5, - _1: 0.200000000000000178 - }; - }) + (() => ({ + TAG: "Approx", + _0: 3.2 % 0.5, + _1: 0.200000000000000178 + })) ], tl: { hd: [ "modf_float1", - (() => { - return { - TAG: "Approx", - _0: a, - _1: 0.299999999999997158 - }; - }) + (() => ({ + TAG: "Approx", + _0: a, + _1: 0.299999999999997158 + })) ], tl: { hd: [ "modf_float2", - (() => { - return { - TAG: "Approx", - _0: b, - _1: 32 - }; - }) + (() => ({ + TAG: "Approx", + _0: b, + _1: 32 + })) ], tl: { hd: [ "int_of_float", - (() => { - return { - TAG: "Eq", - _0: 3, - _1: 3 - }; - }) + (() => ({ + TAG: "Eq", + _0: 3, + _1: 3 + })) ], tl: /* [] */0 } diff --git a/jscomp/test/for_loop_test.js b/jscomp/test/for_loop_test.js index 03e19b4ae87..541d27444ed 100644 --- a/jscomp/test/for_loop_test.js +++ b/jscomp/test/for_loop_test.js @@ -9,20 +9,14 @@ function for_3(x) { let v = { contents: 0 }; - let arr = $$Array.map((param => { - return () => { - - }; - }), x); + let arr = $$Array.map((param => ((() => {}))), x); for (let i = 0, i_finish = x.length; i < i_finish; ++i) { let j = (i << 1); Caml_array.set(arr, i, (() => { v.contents = v.contents + j | 0; })); } - $$Array.iter((x => { - x(); - }), arr); + $$Array.iter((x => x()), arr); return v.contents; } @@ -30,11 +24,7 @@ function for_4(x) { let v = { contents: 0 }; - let arr = $$Array.map((param => { - return () => { - - }; - }), x); + let arr = $$Array.map((param => ((() => {}))), x); for (let i = 0, i_finish = x.length; i < i_finish; ++i) { let j = (i << 1); let k = (j << 1); @@ -42,9 +32,7 @@ function for_4(x) { v.contents = v.contents + k | 0; })); } - $$Array.iter((x => { - x(); - }), arr); + $$Array.iter((x => x()), arr); return v.contents; } @@ -52,20 +40,14 @@ function for_5(x, u) { let v = { contents: 0 }; - let arr = $$Array.map((param => { - return () => { - - }; - }), x); + let arr = $$Array.map((param => ((() => {}))), x); for (let i = 0, i_finish = x.length; i < i_finish; ++i) { let k = Math.imul((u << 1), u); Caml_array.set(arr, i, (() => { v.contents = v.contents + k | 0; })); } - $$Array.iter((x => { - x(); - }), arr); + $$Array.iter((x => x()), arr); return v.contents; } @@ -73,11 +55,7 @@ function for_6(x, u) { let v = { contents: 0 }; - let arr = $$Array.map((param => { - return () => { - - }; - }), x); + let arr = $$Array.map((param => ((() => {}))), x); let v4 = { contents: 0 }; @@ -101,9 +79,7 @@ function for_6(x, u) { } inspect_3 = v2.contents; } - $$Array.iter((x => { - x(); - }), arr); + $$Array.iter((x => x()), arr); return [ v.contents, v4.contents, @@ -116,9 +92,7 @@ function for_7() { let v = { contents: 0 }; - let arr = Caml_array.make(21, (() => { - - })); + let arr = Caml_array.make(21, (() => {})); for (let i = 0; i <= 6; ++i) { for (let j = 0; j <= 2; ++j) { Caml_array.set(arr, Math.imul(i, 3) + j | 0, (() => { @@ -126,9 +100,7 @@ function for_7() { })); } } - $$Array.iter((f => { - f(); - }), arr); + $$Array.iter((f => f()), arr); return v.contents; } @@ -136,9 +108,7 @@ function for_8() { let v = { contents: 0 }; - let arr = Caml_array.make(21, (() => { - - })); + let arr = Caml_array.make(21, (() => {})); for (let i = 0; i <= 6; ++i) { let k = (i << 1); for (let j = 0; j <= 2; ++j) { @@ -148,9 +118,7 @@ function for_8() { })); } } - $$Array.iter((f => { - f(); - }), arr); + $$Array.iter((f => f()), arr); return v.contents; } @@ -170,12 +138,8 @@ function for_9() { let vv2 = { contents: 0 }; - let arr = Caml_array.make(4, (() => { - - })); - let arr2 = Caml_array.make(2, (() => { - - })); + let arr = Caml_array.make(4, (() => {})); + let arr2 = Caml_array.make(2, (() => {})); for (let i = 0; i <= 1; ++i) { let v$1 = { contents: 0 @@ -192,12 +156,8 @@ function for_9() { vv2.contents = vv2.contents + v$1.contents | 0; })); } - $$Array.iter((f => { - f(); - }), arr); - $$Array.iter((f => { - f(); - }), arr2); + $$Array.iter((f => f()), arr); + $$Array.iter((f => f()), arr2); return [[ vv.contents, $$Array.of_list(List.rev(v.contents)), @@ -207,94 +167,80 @@ function for_9() { let suites_0 = [ "for_loop_test_3", - (param => { - return { - TAG: "Eq", - _0: 90, - _1: for_3(Caml_array.make(10, 2)) - }; - }) + (param => ({ + TAG: "Eq", + _0: 90, + _1: for_3(Caml_array.make(10, 2)) + })) ]; let suites_1 = { hd: [ "for_loop_test_4", - (param => { - return { - TAG: "Eq", - _0: 180, - _1: for_4(Caml_array.make(10, 2)) - }; - }) + (param => ({ + TAG: "Eq", + _0: 180, + _1: for_4(Caml_array.make(10, 2)) + })) ], tl: { hd: [ "for_loop_test_5", - (param => { - return { - TAG: "Eq", - _0: 2420, - _1: for_5(Caml_array.make(10, 2), 11) - }; - }) + (param => ({ + TAG: "Eq", + _0: 2420, + _1: for_5(Caml_array.make(10, 2), 11) + })) ], tl: { hd: [ "for_loop_test_6", - (param => { - return { - TAG: "Eq", - _0: [ - 30, - 1, - 2, - 3 - ], - _1: for_6(Caml_array.make(3, 0), 0) - }; - }) + (param => ({ + TAG: "Eq", + _0: [ + 30, + 1, + 2, + 3 + ], + _1: for_6(Caml_array.make(3, 0), 0) + })) ], tl: { hd: [ "for_loop_test_7", - (param => { - return { - TAG: "Eq", - _0: 84, - _1: for_7() - }; - }) + (param => ({ + TAG: "Eq", + _0: 84, + _1: for_7() + })) ], tl: { hd: [ "for_loop_test_8", - (param => { - return { - TAG: "Eq", - _0: 294, - _1: for_8() - }; - }) + (param => ({ + TAG: "Eq", + _0: 294, + _1: for_8() + })) ], tl: { hd: [ "for_loop_test_9", - (param => { - return { - TAG: "Eq", - _0: [[ - 10, - [ - 1, - 2, - 2, - 3 - ], - 5 - ]], - _1: for_9() - }; - }) + (param => ({ + TAG: "Eq", + _0: [[ + 10, + [ + 1, + 2, + 2, + 3 + ], + 5 + ]], + _1: for_9() + })) ], tl: /* [] */0 } diff --git a/jscomp/test/for_side_effect_test.js b/jscomp/test/for_side_effect_test.js index b09d72bbaeb..9eefaf994c9 100644 --- a/jscomp/test/for_side_effect_test.js +++ b/jscomp/test/for_side_effect_test.js @@ -21,13 +21,11 @@ function test2() { let suites_0 = [ "for_order", - (param => { - return { - TAG: "Eq", - _0: 10, - _1: test2() - }; - }) + (param => ({ + TAG: "Eq", + _0: 10, + _1: test2() + })) ]; let suites = { diff --git a/jscomp/test/format_test.js b/jscomp/test/format_test.js index c56ca5671b5..60194b196c0 100644 --- a/jscomp/test/format_test.js +++ b/jscomp/test/format_test.js @@ -20,13 +20,11 @@ function eq(loc, x, y) { suites.contents = { hd: [ loc + (" id " + String(test_id.contents)), - (() => { - return { - TAG: "Eq", - _0: x, - _1: y - }; - }) + (() => ({ + TAG: "Eq", + _0: x, + _1: y + })) ], tl: suites.contents }; @@ -77,9 +75,7 @@ eq("File \"format_test.res\", line 45, characters 5-12", (1 + 4095 / 4096) * 8, eq("File \"format_test.res\", line 46, characters 5-12", (1 + 65535 / 65536) * 8, 15.9998779296875); function f(loc, ls) { - List.iter((param => { - eq(loc, Caml_format.float_of_string(param[0]), param[1]); - }), ls); + List.iter((param => eq(loc, Caml_format.float_of_string(param[0]), param[1])), ls); } f("File \"format_test.res\", line 53, characters 11-18", { @@ -107,9 +103,7 @@ function sl(f) { } function aux_list(loc, ls) { - List.iter((param => { - eq(loc, Caml_format.hexstring_of_float(param[0], -1, /* '-' */45), param[1]); - }), ls); + List.iter((param => eq(loc, Caml_format.hexstring_of_float(param[0], -1, /* '-' */45), param[1])), ls); } let literals_0 = [ @@ -186,9 +180,7 @@ scan_float("File \"format_test.res\", line 80, characters 13-20", "0x3f.p1", 126 scan_float("File \"format_test.res\", line 81, characters 13-20", "0x1.3333333333333p-2", 0.3); -List.iter((param => { - scan_float("File \"format_test.res\", line 82, characters 35-42", param[1], param[0]); -}), literals); +List.iter((param => scan_float("File \"format_test.res\", line 82, characters 35-42", param[1], param[0])), literals); let f1 = - -9.9; diff --git a/jscomp/test/functor_app_test.js b/jscomp/test/functor_app_test.js index 6b744b7ca3f..dfe9b6b287f 100644 --- a/jscomp/test/functor_app_test.js +++ b/jscomp/test/functor_app_test.js @@ -18,13 +18,11 @@ function eq(loc, x, y) { suites.contents = { hd: [ loc + (" id " + String(test_id.contents)), - (() => { - return { - TAG: "Eq", - _0: x, - _1: y - }; - }) + (() => ({ + TAG: "Eq", + _0: x, + _1: y + })) ], tl: suites.contents }; diff --git a/jscomp/test/functor_ffi.js b/jscomp/test/functor_ffi.js index a5f95c44a47..70f82d1356e 100644 --- a/jscomp/test/functor_ffi.js +++ b/jscomp/test/functor_ffi.js @@ -4,9 +4,7 @@ let Caml_option = require("../../lib/js/caml_option.js"); function Make(S) { - let opt_get = (f, i) => { - return Caml_option.undefined_to_opt(f[i]); - }; + let opt_get = (f, i) => Caml_option.undefined_to_opt(f[i]); return { opt_get: opt_get }; diff --git a/jscomp/test/functors.js b/jscomp/test/functors.js index f603ffb3f55..8356fd371ee 100644 --- a/jscomp/test/functors.js +++ b/jscomp/test/functors.js @@ -3,12 +3,8 @@ function O(X) { - let cow = x => { - return X.foo(x); - }; - let sheep = x => { - return 1 + X.foo(x) | 0; - }; + let cow = x => X.foo(x); + let sheep = x => 1 + X.foo(x) | 0; return { cow: cow, sheep: sheep @@ -16,12 +12,8 @@ function O(X) { } function F(X, Y) { - let cow = x => { - return Y.foo(X.foo(x)); - }; - let sheep = x => { - return 1 + Y.foo(X.foo(x)) | 0; - }; + let cow = x => Y.foo(X.foo(x)); + let sheep = x => 1 + Y.foo(X.foo(x)) | 0; return { cow: cow, sheep: sheep @@ -29,18 +21,14 @@ function F(X, Y) { } function F1(X, Y) { - let sheep = x => { - return 1 + Y.foo(X.foo(x)) | 0; - }; + let sheep = x => 1 + Y.foo(X.foo(x)) | 0; return { sheep: sheep }; } function F2(X, Y) { - let sheep = x => { - return 1 + Y.foo(X.foo(x)) | 0; - }; + let sheep = x => 1 + Y.foo(X.foo(x)) | 0; return { sheep: sheep }; @@ -48,9 +36,7 @@ function F2(X, Y) { let M = { F: ((funarg, funarg$1) => { - let sheep = x => { - return 1 + funarg$1.foo(funarg.foo(x)) | 0; - }; + let sheep = x => 1 + funarg$1.foo(funarg.foo(x)) | 0; return { sheep: sheep }; diff --git a/jscomp/test/genlex_test.js b/jscomp/test/genlex_test.js index 351756a40dc..ffd25cdc8a7 100644 --- a/jscomp/test/genlex_test.js +++ b/jscomp/test/genlex_test.js @@ -59,55 +59,53 @@ function to_list(s) { let suites_0 = [ "lexer_stream_genlex", - (param => { - return { - TAG: "Eq", - _0: { + (param => ({ + TAG: "Eq", + _0: { + hd: { + TAG: "Int", + _0: 3 + }, + tl: { hd: { - TAG: "Int", - _0: 3 + TAG: "Kwd", + _0: "(" }, tl: { hd: { - TAG: "Kwd", - _0: "(" + TAG: "Int", + _0: 3 }, tl: { hd: { - TAG: "Int", - _0: 3 + TAG: "Kwd", + _0: "+" }, tl: { hd: { - TAG: "Kwd", - _0: "+" + TAG: "Int", + _0: 2 }, tl: { hd: { TAG: "Int", - _0: 2 + _0: -1 }, tl: { hd: { - TAG: "Int", - _0: -1 + TAG: "Kwd", + _0: ")" }, - tl: { - hd: { - TAG: "Kwd", - _0: ")" - }, - tl: /* [] */0 - } + tl: /* [] */0 } } } } } - }, - _1: to_list(lexer(Stream.of_string("3(3 + 2 -1)"))) - }; - }) + } + }, + _1: to_list(lexer(Stream.of_string("3(3 + 2 -1)"))) + })) ]; let suites = { diff --git a/jscomp/test/global_exception_regression_test.js b/jscomp/test/global_exception_regression_test.js index 39e4feb2abc..cb861d4208c 100644 --- a/jscomp/test/global_exception_regression_test.js +++ b/jscomp/test/global_exception_regression_test.js @@ -17,25 +17,21 @@ let s = { let suites_0 = [ "not_found_equal", - (param => { - return { - TAG: "Eq", - _0: u, - _1: v - }; - }) + (param => ({ + TAG: "Eq", + _0: u, + _1: v + })) ]; let suites_1 = { hd: [ "not_found_not_equal_end_of_file", - (param => { - return { - TAG: "Neq", - _0: u, - _1: s - }; - }) + (param => ({ + TAG: "Neq", + _0: u, + _1: s + })) ], tl: /* [] */0 }; diff --git a/jscomp/test/global_module_alias_test.js b/jscomp/test/global_module_alias_test.js index 170a91f701c..231d06129dd 100644 --- a/jscomp/test/global_module_alias_test.js +++ b/jscomp/test/global_module_alias_test.js @@ -17,13 +17,11 @@ function eq(loc, x, y) { suites.contents = { hd: [ loc + (" id " + String(test_id.contents)), - (() => { - return { - TAG: "Eq", - _0: x, - _1: y - }; - }) + (() => ({ + TAG: "Eq", + _0: x, + _1: y + })) ], tl: suites.contents }; diff --git a/jscomp/test/google_closure_test.js b/jscomp/test/google_closure_test.js index 41457ae4f3a..86f0461e0fb 100644 --- a/jscomp/test/google_closure_test.js +++ b/jscomp/test/google_closure_test.js @@ -7,24 +7,22 @@ let Test_google_closure = require("./test_google_closure.js"); Mt.from_pair_suites("Closure", { hd: [ "partial", - (() => { - return { - TAG: "Eq", - _0: [ - Test_google_closure.a, - Test_google_closure.b, - Test_google_closure.c - ], - _1: [ - "3", - 101, - [ - 1, - 2 - ] + (() => ({ + TAG: "Eq", + _0: [ + Test_google_closure.a, + Test_google_closure.b, + Test_google_closure.c + ], + _1: [ + "3", + 101, + [ + 1, + 2 ] - }; - }) + ] + })) ], tl: /* [] */0 }); diff --git a/jscomp/test/gpr496_test.js b/jscomp/test/gpr496_test.js index 039f6601733..390b2db6eee 100644 --- a/jscomp/test/gpr496_test.js +++ b/jscomp/test/gpr496_test.js @@ -17,13 +17,11 @@ function eq(loc, x, y) { suites.contents = { hd: [ loc + (" id " + String(test_id.contents)), - (() => { - return { - TAG: "Eq", - _0: x, - _1: y - }; - }) + (() => ({ + TAG: "Eq", + _0: x, + _1: y + })) ], tl: suites.contents }; diff --git a/jscomp/test/gpr_1154_test.js b/jscomp/test/gpr_1154_test.js index bad92814257..12c93aa5549 100644 --- a/jscomp/test/gpr_1154_test.js +++ b/jscomp/test/gpr_1154_test.js @@ -18,13 +18,11 @@ function eq(loc, x, y) { suites.contents = { hd: [ loc + (" id " + String(test_id.contents)), - (() => { - return { - TAG: "Eq", - _0: x, - _1: y - }; - }) + (() => ({ + TAG: "Eq", + _0: x, + _1: y + })) ], tl: suites.contents }; diff --git a/jscomp/test/gpr_1409_test.js b/jscomp/test/gpr_1409_test.js index cc023a68eb5..adfd00605bb 100644 --- a/jscomp/test/gpr_1409_test.js +++ b/jscomp/test/gpr_1409_test.js @@ -19,13 +19,11 @@ function eq(loc, x, y) { suites.contents = { hd: [ loc + (" id " + String(test_id.contents)), - (() => { - return { - TAG: "Eq", - _0: x, - _1: y - }; - }) + (() => ({ + TAG: "Eq", + _0: x, + _1: y + })) ], tl: suites.contents }; @@ -46,9 +44,7 @@ function map(f, x) { function make(foo, param) { let tmp = {}; - let tmp$1 = map((prim => { - return String(prim); - }), foo); + let tmp$1 = map((prim => String(prim)), foo); if (tmp$1 !== undefined) { tmp.foo = tmp$1; } diff --git a/jscomp/test/gpr_1423_app_test.js b/jscomp/test/gpr_1423_app_test.js index 16eb50ef179..bdf146e109c 100644 --- a/jscomp/test/gpr_1423_app_test.js +++ b/jscomp/test/gpr_1423_app_test.js @@ -16,13 +16,11 @@ function eq(loc, x, y) { suites.contents = { hd: [ loc + (" id " + String(test_id.contents)), - (() => { - return { - TAG: "Eq", - _0: x, - _1: y - }; - }) + (() => ({ + TAG: "Eq", + _0: x, + _1: y + })) ], tl: suites.contents }; @@ -32,9 +30,7 @@ function foo(f) { console.log(f("a1", undefined)); } -foo((none, extra) => { - return none + "a2"; -}); +foo((none, extra) => none + "a2"); function foo2(f) { return f("a1", undefined); diff --git a/jscomp/test/gpr_1438.js b/jscomp/test/gpr_1438.js index ccbd93c17ae..8f89b09dfb7 100644 --- a/jscomp/test/gpr_1438.js +++ b/jscomp/test/gpr_1438.js @@ -16,9 +16,7 @@ function actionKey(key, a, b, c, d, e) { case 118 : return a; } - return param => { - - }; + return param => {}; } exports.actionKey = actionKey; diff --git a/jscomp/test/gpr_1503_test.js b/jscomp/test/gpr_1503_test.js index d803eb5dd31..0fbfae3775b 100644 --- a/jscomp/test/gpr_1503_test.js +++ b/jscomp/test/gpr_1503_test.js @@ -19,13 +19,11 @@ function eq(loc, x, y) { suites.contents = { hd: [ loc + (" id " + String(test_id.contents)), - (() => { - return { - TAG: "Eq", - _0: x, - _1: y - }; - }) + (() => ({ + TAG: "Eq", + _0: x, + _1: y + })) ], tl: suites.contents }; diff --git a/jscomp/test/gpr_1539_test.js b/jscomp/test/gpr_1539_test.js index 67a95af5756..11f8a5ea571 100644 --- a/jscomp/test/gpr_1539_test.js +++ b/jscomp/test/gpr_1539_test.js @@ -22,9 +22,7 @@ Caml_module.update_mod({ "add" ]] }, Point, { - add: ((prim0, prim1) => { - return prim0.add(prim1); - }) + add: ((prim0, prim1) => prim0.add(prim1)) }); let CRS; diff --git a/jscomp/test/gpr_1658_test.js b/jscomp/test/gpr_1658_test.js index 4c440accde2..2b0408c80f8 100644 --- a/jscomp/test/gpr_1658_test.js +++ b/jscomp/test/gpr_1658_test.js @@ -17,13 +17,11 @@ function eq(loc, x, y) { suites.contents = { hd: [ loc + (" id " + String(test_id.contents)), - (() => { - return { - TAG: "Eq", - _0: x, - _1: y - }; - }) + (() => ({ + TAG: "Eq", + _0: x, + _1: y + })) ], tl: suites.contents }; diff --git a/jscomp/test/gpr_1667_test.js b/jscomp/test/gpr_1667_test.js index 15519d83e8a..99317330bc0 100644 --- a/jscomp/test/gpr_1667_test.js +++ b/jscomp/test/gpr_1667_test.js @@ -16,13 +16,11 @@ function eq(loc, x, y) { suites.contents = { hd: [ loc + (" id " + String(test_id.contents)), - (() => { - return { - TAG: "Eq", - _0: x, - _1: y - }; - }) + (() => ({ + TAG: "Eq", + _0: x, + _1: y + })) ], tl: suites.contents }; diff --git a/jscomp/test/gpr_1692_test.js b/jscomp/test/gpr_1692_test.js index 6e74a6ca12a..7c0694ed44b 100644 --- a/jscomp/test/gpr_1692_test.js +++ b/jscomp/test/gpr_1692_test.js @@ -2,8 +2,6 @@ 'use strict'; -(f => { - return 0; -})(""); +(f => 0)(""); /* Not a pure module */ diff --git a/jscomp/test/gpr_1716_test.js b/jscomp/test/gpr_1716_test.js index 21b7bfe6906..b1016951d5b 100644 --- a/jscomp/test/gpr_1716_test.js +++ b/jscomp/test/gpr_1716_test.js @@ -17,13 +17,11 @@ function eq(loc, x, y) { suites.contents = { hd: [ loc + (" id " + String(test_id.contents)), - (() => { - return { - TAG: "Eq", - _0: x, - _1: y - }; - }) + (() => ({ + TAG: "Eq", + _0: x, + _1: y + })) ], tl: suites.contents }; diff --git a/jscomp/test/gpr_1728_test.js b/jscomp/test/gpr_1728_test.js index 2d5f21a274a..4c1002b1aee 100644 --- a/jscomp/test/gpr_1728_test.js +++ b/jscomp/test/gpr_1728_test.js @@ -17,13 +17,11 @@ function eq(loc, x, y) { suites.contents = { hd: [ loc + (" id " + String(test_id.contents)), - (() => { - return { - TAG: "Eq", - _0: x, - _1: y - }; - }) + (() => ({ + TAG: "Eq", + _0: x, + _1: y + })) ], tl: suites.contents }; diff --git a/jscomp/test/gpr_1749_test.js b/jscomp/test/gpr_1749_test.js index b876b7424d7..989a80fc277 100644 --- a/jscomp/test/gpr_1749_test.js +++ b/jscomp/test/gpr_1749_test.js @@ -16,13 +16,11 @@ function eq(loc, x, y) { suites.contents = { hd: [ loc + (" id " + String(test_id.contents)), - (() => { - return { - TAG: "Eq", - _0: x, - _1: y - }; - }) + (() => ({ + TAG: "Eq", + _0: x, + _1: y + })) ], tl: suites.contents }; diff --git a/jscomp/test/gpr_1760_test.js b/jscomp/test/gpr_1760_test.js index bf26204915f..e79a4f6eb4b 100644 --- a/jscomp/test/gpr_1760_test.js +++ b/jscomp/test/gpr_1760_test.js @@ -18,13 +18,11 @@ function eq(loc, x, y) { suites.contents = { hd: [ loc + (" id " + String(test_id.contents)), - (() => { - return { - TAG: "Eq", - _0: x, - _1: y - }; - }) + (() => ({ + TAG: "Eq", + _0: x, + _1: y + })) ], tl: suites.contents }; diff --git a/jscomp/test/gpr_1762_test.js b/jscomp/test/gpr_1762_test.js index df8ce906439..cf40b53c356 100644 --- a/jscomp/test/gpr_1762_test.js +++ b/jscomp/test/gpr_1762_test.js @@ -16,13 +16,11 @@ function eq(loc, x, y) { suites.contents = { hd: [ loc + (" id " + String(test_id.contents)), - (() => { - return { - TAG: "Eq", - _0: x, - _1: y - }; - }) + (() => ({ + TAG: "Eq", + _0: x, + _1: y + })) ], tl: suites.contents }; diff --git a/jscomp/test/gpr_1817_test.js b/jscomp/test/gpr_1817_test.js index 1c6ac00d41d..2ef62be1b6c 100644 --- a/jscomp/test/gpr_1817_test.js +++ b/jscomp/test/gpr_1817_test.js @@ -17,13 +17,11 @@ function eq(loc, x, y) { suites.contents = { hd: [ loc + (" id " + String(test_id.contents)), - (() => { - return { - TAG: "Eq", - _0: x, - _1: y - }; - }) + (() => ({ + TAG: "Eq", + _0: x, + _1: y + })) ], tl: suites.contents }; diff --git a/jscomp/test/gpr_1822_test.js b/jscomp/test/gpr_1822_test.js index fa37e5eb78d..2c5fd0e3ad9 100644 --- a/jscomp/test/gpr_1822_test.js +++ b/jscomp/test/gpr_1822_test.js @@ -16,13 +16,11 @@ function eq(loc, x, y) { suites.contents = { hd: [ loc + (" id " + String(test_id.contents)), - (() => { - return { - TAG: "Eq", - _0: x, - _1: y - }; - }) + (() => ({ + TAG: "Eq", + _0: x, + _1: y + })) ], tl: suites.contents }; diff --git a/jscomp/test/gpr_1943_test.js b/jscomp/test/gpr_1943_test.js index 100a1b636e2..f5cd2292894 100644 --- a/jscomp/test/gpr_1943_test.js +++ b/jscomp/test/gpr_1943_test.js @@ -16,13 +16,11 @@ function eq(loc, x, y) { suites.contents = { hd: [ loc + (" id " + String(test_id.contents)), - (() => { - return { - TAG: "Eq", - _0: x, - _1: y - }; - }) + (() => ({ + TAG: "Eq", + _0: x, + _1: y + })) ], tl: suites.contents }; diff --git a/jscomp/test/gpr_2316_test.js b/jscomp/test/gpr_2316_test.js index 618a1a838d5..ff97acef5f3 100644 --- a/jscomp/test/gpr_2316_test.js +++ b/jscomp/test/gpr_2316_test.js @@ -17,13 +17,11 @@ function eq(loc, x, y) { suites.contents = { hd: [ loc + (" id " + String(test_id.contents)), - (() => { - return { - TAG: "Eq", - _0: x, - _1: y - }; - }) + (() => ({ + TAG: "Eq", + _0: x, + _1: y + })) ], tl: suites.contents }; diff --git a/jscomp/test/gpr_2487.js b/jscomp/test/gpr_2487.js index e5834575b61..feb3ae3c83d 100644 --- a/jscomp/test/gpr_2487.js +++ b/jscomp/test/gpr_2487.js @@ -11,9 +11,7 @@ let b = Belt_Array.eq([ 1, 2, 3 -], ((prim0, prim1) => { - return prim0 === prim1; -})); +], ((prim0, prim1) => prim0 === prim1)); let A; diff --git a/jscomp/test/gpr_2608_test.js b/jscomp/test/gpr_2608_test.js index 9373980495a..eb2726fd80d 100644 --- a/jscomp/test/gpr_2608_test.js +++ b/jscomp/test/gpr_2608_test.js @@ -24,18 +24,14 @@ let oppHeroes = { let huntGrootCondition = false; if (List.length(/* [] */0) > 0) { - let x = List.filter((h => { - return List.hd(/* [] */0) <= 1000; - }), oppHeroes); + let x = List.filter((h => List.hd(/* [] */0) <= 1000), oppHeroes); huntGrootCondition = List.length(x) === 0; } let huntGrootCondition2 = true; if (List.length(/* [] */0) < 0) { - let x$1 = List.filter((h => { - return List.hd(/* [] */0) <= 1000; - }), oppHeroes); + let x$1 = List.filter((h => List.hd(/* [] */0) <= 1000), oppHeroes); huntGrootCondition2 = List.length(x$1) === 0; } diff --git a/jscomp/test/gpr_3536_test.js b/jscomp/test/gpr_3536_test.js index bb492567191..f9972027244 100644 --- a/jscomp/test/gpr_3536_test.js +++ b/jscomp/test/gpr_3536_test.js @@ -23,13 +23,7 @@ function xx(obj, a0, a1, a2, a3, a4, a5) { eq("File \"gpr_3536_test.res\", line 18, characters 12-19", 5, 5); -eq("File \"gpr_3536_test.res\", line 20, characters 12-19", xx(3, ((prim0, prim1) => { - return prim0 - prim1 | 0; -}), 2, ((prim0, prim1) => { - return prim0 + prim1 | 0; -}), 4, ((prim0, prim1) => { - return Math.imul(prim0, prim1); -}), 3), 11); +eq("File \"gpr_3536_test.res\", line 20, characters 12-19", xx(3, ((prim0, prim1) => prim0 - prim1 | 0), 2, ((prim0, prim1) => prim0 + prim1 | 0), 4, ((prim0, prim1) => Math.imul(prim0, prim1)), 3), 11); Mt.from_pair_suites("Gpr_3536_test", suites.contents); diff --git a/jscomp/test/gpr_3566_test.js b/jscomp/test/gpr_3566_test.js index 745294d913b..aab0570a8aa 100644 --- a/jscomp/test/gpr_3566_test.js +++ b/jscomp/test/gpr_3566_test.js @@ -75,9 +75,7 @@ function Test4($star) { } function Test5($star) { - let f = x => { - return Caml_option.some(x); - }; + let f = x => Caml_option.some(x); let Caml_option$1 = {}; return { f: f, @@ -87,9 +85,7 @@ function Test5($star) { function Test6($star) { let Caml_option$1 = {}; - let f = x => { - return Caml_option.some(x); - }; + let f = x => Caml_option.some(x); return { Caml_option: Caml_option$1, f: f @@ -105,9 +101,7 @@ function Test7($star) { function Test8($star) { let Curry = {}; - let f = x => { - return x(1); - }; + let f = x => x(1); return { Curry: Curry, f: f @@ -115,9 +109,7 @@ function Test8($star) { } function Test9($star) { - let f = x => { - return x(1); - }; + let f = x => x(1); let Curry = {}; return { f: f, diff --git a/jscomp/test/gpr_3697_test.js b/jscomp/test/gpr_3697_test.js index f8194c98d8a..c2bae67104e 100644 --- a/jscomp/test/gpr_3697_test.js +++ b/jscomp/test/gpr_3697_test.js @@ -6,9 +6,7 @@ let CamlinternalLazy = require("../../lib/js/camlinternalLazy.js"); function fix() { return { TAG: "Fix", - _0: CamlinternalLazy.from_fun(() => { - return fix(); - }) + _0: CamlinternalLazy.from_fun(() => fix()) }; } diff --git a/jscomp/test/gpr_3875_test.js b/jscomp/test/gpr_3875_test.js index 5e8da892aa5..886d383a303 100644 --- a/jscomp/test/gpr_3875_test.js +++ b/jscomp/test/gpr_3875_test.js @@ -58,9 +58,7 @@ function eq(loc, x, y) { Mt.eq_suites(test_id, suites, loc, x, y); } -compilerBug("x", undefined, true, (() => { - return true; -})); +compilerBug("x", undefined, true, (() => true)); eq("File \"gpr_3875_test.res\", line 35, characters 5-12", result.contents, "Some x, f returns true"); diff --git a/jscomp/test/gpr_4274_test.js b/jscomp/test/gpr_4274_test.js index a2413299152..7c8aed2ae68 100644 --- a/jscomp/test/gpr_4274_test.js +++ b/jscomp/test/gpr_4274_test.js @@ -29,9 +29,7 @@ let bar = [{ foo: "bar" }]; -Belt_Array.map(bar, (b => { - return b.foo; -})); +Belt_Array.map(bar, (b => b.foo)); exports.N = N; exports.f = f; diff --git a/jscomp/test/gpr_459_test.js b/jscomp/test/gpr_459_test.js index 60968948cd1..8a515314ee8 100644 --- a/jscomp/test/gpr_459_test.js +++ b/jscomp/test/gpr_459_test.js @@ -16,13 +16,11 @@ function eq(loc, x, y) { suites.contents = { hd: [ loc + (" id " + String(test_id.contents)), - (() => { - return { - TAG: "Eq", - _0: x, - _1: y - }; - }) + (() => ({ + TAG: "Eq", + _0: x, + _1: y + })) ], tl: suites.contents }; diff --git a/jscomp/test/gpr_858_unit2_test.js b/jscomp/test/gpr_858_unit2_test.js index c2e7841171e..ed0f9cfb439 100644 --- a/jscomp/test/gpr_858_unit2_test.js +++ b/jscomp/test/gpr_858_unit2_test.js @@ -3,9 +3,7 @@ let delayed = { - contents: (() => { - - }) + contents: (() => {}) }; for (let i = 1; i <= 2; ++i) { diff --git a/jscomp/test/gpr_904_test.js b/jscomp/test/gpr_904_test.js index 91fa921cd97..7fd086142d1 100644 --- a/jscomp/test/gpr_904_test.js +++ b/jscomp/test/gpr_904_test.js @@ -16,13 +16,11 @@ function eq(loc, x, y) { suites.contents = { hd: [ loc + (" id " + String(test_id.contents)), - (() => { - return { - TAG: "Eq", - _0: x, - _1: y - }; - }) + (() => ({ + TAG: "Eq", + _0: x, + _1: y + })) ], tl: suites.contents }; diff --git a/jscomp/test/gpr_977_test.js b/jscomp/test/gpr_977_test.js index 4b8a8b2e5b9..69a06171e39 100644 --- a/jscomp/test/gpr_977_test.js +++ b/jscomp/test/gpr_977_test.js @@ -17,13 +17,11 @@ function eq(loc, x, y) { suites.contents = { hd: [ loc + (" id " + String(test_id.contents)), - (() => { - return { - TAG: "Eq", - _0: x, - _1: y - }; - }) + (() => ({ + TAG: "Eq", + _0: x, + _1: y + })) ], tl: suites.contents }; diff --git a/jscomp/test/hash_test.js b/jscomp/test/hash_test.js index 14a693e2e05..7463e6f6499 100644 --- a/jscomp/test/hash_test.js +++ b/jscomp/test/hash_test.js @@ -20,9 +20,7 @@ function eq(f, x, y) { Mt_global.collect_eq(test_id, suites, f, x, y); } -let test_strings = $$Array.init(32, (i => { - return Caml_string.make(i, Char.chr(i)); -})); +let test_strings = $$Array.init(32, (i => Caml_string.make(i, Char.chr(i)))); let test_strings_hash_results = [ 0, diff --git a/jscomp/test/hashtbl_test.js b/jscomp/test/hashtbl_test.js index a0baa3f5fca..3393ea8c665 100644 --- a/jscomp/test/hashtbl_test.js +++ b/jscomp/test/hashtbl_test.js @@ -9,15 +9,13 @@ let Hashtbl = require("../../lib/js/hashtbl.js"); let MoreLabels = require("../../lib/js/moreLabels.js"); function to_list(tbl) { - return Hashtbl.fold(((k, v, acc) => { - return { - hd: [ - k, - v - ], - tl: acc - }; - }), tbl, /* [] */0); + return Hashtbl.fold(((k, v, acc) => ({ + hd: [ + k, + v + ], + tl: acc + })), tbl, /* [] */0); } function f() { @@ -25,9 +23,7 @@ function f() { Hashtbl.add(tbl, 1, /* '1' */49); Hashtbl.add(tbl, 2, /* '2' */50); let extra = to_list(tbl); - return List.sort(((param, param$1) => { - return Caml.int_compare(param[0], param$1[0]); - }), extra); + return List.sort(((param, param$1) => Caml.int_compare(param[0], param$1[0])), extra); } function g(count) { @@ -39,49 +35,41 @@ function g(count) { Hashtbl.replace(tbl, (i$1 << 1), String(i$1)); } let v = to_list(tbl); - return $$Array.of_list(List.sort(((param, param$1) => { - return Caml.int_compare(param[0], param$1[0]); - }), v)); + return $$Array.of_list(List.sort(((param, param$1) => Caml.int_compare(param[0], param$1[0])), v)); } let suites_0 = [ "simple", - (param => { - return { - TAG: "Eq", - _0: { + (param => ({ + TAG: "Eq", + _0: { + hd: [ + 1, + /* '1' */49 + ], + tl: { hd: [ - 1, - /* '1' */49 + 2, + /* '2' */50 ], - tl: { - hd: [ - 2, - /* '2' */50 - ], - tl: /* [] */0 - } - }, - _1: f() - }; - }) + tl: /* [] */0 + } + }, + _1: f() + })) ]; let suites_1 = { hd: [ "more_iterations", - (param => { - return { - TAG: "Eq", - _0: $$Array.init(1001, (i => { - return [ - (i << 1), - String(i) - ]; - })), - _1: g(1000) - }; - }) + (param => ({ + TAG: "Eq", + _0: $$Array.init(1001, (i => [ + (i << 1), + String(i) + ])), + _1: g(1000) + })) ], tl: { hd: [ diff --git a/jscomp/test/ignore_test.js b/jscomp/test/ignore_test.js index 64a5035e086..3763253f6d9 100644 --- a/jscomp/test/ignore_test.js +++ b/jscomp/test/ignore_test.js @@ -16,13 +16,11 @@ function eq(loc, x, y) { suites.contents = { hd: [ loc + (" id " + String(test_id.contents)), - (() => { - return { - TAG: "Eq", - _0: x, - _1: y - }; - }) + (() => ({ + TAG: "Eq", + _0: x, + _1: y + })) ], tl: suites.contents }; diff --git a/jscomp/test/import2.js b/jscomp/test/import2.js index c6ddb6aaeca..3f5a1f3bb1d 100644 --- a/jscomp/test/import2.js +++ b/jscomp/test/import2.js @@ -3,9 +3,7 @@ let A = require("a").default; -let a = import("a").then(m => { - return m.default; -}); +let a = import("a").then(m => m.default); let b = A; diff --git a/jscomp/test/import_external.js b/jscomp/test/import_external.js index ad11e4f2569..38dab086789 100644 --- a/jscomp/test/import_external.js +++ b/jscomp/test/import_external.js @@ -2,9 +2,7 @@ 'use strict'; -let f8 = import("a").then(m => { - return m.default; -}); +let f8 = import("a").then(m => m.default); exports.f8 = f8; /* f8 Not a pure module */ diff --git a/jscomp/test/import_side_effect.js b/jscomp/test/import_side_effect.js index 4b33d31358a..afbe3337f7d 100644 --- a/jscomp/test/import_side_effect.js +++ b/jscomp/test/import_side_effect.js @@ -2,9 +2,7 @@ 'use strict'; -let a = import("./side_effect2.js").then(m => { - return m.a; -}); +let a = import("./side_effect2.js").then(m => m.a); let M = await import("./side_effect.js"); diff --git a/jscomp/test/import_side_effect_free.js b/jscomp/test/import_side_effect_free.js index 3f014a84a6d..4df30a1a431 100644 --- a/jscomp/test/import_side_effect_free.js +++ b/jscomp/test/import_side_effect_free.js @@ -2,9 +2,7 @@ 'use strict'; -let a = await import("./side_effect_free.js").then(m => { - return m.a; -}); +let a = await import("./side_effect_free.js").then(m => m.a); exports.a = a; /* a Not a pure module */ diff --git a/jscomp/test/inline_map2_test.js b/jscomp/test/inline_map2_test.js index bd17d86eb66..6fda5e08271 100644 --- a/jscomp/test/inline_map2_test.js +++ b/jscomp/test/inline_map2_test.js @@ -26,16 +26,14 @@ function Make(Ord) { _4: hl >= hr ? hl + 1 | 0 : hr + 1 | 0 }; }; - let singleton = (x, d) => { - return { - TAG: "Node", - _0: "Empty", - _1: x, - _2: d, - _3: "Empty", - _4: 1 - }; - }; + let singleton = (x, d) => ({ + TAG: "Node", + _0: "Empty", + _1: x, + _2: d, + _3: "Empty", + _4: 1 + }); let bal = (l, x, d, r) => { let hl; hl = typeof l !== "object" ? 0 : l._4; @@ -598,9 +596,7 @@ function Make(Ord) { continue; }; }; - let bindings = s => { - return bindings_aux(/* [] */0, s); - }; + let bindings = s => bindings_aux(/* [] */0, s); return { height: height, create: create, @@ -1305,9 +1301,7 @@ let IntMap = { choose: min_binding }; -let m = List.fold_left(((acc, param) => { - return add(param[0], param[1], acc); -}), "Empty", { +let m = List.fold_left(((acc, param) => add(param[0], param[1], acc)), "Empty", { hd: [ 10, /* 'a' */97 @@ -1998,9 +1992,7 @@ let SMap = { choose: min_binding$1 }; -let s = List.fold_left(((acc, param) => { - return add$1(param[0], param[1], acc); -}), "Empty", { +let s = List.fold_left(((acc, param) => add$1(param[0], param[1], acc)), "Empty", { hd: [ "10", /* 'a' */97 @@ -2029,24 +2021,20 @@ let s = List.fold_left(((acc, param) => { Mt.from_pair_suites("Inline_map2_test", { hd: [ "assertion1", - (() => { - return { - TAG: "Eq", - _0: find(10, m), - _1: /* 'a' */97 - }; - }) + (() => ({ + TAG: "Eq", + _0: find(10, m), + _1: /* 'a' */97 + })) ], tl: { hd: [ "assertion2", - (() => { - return { - TAG: "Eq", - _0: find$1("10", s), - _1: /* 'a' */97 - }; - }) + (() => ({ + TAG: "Eq", + _0: find$1("10", s), + _1: /* 'a' */97 + })) ], tl: /* [] */0 } diff --git a/jscomp/test/inline_map_demo.js b/jscomp/test/inline_map_demo.js index fd5b21a4195..91ebbb06ba4 100644 --- a/jscomp/test/inline_map_demo.js +++ b/jscomp/test/inline_map_demo.js @@ -141,9 +141,7 @@ function add(x, data, tree) { } } -let m = List.fold_left(((acc, param) => { - return add(param[0], param[1], acc); -}), "Empty", { +let m = List.fold_left(((acc, param) => add(param[0], param[1], acc)), "Empty", { hd: [ 10, /* 'a' */97 @@ -191,13 +189,11 @@ function find(px, _x) { Mt.from_pair_suites("Inline_map_demo", { hd: [ "find", - (() => { - return { - TAG: "Eq", - _0: find(10, m), - _1: /* 'a' */97 - }; - }) + (() => ({ + TAG: "Eq", + _0: find(10, m), + _1: /* 'a' */97 + })) ], tl: /* [] */0 }); diff --git a/jscomp/test/inline_map_test.js b/jscomp/test/inline_map_test.js index 880b9274dc6..4479b97a96f 100644 --- a/jscomp/test/inline_map_test.js +++ b/jscomp/test/inline_map_test.js @@ -144,9 +144,7 @@ function find(x, _x_) { }; } -let m = List.fold_left(((acc, param) => { - return add(param[0], param[1], acc); -}), "Empty", { +let m = List.fold_left(((acc, param) => add(param[0], param[1], acc)), "Empty", { hd: [ 10, /* 'a' */97 @@ -175,13 +173,11 @@ let m = List.fold_left(((acc, param) => { Mt.from_pair_suites("Inline_map_test", { hd: [ "find", - (() => { - return { - TAG: "Eq", - _0: find(10, m), - _1: /* 'a' */97 - }; - }) + (() => ({ + TAG: "Eq", + _0: find(10, m), + _1: /* 'a' */97 + })) ], tl: /* [] */0 }); diff --git a/jscomp/test/inline_record_test.js b/jscomp/test/inline_record_test.js index c14c78b44e6..d519c996b18 100644 --- a/jscomp/test/inline_record_test.js +++ b/jscomp/test/inline_record_test.js @@ -36,13 +36,9 @@ let v1 = { function f(x) { if (x.TAG === "A0") { - return List.fold_left(((prim0, prim1) => { - return prim0 + prim1 | 0; - }), x.lbl, x.more); + return List.fold_left(((prim0, prim1) => prim0 + prim1 | 0), x.lbl, x.more); } else { - return List.fold_left(((prim0, prim1) => { - return prim0 + prim1 | 0; - }), 0, x.more); + return List.fold_left(((prim0, prim1) => prim0 + prim1 | 0), 0, x.more); } } diff --git a/jscomp/test/inline_regression_test.js b/jscomp/test/inline_regression_test.js index 0ca64bb4c1f..0ec534d9483 100644 --- a/jscomp/test/inline_regression_test.js +++ b/jscomp/test/inline_regression_test.js @@ -38,20 +38,16 @@ function generic_basename(is_dir_sep, current_dir_name, name) { } function basename(extra) { - return generic_basename(((s, i) => { - return Caml_string.get(s, i) === /* '/' */47; - }), Filename.current_dir_name, extra); + return generic_basename(((s, i) => Caml_string.get(s, i) === /* '/' */47), Filename.current_dir_name, extra); } let suites_0 = [ "basename", - (param => { - return { - TAG: "Eq", - _0: basename("b/c/a.b"), - _1: "a.b" - }; - }) + (param => ({ + TAG: "Eq", + _0: basename("b/c/a.b"), + _1: "a.b" + })) ]; let suites = { diff --git a/jscomp/test/inner_unused.js b/jscomp/test/inner_unused.js index 8ad25dd0a94..9f4fb403b8f 100644 --- a/jscomp/test/inner_unused.js +++ b/jscomp/test/inner_unused.js @@ -7,9 +7,7 @@ function f(x) { } function M(S) { - let f = x => { - return x; - }; + let f = x => x; return { f: f }; diff --git a/jscomp/test/installation_test.js b/jscomp/test/installation_test.js index 11bdd2fd4fe..7147c617f8f 100644 --- a/jscomp/test/installation_test.js +++ b/jscomp/test/installation_test.js @@ -16,13 +16,11 @@ function eq(loc, x, y) { suites.contents = { hd: [ loc + (" id " + String(test_id.contents)), - (() => { - return { - TAG: "Eq", - _0: x, - _1: y - }; - }) + (() => ({ + TAG: "Eq", + _0: x, + _1: y + })) ], tl: suites.contents }; diff --git a/jscomp/test/int32_test.js b/jscomp/test/int32_test.js index 796298f120b..7786026c21b 100644 --- a/jscomp/test/int32_test.js +++ b/jscomp/test/int32_test.js @@ -16,9 +16,7 @@ function f(x) { ]; } -let shift_right_logical_tests_0 = $$Array.map((x => { - return (-1 >>> x) | 0; -}), Ext_array_test.range(0, 31)); +let shift_right_logical_tests_0 = $$Array.map((x => (-1 >>> x) | 0), Ext_array_test.range(0, 31)); let shift_right_logical_tests_1 = [ -1, @@ -60,9 +58,7 @@ let shift_right_logical_tests = [ shift_right_logical_tests_1 ]; -let shift_right_tests_0 = $$Array.map((x => { - return (Int32.min_int >> x); -}), Ext_array_test.range(0, 31)); +let shift_right_tests_0 = $$Array.map((x => (Int32.min_int >> x)), Ext_array_test.range(0, 31)); let shift_right_tests_1 = [ -2147483648, @@ -104,9 +100,7 @@ let shift_right_tests = [ shift_right_tests_1 ]; -let shift_left_tests_0 = $$Array.map((x => { - return (1 << x); -}), Ext_array_test.range(0, 31)); +let shift_left_tests_0 = $$Array.map((x => (1 << x)), Ext_array_test.range(0, 31)); let shift_left_tests_1 = [ 1, @@ -156,61 +150,45 @@ let suites = { contents: Pervasives.$at({ hd: [ "File \"int32_test.res\", line 131, characters 9-16", - (() => { - return { - TAG: "Eq", - _0: 1, - _1: 1 - }; - }) + (() => ({ + TAG: "Eq", + _0: 1, + _1: 1 + })) ], tl: { hd: [ "File \"int32_test.res\", line 132, characters 9-16", - (() => { - return { - TAG: "Eq", - _0: -2147483647, - _1: -2147483647 - }; - }) + (() => ({ + TAG: "Eq", + _0: -2147483647, + _1: -2147483647 + })) ], tl: /* [] */0 } - }, Pervasives.$at($$Array.to_list(Ext_array_test.map2i(((i, a, b) => { - return [ - "shift_right_logical_cases " + i, - (() => { - return { - TAG: "Eq", - _0: a, - _1: b - }; - }) - ]; - }), shift_right_logical_tests_0, shift_right_logical_tests_1)), Pervasives.$at($$Array.to_list(Ext_array_test.map2i(((i, a, b) => { - return [ - "shift_right_cases " + i, - (() => { - return { - TAG: "Eq", - _0: a, - _1: b - }; - }) - ]; - }), shift_right_tests_0, shift_right_tests_1)), $$Array.to_list(Ext_array_test.map2i(((i, a, b) => { - return [ - "shift_left_cases " + i, - (() => { - return { - TAG: "Eq", - _0: a, - _1: b - }; - }) - ]; - }), shift_left_tests_0, shift_left_tests_1))))) + }, Pervasives.$at($$Array.to_list(Ext_array_test.map2i(((i, a, b) => [ + "shift_right_logical_cases " + i, + (() => ({ + TAG: "Eq", + _0: a, + _1: b + })) + ]), shift_right_logical_tests_0, shift_right_logical_tests_1)), Pervasives.$at($$Array.to_list(Ext_array_test.map2i(((i, a, b) => [ + "shift_right_cases " + i, + (() => ({ + TAG: "Eq", + _0: a, + _1: b + })) + ]), shift_right_tests_0, shift_right_tests_1)), $$Array.to_list(Ext_array_test.map2i(((i, a, b) => [ + "shift_left_cases " + i, + (() => ({ + TAG: "Eq", + _0: a, + _1: b + })) + ]), shift_left_tests_0, shift_left_tests_1))))) }; let test_id = { diff --git a/jscomp/test/int64_mul_div_test.js b/jscomp/test/int64_mul_div_test.js index 147aeb35151..a96ae4ff0e0 100644 --- a/jscomp/test/int64_mul_div_test.js +++ b/jscomp/test/int64_mul_div_test.js @@ -312,9 +312,7 @@ function from_pairs(prefix, pairs) { let result = param[0]; return [ prefix + "_" + i, - (param => { - return commutative_mul(result, a, b); - }) + (param => commutative_mul(result, a, b)) ]; }), pairs)); } @@ -1516,19 +1514,17 @@ function from(xs) { let a = param[0]; return [ "small_divs " + i, - (param => { - return { - TAG: "Eq", - _0: [ - c, - d - ], - _1: [ - Caml_int64.div(a, b), - Caml_int64.mod_(a, b) - ] - }; - }) + (param => ({ + TAG: "Eq", + _0: [ + c, + d + ], + _1: [ + Caml_int64.div(a, b), + Caml_int64.mod_(a, b) + ] + })) ]; }), $$Array.to_list(xs)); } @@ -1572,13 +1568,11 @@ function from_compare(xs) { let a = param[0]; return [ "int64_compare " + i, - (param => { - return { - TAG: "Eq", - _0: c, - _1: Caml_int64.compare(a, b) - }; - }) + (param => ({ + TAG: "Eq", + _0: c, + _1: Caml_int64.compare(a, b) + })) ]; }), $$Array.to_list(xs)); } @@ -1589,13 +1583,11 @@ function from_to_string(xs) { let a = param[0]; return [ "to_string " + i, - (param => { - return { - TAG: "Eq", - _0: str_a, - _1: Caml_int64.to_string(a) - }; - }) + (param => ({ + TAG: "Eq", + _0: str_a, + _1: Caml_int64.to_string(a) + })) ]; }), $$Array.to_list(xs)); } @@ -1605,73 +1597,59 @@ Mt.from_pair_suites("Int64_mul_div_test", Pervasives.$at(from_pairs("random", pa let i64 = param[0]; return [ "to_float_" + i, - (() => { - return { - TAG: "Eq", - _0: Caml_int64.to_float(i64), - _1: f - }; - }) + (() => ({ + TAG: "Eq", + _0: Caml_int64.to_float(i64), + _1: f + })) ]; }), $$Array.to_list(to_floats)), Pervasives.$at(List.mapi(((i, param) => { let i64 = param[1]; let f = param[0]; return [ "of_float_" + i, - (() => { - return { - TAG: "Eq", - _0: Caml_int64.of_float(f), - _1: i64 - }; - }) + (() => ({ + TAG: "Eq", + _0: Caml_int64.of_float(f), + _1: i64 + })) ]; }), $$Array.to_list(of_float_pairs)), Pervasives.$at({ hd: [ "compare_check_complete", - (() => { - return { - TAG: "Eq", - _0: $$Array.map((param => { - return true; - }), check_complete_compare), - _1: check_complete_compare - }; - }) + (() => ({ + TAG: "Eq", + _0: $$Array.map((param => true), check_complete_compare), + _1: check_complete_compare + })) ], tl: /* [] */0 }, Pervasives.$at(from(simple_divs), Pervasives.$at(from_compare(int64_compare_tests), { hd: [ "div_rem_0", - (() => { - return { - TAG: "Eq", - _0: Caml_int64.zero, - _1: Caml_int64.zero - }; - }) + (() => ({ + TAG: "Eq", + _0: Caml_int64.zero, + _1: Caml_int64.zero + })) ], tl: { hd: [ "div_rem_1", - (() => { - return { - TAG: "Eq", - _0: Caml_int64.neg_one, - _1: Caml_int64.neg_one - }; - }) + (() => ({ + TAG: "Eq", + _0: Caml_int64.neg_one, + _1: Caml_int64.neg_one + })) ], tl: { hd: [ "File \"int64_mul_div_test.res\", line 263, characters 19-26", - (() => { - return { - TAG: "Eq", - _0: Caml_int64.to_float(Int64.max_int), - _1: 9.22337203685477581e+18 - }; - }) + (() => ({ + TAG: "Eq", + _0: Caml_int64.to_float(Int64.max_int), + _1: 9.22337203685477581e+18 + })) ], tl: /* [] */0 } diff --git a/jscomp/test/int64_test.js b/jscomp/test/int64_test.js index 27c1d4f6052..3468ff6ffd6 100644 --- a/jscomp/test/int64_test.js +++ b/jscomp/test/int64_test.js @@ -35,9 +35,7 @@ function commutative_add(result, a, b) { let generic_compare = Caml_obj.compare; -let shift_left_tests_0 = $$Array.map((i => { - return Caml_int64.lsl_(Caml_int64.one, i); -}), Ext_array_test.range(0, 63)); +let shift_left_tests_0 = $$Array.map((i => Caml_int64.lsl_(Caml_int64.one, i)), Ext_array_test.range(0, 63)); let shift_left_tests_1 = [ Caml_int64.one, @@ -297,9 +295,7 @@ let shift_left_tests = [ shift_left_tests_1 ]; -let shift_right_tests_0 = $$Array.map((i => { - return Caml_int64.asr_(Caml_int64.min_int, i); -}), Ext_array_test.range(0, 63)); +let shift_right_tests_0 = $$Array.map((i => Caml_int64.asr_(Caml_int64.min_int, i)), Ext_array_test.range(0, 63)); let shift_right_tests_1 = [ Caml_int64.min_int, @@ -559,9 +555,7 @@ let shift_right_tests = [ shift_right_tests_1 ]; -let shift_right_logical_suites_0 = $$Array.map((i => { - return Caml_int64.lsr_(Caml_int64.min_int, i); -}), Ext_array_test.range(0, 63)); +let shift_right_logical_suites_0 = $$Array.map((i => Caml_int64.lsr_(Caml_int64.min_int, i)), Ext_array_test.range(0, 63)); let shift_right_logical_suites_1 = [ Caml_int64.min_int, @@ -852,1209 +846,1113 @@ function fac(_n, _acc) { let suites = Pervasives.$at({ hd: [ "add_one", - (() => { - return { - TAG: "Eq", - _0: v, - _1: [ - 0, - 2147483648 - ] - }; - }) + (() => ({ + TAG: "Eq", + _0: v, + _1: [ + 0, + 2147483648 + ] + })) ], tl: { hd: [ "add_2", - (() => { - return { - TAG: "Eq", - _0: [ - 0, - 4294967294 - ], - _1: Caml_int64.add(a, a) - }; - }) + (() => ({ + TAG: "Eq", + _0: [ + 0, + 4294967294 + ], + _1: Caml_int64.add(a, a) + })) ], tl: { hd: [ "add_3", - (() => { - return { - TAG: "Eq", - _0: Caml_int64.zero, - _1: Caml_int64.zero - }; - }) + (() => ({ + TAG: "Eq", + _0: Caml_int64.zero, + _1: Caml_int64.zero + })) ], tl: { hd: [ "add_4", - (() => { - return commutative_add([ - -1, - 4294967294 - ], [ - -1, - 4294967293 - ], Caml_int64.one); - }) + (() => commutative_add([ + -1, + 4294967294 + ], [ + -1, + 4294967293 + ], Caml_int64.one)) ], tl: { hd: [ "add_5", - (() => { - return commutative_add([ - -1, - 4294967293 - ], [ - -1, - 4294967293 - ], Caml_int64.zero); - }) + (() => commutative_add([ + -1, + 4294967293 + ], [ + -1, + 4294967293 + ], Caml_int64.zero)) ], tl: { hd: [ "add_6", - (() => { - return commutative_add([ - 0, - 4 - ], [ - -1, - 4294967293 - ], [ - 0, - 7 - ]); - }) + (() => commutative_add([ + 0, + 4 + ], [ + -1, + 4294967293 + ], [ + 0, + 7 + ])) ], tl: { hd: [ "add_7", - (() => { - return commutative_add([ - 1, - 0 - ], [ - 0, - 2147483648 - ], [ - 0, - 2147483648 - ]); - }) + (() => commutative_add([ + 1, + 0 + ], [ + 0, + 2147483648 + ], [ + 0, + 2147483648 + ])) ], tl: { hd: [ "add_8", - (() => { - return commutative_add([ - 1, - 0 - ], [ - 0, - 4294967295 - ], Caml_int64.one); - }) + (() => commutative_add([ + 1, + 0 + ], [ + 0, + 4294967295 + ], Caml_int64.one)) ], tl: { hd: [ "add_9", - (() => { - return commutative_add([ - 0, - 4294967295 - ], [ - 0, - 2147483648 - ], [ - 0, - 2147483647 - ]); - }) + (() => commutative_add([ + 0, + 4294967295 + ], [ + 0, + 2147483648 + ], [ + 0, + 2147483647 + ])) ], tl: { hd: [ "add_10", - (() => { - return commutative_add([ - 0, - 2147483648 - ], [ - 0, - 2147483648 - ], Caml_int64.zero); - }) + (() => commutative_add([ + 0, + 2147483648 + ], [ + 0, + 2147483648 + ], Caml_int64.zero)) ], tl: { hd: [ "add_11", - (() => { - return commutative_add([ - 0, - 4294967295 - ], [ - 0, - 4294967295 - ], Caml_int64.zero); - }) + (() => commutative_add([ + 0, + 4294967295 + ], [ + 0, + 4294967295 + ], Caml_int64.zero)) ], tl: { hd: [ "to_int32", - (() => { - return { + (() => ({ + TAG: "Eq", + _0: 3, + _1: Caml_int64.to_int32([ + 0, + 3 + ]) + })) + ], + tl: { + hd: [ + "to_int", + (() => ({ TAG: "Eq", _0: 3, _1: Caml_int64.to_int32([ 0, 3 ]) - }; - }) - ], - tl: { - hd: [ - "to_int", - (() => { - return { - TAG: "Eq", - _0: 3, - _1: Caml_int64.to_int32([ - 0, - 3 - ]) - }; - }) + })) ], tl: { hd: [ "of_int", - (() => { - return { + (() => ({ + TAG: "Eq", + _0: [ + 0, + 3 + ], + _1: [ + 0, + 3 + ] + })) + ], + tl: { + hd: [ + "lognot", + (() => ({ TAG: "Eq", _0: [ - 0, - 3 + -1, + 4294967293 ], _1: [ - 0, - 3 + -1, + 4294967293 ] - }; - }) - ], - tl: { - hd: [ - "lognot", - (() => { - return { + })) + ], + tl: { + hd: [ + "neg", + (() => ({ TAG: "Eq", _0: [ -1, - 4294967293 + 4294967294 ], _1: [ -1, - 4294967293 + 4294967294 ] - }; - }) - ], - tl: { - hd: [ - "neg", - (() => { - return { - TAG: "Eq", - _0: [ - -1, - 4294967294 - ], - _1: [ - -1, - 4294967294 - ] - }; - }) + })) ], tl: { hd: [ "File \"int64_test.res\", line 277, characters 7-14", - (() => { - return { - TAG: "Eq", - _0: Int64.min_int, - _1: Caml_int64.neg(Int64.min_int) - }; - }) + (() => ({ + TAG: "Eq", + _0: Int64.min_int, + _1: Caml_int64.neg(Int64.min_int) + })) ], tl: { hd: [ "File \"int64_test.res\", line 279, characters 8-15", - (() => { - return { - TAG: "Eq", - _0: Int64.max_int, - _1: Caml_int64.neg(Caml_int64.add(Int64.min_int, Caml_int64.one)) - }; - }) + (() => ({ + TAG: "Eq", + _0: Int64.max_int, + _1: Caml_int64.neg(Caml_int64.add(Int64.min_int, Caml_int64.one)) + })) ], tl: { hd: [ "sub1", - (() => { - return { - TAG: "Eq", - _0: [ - 0, - 2 - ], - _1: [ - 0, - 2 - ] - }; - }) + (() => ({ + TAG: "Eq", + _0: [ + 0, + 2 + ], + _1: [ + 0, + 2 + ] + })) ], tl: { hd: [ "xor1", - (() => { - return { - TAG: "Eq", - _0: [ - [ - 0, - 286331153 - ], - Caml_int64.xor(a, [ - 0, - 4009750271 - ]) + (() => ({ + TAG: "Eq", + _0: [ + [ + 0, + 286331153 ], - _1: [ - [ - 0, - 286331153 - ], - [ - 0, - 2432700672 - ] + Caml_int64.xor(a, [ + 0, + 4009750271 + ]) + ], + _1: [ + [ + 0, + 286331153 + ], + [ + 0, + 2432700672 ] - }; - }) + ] + })) ], tl: { hd: [ "or", - (() => { - return { + (() => ({ + TAG: "Eq", + _0: [ + 0, + 4294967295 + ], + _1: [ + 0, + 4294967295 + ] + })) + ], + tl: { + hd: [ + "and", + (() => ({ TAG: "Eq", _0: [ 0, - 4294967295 + 4008636142 ], _1: [ 0, - 4294967295 + 4008636142 ] - }; - }) - ], - tl: { - hd: [ - "and", - (() => { - return { - TAG: "Eq", - _0: [ - 0, - 4008636142 - ], - _1: [ - 0, - 4008636142 - ] - }; - }) + })) ], tl: { hd: [ "lsl", - (() => { - return { + (() => ({ + TAG: "Eq", + _0: $$Array.map((x => Caml_int64.lsl_(Caml_int64.one, x)), $$Array.init(64, (i => i))), + _1: [ + Caml_int64.one, + [ + 0, + 2 + ], + [ + 0, + 4 + ], + [ + 0, + 8 + ], + [ + 0, + 16 + ], + [ + 0, + 32 + ], + [ + 0, + 64 + ], + [ + 0, + 128 + ], + [ + 0, + 256 + ], + [ + 0, + 512 + ], + [ + 0, + 1024 + ], + [ + 0, + 2048 + ], + [ + 0, + 4096 + ], + [ + 0, + 8192 + ], + [ + 0, + 16384 + ], + [ + 0, + 32768 + ], + [ + 0, + 65536 + ], + [ + 0, + 131072 + ], + [ + 0, + 262144 + ], + [ + 0, + 524288 + ], + [ + 0, + 1048576 + ], + [ + 0, + 2097152 + ], + [ + 0, + 4194304 + ], + [ + 0, + 8388608 + ], + [ + 0, + 16777216 + ], + [ + 0, + 33554432 + ], + [ + 0, + 67108864 + ], + [ + 0, + 134217728 + ], + [ + 0, + 268435456 + ], + [ + 0, + 536870912 + ], + [ + 0, + 1073741824 + ], + [ + 0, + 2147483648 + ], + [ + 1, + 0 + ], + [ + 2, + 0 + ], + [ + 4, + 0 + ], + [ + 8, + 0 + ], + [ + 16, + 0 + ], + [ + 32, + 0 + ], + [ + 64, + 0 + ], + [ + 128, + 0 + ], + [ + 256, + 0 + ], + [ + 512, + 0 + ], + [ + 1024, + 0 + ], + [ + 2048, + 0 + ], + [ + 4096, + 0 + ], + [ + 8192, + 0 + ], + [ + 16384, + 0 + ], + [ + 32768, + 0 + ], + [ + 65536, + 0 + ], + [ + 131072, + 0 + ], + [ + 262144, + 0 + ], + [ + 524288, + 0 + ], + [ + 1048576, + 0 + ], + [ + 2097152, + 0 + ], + [ + 4194304, + 0 + ], + [ + 8388608, + 0 + ], + [ + 16777216, + 0 + ], + [ + 33554432, + 0 + ], + [ + 67108864, + 0 + ], + [ + 134217728, + 0 + ], + [ + 268435456, + 0 + ], + [ + 536870912, + 0 + ], + [ + 1073741824, + 0 + ], + Caml_int64.min_int + ] + })) + ], + tl: { + hd: [ + "lsr", + (() => ({ TAG: "Eq", - _0: $$Array.map((x => { - return Caml_int64.lsl_(Caml_int64.one, x); - }), $$Array.init(64, (i => { - return i; - }))), + _0: $$Array.map((x => Caml_int64.lsr_(Caml_int64.neg_one, x)), $$Array.init(64, (i => i))), _1: [ - Caml_int64.one, + Caml_int64.neg_one, + Caml_int64.max_int, [ - 0, - 2 + 1073741823, + 4294967295 ], [ - 0, - 4 + 536870911, + 4294967295 ], [ - 0, - 8 + 268435455, + 4294967295 ], [ - 0, - 16 + 134217727, + 4294967295 ], [ - 0, - 32 + 67108863, + 4294967295 ], [ - 0, - 64 + 33554431, + 4294967295 ], [ - 0, - 128 + 16777215, + 4294967295 ], [ - 0, - 256 + 8388607, + 4294967295 ], [ - 0, - 512 + 4194303, + 4294967295 ], [ - 0, - 1024 + 2097151, + 4294967295 ], [ - 0, - 2048 + 1048575, + 4294967295 ], [ - 0, - 4096 + 524287, + 4294967295 ], [ - 0, - 8192 + 262143, + 4294967295 ], [ - 0, - 16384 + 131071, + 4294967295 ], [ - 0, - 32768 + 65535, + 4294967295 ], [ - 0, - 65536 + 32767, + 4294967295 ], [ - 0, - 131072 + 16383, + 4294967295 ], [ - 0, - 262144 + 8191, + 4294967295 ], [ - 0, - 524288 + 4095, + 4294967295 ], [ - 0, - 1048576 + 2047, + 4294967295 ], [ - 0, - 2097152 + 1023, + 4294967295 ], [ - 0, - 4194304 + 511, + 4294967295 ], [ - 0, - 8388608 + 255, + 4294967295 ], [ - 0, - 16777216 + 127, + 4294967295 ], [ - 0, - 33554432 + 63, + 4294967295 ], [ - 0, - 67108864 + 31, + 4294967295 ], [ - 0, - 134217728 + 15, + 4294967295 ], [ - 0, - 268435456 + 7, + 4294967295 ], [ - 0, - 536870912 + 3, + 4294967295 ], [ - 0, - 1073741824 + 1, + 4294967295 ], [ 0, - 2147483648 + 4294967295 ], [ - 1, - 0 + 0, + 2147483647 ], [ - 2, - 0 + 0, + 1073741823 ], [ - 4, - 0 + 0, + 536870911 ], [ - 8, - 0 + 0, + 268435455 ], [ - 16, - 0 - ], - [ - 32, - 0 + 0, + 134217727 ], [ - 64, - 0 + 0, + 67108863 ], [ - 128, - 0 + 0, + 33554431 ], [ - 256, - 0 + 0, + 16777215 ], [ - 512, - 0 + 0, + 8388607 ], [ - 1024, - 0 + 0, + 4194303 ], [ - 2048, - 0 + 0, + 2097151 ], [ - 4096, - 0 + 0, + 1048575 ], [ - 8192, - 0 + 0, + 524287 ], [ - 16384, - 0 + 0, + 262143 ], [ - 32768, - 0 + 0, + 131071 ], [ - 65536, - 0 + 0, + 65535 ], [ - 131072, - 0 + 0, + 32767 ], [ - 262144, - 0 + 0, + 16383 ], [ - 524288, - 0 + 0, + 8191 ], [ - 1048576, - 0 + 0, + 4095 ], [ - 2097152, - 0 + 0, + 2047 ], [ - 4194304, - 0 + 0, + 1023 ], [ - 8388608, - 0 + 0, + 511 ], [ - 16777216, - 0 + 0, + 255 ], [ - 33554432, - 0 + 0, + 127 ], [ - 67108864, - 0 + 0, + 63 ], [ - 134217728, - 0 + 0, + 31 ], [ - 268435456, - 0 + 0, + 15 ], [ - 536870912, - 0 + 0, + 7 ], [ - 1073741824, - 0 + 0, + 3 ], - Caml_int64.min_int + Caml_int64.one ] - }; - }) - ], - tl: { - hd: [ - "lsr", - (() => { - return { - TAG: "Eq", - _0: $$Array.map((x => { - return Caml_int64.lsr_(Caml_int64.neg_one, x); - }), $$Array.init(64, (i => { - return i; - }))), - _1: [ - Caml_int64.neg_one, - Caml_int64.max_int, - [ - 1073741823, - 4294967295 - ], - [ - 536870911, - 4294967295 - ], - [ - 268435455, - 4294967295 - ], - [ - 134217727, - 4294967295 - ], - [ - 67108863, - 4294967295 - ], - [ - 33554431, - 4294967295 - ], - [ - 16777215, - 4294967295 - ], - [ - 8388607, - 4294967295 - ], - [ - 4194303, - 4294967295 - ], - [ - 2097151, - 4294967295 - ], - [ - 1048575, - 4294967295 - ], - [ - 524287, - 4294967295 - ], - [ - 262143, - 4294967295 - ], - [ - 131071, - 4294967295 - ], - [ - 65535, - 4294967295 - ], - [ - 32767, - 4294967295 - ], - [ - 16383, - 4294967295 - ], - [ - 8191, - 4294967295 - ], - [ - 4095, - 4294967295 - ], - [ - 2047, - 4294967295 - ], - [ - 1023, - 4294967295 - ], - [ - 511, - 4294967295 - ], - [ - 255, - 4294967295 - ], - [ - 127, - 4294967295 - ], - [ - 63, - 4294967295 - ], - [ - 31, - 4294967295 - ], - [ - 15, - 4294967295 - ], - [ - 7, - 4294967295 - ], - [ - 3, - 4294967295 - ], - [ - 1, - 4294967295 - ], - [ - 0, - 4294967295 - ], - [ - 0, - 2147483647 - ], - [ - 0, - 1073741823 - ], - [ - 0, - 536870911 - ], - [ - 0, - 268435455 - ], - [ - 0, - 134217727 - ], - [ - 0, - 67108863 - ], - [ - 0, - 33554431 - ], - [ - 0, - 16777215 - ], - [ - 0, - 8388607 - ], - [ - 0, - 4194303 - ], - [ - 0, - 2097151 - ], - [ - 0, - 1048575 - ], - [ - 0, - 524287 - ], - [ - 0, - 262143 - ], - [ - 0, - 131071 - ], - [ - 0, - 65535 - ], - [ - 0, - 32767 - ], - [ - 0, - 16383 - ], - [ - 0, - 8191 - ], - [ - 0, - 4095 - ], - [ - 0, - 2047 - ], - [ - 0, - 1023 - ], - [ - 0, - 511 - ], - [ - 0, - 255 - ], - [ - 0, - 127 - ], - [ - 0, - 63 - ], - [ - 0, - 31 - ], - [ - 0, - 15 - ], - [ - 0, - 7 - ], - [ - 0, - 3 - ], - Caml_int64.one - ] - }; - }) + })) ], tl: { hd: [ "asr", - (() => { - return { - TAG: "Eq", - _0: $$Array.map((x => { - return Caml_int64.asr_(Caml_int64.neg_one, x); - }), $$Array.init(64, (i => { - return i; - }))), - _1: [ - Caml_int64.neg_one, - Caml_int64.neg_one, - Caml_int64.neg_one, - Caml_int64.neg_one, - Caml_int64.neg_one, - Caml_int64.neg_one, - Caml_int64.neg_one, - Caml_int64.neg_one, - Caml_int64.neg_one, - Caml_int64.neg_one, - Caml_int64.neg_one, - Caml_int64.neg_one, - Caml_int64.neg_one, - Caml_int64.neg_one, - Caml_int64.neg_one, - Caml_int64.neg_one, - Caml_int64.neg_one, - Caml_int64.neg_one, - Caml_int64.neg_one, - Caml_int64.neg_one, - Caml_int64.neg_one, - Caml_int64.neg_one, - Caml_int64.neg_one, - Caml_int64.neg_one, - Caml_int64.neg_one, - Caml_int64.neg_one, - Caml_int64.neg_one, - Caml_int64.neg_one, - Caml_int64.neg_one, - Caml_int64.neg_one, - Caml_int64.neg_one, - Caml_int64.neg_one, - Caml_int64.neg_one, - Caml_int64.neg_one, - Caml_int64.neg_one, - Caml_int64.neg_one, - Caml_int64.neg_one, - Caml_int64.neg_one, - Caml_int64.neg_one, - Caml_int64.neg_one, - Caml_int64.neg_one, - Caml_int64.neg_one, - Caml_int64.neg_one, - Caml_int64.neg_one, - Caml_int64.neg_one, - Caml_int64.neg_one, - Caml_int64.neg_one, - Caml_int64.neg_one, - Caml_int64.neg_one, - Caml_int64.neg_one, - Caml_int64.neg_one, - Caml_int64.neg_one, - Caml_int64.neg_one, - Caml_int64.neg_one, - Caml_int64.neg_one, - Caml_int64.neg_one, - Caml_int64.neg_one, - Caml_int64.neg_one, - Caml_int64.neg_one, - Caml_int64.neg_one, - Caml_int64.neg_one, - Caml_int64.neg_one, - Caml_int64.neg_one, - Caml_int64.neg_one - ] - }; - }) + (() => ({ + TAG: "Eq", + _0: $$Array.map((x => Caml_int64.asr_(Caml_int64.neg_one, x)), $$Array.init(64, (i => i))), + _1: [ + Caml_int64.neg_one, + Caml_int64.neg_one, + Caml_int64.neg_one, + Caml_int64.neg_one, + Caml_int64.neg_one, + Caml_int64.neg_one, + Caml_int64.neg_one, + Caml_int64.neg_one, + Caml_int64.neg_one, + Caml_int64.neg_one, + Caml_int64.neg_one, + Caml_int64.neg_one, + Caml_int64.neg_one, + Caml_int64.neg_one, + Caml_int64.neg_one, + Caml_int64.neg_one, + Caml_int64.neg_one, + Caml_int64.neg_one, + Caml_int64.neg_one, + Caml_int64.neg_one, + Caml_int64.neg_one, + Caml_int64.neg_one, + Caml_int64.neg_one, + Caml_int64.neg_one, + Caml_int64.neg_one, + Caml_int64.neg_one, + Caml_int64.neg_one, + Caml_int64.neg_one, + Caml_int64.neg_one, + Caml_int64.neg_one, + Caml_int64.neg_one, + Caml_int64.neg_one, + Caml_int64.neg_one, + Caml_int64.neg_one, + Caml_int64.neg_one, + Caml_int64.neg_one, + Caml_int64.neg_one, + Caml_int64.neg_one, + Caml_int64.neg_one, + Caml_int64.neg_one, + Caml_int64.neg_one, + Caml_int64.neg_one, + Caml_int64.neg_one, + Caml_int64.neg_one, + Caml_int64.neg_one, + Caml_int64.neg_one, + Caml_int64.neg_one, + Caml_int64.neg_one, + Caml_int64.neg_one, + Caml_int64.neg_one, + Caml_int64.neg_one, + Caml_int64.neg_one, + Caml_int64.neg_one, + Caml_int64.neg_one, + Caml_int64.neg_one, + Caml_int64.neg_one, + Caml_int64.neg_one, + Caml_int64.neg_one, + Caml_int64.neg_one, + Caml_int64.neg_one, + Caml_int64.neg_one, + Caml_int64.neg_one, + Caml_int64.neg_one, + Caml_int64.neg_one + ] + })) ], tl: { hd: [ "mul simple", - (() => { - return { - TAG: "Eq", - _0: [ - 0, - 6 - ], - _1: [ - 0, - 6 - ] - }; - }) + (() => ({ + TAG: "Eq", + _0: [ + 0, + 6 + ], + _1: [ + 0, + 6 + ] + })) ], tl: { hd: [ "of_int32", - (() => { - return { - TAG: "Eq", - _0: $$Array.map(Caml_int64.of_int32, [ - 0, - -2147483648 - ]), - _1: [ - Caml_int64.zero, - [ - -1, - 2147483648 - ] + (() => ({ + TAG: "Eq", + _0: $$Array.map(Caml_int64.of_int32, [ + 0, + -2147483648 + ]), + _1: [ + Caml_int64.zero, + [ + -1, + 2147483648 ] - }; - }) + ] + })) ], tl: { hd: [ "of_int32_singleton", - (() => { - return { + (() => ({ + TAG: "Eq", + _0: [ + -1, + 4294967293 + ], + _1: [ + -1, + 4294967293 + ] + })) + ], + tl: { + hd: [ + "File \"int64_test.res\", line 526, characters 7-14", + (() => ({ TAG: "Eq", _0: [ - -1, - 4294967293 + 0, + 3 ], _1: [ - -1, - 4294967293 + 0, + 3 ] - }; - }) - ], - tl: { - hd: [ - "File \"int64_test.res\", line 526, characters 7-14", - (() => { - return { - TAG: "Eq", - _0: [ - 0, - 3 - ], - _1: [ - 0, - 3 - ] - }; - }) + })) ], tl: { hd: [ "to_int32", - (() => { - return { - TAG: "Eq", - _0: $$Array.map(Caml_int64.to_int32, [ - Caml_int64.zero, - [ - 0, - 2147483648 - ] - ]), - _1: [ + (() => ({ + TAG: "Eq", + _0: $$Array.map(Caml_int64.to_int32, [ + Caml_int64.zero, + [ 0, - -2147483648 + 2147483648 ] - }; - }) + ]), + _1: [ + 0, + -2147483648 + ] + })) ], tl: { hd: [ "discard_sign", - (() => { - return { - TAG: "Eq", - _0: Caml_int64.discard_sign(Caml_int64.neg_one), - _1: Caml_int64.max_int - }; - }) + (() => ({ + TAG: "Eq", + _0: Caml_int64.discard_sign(Caml_int64.neg_one), + _1: Caml_int64.max_int + })) ], tl: { hd: [ "div_mod", - (() => { - return { - TAG: "Eq", - _0: Caml_int64.div_mod([ - 0, - 7 - ], [ + (() => ({ + TAG: "Eq", + _0: Caml_int64.div_mod([ + 0, + 7 + ], [ + 0, + 3 + ]), + _1: [ + [ 0, - 3 - ]), - _1: [ - [ - 0, - 2 - ], - Caml_int64.one - ] - }; - }) + 2 + ], + Caml_int64.one + ] + })) ], tl: { hd: [ "to_hex", - (() => { - return { - TAG: "Eq", - _0: Caml_int64.to_hex(Caml_int64.neg_one), - _1: "ffffffffffffffff" - }; - }) + (() => ({ + TAG: "Eq", + _0: Caml_int64.to_hex(Caml_int64.neg_one), + _1: "ffffffffffffffff" + })) ], tl: { hd: [ "generic_compare", - (() => { - return { - TAG: "Eq", - _0: Caml_obj.compare([ - 1, - 0 - ], Caml_int64.one) > 0, - _1: true - }; - }) + (() => ({ + TAG: "Eq", + _0: Caml_obj.compare([ + 1, + 0 + ], Caml_int64.one) > 0, + _1: true + })) ], tl: { hd: [ "test_compier_literal", - (() => { - return { - TAG: "Eq", - _0: [ - 0, - 4294967295 - ], - _1: [ - 0, - 4294967295 - ] - }; - }) + (() => ({ + TAG: "Eq", + _0: [ + 0, + 4294967295 + ], + _1: [ + 0, + 4294967295 + ] + })) ], tl: { hd: [ "generic_compare2", - (() => { - return { - TAG: "Eq", - _0: Caml_obj.compare([ - 0, - 2147483648 - ], Caml_int64.one) > 0, - _1: true - }; - }) + (() => ({ + TAG: "Eq", + _0: Caml_obj.compare([ + 0, + 2147483648 + ], Caml_int64.one) > 0, + _1: true + })) ], tl: { hd: [ "shift_left", - (() => { - return { - TAG: "Eq", - _0: [ - 0, - 4294967040 - ], - _1: [ - 0, - 4294967040 - ] - }; - }) + (() => ({ + TAG: "Eq", + _0: [ + 0, + 4294967040 + ], + _1: [ + 0, + 4294967040 + ] + })) ], tl: { hd: [ "fib_int64", - (() => { - return { - TAG: "Eq", - _0: fib(1000, Caml_int64.one, [ - 0, - 2 - ]), - _1: [ - -1990564327, - 2874523960 - ] - }; - }) + (() => ({ + TAG: "Eq", + _0: fib(1000, Caml_int64.one, [ + 0, + 2 + ]), + _1: [ + -1990564327, + 2874523960 + ] + })) ], tl: { hd: [ "fac_int64", - (() => { - return { - TAG: "Eq", - _0: fac(30, Caml_int64.one), - _1: [ - -2040662563, - 1409286144 - ] - }; - }) + (() => ({ + TAG: "Eq", + _0: fac(30, Caml_int64.one), + _1: [ + -2040662563, + 1409286144 + ] + })) ], tl: { hd: [ "File \"int64_test.res\", line 553, characters 8-15", - (() => { - return { - TAG: "Eq", - _0: Caml_int64.add(Int64.max_int, Int64.max_int), - _1: [ - -1, - 4294967294 - ] - }; - }) + (() => ({ + TAG: "Eq", + _0: Caml_int64.add(Int64.max_int, Int64.max_int), + _1: [ + -1, + 4294967294 + ] + })) ], tl: { hd: [ "File \"int64_test.res\", line 563, characters 8-15", - (() => { - return { - TAG: "Eq", - _0: Caml_int64.add(Int64.min_int, Int64.min_int), - _1: Caml_int64.zero - }; - }) + (() => ({ + TAG: "Eq", + _0: Caml_int64.add(Int64.min_int, Int64.min_int), + _1: Caml_int64.zero + })) ], tl: { hd: [ "File \"int64_test.res\", line 573, characters 8-15", - (() => { - return { - TAG: "Eq", - _0: Caml_int64.neg_one, - _1: Caml_int64.neg_one - }; - }) + (() => ({ + TAG: "Eq", + _0: Caml_int64.neg_one, + _1: Caml_int64.neg_one + })) ], tl: /* [] */0 } @@ -2098,40 +1996,28 @@ let suites = Pervasives.$at({ } } } -}, Pervasives.$at($$Array.to_list(Ext_array_test.map2i(((i, a, b) => { - return [ - "shift_left_cases " + i, - (() => { - return { - TAG: "Eq", - _0: a, - _1: b - }; - }) - ]; -}), shift_left_tests_0, shift_left_tests_1)), Pervasives.$at($$Array.to_list(Ext_array_test.map2i(((i, a, b) => { - return [ - "shift_right_cases " + i, - (() => { - return { - TAG: "Eq", - _0: a, - _1: b - }; - }) - ]; -}), shift_right_tests_0, shift_right_tests_1)), $$Array.to_list(Ext_array_test.map2i(((i, a, b) => { - return [ - "shift_right_logical_cases " + i, - (() => { - return { - TAG: "Eq", - _0: a, - _1: b - }; - }) - ]; -}), shift_right_logical_suites_0, shift_right_logical_suites_1))))); +}, Pervasives.$at($$Array.to_list(Ext_array_test.map2i(((i, a, b) => [ + "shift_left_cases " + i, + (() => ({ + TAG: "Eq", + _0: a, + _1: b + })) +]), shift_left_tests_0, shift_left_tests_1)), Pervasives.$at($$Array.to_list(Ext_array_test.map2i(((i, a, b) => [ + "shift_right_cases " + i, + (() => ({ + TAG: "Eq", + _0: a, + _1: b + })) +]), shift_right_tests_0, shift_right_tests_1)), $$Array.to_list(Ext_array_test.map2i(((i, a, b) => [ + "shift_right_logical_cases " + i, + (() => ({ + TAG: "Eq", + _0: a, + _1: b + })) +]), shift_right_logical_suites_0, shift_right_logical_suites_1))))); let suites$1 = { contents: suites diff --git a/jscomp/test/int_hashtbl_test.js b/jscomp/test/int_hashtbl_test.js index a9fbce24483..1fdcfb1d7fa 100644 --- a/jscomp/test/int_hashtbl_test.js +++ b/jscomp/test/int_hashtbl_test.js @@ -11,18 +11,14 @@ function f(H) { let tbl = H.create(17); H.add(tbl, 1, /* '1' */49); H.add(tbl, 2, /* '2' */50); - let extra = H.fold(((k, v, acc) => { - return { - hd: [ - k, - v - ], - tl: acc - }; - }), tbl, /* [] */0); - return List.sort(((param, param$1) => { - return Caml.int_compare(param[0], param$1[0]); - }), extra); + let extra = H.fold(((k, v, acc) => ({ + hd: [ + k, + v + ], + tl: acc + })), tbl, /* [] */0); + return List.sort(((param, param$1) => Caml.int_compare(param[0], param$1[0])), extra); } function g(H, count) { @@ -33,18 +29,14 @@ function g(H, count) { for (let i$1 = 0; i$1 <= count; ++i$1) { H.replace(tbl, (i$1 << 1), String(i$1)); } - let v = H.fold(((k, v, acc) => { - return { - hd: [ - k, - v - ], - tl: acc - }; - }), tbl, /* [] */0); - return $$Array.of_list(List.sort(((param, param$1) => { - return Caml.int_compare(param[0], param$1[0]); - }), v)); + let v = H.fold(((k, v, acc) => ({ + hd: [ + k, + v + ], + tl: acc + })), tbl, /* [] */0); + return $$Array.of_list(List.sort(((param, param$1) => Caml.int_compare(param[0], param$1[0])), v)); } let hash = Hashtbl.hash; @@ -60,42 +52,36 @@ let Int_hash = Hashtbl.Make({ let suites_0 = [ "simple", - (param => { - return { - TAG: "Eq", - _0: { + (param => ({ + TAG: "Eq", + _0: { + hd: [ + 1, + /* '1' */49 + ], + tl: { hd: [ - 1, - /* '1' */49 + 2, + /* '2' */50 ], - tl: { - hd: [ - 2, - /* '2' */50 - ], - tl: /* [] */0 - } - }, - _1: f(Int_hash) - }; - }) + tl: /* [] */0 + } + }, + _1: f(Int_hash) + })) ]; let suites_1 = { hd: [ "more_iterations", - (param => { - return { - TAG: "Eq", - _0: $$Array.init(1001, (i => { - return [ - (i << 1), - String(i) - ]; - })), - _1: g(Int_hash, 1000) - }; - }) + (param => ({ + TAG: "Eq", + _0: $$Array.init(1001, (i => [ + (i << 1), + String(i) + ])), + _1: g(Int_hash, 1000) + })) ], tl: /* [] */0 }; diff --git a/jscomp/test/int_overflow_test.js b/jscomp/test/int_overflow_test.js index cab24280bbf..a60f6687a12 100644 --- a/jscomp/test/int_overflow_test.js +++ b/jscomp/test/int_overflow_test.js @@ -41,156 +41,128 @@ function fib(x) { Mt.from_pair_suites("Int_overflow_test", { hd: [ "plus_overflow", - (() => { - return { - TAG: "Eq", - _0: true, - _1: (Int32.max_int + 1 | 0) === Int32.min_int - }; - }) + (() => ({ + TAG: "Eq", + _0: true, + _1: (Int32.max_int + 1 | 0) === Int32.min_int + })) ], tl: { hd: [ "minus_overflow", - (() => { - return { - TAG: "Eq", - _0: true, - _1: (Int32.min_int - Int32.one | 0) === Int32.max_int - }; - }) + (() => ({ + TAG: "Eq", + _0: true, + _1: (Int32.min_int - Int32.one | 0) === Int32.max_int + })) ], tl: { hd: [ "flow_again", - (() => { - return { - TAG: "Eq", - _0: 2147483646, - _1: (Int32.max_int + Int32.max_int | 0) + Int32.min_int | 0 - }; - }) + (() => ({ + TAG: "Eq", + _0: 2147483646, + _1: (Int32.max_int + Int32.max_int | 0) + Int32.min_int | 0 + })) ], tl: { hd: [ "flow_again", - (() => { - return { - TAG: "Eq", - _0: -2, - _1: Int32.max_int + Int32.max_int | 0 - }; - }) + (() => ({ + TAG: "Eq", + _0: -2, + _1: Int32.max_int + Int32.max_int | 0 + })) ], tl: { hd: [ "hash_test", - (() => { - return { - TAG: "Eq", - _0: hash_variant("xxyyzzuuxxzzyy00112233"), - _1: 544087776 - }; - }) + (() => ({ + TAG: "Eq", + _0: hash_variant("xxyyzzuuxxzzyy00112233"), + _1: 544087776 + })) ], tl: { hd: [ "hash_test2", - (() => { - return { - TAG: "Eq", - _0: hash_variant("xxyyzxzzyy"), - _1: -449896130 - }; - }) + (() => ({ + TAG: "Eq", + _0: hash_variant("xxyyzxzzyy"), + _1: -449896130 + })) ], tl: { hd: [ "File \"int_overflow_test.res\", line 88, characters 5-12", - (() => { - return { - TAG: "Eq", - _0: hash_variant2("xxyyzzuuxxzzyy00112233"), - _1: 544087776 - }; - }) + (() => ({ + TAG: "Eq", + _0: hash_variant2("xxyyzzuuxxzzyy00112233"), + _1: 544087776 + })) ], tl: { hd: [ "File \"int_overflow_test.res\", line 89, characters 5-12", - (() => { - return { - TAG: "Eq", - _0: hash_variant2("xxyyzxzzyy"), - _1: -449896130 - }; - }) + (() => ({ + TAG: "Eq", + _0: hash_variant2("xxyyzxzzyy"), + _1: -449896130 + })) ], tl: { hd: [ "int_literal_flow", - (() => { - return { - TAG: "Eq", - _0: -1, - _1: -1 - }; - }) + (() => ({ + TAG: "Eq", + _0: -1, + _1: -1 + })) ], tl: { hd: [ "int_literal_flow2", - (() => { - return { - TAG: "Eq", - _0: -1, - _1: -1 - }; - }) + (() => ({ + TAG: "Eq", + _0: -1, + _1: -1 + })) ], tl: { hd: [ "int_literal_flow3", - (() => { - return { - TAG: "Eq", - _0: -1, - _1: -1 - }; - }) + (() => ({ + TAG: "Eq", + _0: -1, + _1: -1 + })) ], tl: { hd: [ "int32_mul", - (() => { - return { - TAG: "Eq", - _0: -33554431, - _1: -33554431 - }; - }) + (() => ({ + TAG: "Eq", + _0: -33554431, + _1: -33554431 + })) ], tl: { hd: [ "File \"int_overflow_test.res\", line 94, characters 5-12", - (() => { - return { - TAG: "Eq", - _0: Number("3") | 0, - _1: 3 - }; - }) + (() => ({ + TAG: "Eq", + _0: Number("3") | 0, + _1: 3 + })) ], tl: { hd: [ "File \"int_overflow_test.res\", line 96, characters 5-12", - (() => { - return { - TAG: "Eq", - _0: Number("3.2") | 0, - _1: 3 - }; - }) + (() => ({ + TAG: "Eq", + _0: Number("3.2") | 0, + _1: 3 + })) ], tl: /* [] */0 } diff --git a/jscomp/test/int_switch_test.js b/jscomp/test/int_switch_test.js index f888521b2c5..54e513b7bf1 100644 --- a/jscomp/test/int_switch_test.js +++ b/jscomp/test/int_switch_test.js @@ -61,25 +61,15 @@ function f33(x) { } } -eq("File \"int_switch_test.res\", line 32, characters 3-10", f(() => { - return 1; -}), /* 'a' */97); +eq("File \"int_switch_test.res\", line 32, characters 3-10", f(() => 1), /* 'a' */97); -eq("File \"int_switch_test.res\", line 33, characters 3-10", f(() => { - return 2; -}), /* 'b' */98); +eq("File \"int_switch_test.res\", line 33, characters 3-10", f(() => 2), /* 'b' */98); -eq("File \"int_switch_test.res\", line 34, characters 3-10", f(() => { - return 3; -}), /* 'c' */99); +eq("File \"int_switch_test.res\", line 34, characters 3-10", f(() => 3), /* 'c' */99); -eq("File \"int_switch_test.res\", line 35, characters 3-10", f(() => { - return 0; -}), /* 'x' */120); +eq("File \"int_switch_test.res\", line 35, characters 3-10", f(() => 0), /* 'x' */120); -eq("File \"int_switch_test.res\", line 36, characters 3-10", f(() => { - return -1; -}), /* 'x' */120); +eq("File \"int_switch_test.res\", line 36, characters 3-10", f(() => -1), /* 'x' */120); Mt.from_pair_suites("Int_switch_test", suites.contents); diff --git a/jscomp/test/js_array_test.js b/jscomp/test/js_array_test.js index cb2ca6388b0..fd1b6077847 100644 --- a/jscomp/test/js_array_test.js +++ b/jscomp/test/js_array_test.js @@ -6,53 +6,67 @@ let Caml_option = require("../../lib/js/caml_option.js"); let suites_0 = [ "isArray_array", - (param => { - return { - TAG: "Eq", - _0: true, - _1: Array.isArray([]) - }; - }) + (param => ({ + TAG: "Eq", + _0: true, + _1: Array.isArray([]) + })) ]; let suites_1 = { hd: [ "isArray_int", - (param => { - return { - TAG: "Eq", - _0: false, - _1: Array.isArray(34) - }; - }) + (param => ({ + TAG: "Eq", + _0: false, + _1: Array.isArray(34) + })) ], tl: { hd: [ "length", - (param => { - return { - TAG: "Eq", - _0: 3, - _1: [ - 1, - 2, - 3 - ].length - }; - }) + (param => ({ + TAG: "Eq", + _0: 3, + _1: [ + 1, + 2, + 3 + ].length + })) ], tl: { hd: [ "copyWithin", - (param => { - return { + (param => ({ + TAG: "Eq", + _0: [ + 1, + 2, + 3, + 1, + 2 + ], + _1: [ + 1, + 2, + 3, + 4, + 5 + ].copyWithin(-2) + })) + ], + tl: { + hd: [ + "copyWithinFrom", + (param => ({ TAG: "Eq", _0: [ - 1, - 2, + 4, + 5, 3, - 1, - 2 + 4, + 5 ], _1: [ 1, @@ -60,19 +74,17 @@ let suites_1 = { 3, 4, 5 - ].copyWithin(-2) - }; - }) - ], - tl: { - hd: [ - "copyWithinFrom", - (param => { - return { + ].copyWithin(0, 3) + })) + ], + tl: { + hd: [ + "copyWithinFromRange", + (param => ({ TAG: "Eq", _0: [ 4, - 5, + 2, 3, 4, 5 @@ -83,41 +95,33 @@ let suites_1 = { 3, 4, 5 - ].copyWithin(0, 3) - }; - }) - ], - tl: { - hd: [ - "copyWithinFromRange", - (param => { - return { + ].copyWithin(0, 3, 4) + })) + ], + tl: { + hd: [ + "fillInPlace", + (param => ({ TAG: "Eq", _0: [ 4, - 2, - 3, 4, - 5 + 4 ], _1: [ 1, 2, - 3, - 4, - 5 - ].copyWithin(0, 3, 4) - }; - }) - ], - tl: { - hd: [ - "fillInPlace", - (param => { - return { + 3 + ].fill(4) + })) + ], + tl: { + hd: [ + "fillFromInPlace", + (param => ({ TAG: "Eq", _0: [ - 4, + 1, 4, 4 ], @@ -125,188 +129,146 @@ let suites_1 = { 1, 2, 3 - ].fill(4) - }; - }) - ], - tl: { - hd: [ - "fillFromInPlace", - (param => { - return { + ].fill(4, 1) + })) + ], + tl: { + hd: [ + "fillRangeInPlace", + (param => ({ TAG: "Eq", _0: [ 1, 4, - 4 + 3 ], _1: [ 1, 2, 3 - ].fill(4, 1) - }; - }) - ], - tl: { - hd: [ - "fillRangeInPlace", - (param => { - return { - TAG: "Eq", - _0: [ - 1, - 4, - 3 - ], - _1: [ - 1, - 2, - 3 - ].fill(4, 1, 2) - }; - }) + ].fill(4, 1, 2) + })) ], tl: { hd: [ "pop", - (param => { - return { - TAG: "Eq", - _0: 3, - _1: Caml_option.undefined_to_opt([ - 1, - 2, - 3 - ].pop()) - }; - }) + (param => ({ + TAG: "Eq", + _0: 3, + _1: Caml_option.undefined_to_opt([ + 1, + 2, + 3 + ].pop()) + })) ], tl: { hd: [ "pop - empty array", - (param => { - return { - TAG: "Eq", - _0: undefined, - _1: Caml_option.undefined_to_opt([].pop()) - }; - }) + (param => ({ + TAG: "Eq", + _0: undefined, + _1: Caml_option.undefined_to_opt([].pop()) + })) ], tl: { hd: [ "push", - (param => { - return { + (param => ({ + TAG: "Eq", + _0: 4, + _1: [ + 1, + 2, + 3 + ].push(4) + })) + ], + tl: { + hd: [ + "pushMany", + (param => ({ TAG: "Eq", - _0: 4, + _0: 5, _1: [ 1, 2, 3 - ].push(4) - }; - }) - ], - tl: { - hd: [ - "pushMany", - (param => { - return { + ].push(4, 5) + })) + ], + tl: { + hd: [ + "reverseInPlace", + (param => ({ TAG: "Eq", - _0: 5, + _0: [ + 3, + 2, + 1 + ], _1: [ 1, 2, 3 - ].push(4, 5) - }; - }) - ], - tl: { - hd: [ - "reverseInPlace", - (param => { - return { - TAG: "Eq", - _0: [ - 3, - 2, - 1 - ], - _1: [ - 1, - 2, - 3 - ].reverse() - }; - }) + ].reverse() + })) ], tl: { hd: [ "shift", - (param => { - return { - TAG: "Eq", - _0: 1, - _1: Caml_option.undefined_to_opt([ - 1, - 2, - 3 - ].shift()) - }; - }) + (param => ({ + TAG: "Eq", + _0: 1, + _1: Caml_option.undefined_to_opt([ + 1, + 2, + 3 + ].shift()) + })) ], tl: { hd: [ "shift - empty array", - (param => { - return { - TAG: "Eq", - _0: undefined, - _1: Caml_option.undefined_to_opt([].shift()) - }; - }) + (param => ({ + TAG: "Eq", + _0: undefined, + _1: Caml_option.undefined_to_opt([].shift()) + })) ], tl: { hd: [ "sortInPlace", - (param => { - return { + (param => ({ + TAG: "Eq", + _0: [ + 1, + 2, + 3 + ], + _1: [ + 3, + 1, + 2 + ].sort() + })) + ], + tl: { + hd: [ + "sortInPlaceWith", + (param => ({ TAG: "Eq", _0: [ - 1, + 3, 2, - 3 + 1 ], _1: [ 3, 1, 2 - ].sort() - }; - }) - ], - tl: { - hd: [ - "sortInPlaceWith", - (param => { - return { - TAG: "Eq", - _0: [ - 3, - 2, - 1 - ], - _1: [ - 3, - 1, - 2 - ].sort((a, b) => { - return b - a | 0; - }) - }; - }) + ].sort((a, b) => b - a | 0) + })) ], tl: { hd: [ @@ -399,65 +361,82 @@ let suites_1 = { tl: { hd: [ "unshift", - (param => { - return { + (param => ({ + TAG: "Eq", + _0: 4, + _1: [ + 1, + 2, + 3 + ].unshift(4) + })) + ], + tl: { + hd: [ + "unshiftMany", + (param => ({ TAG: "Eq", - _0: 4, + _0: 5, _1: [ 1, 2, 3 - ].unshift(4) - }; - }) - ], - tl: { - hd: [ - "unshiftMany", - (param => { - return { + ].unshift(4, 5) + })) + ], + tl: { + hd: [ + "append", + (param => ({ TAG: "Eq", - _0: 5, + _0: [ + 1, + 2, + 3, + 4 + ], _1: [ 1, 2, 3 - ].unshift(4, 5) - }; - }) - ], - tl: { - hd: [ - "append", - (param => { - return { + ].concat([4]) + })) + ], + tl: { + hd: [ + "concat", + (param => ({ TAG: "Eq", _0: [ 1, 2, 3, - 4 + 4, + 5 ], _1: [ 1, 2, 3 - ].concat([4]) - }; - }) - ], - tl: { - hd: [ - "concat", - (param => { - return { + ].concat([ + 4, + 5 + ]) + })) + ], + tl: { + hd: [ + "concatMany", + (param => ({ TAG: "Eq", _0: [ 1, 2, 3, 4, - 5 + 5, + 6, + 7 ], _1: [ 1, @@ -466,155 +445,134 @@ let suites_1 = { ].concat([ 4, 5 + ], [ + 6, + 7 ]) - }; - }) - ], - tl: { - hd: [ - "concatMany", - (param => { - return { + })) + ], + tl: { + hd: [ + "includes", + (param => ({ TAG: "Eq", - _0: [ - 1, - 2, - 3, - 4, - 5, - 6, - 7 - ], + _0: true, _1: [ 1, 2, 3 - ].concat([ - 4, - 5 - ], [ - 6, - 7 - ]) - }; - }) - ], - tl: { - hd: [ - "includes", - (param => { - return { + ].includes(3) + })) + ], + tl: { + hd: [ + "indexOf", + (param => ({ TAG: "Eq", - _0: true, + _0: 1, _1: [ 1, 2, 3 - ].includes(3) - }; - }) - ], - tl: { - hd: [ - "indexOf", - (param => { - return { - TAG: "Eq", - _0: 1, - _1: [ - 1, - 2, - 3 - ].indexOf(2) - }; - }) + ].indexOf(2) + })) ], tl: { hd: [ "indexOfFrom", - (param => { - return { - TAG: "Eq", - _0: 3, - _1: [ - 1, - 2, - 3, - 2 - ].indexOf(2, 2) - }; - }) + (param => ({ + TAG: "Eq", + _0: 3, + _1: [ + 1, + 2, + 3, + 2 + ].indexOf(2, 2) + })) ], tl: { hd: [ "join", - (param => { - return { + (param => ({ + TAG: "Eq", + _0: "1,2,3", + _1: [ + 1, + 2, + 3 + ].join() + })) + ], + tl: { + hd: [ + "joinWith", + (param => ({ TAG: "Eq", - _0: "1,2,3", + _0: "1;2;3", _1: [ 1, 2, 3 - ].join() - }; - }) - ], - tl: { - hd: [ - "joinWith", - (param => { - return { + ].join(";") + })) + ], + tl: { + hd: [ + "lastIndexOf", + (param => ({ TAG: "Eq", - _0: "1;2;3", + _0: 1, _1: [ 1, 2, 3 - ].join(";") - }; - }) - ], - tl: { - hd: [ - "lastIndexOf", - (param => { - return { + ].lastIndexOf(2) + })) + ], + tl: { + hd: [ + "lastIndexOfFrom", + (param => ({ TAG: "Eq", _0: 1, _1: [ 1, 2, - 3 - ].lastIndexOf(2) - }; - }) - ], - tl: { - hd: [ - "lastIndexOfFrom", - (param => { - return { + 3, + 2 + ].lastIndexOf(2, 2) + })) + ], + tl: { + hd: [ + "slice", + (param => ({ TAG: "Eq", - _0: 1, + _0: [ + 2, + 3 + ], _1: [ 1, 2, 3, - 2 - ].lastIndexOf(2, 2) - }; - }) - ], - tl: { - hd: [ - "slice", - (param => { - return { + 4, + 5 + ].slice(1, 3) + })) + ], + tl: { + hd: [ + "copy", + (param => ({ TAG: "Eq", _0: [ + 1, 2, - 3 + 3, + 4, + 5 ], _1: [ 1, @@ -622,19 +580,15 @@ let suites_1 = { 3, 4, 5 - ].slice(1, 3) - }; - }) - ], - tl: { - hd: [ - "copy", - (param => { - return { + ].slice() + })) + ], + tl: { + hd: [ + "sliceFrom", + (param => ({ TAG: "Eq", _0: [ - 1, - 2, 3, 4, 5 @@ -645,244 +599,178 @@ let suites_1 = { 3, 4, 5 - ].slice() - }; - }) - ], - tl: { - hd: [ - "sliceFrom", - (param => { - return { - TAG: "Eq", - _0: [ - 3, - 4, - 5 - ], - _1: [ - 1, - 2, - 3, - 4, - 5 - ].slice(2) - }; - }) + ].slice(2) + })) ], tl: { hd: [ "toString", - (param => { - return { + (param => ({ + TAG: "Eq", + _0: "1,2,3", + _1: [ + 1, + 2, + 3 + ].toString() + })) + ], + tl: { + hd: [ + "toLocaleString", + (param => ({ TAG: "Eq", _0: "1,2,3", _1: [ 1, 2, 3 - ].toString() - }; - }) - ], - tl: { - hd: [ - "toLocaleString", - (param => { - return { + ].toLocaleString() + })) + ], + tl: { + hd: [ + "every", + (param => ({ TAG: "Eq", - _0: "1,2,3", + _0: true, _1: [ 1, 2, 3 - ].toLocaleString() - }; - }) - ], - tl: { - hd: [ - "every", - (param => { - return { + ].every(n => n > 0) + })) + ], + tl: { + hd: [ + "everyi", + (param => ({ TAG: "Eq", - _0: true, + _0: false, _1: [ 1, 2, 3 - ].every(n => { - return n > 0; - }) - }; - }) - ], - tl: { - hd: [ - "everyi", - (param => { - return { - TAG: "Eq", - _0: false, - _1: [ - 1, - 2, - 3 - ].every((param, i) => { - return i > 0; - }) - }; - }) + ].every((param, i) => i > 0) + })) ], tl: { hd: [ "filter", - (param => { - return { + (param => ({ + TAG: "Eq", + _0: [ + 2, + 4 + ], + _1: [ + 1, + 2, + 3, + 4 + ].filter(n => n % 2 === 0) + })) + ], + tl: { + hd: [ + "filteri", + (param => ({ TAG: "Eq", _0: [ - 2, - 4 + 1, + 3 ], _1: [ 1, 2, 3, 4 - ].filter(n => { - return n % 2 === 0; - }) - }; - }) - ], - tl: { - hd: [ - "filteri", - (param => { - return { + ].filter((param, i) => i % 2 === 0) + })) + ], + tl: { + hd: [ + "find", + (param => ({ TAG: "Eq", - _0: [ - 1, - 3 - ], - _1: [ + _0: 2, + _1: Caml_option.undefined_to_opt([ 1, 2, 3, 4 - ].filter((param, i) => { - return i % 2 === 0; - }) - }; - }) - ], - tl: { - hd: [ - "find", - (param => { - return { + ].find(n => n % 2 === 0)) + })) + ], + tl: { + hd: [ + "find - no match", + (param => ({ TAG: "Eq", - _0: 2, + _0: undefined, _1: Caml_option.undefined_to_opt([ 1, 2, 3, 4 - ].find(n => { - return n % 2 === 0; - })) - }; - }) - ], - tl: { - hd: [ - "find - no match", - (param => { - return { + ].find(n => n % 2 === 5)) + })) + ], + tl: { + hd: [ + "findi", + (param => ({ TAG: "Eq", - _0: undefined, + _0: 1, _1: Caml_option.undefined_to_opt([ 1, 2, 3, 4 - ].find(n => { - return n % 2 === 5; - })) - }; - }) - ], - tl: { - hd: [ - "findi", - (param => { - return { + ].find((param, i) => i % 2 === 0)) + })) + ], + tl: { + hd: [ + "findi - no match", + (param => ({ TAG: "Eq", - _0: 1, + _0: undefined, _1: Caml_option.undefined_to_opt([ 1, 2, 3, 4 - ].find((param, i) => { - return i % 2 === 0; - })) - }; - }) - ], - tl: { - hd: [ - "findi - no match", - (param => { - return { + ].find((param, i) => i % 2 === 5)) + })) + ], + tl: { + hd: [ + "findIndex", + (param => ({ TAG: "Eq", - _0: undefined, - _1: Caml_option.undefined_to_opt([ + _0: 1, + _1: [ 1, 2, 3, 4 - ].find((param, i) => { - return i % 2 === 5; - })) - }; - }) - ], - tl: { - hd: [ - "findIndex", - (param => { - return { + ].findIndex(n => n % 2 === 0) + })) + ], + tl: { + hd: [ + "findIndexi", + (param => ({ TAG: "Eq", - _0: 1, + _0: 0, _1: [ 1, 2, 3, 4 - ].findIndex(n => { - return n % 2 === 0; - }) - }; - }) - ], - tl: { - hd: [ - "findIndexi", - (param => { - return { - TAG: "Eq", - _0: 0, - _1: [ - 1, - 2, - 3, - 4 - ].findIndex((param, i) => { - return i % 2 === 0; - }) - }; - }) + ].findIndex((param, i) => i % 2 === 0) + })) ], tl: { hd: [ @@ -929,156 +817,124 @@ let suites_1 = { tl: { hd: [ "map", - (param => { - return { + (param => ({ + TAG: "Eq", + _0: [ + 2, + 4, + 6, + 8 + ], + _1: [ + 1, + 2, + 3, + 4 + ].map(n => (n << 1)) + })) + ], + tl: { + hd: [ + "map", + (param => ({ TAG: "Eq", _0: [ + 0, 2, 4, - 6, - 8 + 6 ], _1: [ 1, 2, 3, 4 - ].map(n => { - return (n << 1); - }) - }; - }) - ], - tl: { - hd: [ - "map", - (param => { - return { + ].map((param, i) => (i << 1)) + })) + ], + tl: { + hd: [ + "reduce", + (param => ({ TAG: "Eq", - _0: [ - 0, - 2, - 4, - 6 - ], + _0: -10, _1: [ 1, 2, 3, 4 - ].map((param, i) => { - return (i << 1); - }) - }; - }) - ], - tl: { - hd: [ - "reduce", - (param => { - return { + ].reduce(((acc, n) => acc - n | 0), 0) + })) + ], + tl: { + hd: [ + "reducei", + (param => ({ TAG: "Eq", - _0: -10, + _0: -6, _1: [ 1, 2, 3, 4 - ].reduce(((acc, n) => { - return acc - n | 0; - }), 0) - }; - }) - ], - tl: { - hd: [ - "reducei", - (param => { - return { + ].reduce(((acc, param, i) => acc - i | 0), 0) + })) + ], + tl: { + hd: [ + "reduceRight", + (param => ({ TAG: "Eq", - _0: -6, + _0: -10, _1: [ 1, 2, 3, 4 - ].reduce(((acc, param, i) => { - return acc - i | 0; - }), 0) - }; - }) - ], - tl: { - hd: [ - "reduceRight", - (param => { - return { + ].reduceRight(((acc, n) => acc - n | 0), 0) + })) + ], + tl: { + hd: [ + "reduceRighti", + (param => ({ TAG: "Eq", - _0: -10, + _0: -6, _1: [ 1, 2, 3, 4 - ].reduceRight(((acc, n) => { - return acc - n | 0; - }), 0) - }; - }) - ], - tl: { - hd: [ - "reduceRighti", - (param => { - return { + ].reduceRight(((acc, param, i) => acc - i | 0), 0) + })) + ], + tl: { + hd: [ + "some", + (param => ({ TAG: "Eq", - _0: -6, + _0: false, _1: [ 1, 2, 3, 4 - ].reduceRight(((acc, param, i) => { - return acc - i | 0; - }), 0) - }; - }) - ], - tl: { - hd: [ - "some", - (param => { - return { + ].some(n => n <= 0) + })) + ], + tl: { + hd: [ + "somei", + (param => ({ TAG: "Eq", - _0: false, + _0: true, _1: [ 1, 2, 3, 4 - ].some(n => { - return n <= 0; - }) - }; - }) - ], - tl: { - hd: [ - "somei", - (param => { - return { - TAG: "Eq", - _0: true, - _1: [ - 1, - 2, - 3, - 4 - ].some((param, i) => { - return i <= 0; - }) - }; - }) + ].some((param, i) => i <= 0) + })) ], tl: /* [] */0 } diff --git a/jscomp/test/js_bool_test.js b/jscomp/test/js_bool_test.js index fbe4ce63ef4..b27705f5d55 100644 --- a/jscomp/test/js_bool_test.js +++ b/jscomp/test/js_bool_test.js @@ -33,36 +33,30 @@ let v = true; let suites_0 = [ "?bool_eq_caml_bool", - (param => { - return { - TAG: "Eq", - _0: u, - _1: true - }; - }) + (param => ({ + TAG: "Eq", + _0: u, + _1: true + })) ]; let suites_1 = { hd: [ "js_bool_eq_js_bool", - (param => { - return { - TAG: "Eq", - _0: v, - _1: true - }; - }) + (param => ({ + TAG: "Eq", + _0: v, + _1: true + })) ], tl: { hd: [ "js_bool_neq_acml_bool", - (param => { - return { - TAG: "Eq", - _0: true, - _1: true === true - }; - }) + (param => ({ + TAG: "Eq", + _0: true, + _1: true === true + })) ], tl: /* [] */0 } diff --git a/jscomp/test/js_cast_test.js b/jscomp/test/js_cast_test.js index 87489a9d5d6..5406f47ecab 100644 --- a/jscomp/test/js_cast_test.js +++ b/jscomp/test/js_cast_test.js @@ -24,13 +24,11 @@ function add_test(loc, test) { } function eq(loc, x, y) { - add_test(loc, (() => { - return { - TAG: "Eq", - _0: x, - _1: y - }; - })); + add_test(loc, (() => ({ + TAG: "Eq", + _0: x, + _1: y + }))); } eq("File \"js_cast_test.res\", line 14, characters 12-19", true, 1); diff --git a/jscomp/test/js_date_test.js b/jscomp/test/js_date_test.js index 5ae1b6e167e..8b614ad2107 100644 --- a/jscomp/test/js_date_test.js +++ b/jscomp/test/js_date_test.js @@ -10,77 +10,63 @@ function date() { let suites_0 = [ "valueOf", - (param => { - return { - TAG: "Eq", - _0: 195131516789, - _1: new Date("1976-03-08T12:34:56.789+01:23").valueOf() - }; - }) + (param => ({ + TAG: "Eq", + _0: 195131516789, + _1: new Date("1976-03-08T12:34:56.789+01:23").valueOf() + })) ]; let suites_1 = { hd: [ "make", - (param => { - return { - TAG: "Ok", - _0: new Date().getTime() > 1487223505382 - }; - }) + (param => ({ + TAG: "Ok", + _0: new Date().getTime() > 1487223505382 + })) ], tl: { hd: [ "parseAsFloat", - (param => { - return { - TAG: "Eq", - _0: Date.parse("1976-03-08T12:34:56.789+01:23"), - _1: 195131516789 - }; - }) + (param => ({ + TAG: "Eq", + _0: Date.parse("1976-03-08T12:34:56.789+01:23"), + _1: 195131516789 + })) ], tl: { hd: [ "parseAsFloat_invalid", - (param => { - return { - TAG: "Ok", - _0: Number.isNaN(Date.parse("gibberish")) - }; - }) + (param => ({ + TAG: "Ok", + _0: Number.isNaN(Date.parse("gibberish")) + })) ], tl: { hd: [ "fromFloat", - (param => { - return { - TAG: "Eq", - _0: "1976-03-08T11:11:56.789Z", - _1: new Date(195131516789).toISOString() - }; - }) + (param => ({ + TAG: "Eq", + _0: "1976-03-08T11:11:56.789Z", + _1: new Date(195131516789).toISOString() + })) ], tl: { hd: [ "fromString_valid", - (param => { - return { - TAG: "Eq", - _0: 195131516789, - _1: new Date("1976-03-08T12:34:56.789+01:23").getTime() - }; - }) + (param => ({ + TAG: "Eq", + _0: 195131516789, + _1: new Date("1976-03-08T12:34:56.789+01:23").getTime() + })) ], tl: { hd: [ "fromString_invalid", - (param => { - return { - TAG: "Ok", - _0: Number.isNaN(new Date("gibberish").getTime()) - }; - }) + (param => ({ + TAG: "Ok", + _0: Number.isNaN(new Date("gibberish").getTime()) + })) ], tl: { hd: [ @@ -310,145 +296,119 @@ let suites_1 = { tl: { hd: [ "getFullYear", - (param => { - return { - TAG: "Eq", - _0: 1976, - _1: new Date("1976-03-08T12:34:56.789+01:23").getFullYear() - }; - }) + (param => ({ + TAG: "Eq", + _0: 1976, + _1: new Date("1976-03-08T12:34:56.789+01:23").getFullYear() + })) ], tl: { hd: [ "getMilliseconds", - (param => { - return { - TAG: "Eq", - _0: 789, - _1: new Date("1976-03-08T12:34:56.789+01:23").getMilliseconds() - }; - }) + (param => ({ + TAG: "Eq", + _0: 789, + _1: new Date("1976-03-08T12:34:56.789+01:23").getMilliseconds() + })) ], tl: { hd: [ "getSeconds", - (param => { - return { - TAG: "Eq", - _0: 56, - _1: new Date("1976-03-08T12:34:56.789+01:23").getSeconds() - }; - }) + (param => ({ + TAG: "Eq", + _0: 56, + _1: new Date("1976-03-08T12:34:56.789+01:23").getSeconds() + })) ], tl: { hd: [ "getTime", - (param => { - return { - TAG: "Eq", - _0: 195131516789, - _1: new Date("1976-03-08T12:34:56.789+01:23").getTime() - }; - }) + (param => ({ + TAG: "Eq", + _0: 195131516789, + _1: new Date("1976-03-08T12:34:56.789+01:23").getTime() + })) ], tl: { hd: [ "getUTCDate", - (param => { - return { - TAG: "Eq", - _0: 8, - _1: new Date("1976-03-08T12:34:56.789+01:23").getUTCDate() - }; - }) + (param => ({ + TAG: "Eq", + _0: 8, + _1: new Date("1976-03-08T12:34:56.789+01:23").getUTCDate() + })) ], tl: { hd: [ "getUTCDay", - (param => { - return { - TAG: "Eq", - _0: 1, - _1: new Date("1976-03-08T12:34:56.789+01:23").getUTCDay() - }; - }) + (param => ({ + TAG: "Eq", + _0: 1, + _1: new Date("1976-03-08T12:34:56.789+01:23").getUTCDay() + })) ], tl: { hd: [ "getUTCFUllYear", - (param => { - return { - TAG: "Eq", - _0: 1976, - _1: new Date("1976-03-08T12:34:56.789+01:23").getUTCFullYear() - }; - }) + (param => ({ + TAG: "Eq", + _0: 1976, + _1: new Date("1976-03-08T12:34:56.789+01:23").getUTCFullYear() + })) ], tl: { hd: [ "getUTCHours", - (param => { - return { - TAG: "Eq", - _0: 11, - _1: new Date("1976-03-08T12:34:56.789+01:23").getUTCHours() - }; - }) + (param => ({ + TAG: "Eq", + _0: 11, + _1: new Date("1976-03-08T12:34:56.789+01:23").getUTCHours() + })) ], tl: { hd: [ "getUTCMilliseconds", - (param => { - return { - TAG: "Eq", - _0: 789, - _1: new Date("1976-03-08T12:34:56.789+01:23").getUTCMilliseconds() - }; - }) + (param => ({ + TAG: "Eq", + _0: 789, + _1: new Date("1976-03-08T12:34:56.789+01:23").getUTCMilliseconds() + })) ], tl: { hd: [ "getUTCMinutes", - (param => { - return { - TAG: "Eq", - _0: 11, - _1: new Date("1976-03-08T12:34:56.789+01:23").getUTCMinutes() - }; - }) + (param => ({ + TAG: "Eq", + _0: 11, + _1: new Date("1976-03-08T12:34:56.789+01:23").getUTCMinutes() + })) ], tl: { hd: [ "getUTCMonth", - (param => { - return { - TAG: "Eq", - _0: 2, - _1: new Date("1976-03-08T12:34:56.789+01:23").getUTCMonth() - }; - }) + (param => ({ + TAG: "Eq", + _0: 2, + _1: new Date("1976-03-08T12:34:56.789+01:23").getUTCMonth() + })) ], tl: { hd: [ "getUTCSeconds", - (param => { - return { - TAG: "Eq", - _0: 56, - _1: new Date("1976-03-08T12:34:56.789+01:23").getUTCSeconds() - }; - }) + (param => ({ + TAG: "Eq", + _0: 56, + _1: new Date("1976-03-08T12:34:56.789+01:23").getUTCSeconds() + })) ], tl: { hd: [ "getYear", - (param => { - return { - TAG: "Eq", - _0: 1976, - _1: new Date("1976-03-08T12:34:56.789+01:23").getFullYear() - }; - }) + (param => ({ + TAG: "Eq", + _0: 1976, + _1: new Date("1976-03-08T12:34:56.789+01:23").getFullYear() + })) ], tl: { hd: [ @@ -951,68 +911,56 @@ let suites_1 = { tl: { hd: [ "toDateString", - (param => { - return { - TAG: "Eq", - _0: "Mon Mar 08 1976", - _1: new Date("1976-03-08T12:34:56.789+01:23").toDateString() - }; - }) + (param => ({ + TAG: "Eq", + _0: "Mon Mar 08 1976", + _1: new Date("1976-03-08T12:34:56.789+01:23").toDateString() + })) ], tl: { hd: [ "toGMTString", - (param => { - return { - TAG: "Eq", - _0: "Mon, 08 Mar 1976 11:11:56 GMT", - _1: new Date("1976-03-08T12:34:56.789+01:23").toUTCString() - }; - }) + (param => ({ + TAG: "Eq", + _0: "Mon, 08 Mar 1976 11:11:56 GMT", + _1: new Date("1976-03-08T12:34:56.789+01:23").toUTCString() + })) ], tl: { hd: [ "toISOString", - (param => { - return { - TAG: "Eq", - _0: "1976-03-08T11:11:56.789Z", - _1: new Date("1976-03-08T12:34:56.789+01:23").toISOString() - }; - }) + (param => ({ + TAG: "Eq", + _0: "1976-03-08T11:11:56.789Z", + _1: new Date("1976-03-08T12:34:56.789+01:23").toISOString() + })) ], tl: { hd: [ "toJSON", - (param => { - return { - TAG: "Eq", - _0: "1976-03-08T11:11:56.789Z", - _1: new Date("1976-03-08T12:34:56.789+01:23").toJSON() - }; - }) + (param => ({ + TAG: "Eq", + _0: "1976-03-08T11:11:56.789Z", + _1: new Date("1976-03-08T12:34:56.789+01:23").toJSON() + })) ], tl: { hd: [ "toJSONUnsafe", - (param => { - return { - TAG: "Eq", - _0: "1976-03-08T11:11:56.789Z", - _1: new Date("1976-03-08T12:34:56.789+01:23").toJSON() - }; - }) + (param => ({ + TAG: "Eq", + _0: "1976-03-08T11:11:56.789Z", + _1: new Date("1976-03-08T12:34:56.789+01:23").toJSON() + })) ], tl: { hd: [ "toUTCString", - (param => { - return { - TAG: "Eq", - _0: "Mon, 08 Mar 1976 11:11:56 GMT", - _1: new Date("1976-03-08T12:34:56.789+01:23").toUTCString() - }; - }) + (param => ({ + TAG: "Eq", + _0: "Mon, 08 Mar 1976 11:11:56 GMT", + _1: new Date("1976-03-08T12:34:56.789+01:23").toUTCString() + })) ], tl: { hd: [ diff --git a/jscomp/test/js_dict_test.js b/jscomp/test/js_dict_test.js index 4beaff0ed8a..f32b9f42294 100644 --- a/jscomp/test/js_dict_test.js +++ b/jscomp/test/js_dict_test.js @@ -13,56 +13,48 @@ function obj() { let suites_0 = [ "empty", - (param => { - return { - TAG: "Eq", - _0: [], - _1: Object.keys({}) - }; - }) + (param => ({ + TAG: "Eq", + _0: [], + _1: Object.keys({}) + })) ]; let suites_1 = { hd: [ "get", - (param => { - return { - TAG: "Eq", - _0: 43, - _1: Js_dict.get({ - foo: 43, - bar: 86 - }, "foo") - }; - }) + (param => ({ + TAG: "Eq", + _0: 43, + _1: Js_dict.get({ + foo: 43, + bar: 86 + }, "foo") + })) ], tl: { hd: [ "get - property not in object", - (param => { - return { - TAG: "Eq", - _0: undefined, - _1: Js_dict.get({ - foo: 43, - bar: 86 - }, "baz") - }; - }) + (param => ({ + TAG: "Eq", + _0: undefined, + _1: Js_dict.get({ + foo: 43, + bar: 86 + }, "baz") + })) ], tl: { hd: [ "unsafe_get", - (param => { - return { - TAG: "Eq", - _0: 43, - _1: ({ - foo: 43, - bar: 86 - })["foo"] - }; - }) + (param => ({ + TAG: "Eq", + _0: 43, + _1: ({ + foo: 43, + bar: 86 + })["foo"] + })) ], tl: { hd: [ @@ -83,161 +75,143 @@ let suites_1 = { tl: { hd: [ "keys", - (param => { - return { + (param => ({ + TAG: "Eq", + _0: [ + "foo", + "bar" + ], + _1: Object.keys({ + foo: 43, + bar: 86 + }) + })) + ], + tl: { + hd: [ + "entries", + (param => ({ TAG: "Eq", _0: [ - "foo", - "bar" + [ + "foo", + 43 + ], + [ + "bar", + 86 + ] ], - _1: Object.keys({ + _1: Js_dict.entries({ foo: 43, bar: 86 }) - }; - }) - ], - tl: { - hd: [ - "entries", - (param => { - return { + })) + ], + tl: { + hd: [ + "values", + (param => ({ TAG: "Eq", _0: [ - [ - "foo", - 43 - ], - [ - "bar", - 86 - ] + 43, + 86 ], - _1: Js_dict.entries({ + _1: Js_dict.values({ foo: 43, bar: 86 }) - }; - }) - ], - tl: { - hd: [ - "values", - (param => { - return { - TAG: "Eq", - _0: [ - 43, - 86 - ], - _1: Js_dict.values({ - foo: 43, - bar: 86 - }) - }; - }) + })) ], tl: { hd: [ "fromList - []", - (param => { - return { - TAG: "Eq", - _0: {}, - _1: Js_dict.fromList(/* [] */0) - }; - }) + (param => ({ + TAG: "Eq", + _0: {}, + _1: Js_dict.fromList(/* [] */0) + })) ], tl: { hd: [ "fromList", - (param => { - return { - TAG: "Eq", - _0: [ - [ - "x", - 23 - ], - [ - "y", - 46 - ] + (param => ({ + TAG: "Eq", + _0: [ + [ + "x", + 23 + ], + [ + "y", + 46 + ] + ], + _1: Js_dict.entries(Js_dict.fromList({ + hd: [ + "x", + 23 ], - _1: Js_dict.entries(Js_dict.fromList({ + tl: { hd: [ - "x", - 23 + "y", + 46 ], - tl: { - hd: [ - "y", - 46 - ], - tl: /* [] */0 - } - })) - }; - }) + tl: /* [] */0 + } + })) + })) ], tl: { hd: [ "fromArray - []", - (param => { - return { - TAG: "Eq", - _0: {}, - _1: Js_dict.fromArray([]) - }; - }) + (param => ({ + TAG: "Eq", + _0: {}, + _1: Js_dict.fromArray([]) + })) ], tl: { hd: [ "fromArray", - (param => { - return { - TAG: "Eq", - _0: [ - [ - "x", - 23 - ], - [ - "y", - 46 - ] + (param => ({ + TAG: "Eq", + _0: [ + [ + "x", + 23 + ], + [ + "y", + 46 + ] + ], + _1: Js_dict.entries(Js_dict.fromArray([ + [ + "x", + 23 ], - _1: Js_dict.entries(Js_dict.fromArray([ - [ - "x", - 23 - ], - [ - "y", - 46 - ] - ])) - }; - }) + [ + "y", + 46 + ] + ])) + })) ], tl: { hd: [ "map", - (param => { - return { - TAG: "Eq", - _0: { - foo: "43", - bar: "86" - }, - _1: Js_dict.map((i => { - return String(i); - }), { - foo: 43, - bar: 86 - }) - }; - }) + (param => ({ + TAG: "Eq", + _0: { + foo: "43", + bar: "86" + }, + _1: Js_dict.map((i => String(i)), { + foo: 43, + bar: 86 + }) + })) ], tl: /* [] */0 } diff --git a/jscomp/test/js_exception_catch_test.js b/jscomp/test/js_exception_catch_test.js index c39777779df..a35d45a033f 100644 --- a/jscomp/test/js_exception_catch_test.js +++ b/jscomp/test/js_exception_catch_test.js @@ -27,31 +27,25 @@ function add_test(loc, test) { } function eq(loc, x, y) { - add_test(loc, (() => { - return { - TAG: "Eq", - _0: x, - _1: y - }; - })); + add_test(loc, (() => ({ + TAG: "Eq", + _0: x, + _1: y + }))); } function false_(loc) { - add_test(loc, (() => { - return { - TAG: "Ok", - _0: false - }; - })); + add_test(loc, (() => ({ + TAG: "Ok", + _0: false + }))); } function true_(loc) { - add_test(loc, (() => { - return { - TAG: "Ok", - _0: true - }; - })); + add_test(loc, (() => ({ + TAG: "Ok", + _0: true + }))); } let exit = 0; @@ -64,12 +58,10 @@ try { } catch (raw_x) { let x = Caml_js_exceptions.internalToOCamlException(raw_x); if (x.RE_EXN_ID === Js_exn.$$Error) { - add_test("File \"js_exception_catch_test.res\", line 18, characters 37-44", (() => { - return { - TAG: "Ok", - _0: true - }; - })); + add_test("File \"js_exception_catch_test.res\", line 18, characters 37-44", (() => ({ + TAG: "Ok", + _0: true + }))); } else { throw new Error(x.RE_EXN_ID, { cause: x @@ -78,12 +70,10 @@ try { } if (exit === 1) { - add_test("File \"js_exception_catch_test.res\", line 19, characters 14-21", (() => { - return { - TAG: "Ok", - _0: false - }; - })); + add_test("File \"js_exception_catch_test.res\", line 19, characters 14-21", (() => ({ + TAG: "Ok", + _0: false + }))); } let A = /* @__PURE__ */Caml_exceptions.create("Js_exception_catch_test.A"); @@ -128,9 +118,7 @@ function test(f) { } } -eq("File \"js_exception_catch_test.res\", line 44, characters 5-12", test(() => { - -}), "No_error"); +eq("File \"js_exception_catch_test.res\", line 44, characters 5-12", test(() => {}), "No_error"); eq("File \"js_exception_catch_test.res\", line 45, characters 5-12", test(() => { throw new Error("Not_found", { diff --git a/jscomp/test/js_float_test.js b/jscomp/test/js_float_test.js index 860427c4268..bdc5d72dc14 100644 --- a/jscomp/test/js_float_test.js +++ b/jscomp/test/js_float_test.js @@ -6,485 +6,399 @@ let Pervasives = require("../../lib/js/pervasives.js"); let suites_0 = [ "_NaN <> _NaN", - (param => { - return { - TAG: "Eq", - _0: false, - _1: NaN === NaN - }; - }) + (param => ({ + TAG: "Eq", + _0: false, + _1: NaN === NaN + })) ]; let suites_1 = { hd: [ "isNaN - _NaN", - (param => { - return { - TAG: "Eq", - _0: true, - _1: Number.isNaN(NaN) - }; - }) + (param => ({ + TAG: "Eq", + _0: true, + _1: Number.isNaN(NaN) + })) ], tl: { hd: [ "isNaN - 0.", - (param => { - return { - TAG: "Eq", - _0: false, - _1: Number.isNaN(0) - }; - }) + (param => ({ + TAG: "Eq", + _0: false, + _1: Number.isNaN(0) + })) ], tl: { hd: [ "isFinite - infinity", - (param => { - return { - TAG: "Eq", - _0: false, - _1: Number.isFinite(Pervasives.infinity) - }; - }) + (param => ({ + TAG: "Eq", + _0: false, + _1: Number.isFinite(Pervasives.infinity) + })) ], tl: { hd: [ "isFinite - neg_infinity", - (param => { - return { - TAG: "Eq", - _0: false, - _1: Number.isFinite(Pervasives.neg_infinity) - }; - }) + (param => ({ + TAG: "Eq", + _0: false, + _1: Number.isFinite(Pervasives.neg_infinity) + })) ], tl: { hd: [ "isFinite - _NaN", - (param => { - return { - TAG: "Eq", - _0: false, - _1: Number.isFinite(NaN) - }; - }) + (param => ({ + TAG: "Eq", + _0: false, + _1: Number.isFinite(NaN) + })) ], tl: { hd: [ "isFinite - 0.", - (param => { - return { - TAG: "Eq", - _0: true, - _1: Number.isFinite(0) - }; - }) + (param => ({ + TAG: "Eq", + _0: true, + _1: Number.isFinite(0) + })) ], tl: { hd: [ "toExponential", - (param => { - return { - TAG: "Eq", - _0: "1.23456e+2", - _1: (123.456).toExponential() - }; - }) + (param => ({ + TAG: "Eq", + _0: "1.23456e+2", + _1: (123.456).toExponential() + })) ], tl: { hd: [ "toExponential - large number", - (param => { - return { - TAG: "Eq", - _0: "1.2e+21", - _1: (1.2e21).toExponential() - }; - }) + (param => ({ + TAG: "Eq", + _0: "1.2e+21", + _1: (1.2e21).toExponential() + })) ], tl: { hd: [ "toExponentialWithPrecision - digits:2", - (param => { - return { - TAG: "Eq", - _0: "1.23e+2", - _1: (123.456).toExponential(2) - }; - }) + (param => ({ + TAG: "Eq", + _0: "1.23e+2", + _1: (123.456).toExponential(2) + })) ], tl: { hd: [ "toExponentialWithPrecision - digits:4", - (param => { - return { - TAG: "Eq", - _0: "1.2346e+2", - _1: (123.456).toExponential(4) - }; - }) + (param => ({ + TAG: "Eq", + _0: "1.2346e+2", + _1: (123.456).toExponential(4) + })) ], tl: { hd: [ "toExponentialWithPrecision - digits:20", - (param => { - return { - TAG: "Eq", - _0: "0.00000000000000000000e+0", - _1: (0).toExponential(20) - }; - }) + (param => ({ + TAG: "Eq", + _0: "0.00000000000000000000e+0", + _1: (0).toExponential(20) + })) ], tl: { hd: [ "File \"js_float_test.res\", line 27, characters 5-12", - (param => { - return { - TAG: "ThrowAny", - _0: (() => { - (0).toExponential(101); - }) - }; - }) + (param => ({ + TAG: "ThrowAny", + _0: (() => { + (0).toExponential(101); + }) + })) ], tl: { hd: [ "toExponentialWithPrecision - digits:-1", - (param => { - return { - TAG: "ThrowAny", - _0: (() => { - (0).toExponential(-1); - }) - }; - }) + (param => ({ + TAG: "ThrowAny", + _0: (() => { + (0).toExponential(-1); + }) + })) ], tl: { hd: [ "toFixed", - (param => { - return { - TAG: "Eq", - _0: "123", - _1: (123.456).toFixed() - }; - }) + (param => ({ + TAG: "Eq", + _0: "123", + _1: (123.456).toFixed() + })) ], tl: { hd: [ "toFixed - large number", - (param => { - return { - TAG: "Eq", - _0: "1.2e+21", - _1: (1.2e21).toFixed() - }; - }) + (param => ({ + TAG: "Eq", + _0: "1.2e+21", + _1: (1.2e21).toFixed() + })) ], tl: { hd: [ "toFixedWithPrecision - digits:2", - (param => { - return { - TAG: "Eq", - _0: "123.46", - _1: (123.456).toFixed(2) - }; - }) + (param => ({ + TAG: "Eq", + _0: "123.46", + _1: (123.456).toFixed(2) + })) ], tl: { hd: [ "toFixedWithPrecision - digits:4", - (param => { - return { - TAG: "Eq", - _0: "123.4560", - _1: (123.456).toFixed(4) - }; - }) + (param => ({ + TAG: "Eq", + _0: "123.4560", + _1: (123.456).toFixed(4) + })) ], tl: { hd: [ "toFixedWithPrecision - digits:20", - (param => { - return { - TAG: "Eq", - _0: "0.00000000000000000000", - _1: (0).toFixed(20) - }; - }) + (param => ({ + TAG: "Eq", + _0: "0.00000000000000000000", + _1: (0).toFixed(20) + })) ], tl: { hd: [ "toFixedWithPrecision - digits:101", - (param => { - return { - TAG: "ThrowAny", - _0: (() => { - (0).toFixed(101); - }) - }; - }) + (param => ({ + TAG: "ThrowAny", + _0: (() => { + (0).toFixed(101); + }) + })) ], tl: { hd: [ "toFixedWithPrecision - digits:-1", - (param => { - return { - TAG: "ThrowAny", - _0: (() => { - (0).toFixed(-1); - }) - }; - }) + (param => ({ + TAG: "ThrowAny", + _0: (() => { + (0).toFixed(-1); + }) + })) ], tl: { hd: [ "toPrecision", - (param => { - return { - TAG: "Eq", - _0: "123.456", - _1: (123.456).toPrecision() - }; - }) + (param => ({ + TAG: "Eq", + _0: "123.456", + _1: (123.456).toPrecision() + })) ], tl: { hd: [ "toPrecision - large number", - (param => { - return { - TAG: "Eq", - _0: "1.2e+21", - _1: (1.2e21).toPrecision() - }; - }) + (param => ({ + TAG: "Eq", + _0: "1.2e+21", + _1: (1.2e21).toPrecision() + })) ], tl: { hd: [ "toPrecisionWithPrecision - digits:2", - (param => { - return { - TAG: "Eq", - _0: "1.2e+2", - _1: (123.456).toPrecision(2) - }; - }) + (param => ({ + TAG: "Eq", + _0: "1.2e+2", + _1: (123.456).toPrecision(2) + })) ], tl: { hd: [ "toPrecisionWithPrecision - digits:4", - (param => { - return { - TAG: "Eq", - _0: "123.5", - _1: (123.456).toPrecision(4) - }; - }) + (param => ({ + TAG: "Eq", + _0: "123.5", + _1: (123.456).toPrecision(4) + })) ], tl: { hd: [ "toPrecisionWithPrecision - digits:20", - (param => { - return { - TAG: "Eq", - _0: "0.0000000000000000000", - _1: (0).toPrecision(20) - }; - }) + (param => ({ + TAG: "Eq", + _0: "0.0000000000000000000", + _1: (0).toPrecision(20) + })) ], tl: { hd: [ "File \"js_float_test.res\", line 68, characters 5-12", - (param => { - return { - TAG: "ThrowAny", - _0: (() => { - (0).toPrecision(101); - }) - }; - }) + (param => ({ + TAG: "ThrowAny", + _0: (() => { + (0).toPrecision(101); + }) + })) ], tl: { hd: [ "toPrecisionWithPrecision - digits:-1", - (param => { - return { - TAG: "ThrowAny", - _0: (() => { - (0).toPrecision(-1); - }) - }; - }) + (param => ({ + TAG: "ThrowAny", + _0: (() => { + (0).toPrecision(-1); + }) + })) ], tl: { hd: [ "toString", - (param => { - return { - TAG: "Eq", - _0: "1.23", - _1: (1.23).toString() - }; - }) + (param => ({ + TAG: "Eq", + _0: "1.23", + _1: (1.23).toString() + })) ], tl: { hd: [ "toString - large number", - (param => { - return { - TAG: "Eq", - _0: "1.2e+21", - _1: (1.2e21).toString() - }; - }) + (param => ({ + TAG: "Eq", + _0: "1.2e+21", + _1: (1.2e21).toString() + })) ], tl: { hd: [ "toStringWithRadix - radix:2", - (param => { - return { - TAG: "Eq", - _0: "1111011.0111010010111100011010100111111011111001110111", - _1: (123.456).toString(2) - }; - }) + (param => ({ + TAG: "Eq", + _0: "1111011.0111010010111100011010100111111011111001110111", + _1: (123.456).toString(2) + })) ], tl: { hd: [ "toStringWithRadix - radix:16", - (param => { - return { - TAG: "Eq", - _0: "7b.74bc6a7ef9dc", - _1: (123.456).toString(16) - }; - }) + (param => ({ + TAG: "Eq", + _0: "7b.74bc6a7ef9dc", + _1: (123.456).toString(16) + })) ], tl: { hd: [ "toStringWithRadix - radix:36", - (param => { - return { - TAG: "Eq", - _0: "3f", - _1: (123).toString(36) - }; - }) + (param => ({ + TAG: "Eq", + _0: "3f", + _1: (123).toString(36) + })) ], tl: { hd: [ "toStringWithRadix - radix:37", - (param => { - return { - TAG: "ThrowAny", - _0: (() => { - (0).toString(37); - }) - }; - }) + (param => ({ + TAG: "ThrowAny", + _0: (() => { + (0).toString(37); + }) + })) ], tl: { hd: [ "toStringWithRadix - radix:1", - (param => { - return { - TAG: "ThrowAny", - _0: (() => { - (0).toString(1); - }) - }; - }) + (param => ({ + TAG: "ThrowAny", + _0: (() => { + (0).toString(1); + }) + })) ], tl: { hd: [ "toStringWithRadix - radix:-1", - (param => { - return { - TAG: "ThrowAny", - _0: (() => { - (0).toString(-1); - }) - }; - }) + (param => ({ + TAG: "ThrowAny", + _0: (() => { + (0).toString(-1); + }) + })) ], tl: { hd: [ "fromString - 123", - (param => { - return { - TAG: "Eq", - _0: 123, - _1: Number("123") - }; - }) + (param => ({ + TAG: "Eq", + _0: 123, + _1: Number("123") + })) ], tl: { hd: [ "fromString - 12.3", - (param => { - return { - TAG: "Eq", - _0: 12.3, - _1: Number("12.3") - }; - }) + (param => ({ + TAG: "Eq", + _0: 12.3, + _1: Number("12.3") + })) ], tl: { hd: [ "fromString - empty string", - (param => { - return { - TAG: "Eq", - _0: 0, - _1: Number("") - }; - }) + (param => ({ + TAG: "Eq", + _0: 0, + _1: Number("") + })) ], tl: { hd: [ "fromString - 0x11", - (param => { - return { - TAG: "Eq", - _0: 17, - _1: Number("0x11") - }; - }) + (param => ({ + TAG: "Eq", + _0: 17, + _1: Number("0x11") + })) ], tl: { hd: [ "fromString - 0b11", - (param => { - return { - TAG: "Eq", - _0: 3, - _1: Number("0b11") - }; - }) + (param => ({ + TAG: "Eq", + _0: 3, + _1: Number("0b11") + })) ], tl: { hd: [ "fromString - 0o11", - (param => { - return { - TAG: "Eq", - _0: 9, - _1: Number("0o11") - }; - }) + (param => ({ + TAG: "Eq", + _0: 9, + _1: Number("0o11") + })) ], tl: { hd: [ "fromString - invalid string", - (param => { - return { - TAG: "Eq", - _0: true, - _1: Number.isNaN(Number("foo")) - }; - }) + (param => ({ + TAG: "Eq", + _0: true, + _1: Number.isNaN(Number("foo")) + })) ], tl: /* [] */0 } diff --git a/jscomp/test/js_global_test.js b/jscomp/test/js_global_test.js index cbfb2189812..05aa3de7b63 100644 --- a/jscomp/test/js_global_test.js +++ b/jscomp/test/js_global_test.js @@ -6,9 +6,7 @@ let Mt = require("./mt.js"); let suites_0 = [ "setTimeout/clearTimeout sanity check", (param => { - let handle = setTimeout((() => { - - }), 0); + let handle = setTimeout((() => {}), 0); clearTimeout(handle); return { TAG: "Ok", @@ -21,9 +19,7 @@ let suites_1 = { hd: [ "setInerval/clearInterval sanity check", (param => { - let handle = setInterval((() => { - - }), 0); + let handle = setInterval((() => {}), 0); clearInterval(handle); return { TAG: "Ok", @@ -34,46 +30,38 @@ let suites_1 = { tl: { hd: [ "encodeURI", - (param => { - return { - TAG: "Eq", - _0: encodeURI("[-=-]"), - _1: "%5B-=-%5D" - }; - }) + (param => ({ + TAG: "Eq", + _0: encodeURI("[-=-]"), + _1: "%5B-=-%5D" + })) ], tl: { hd: [ "decodeURI", - (param => { - return { - TAG: "Eq", - _0: decodeURI("%5B-=-%5D"), - _1: "[-=-]" - }; - }) + (param => ({ + TAG: "Eq", + _0: decodeURI("%5B-=-%5D"), + _1: "[-=-]" + })) ], tl: { hd: [ "encodeURIComponent", - (param => { - return { - TAG: "Eq", - _0: encodeURIComponent("[-=-]"), - _1: "%5B-%3D-%5D" - }; - }) + (param => ({ + TAG: "Eq", + _0: encodeURIComponent("[-=-]"), + _1: "%5B-%3D-%5D" + })) ], tl: { hd: [ "decodeURIComponent", - (param => { - return { - TAG: "Eq", - _0: decodeURIComponent("%5B-%3D-%5D"), - _1: "[-=-]" - }; - }) + (param => ({ + TAG: "Eq", + _0: decodeURIComponent("%5B-%3D-%5D"), + _1: "[-=-]" + })) ], tl: /* [] */0 } diff --git a/jscomp/test/js_int_test.js b/jscomp/test/js_int_test.js index 0f15cc51997..34deb2ec445 100644 --- a/jscomp/test/js_int_test.js +++ b/jscomp/test/js_int_test.js @@ -5,219 +5,181 @@ let Mt = require("./mt.js"); let suites_0 = [ "toExponential", - (param => { - return { - TAG: "Eq", - _0: "1.23456e+5", - _1: (123456).toExponential() - }; - }) + (param => ({ + TAG: "Eq", + _0: "1.23456e+5", + _1: (123456).toExponential() + })) ]; let suites_1 = { hd: [ "toExponentialWithPrecision - digits:2", - (param => { - return { - TAG: "Eq", - _0: "1.23e+5", - _1: (123456).toExponential(2) - }; - }) + (param => ({ + TAG: "Eq", + _0: "1.23e+5", + _1: (123456).toExponential(2) + })) ], tl: { hd: [ "toExponentialWithPrecision - digits:4", - (param => { - return { - TAG: "Eq", - _0: "1.2346e+5", - _1: (123456).toExponential(4) - }; - }) + (param => ({ + TAG: "Eq", + _0: "1.2346e+5", + _1: (123456).toExponential(4) + })) ], tl: { hd: [ "toExponentialWithPrecision - digits:20", - (param => { - return { - TAG: "Eq", - _0: "0.00000000000000000000e+0", - _1: (0).toExponential(20) - }; - }) + (param => ({ + TAG: "Eq", + _0: "0.00000000000000000000e+0", + _1: (0).toExponential(20) + })) ], tl: { hd: [ "File \"js_int_test.res\", line 19, characters 5-12", - (param => { - return { - TAG: "ThrowAny", - _0: (() => { - (0).toExponential(101); - }) - }; - }) + (param => ({ + TAG: "ThrowAny", + _0: (() => { + (0).toExponential(101); + }) + })) ], tl: { hd: [ "toExponentialWithPrecision - digits:-1", - (param => { - return { - TAG: "ThrowAny", - _0: (() => { - (0).toExponential(-1); - }) - }; - }) + (param => ({ + TAG: "ThrowAny", + _0: (() => { + (0).toExponential(-1); + }) + })) ], tl: { hd: [ "toPrecision", - (param => { - return { - TAG: "Eq", - _0: "123456", - _1: (123456).toPrecision() - }; - }) + (param => ({ + TAG: "Eq", + _0: "123456", + _1: (123456).toPrecision() + })) ], tl: { hd: [ "toPrecisionWithPrecision - digits:2", - (param => { - return { - TAG: "Eq", - _0: "1.2e+5", - _1: (123456).toPrecision(2) - }; - }) + (param => ({ + TAG: "Eq", + _0: "1.2e+5", + _1: (123456).toPrecision(2) + })) ], tl: { hd: [ "toPrecisionWithPrecision - digits:4", - (param => { - return { - TAG: "Eq", - _0: "1.235e+5", - _1: (123456).toPrecision(4) - }; - }) + (param => ({ + TAG: "Eq", + _0: "1.235e+5", + _1: (123456).toPrecision(4) + })) ], tl: { hd: [ "toPrecisionWithPrecision - digits:20", - (param => { - return { - TAG: "Eq", - _0: "0.0000000000000000000", - _1: (0).toPrecision(20) - }; - }) + (param => ({ + TAG: "Eq", + _0: "0.0000000000000000000", + _1: (0).toPrecision(20) + })) ], tl: { hd: [ "File \"js_int_test.res\", line 37, characters 5-12", - (param => { - return { - TAG: "ThrowAny", - _0: (() => { - (0).toPrecision(101); - }) - }; - }) + (param => ({ + TAG: "ThrowAny", + _0: (() => { + (0).toPrecision(101); + }) + })) ], tl: { hd: [ "toPrecisionWithPrecision - digits:-1", - (param => { - return { - TAG: "ThrowAny", - _0: (() => { - (0).toPrecision(-1); - }) - }; - }) + (param => ({ + TAG: "ThrowAny", + _0: (() => { + (0).toPrecision(-1); + }) + })) ], tl: { hd: [ "toString", - (param => { - return { - TAG: "Eq", - _0: "123", - _1: (123).toString() - }; - }) + (param => ({ + TAG: "Eq", + _0: "123", + _1: (123).toString() + })) ], tl: { hd: [ "toStringWithRadix - radix:2", - (param => { - return { - TAG: "Eq", - _0: "11110001001000000", - _1: (123456).toString(2) - }; - }) + (param => ({ + TAG: "Eq", + _0: "11110001001000000", + _1: (123456).toString(2) + })) ], tl: { hd: [ "toStringWithRadix - radix:16", - (param => { - return { - TAG: "Eq", - _0: "1e240", - _1: (123456).toString(16) - }; - }) + (param => ({ + TAG: "Eq", + _0: "1e240", + _1: (123456).toString(16) + })) ], tl: { hd: [ "toStringWithRadix - radix:36", - (param => { - return { - TAG: "Eq", - _0: "2n9c", - _1: (123456).toString(36) - }; - }) + (param => ({ + TAG: "Eq", + _0: "2n9c", + _1: (123456).toString(36) + })) ], tl: { hd: [ "toStringWithRadix - radix:37", - (param => { - return { - TAG: "ThrowAny", - _0: (() => { - (0).toString(37); - }) - }; - }) + (param => ({ + TAG: "ThrowAny", + _0: (() => { + (0).toString(37); + }) + })) ], tl: { hd: [ "toStringWithRadix - radix:1", - (param => { - return { - TAG: "ThrowAny", - _0: (() => { - (0).toString(1); - }) - }; - }) + (param => ({ + TAG: "ThrowAny", + _0: (() => { + (0).toString(1); + }) + })) ], tl: { hd: [ "toStringWithRadix - radix:-1", - (param => { - return { - TAG: "ThrowAny", - _0: (() => { - (0).toString(-1); - }) - }; - }) + (param => ({ + TAG: "ThrowAny", + _0: (() => { + (0).toString(-1); + }) + })) ], tl: /* [] */0 } diff --git a/jscomp/test/js_json_test.js b/jscomp/test/js_json_test.js index ccde3476829..c62d11cdbcd 100644 --- a/jscomp/test/js_json_test.js +++ b/jscomp/test/js_json_test.js @@ -31,31 +31,25 @@ function add_test(loc, test) { } function eq(loc, x, y) { - add_test(loc, (() => { - return { - TAG: "Eq", - _0: x, - _1: y - }; - })); + add_test(loc, (() => ({ + TAG: "Eq", + _0: x, + _1: y + }))); } function false_(loc) { - add_test(loc, (() => { - return { - TAG: "Ok", - _0: false - }; - })); + add_test(loc, (() => ({ + TAG: "Ok", + _0: false + }))); } function true_(loc) { - add_test(loc, (() => { - return { - TAG: "Ok", - _0: true - }; - })); + add_test(loc, (() => ({ + TAG: "Ok", + _0: true + }))); } let v = JSON.parse(" { \"x\" : [1, 2, 3 ] } "); @@ -136,29 +130,23 @@ let ty = Js_json.classify(json); if (typeof ty !== "object") { if (ty === "JSONNull") { - add_test("File \"js_json_test.res\", line 55, characters 24-31", (() => { - return { - TAG: "Ok", - _0: true - }; - })); + add_test("File \"js_json_test.res\", line 55, characters 24-31", (() => ({ + TAG: "Ok", + _0: true + }))); } else { console.log(ty); - add_test("File \"js_json_test.res\", line 58, characters 11-18", (() => { - return { - TAG: "Ok", - _0: false - }; - })); + add_test("File \"js_json_test.res\", line 58, characters 11-18", (() => ({ + TAG: "Ok", + _0: false + }))); } } else { console.log(ty); - add_test("File \"js_json_test.res\", line 58, characters 11-18", (() => { - return { - TAG: "Ok", - _0: false - }; - })); + add_test("File \"js_json_test.res\", line 58, characters 11-18", (() => ({ + TAG: "Ok", + _0: false + }))); } let json$1 = JSON.parse(JSON.stringify("test string")); @@ -166,21 +154,17 @@ let json$1 = JSON.parse(JSON.stringify("test string")); let ty$1 = Js_json.classify(json$1); if (typeof ty$1 !== "object") { - add_test("File \"js_json_test.res\", line 68, characters 16-23", (() => { - return { - TAG: "Ok", - _0: false - }; - })); + add_test("File \"js_json_test.res\", line 68, characters 16-23", (() => ({ + TAG: "Ok", + _0: false + }))); } else if (ty$1.TAG === "JSONString") { eq("File \"js_json_test.res\", line 67, characters 26-33", ty$1._0, "test string"); } else { - add_test("File \"js_json_test.res\", line 68, characters 16-23", (() => { - return { - TAG: "Ok", - _0: false - }; - })); + add_test("File \"js_json_test.res\", line 68, characters 16-23", (() => ({ + TAG: "Ok", + _0: false + }))); } let json$2 = JSON.parse(JSON.stringify(1.23456789)); @@ -196,12 +180,10 @@ if (typeof ty$2 !== "object" || ty$2.TAG !== "JSONNumber") { } if (exit === 1) { - add_test("File \"js_json_test.res\", line 78, characters 18-25", (() => { - return { - TAG: "Ok", - _0: false - }; - })); + add_test("File \"js_json_test.res\", line 78, characters 18-25", (() => ({ + TAG: "Ok", + _0: false + }))); } let json$3 = JSON.parse(JSON.stringify(-1347440721)); @@ -217,24 +199,20 @@ if (typeof ty$3 !== "object" || ty$3.TAG !== "JSONNumber") { } if (exit$1 === 1) { - add_test("File \"js_json_test.res\", line 88, characters 18-25", (() => { - return { - TAG: "Ok", - _0: false - }; - })); + add_test("File \"js_json_test.res\", line 88, characters 18-25", (() => ({ + TAG: "Ok", + _0: false + }))); } function test(v) { let json = JSON.parse(JSON.stringify(v)); let ty = Js_json.classify(json); if (typeof ty === "object") { - return add_test("File \"js_json_test.res\", line 100, characters 18-25", (() => { - return { - TAG: "Ok", - _0: false - }; - })); + return add_test("File \"js_json_test.res\", line 100, characters 18-25", (() => ({ + TAG: "Ok", + _0: false + }))); } switch (ty) { case "JSONFalse" : @@ -242,12 +220,10 @@ function test(v) { case "JSONTrue" : return eq("File \"js_json_test.res\", line 98, characters 23-30", true, v); default: - return add_test("File \"js_json_test.res\", line 100, characters 18-25", (() => { - return { - TAG: "Ok", - _0: false - }; - })); + return add_test("File \"js_json_test.res\", line 100, characters 18-25", (() => ({ + TAG: "Ok", + _0: false + }))); } } @@ -282,174 +258,136 @@ let json$4 = JSON.parse(JSON.stringify(dict)); let ty$4 = Js_json.classify(json$4); if (typeof ty$4 !== "object") { - add_test("File \"js_json_test.res\", line 142, characters 16-23", (() => { - return { - TAG: "Ok", - _0: false - }; - })); + add_test("File \"js_json_test.res\", line 142, characters 16-23", (() => ({ + TAG: "Ok", + _0: false + }))); } else if (ty$4.TAG === "JSONObject") { let x = ty$4._0; let ta = Js_json.classify(option_get(Js_dict.get(x, "a"))); if (typeof ta !== "object") { - add_test("File \"js_json_test.res\", line 140, characters 18-25", (() => { - return { - TAG: "Ok", - _0: false - }; - })); + add_test("File \"js_json_test.res\", line 140, characters 18-25", (() => ({ + TAG: "Ok", + _0: false + }))); } else if (ta.TAG === "JSONString") { if (ta._0 !== "test string") { - add_test("File \"js_json_test.res\", line 131, characters 15-22", (() => { - return { - TAG: "Ok", - _0: false - }; - })); + add_test("File \"js_json_test.res\", line 131, characters 15-22", (() => ({ + TAG: "Ok", + _0: false + }))); } else { let ty$5 = Js_json.classify(option_get(Js_dict.get(x, "b"))); if (typeof ty$5 !== "object") { - add_test("File \"js_json_test.res\", line 137, characters 22-29", (() => { - return { - TAG: "Ok", - _0: false - }; - })); + add_test("File \"js_json_test.res\", line 137, characters 22-29", (() => ({ + TAG: "Ok", + _0: false + }))); } else if (ty$5.TAG === "JSONNumber") { let b = ty$5._0; - add_test("File \"js_json_test.res\", line 136, characters 38-45", (() => { - return { - TAG: "Approx", - _0: 123.0, - _1: b - }; - })); + add_test("File \"js_json_test.res\", line 136, characters 38-45", (() => ({ + TAG: "Approx", + _0: 123.0, + _1: b + }))); } else { - add_test("File \"js_json_test.res\", line 137, characters 22-29", (() => { - return { - TAG: "Ok", - _0: false - }; - })); + add_test("File \"js_json_test.res\", line 137, characters 22-29", (() => ({ + TAG: "Ok", + _0: false + }))); } } } else { - add_test("File \"js_json_test.res\", line 140, characters 18-25", (() => { - return { - TAG: "Ok", - _0: false - }; - })); - } -} else { - add_test("File \"js_json_test.res\", line 142, characters 16-23", (() => { - return { + add_test("File \"js_json_test.res\", line 140, characters 18-25", (() => ({ TAG: "Ok", _0: false - }; - })); + }))); + } +} else { + add_test("File \"js_json_test.res\", line 142, characters 16-23", (() => ({ + TAG: "Ok", + _0: false + }))); } function eq_at_i(loc, json, i, kind, expected) { let ty = Js_json.classify(json); if (typeof ty !== "object") { - return add_test(loc, (() => { - return { - TAG: "Ok", - _0: false - }; - })); + return add_test(loc, (() => ({ + TAG: "Ok", + _0: false + }))); } if (ty.TAG !== "JSONArray") { - return add_test(loc, (() => { - return { - TAG: "Ok", - _0: false - }; - })); + return add_test(loc, (() => ({ + TAG: "Ok", + _0: false + }))); } let ty$1 = Js_json.classify(Caml_array.get(ty._0, i)); switch (kind) { case "String" : if (typeof ty$1 !== "object") { - return add_test(loc, (() => { - return { - TAG: "Ok", - _0: false - }; - })); + return add_test(loc, (() => ({ + TAG: "Ok", + _0: false + }))); } else if (ty$1.TAG === "JSONString") { return eq(loc, ty$1._0, expected); } else { - return add_test(loc, (() => { - return { - TAG: "Ok", - _0: false - }; - })); + return add_test(loc, (() => ({ + TAG: "Ok", + _0: false + }))); } case "Number" : if (typeof ty$1 !== "object") { - return add_test(loc, (() => { - return { - TAG: "Ok", - _0: false - }; - })); + return add_test(loc, (() => ({ + TAG: "Ok", + _0: false + }))); } else if (ty$1.TAG === "JSONNumber") { return eq(loc, ty$1._0, expected); } else { - return add_test(loc, (() => { - return { - TAG: "Ok", - _0: false - }; - })); + return add_test(loc, (() => ({ + TAG: "Ok", + _0: false + }))); } case "Object" : if (typeof ty$1 !== "object") { - return add_test(loc, (() => { - return { - TAG: "Ok", - _0: false - }; - })); + return add_test(loc, (() => ({ + TAG: "Ok", + _0: false + }))); } else if (ty$1.TAG === "JSONObject") { return eq(loc, ty$1._0, expected); } else { - return add_test(loc, (() => { - return { - TAG: "Ok", - _0: false - }; - })); + return add_test(loc, (() => ({ + TAG: "Ok", + _0: false + }))); } case "Array" : if (typeof ty$1 !== "object") { - return add_test(loc, (() => { - return { - TAG: "Ok", - _0: false - }; - })); + return add_test(loc, (() => ({ + TAG: "Ok", + _0: false + }))); } else if (ty$1.TAG === "JSONArray") { return eq(loc, ty$1._0, expected); } else { - return add_test(loc, (() => { - return { - TAG: "Ok", - _0: false - }; - })); + return add_test(loc, (() => ({ + TAG: "Ok", + _0: false + }))); } case "Boolean" : if (typeof ty$1 === "object") { - return add_test(loc, (() => { - return { - TAG: "Ok", - _0: false - }; - })); + return add_test(loc, (() => ({ + TAG: "Ok", + _0: false + }))); } switch (ty$1) { case "JSONFalse" : @@ -457,44 +395,34 @@ function eq_at_i(loc, json, i, kind, expected) { case "JSONTrue" : return eq(loc, true, expected); default: - return add_test(loc, (() => { - return { - TAG: "Ok", - _0: false - }; - })); + return add_test(loc, (() => ({ + TAG: "Ok", + _0: false + }))); } case "Null" : if (typeof ty$1 !== "object") { if (ty$1 === "JSONNull") { - return add_test(loc, (() => { - return { - TAG: "Ok", - _0: true - }; - })); + return add_test(loc, (() => ({ + TAG: "Ok", + _0: true + }))); } else { - return add_test(loc, (() => { - return { - TAG: "Ok", - _0: false - }; - })); - } - } else { - return add_test(loc, (() => { - return { + return add_test(loc, (() => ({ TAG: "Ok", _0: false - }; - })); + }))); + } + } else { + return add_test(loc, (() => ({ + TAG: "Ok", + _0: false + }))); } } } -let json$5 = JSON.parse(JSON.stringify($$Array.map((prim => { - return prim; -}), [ +let json$5 = JSON.parse(JSON.stringify($$Array.map((prim => prim), [ "string 0", "string 1", "string 2" @@ -538,9 +466,7 @@ let a$1 = [ -268391749 ]; -let json$8 = JSON.parse(JSON.stringify($$Array.map((prim => { - return prim; -}), a$1))); +let json$8 = JSON.parse(JSON.stringify($$Array.map((prim => prim), a$1))); eq_at_i("File \"js_json_test.res\", line 230, characters 10-17", json$8, 0, "Number", Caml_array.get(a$1, 0)); @@ -579,72 +505,56 @@ let json$10 = JSON.parse(JSON.stringify(a$3)); let ty$6 = Js_json.classify(json$10); if (typeof ty$6 !== "object") { - add_test("File \"js_json_test.res\", line 271, characters 16-23", (() => { - return { - TAG: "Ok", - _0: false - }; - })); + add_test("File \"js_json_test.res\", line 271, characters 16-23", (() => ({ + TAG: "Ok", + _0: false + }))); } else if (ty$6.TAG === "JSONArray") { let ty$7 = Js_json.classify(Caml_array.get(ty$6._0, 1)); if (typeof ty$7 !== "object") { - add_test("File \"js_json_test.res\", line 269, characters 18-25", (() => { - return { - TAG: "Ok", - _0: false - }; - })); + add_test("File \"js_json_test.res\", line 269, characters 18-25", (() => ({ + TAG: "Ok", + _0: false + }))); } else if (ty$7.TAG === "JSONObject") { let ty$8 = Js_json.classify(option_get(Js_dict.get(ty$7._0, "a"))); if (typeof ty$8 !== "object") { - add_test("File \"js_json_test.res\", line 267, characters 20-27", (() => { - return { - TAG: "Ok", - _0: false - }; - })); + add_test("File \"js_json_test.res\", line 267, characters 20-27", (() => ({ + TAG: "Ok", + _0: false + }))); } else if (ty$8.TAG === "JSONString") { eq("File \"js_json_test.res\", line 266, characters 35-42", ty$8._0, "bbb"); } else { - add_test("File \"js_json_test.res\", line 267, characters 20-27", (() => { - return { - TAG: "Ok", - _0: false - }; - })); - } - } else { - add_test("File \"js_json_test.res\", line 269, characters 18-25", (() => { - return { + add_test("File \"js_json_test.res\", line 267, characters 20-27", (() => ({ TAG: "Ok", _0: false - }; - })); - } -} else { - add_test("File \"js_json_test.res\", line 271, characters 16-23", (() => { - return { + }))); + } + } else { + add_test("File \"js_json_test.res\", line 269, characters 18-25", (() => ({ TAG: "Ok", _0: false - }; - })); + }))); + } +} else { + add_test("File \"js_json_test.res\", line 271, characters 16-23", (() => ({ + TAG: "Ok", + _0: false + }))); } try { JSON.parse("{{ A}"); - add_test("File \"js_json_test.res\", line 279, characters 11-18", (() => { - return { - TAG: "Ok", - _0: false - }; - })); + add_test("File \"js_json_test.res\", line 279, characters 11-18", (() => ({ + TAG: "Ok", + _0: false + }))); } catch (exn) { - add_test("File \"js_json_test.res\", line 281, characters 17-24", (() => { - return { - TAG: "Ok", - _0: true - }; - })); + add_test("File \"js_json_test.res\", line 281, characters 17-24", (() => ({ + TAG: "Ok", + _0: true + }))); } eq("File \"js_json_test.res\", line 287, characters 12-19", JSON.stringify([ diff --git a/jscomp/test/js_math_test.js b/jscomp/test/js_math_test.js index 68da060bf48..1175177c90f 100644 --- a/jscomp/test/js_math_test.js +++ b/jscomp/test/js_math_test.js @@ -6,512 +6,424 @@ let Js_math = require("../../lib/js/js_math.js"); let suites_0 = [ "_E", - (param => { - return { - TAG: "ApproxThreshold", - _0: 0.001, - _1: 2.718, - _2: Math.E - }; - }) + (param => ({ + TAG: "ApproxThreshold", + _0: 0.001, + _1: 2.718, + _2: Math.E + })) ]; let suites_1 = { hd: [ "_LN2", - (param => { - return { - TAG: "ApproxThreshold", - _0: 0.001, - _1: 0.693, - _2: Math.LN2 - }; - }) + (param => ({ + TAG: "ApproxThreshold", + _0: 0.001, + _1: 0.693, + _2: Math.LN2 + })) ], tl: { hd: [ "_LN10", - (param => { - return { - TAG: "ApproxThreshold", - _0: 0.001, - _1: 2.303, - _2: Math.LN10 - }; - }) + (param => ({ + TAG: "ApproxThreshold", + _0: 0.001, + _1: 2.303, + _2: Math.LN10 + })) ], tl: { hd: [ "_LOG2E", - (param => { - return { - TAG: "ApproxThreshold", - _0: 0.001, - _1: 1.443, - _2: Math.LOG2E - }; - }) + (param => ({ + TAG: "ApproxThreshold", + _0: 0.001, + _1: 1.443, + _2: Math.LOG2E + })) ], tl: { hd: [ "_LOG10E", - (param => { - return { - TAG: "ApproxThreshold", - _0: 0.001, - _1: 0.434, - _2: Math.LOG10E - }; - }) + (param => ({ + TAG: "ApproxThreshold", + _0: 0.001, + _1: 0.434, + _2: Math.LOG10E + })) ], tl: { hd: [ "_PI", - (param => { - return { - TAG: "ApproxThreshold", - _0: 0.00001, - _1: 3.14159, - _2: Math.PI - }; - }) + (param => ({ + TAG: "ApproxThreshold", + _0: 0.00001, + _1: 3.14159, + _2: Math.PI + })) ], tl: { hd: [ "_SQRT1_2", - (param => { - return { - TAG: "ApproxThreshold", - _0: 0.001, - _1: 0.707, - _2: Math.SQRT1_2 - }; - }) + (param => ({ + TAG: "ApproxThreshold", + _0: 0.001, + _1: 0.707, + _2: Math.SQRT1_2 + })) ], tl: { hd: [ "_SQRT2", - (param => { - return { - TAG: "ApproxThreshold", - _0: 0.001, - _1: 1.414, - _2: Math.SQRT2 - }; - }) + (param => ({ + TAG: "ApproxThreshold", + _0: 0.001, + _1: 1.414, + _2: Math.SQRT2 + })) ], tl: { hd: [ "abs_int", - (param => { - return { - TAG: "Eq", - _0: 4, - _1: Math.abs(-4) - }; - }) + (param => ({ + TAG: "Eq", + _0: 4, + _1: Math.abs(-4) + })) ], tl: { hd: [ "abs_float", - (param => { - return { - TAG: "Eq", - _0: 1.2, - _1: Math.abs(-1.2) - }; - }) + (param => ({ + TAG: "Eq", + _0: 1.2, + _1: Math.abs(-1.2) + })) ], tl: { hd: [ "acos", - (param => { - return { - TAG: "ApproxThreshold", - _0: 0.001, - _1: 1.159, - _2: Math.acos(0.4) - }; - }) + (param => ({ + TAG: "ApproxThreshold", + _0: 0.001, + _1: 1.159, + _2: Math.acos(0.4) + })) ], tl: { hd: [ "acosh", - (param => { - return { - TAG: "ApproxThreshold", - _0: 0.001, - _1: 0.622, - _2: Math.acosh(1.2) - }; - }) + (param => ({ + TAG: "ApproxThreshold", + _0: 0.001, + _1: 0.622, + _2: Math.acosh(1.2) + })) ], tl: { hd: [ "asin", - (param => { - return { - TAG: "ApproxThreshold", - _0: 0.001, - _1: 0.411, - _2: Math.asin(0.4) - }; - }) + (param => ({ + TAG: "ApproxThreshold", + _0: 0.001, + _1: 0.411, + _2: Math.asin(0.4) + })) ], tl: { hd: [ "asinh", - (param => { - return { - TAG: "ApproxThreshold", - _0: 0.001, - _1: 0.390, - _2: Math.asinh(0.4) - }; - }) + (param => ({ + TAG: "ApproxThreshold", + _0: 0.001, + _1: 0.390, + _2: Math.asinh(0.4) + })) ], tl: { hd: [ "atan", - (param => { - return { - TAG: "ApproxThreshold", - _0: 0.001, - _1: 0.380, - _2: Math.atan(0.4) - }; - }) + (param => ({ + TAG: "ApproxThreshold", + _0: 0.001, + _1: 0.380, + _2: Math.atan(0.4) + })) ], tl: { hd: [ "atanh", - (param => { - return { - TAG: "ApproxThreshold", - _0: 0.001, - _1: 0.423, - _2: Math.atanh(0.4) - }; - }) + (param => ({ + TAG: "ApproxThreshold", + _0: 0.001, + _1: 0.423, + _2: Math.atanh(0.4) + })) ], tl: { hd: [ "atan2", - (param => { - return { - TAG: "ApproxThreshold", - _0: 0.001, - _1: 0.588, - _2: Math.atan2(0.4, 0.6) - }; - }) + (param => ({ + TAG: "ApproxThreshold", + _0: 0.001, + _1: 0.588, + _2: Math.atan2(0.4, 0.6) + })) ], tl: { hd: [ "cbrt", - (param => { - return { - TAG: "Eq", - _0: 2, - _1: Math.cbrt(8) - }; - }) + (param => ({ + TAG: "Eq", + _0: 2, + _1: Math.cbrt(8) + })) ], tl: { hd: [ "unsafe_ceil_int", - (param => { - return { - TAG: "Eq", - _0: 4, - _1: Math.ceil(3.2) - }; - }) + (param => ({ + TAG: "Eq", + _0: 4, + _1: Math.ceil(3.2) + })) ], tl: { hd: [ "ceil_int", - (param => { - return { - TAG: "Eq", - _0: 4, - _1: Js_math.ceil_int(3.2) - }; - }) + (param => ({ + TAG: "Eq", + _0: 4, + _1: Js_math.ceil_int(3.2) + })) ], tl: { hd: [ "ceil_float", - (param => { - return { - TAG: "Eq", - _0: 4, - _1: Math.ceil(3.2) - }; - }) + (param => ({ + TAG: "Eq", + _0: 4, + _1: Math.ceil(3.2) + })) ], tl: { hd: [ "cos", - (param => { - return { - TAG: "ApproxThreshold", - _0: 0.001, - _1: 0.921, - _2: Math.cos(0.4) - }; - }) + (param => ({ + TAG: "ApproxThreshold", + _0: 0.001, + _1: 0.921, + _2: Math.cos(0.4) + })) ], tl: { hd: [ "cosh", - (param => { - return { - TAG: "ApproxThreshold", - _0: 0.001, - _1: 1.081, - _2: Math.cosh(0.4) - }; - }) + (param => ({ + TAG: "ApproxThreshold", + _0: 0.001, + _1: 1.081, + _2: Math.cosh(0.4) + })) ], tl: { hd: [ "exp", - (param => { - return { - TAG: "ApproxThreshold", - _0: 0.001, - _1: 1.491, - _2: Math.exp(0.4) - }; - }) + (param => ({ + TAG: "ApproxThreshold", + _0: 0.001, + _1: 1.491, + _2: Math.exp(0.4) + })) ], tl: { hd: [ "expm1", - (param => { - return { - TAG: "ApproxThreshold", - _0: 0.001, - _1: 0.491, - _2: Math.expm1(0.4) - }; - }) + (param => ({ + TAG: "ApproxThreshold", + _0: 0.001, + _1: 0.491, + _2: Math.expm1(0.4) + })) ], tl: { hd: [ "unsafe_floor_int", - (param => { - return { - TAG: "Eq", - _0: 3, - _1: Math.floor(3.2) - }; - }) + (param => ({ + TAG: "Eq", + _0: 3, + _1: Math.floor(3.2) + })) ], tl: { hd: [ "floor_int", - (param => { - return { - TAG: "Eq", - _0: 3, - _1: Js_math.floor_int(3.2) - }; - }) + (param => ({ + TAG: "Eq", + _0: 3, + _1: Js_math.floor_int(3.2) + })) ], tl: { hd: [ "floor_float", - (param => { - return { - TAG: "Eq", - _0: 3, - _1: Math.floor(3.2) - }; - }) + (param => ({ + TAG: "Eq", + _0: 3, + _1: Math.floor(3.2) + })) ], tl: { hd: [ "fround", - (param => { - return { - TAG: "Approx", - _0: 3.2, - _1: Math.fround(3.2) - }; - }) + (param => ({ + TAG: "Approx", + _0: 3.2, + _1: Math.fround(3.2) + })) ], tl: { hd: [ "hypot", - (param => { - return { - TAG: "ApproxThreshold", - _0: 0.001, - _1: 0.721, - _2: Math.hypot(0.4, 0.6) - }; - }) + (param => ({ + TAG: "ApproxThreshold", + _0: 0.001, + _1: 0.721, + _2: Math.hypot(0.4, 0.6) + })) ], tl: { hd: [ "hypotMany", - (param => { - return { - TAG: "ApproxThreshold", - _0: 0.001, - _1: 1.077, - _2: Math.hypot(0.4, 0.6, 0.8) - }; - }) + (param => ({ + TAG: "ApproxThreshold", + _0: 0.001, + _1: 1.077, + _2: Math.hypot(0.4, 0.6, 0.8) + })) ], tl: { hd: [ "imul", - (param => { - return { - TAG: "Eq", - _0: 8, - _1: Math.imul(4, 2) - }; - }) + (param => ({ + TAG: "Eq", + _0: 8, + _1: Math.imul(4, 2) + })) ], tl: { hd: [ "log", - (param => { - return { - TAG: "ApproxThreshold", - _0: 0.001, - _1: -0.916, - _2: Math.log(0.4) - }; - }) + (param => ({ + TAG: "ApproxThreshold", + _0: 0.001, + _1: -0.916, + _2: Math.log(0.4) + })) ], tl: { hd: [ "log1p", - (param => { - return { - TAG: "ApproxThreshold", - _0: 0.001, - _1: 0.336, - _2: Math.log1p(0.4) - }; - }) + (param => ({ + TAG: "ApproxThreshold", + _0: 0.001, + _1: 0.336, + _2: Math.log1p(0.4) + })) ], tl: { hd: [ "log10", - (param => { - return { - TAG: "ApproxThreshold", - _0: 0.001, - _1: -0.397, - _2: Math.log10(0.4) - }; - }) + (param => ({ + TAG: "ApproxThreshold", + _0: 0.001, + _1: -0.397, + _2: Math.log10(0.4) + })) ], tl: { hd: [ "log2", - (param => { - return { - TAG: "ApproxThreshold", - _0: 0.001, - _1: -1.321, - _2: Math.log2(0.4) - }; - }) + (param => ({ + TAG: "ApproxThreshold", + _0: 0.001, + _1: -1.321, + _2: Math.log2(0.4) + })) ], tl: { hd: [ "max_int", - (param => { - return { - TAG: "Eq", - _0: 4, - _1: Math.max(2, 4) - }; - }) + (param => ({ + TAG: "Eq", + _0: 4, + _1: Math.max(2, 4) + })) ], tl: { hd: [ "maxMany_int", - (param => { - return { - TAG: "Eq", - _0: 4, - _1: Math.max(2, 4, 3) - }; - }) + (param => ({ + TAG: "Eq", + _0: 4, + _1: Math.max(2, 4, 3) + })) ], tl: { hd: [ "max_float", - (param => { - return { - TAG: "Eq", - _0: 4.2, - _1: Math.max(2.7, 4.2) - }; - }) + (param => ({ + TAG: "Eq", + _0: 4.2, + _1: Math.max(2.7, 4.2) + })) ], tl: { hd: [ "maxMany_float", - (param => { - return { - TAG: "Eq", - _0: 4.2, - _1: Math.max(2.7, 4.2, 3.9) - }; - }) + (param => ({ + TAG: "Eq", + _0: 4.2, + _1: Math.max(2.7, 4.2, 3.9) + })) ], tl: { hd: [ "min_int", - (param => { - return { - TAG: "Eq", - _0: 2, - _1: Math.min(2, 4) - }; - }) + (param => ({ + TAG: "Eq", + _0: 2, + _1: Math.min(2, 4) + })) ], tl: { hd: [ "minMany_int", - (param => { - return { - TAG: "Eq", - _0: 2, - _1: Math.min(2, 4, 3) - }; - }) + (param => ({ + TAG: "Eq", + _0: 2, + _1: Math.min(2, 4, 3) + })) ], tl: { hd: [ "min_float", - (param => { - return { - TAG: "Eq", - _0: 2.7, - _1: Math.min(2.7, 4.2) - }; - }) + (param => ({ + TAG: "Eq", + _0: 2.7, + _1: Math.min(2.7, 4.2) + })) ], tl: { hd: [ "minMany_float", - (param => { - return { - TAG: "Eq", - _0: 2.7, - _1: Math.min(2.7, 4.2, 3.9) - }; - }) + (param => ({ + TAG: "Eq", + _0: 2.7, + _1: Math.min(2.7, 4.2, 3.9) + })) ], tl: { hd: [ @@ -538,139 +450,115 @@ let suites_1 = { tl: { hd: [ "unsafe_round", - (param => { - return { - TAG: "Eq", - _0: 3, - _1: Math.round(3.2) - }; - }) + (param => ({ + TAG: "Eq", + _0: 3, + _1: Math.round(3.2) + })) ], tl: { hd: [ "round", - (param => { - return { - TAG: "Eq", - _0: 3, - _1: Math.round(3.2) - }; - }) + (param => ({ + TAG: "Eq", + _0: 3, + _1: Math.round(3.2) + })) ], tl: { hd: [ "sign_int", - (param => { - return { - TAG: "Eq", - _0: -1, - _1: Math.sign(-4) - }; - }) + (param => ({ + TAG: "Eq", + _0: -1, + _1: Math.sign(-4) + })) ], tl: { hd: [ "sign_float", - (param => { - return { - TAG: "Eq", - _0: -1, - _1: Math.sign(-4.2) - }; - }) + (param => ({ + TAG: "Eq", + _0: -1, + _1: Math.sign(-4.2) + })) ], tl: { hd: [ "sign_float -0", - (param => { - return { - TAG: "Eq", - _0: -0, - _1: Math.sign(-0) - }; - }) + (param => ({ + TAG: "Eq", + _0: -0, + _1: Math.sign(-0) + })) ], tl: { hd: [ "sin", - (param => { - return { - TAG: "ApproxThreshold", - _0: 0.001, - _1: 0.389, - _2: Math.sin(0.4) - }; - }) + (param => ({ + TAG: "ApproxThreshold", + _0: 0.001, + _1: 0.389, + _2: Math.sin(0.4) + })) ], tl: { hd: [ "sinh", - (param => { - return { - TAG: "ApproxThreshold", - _0: 0.001, - _1: 0.410, - _2: Math.sinh(0.4) - }; - }) + (param => ({ + TAG: "ApproxThreshold", + _0: 0.001, + _1: 0.410, + _2: Math.sinh(0.4) + })) ], tl: { hd: [ "sqrt", - (param => { - return { - TAG: "ApproxThreshold", - _0: 0.001, - _1: 0.632, - _2: Math.sqrt(0.4) - }; - }) + (param => ({ + TAG: "ApproxThreshold", + _0: 0.001, + _1: 0.632, + _2: Math.sqrt(0.4) + })) ], tl: { hd: [ "tan", - (param => { - return { - TAG: "ApproxThreshold", - _0: 0.001, - _1: 0.422, - _2: Math.tan(0.4) - }; - }) + (param => ({ + TAG: "ApproxThreshold", + _0: 0.001, + _1: 0.422, + _2: Math.tan(0.4) + })) ], tl: { hd: [ "tanh", - (param => { - return { - TAG: "ApproxThreshold", - _0: 0.001, - _1: 0.379, - _2: Math.tanh(0.4) - }; - }) + (param => ({ + TAG: "ApproxThreshold", + _0: 0.001, + _1: 0.379, + _2: Math.tanh(0.4) + })) ], tl: { hd: [ "unsafe_trunc", - (param => { - return { - TAG: "Eq", - _0: 4, - _1: Math.trunc(4.2156) - }; - }) + (param => ({ + TAG: "Eq", + _0: 4, + _1: Math.trunc(4.2156) + })) ], tl: { hd: [ "trunc", - (param => { - return { - TAG: "Eq", - _0: 4, - _1: Math.trunc(4.2156) - }; - }) + (param => ({ + TAG: "Eq", + _0: 4, + _1: Math.trunc(4.2156) + })) ], tl: /* [] */0 } diff --git a/jscomp/test/js_null_test.js b/jscomp/test/js_null_test.js index c665ccc41c8..67c77af53d0 100644 --- a/jscomp/test/js_null_test.js +++ b/jscomp/test/js_null_test.js @@ -7,84 +7,66 @@ let Caml_option = require("../../lib/js/caml_option.js"); let suites_0 = [ "toOption - empty", - (param => { - return { - TAG: "Eq", - _0: undefined, - _1: undefined - }; - }) + (param => ({ + TAG: "Eq", + _0: undefined, + _1: undefined + })) ]; let suites_1 = { hd: [ "toOption - 'a", - (param => { - return { - TAG: "Eq", - _0: Caml_option.some(undefined), - _1: Caml_option.some() - }; - }) + (param => ({ + TAG: "Eq", + _0: Caml_option.some(undefined), + _1: Caml_option.some() + })) ], tl: { hd: [ "return", - (param => { - return { - TAG: "Eq", - _0: "something", - _1: Caml_option.null_to_opt("something") - }; - }) + (param => ({ + TAG: "Eq", + _0: "something", + _1: Caml_option.null_to_opt("something") + })) ], tl: { hd: [ "test - empty", - (param => { - return { - TAG: "Eq", - _0: true, - _1: true - }; - }) + (param => ({ + TAG: "Eq", + _0: true, + _1: true + })) ], tl: { hd: [ "test - 'a", - (param => { - return { - TAG: "Eq", - _0: false, - _1: false - }; - }) + (param => ({ + TAG: "Eq", + _0: false, + _1: false + })) ], tl: { hd: [ "bind - empty", - (param => { - return { - TAG: "StrictEq", - _0: null, - _1: Js_null.bind(null, (v => { - return v; - })) - }; - }) + (param => ({ + TAG: "StrictEq", + _0: null, + _1: Js_null.bind(null, (v => v)) + })) ], tl: { hd: [ "bind - 'a", - (param => { - return { - TAG: "StrictEq", - _0: 4, - _1: Js_null.bind(2, (n => { - return (n << 1); - })) - }; - }) + (param => ({ + TAG: "StrictEq", + _0: 4, + _1: Js_null.bind(2, (n => (n << 1))) + })) ], tl: { hd: [ @@ -123,24 +105,20 @@ let suites_1 = { tl: { hd: [ "fromOption - None", - (param => { - return { - TAG: "Eq", - _0: null, - _1: Js_null.fromOption(undefined) - }; - }) + (param => ({ + TAG: "Eq", + _0: null, + _1: Js_null.fromOption(undefined) + })) ], tl: { hd: [ "fromOption - Some", - (param => { - return { - TAG: "Eq", - _0: 2, - _1: Js_null.fromOption(2) - }; - }) + (param => ({ + TAG: "Eq", + _0: 2, + _1: Js_null.fromOption(2) + })) ], tl: /* [] */0 } diff --git a/jscomp/test/js_null_undefined_test.js b/jscomp/test/js_null_undefined_test.js index 46d6338d350..86aac9f8163 100644 --- a/jscomp/test/js_null_undefined_test.js +++ b/jscomp/test/js_null_undefined_test.js @@ -7,154 +7,120 @@ let Js_null_undefined = require("../../lib/js/js_null_undefined.js"); let suites_0 = [ "toOption - null", - (param => { - return { - TAG: "Eq", - _0: undefined, - _1: undefined - }; - }) + (param => ({ + TAG: "Eq", + _0: undefined, + _1: undefined + })) ]; let suites_1 = { hd: [ "toOption - undefined", - (param => { - return { - TAG: "Eq", - _0: undefined, - _1: undefined - }; - }) + (param => ({ + TAG: "Eq", + _0: undefined, + _1: undefined + })) ], tl: { hd: [ "toOption - empty", - (param => { - return { - TAG: "Eq", - _0: undefined, - _1: undefined - }; - }) + (param => ({ + TAG: "Eq", + _0: undefined, + _1: undefined + })) ], tl: { hd: [ "File \"js_null_undefined_test.res\", line 9, characters 5-12", - (param => { - return { - TAG: "Eq", - _0: "foo", - _1: Caml_option.nullable_to_opt("foo") - }; - }) + (param => ({ + TAG: "Eq", + _0: "foo", + _1: Caml_option.nullable_to_opt("foo") + })) ], tl: { hd: [ "return", - (param => { - return { - TAG: "Eq", - _0: "something", - _1: Caml_option.nullable_to_opt("something") - }; - }) + (param => ({ + TAG: "Eq", + _0: "something", + _1: Caml_option.nullable_to_opt("something") + })) ], tl: { hd: [ "test - null", - (param => { - return { - TAG: "Eq", - _0: true, - _1: true - }; - }) + (param => ({ + TAG: "Eq", + _0: true, + _1: true + })) ], tl: { hd: [ "test - undefined", - (param => { - return { - TAG: "Eq", - _0: true, - _1: true - }; - }) + (param => ({ + TAG: "Eq", + _0: true, + _1: true + })) ], tl: { hd: [ "test - empty", - (param => { - return { - TAG: "Eq", - _0: true, - _1: true - }; - }) + (param => ({ + TAG: "Eq", + _0: true, + _1: true + })) ], tl: { hd: [ "File \"js_null_undefined_test.res\", line 14, characters 5-12", - (param => { - return { - TAG: "Eq", - _0: true, - _1: true - }; - }) + (param => ({ + TAG: "Eq", + _0: true, + _1: true + })) ], tl: { hd: [ "bind - null", - (param => { - return { - TAG: "StrictEq", - _0: null, - _1: Js_null_undefined.bind(null, (v => { - return v; - })) - }; - }) + (param => ({ + TAG: "StrictEq", + _0: null, + _1: Js_null_undefined.bind(null, (v => v)) + })) ], tl: { hd: [ "bind - undefined", - (param => { - return { - TAG: "StrictEq", - _0: undefined, - _1: Js_null_undefined.bind(undefined, (v => { - return v; - })) - }; - }) + (param => ({ + TAG: "StrictEq", + _0: undefined, + _1: Js_null_undefined.bind(undefined, (v => v)) + })) ], tl: { hd: [ "bind - empty", - (param => { - return { - TAG: "StrictEq", - _0: undefined, - _1: Js_null_undefined.bind(undefined, (v => { - return v; - })) - }; - }) + (param => ({ + TAG: "StrictEq", + _0: undefined, + _1: Js_null_undefined.bind(undefined, (v => v)) + })) ], tl: { hd: [ "bind - 'a", - (param => { - return { - TAG: "Eq", - _0: 4, - _1: Js_null_undefined.bind(2, (n => { - return (n << 1); - })) - }; - }) + (param => ({ + TAG: "Eq", + _0: 4, + _1: Js_null_undefined.bind(2, (n => (n << 1))) + })) ], tl: { hd: [ @@ -227,64 +193,52 @@ let suites_1 = { tl: { hd: [ "fromOption - None", - (param => { - return { - TAG: "Eq", - _0: undefined, - _1: Js_null_undefined.fromOption(undefined) - }; - }) + (param => ({ + TAG: "Eq", + _0: undefined, + _1: Js_null_undefined.fromOption(undefined) + })) ], tl: { hd: [ "fromOption - Some", - (param => { - return { - TAG: "Eq", - _0: 2, - _1: Js_null_undefined.fromOption(2) - }; - }) + (param => ({ + TAG: "Eq", + _0: 2, + _1: Js_null_undefined.fromOption(2) + })) ], tl: { hd: [ "null <> undefined", - (param => { - return { - TAG: "Ok", - _0: true - }; - }) + (param => ({ + TAG: "Ok", + _0: true + })) ], tl: { hd: [ "null <> empty", - (param => { - return { - TAG: "Ok", - _0: true - }; - }) + (param => ({ + TAG: "Ok", + _0: true + })) ], tl: { hd: [ "undefined = empty", - (param => { - return { - TAG: "Ok", - _0: true - }; - }) + (param => ({ + TAG: "Ok", + _0: true + })) ], tl: { hd: [ "File \"js_null_undefined_test.res\", line 57, characters 6-13", - (param => { - return { - TAG: "Ok", - _0: true - }; - }) + (param => ({ + TAG: "Ok", + _0: true + })) ], tl: /* [] */0 } diff --git a/jscomp/test/js_nullable_test.js b/jscomp/test/js_nullable_test.js index 2b67f1e240b..44766475b45 100644 --- a/jscomp/test/js_nullable_test.js +++ b/jscomp/test/js_nullable_test.js @@ -16,13 +16,11 @@ function eq(loc, x, y) { suites.contents = { hd: [ loc + (" id " + String(test_id.contents)), - (() => { - return { - TAG: "Eq", - _0: x, - _1: y - }; - }) + (() => ({ + TAG: "Eq", + _0: x, + _1: y + })) ], tl: suites.contents }; diff --git a/jscomp/test/js_obj_test.js b/jscomp/test/js_obj_test.js index c5b5132d58f..4c2f77c269b 100644 --- a/jscomp/test/js_obj_test.js +++ b/jscomp/test/js_obj_test.js @@ -5,29 +5,25 @@ let Mt = require("./mt.js"); let suites_0 = [ "empty", - (param => { - return { - TAG: "Eq", - _0: 0, - _1: Object.keys({}).length - }; - }) + (param => ({ + TAG: "Eq", + _0: 0, + _1: Object.keys({}).length + })) ]; let suites_1 = { hd: [ "assign", - (param => { - return { - TAG: "Eq", - _0: { - a: 1 - }, - _1: Object.assign({}, { - a: 1 - }) - }; - }) + (param => ({ + TAG: "Eq", + _0: { + a: 1 + }, + _1: Object.assign({}, { + a: 1 + }) + })) ], tl: /* [] */0 }; diff --git a/jscomp/test/js_option_test.js b/jscomp/test/js_option_test.js index 227251dc505..6d242f5aaec 100644 --- a/jscomp/test/js_option_test.js +++ b/jscomp/test/js_option_test.js @@ -10,270 +10,210 @@ function simpleEq(a, b) { let option_suites_0 = [ "option_isSome_Some", - (param => { - return { - TAG: "Eq", - _0: true, - _1: true - }; - }) + (param => ({ + TAG: "Eq", + _0: true, + _1: true + })) ]; let option_suites_1 = { hd: [ "option_isSome_None", - (param => { - return { - TAG: "Eq", - _0: false, - _1: false - }; - }) + (param => ({ + TAG: "Eq", + _0: false, + _1: false + })) ], tl: { hd: [ "option_isNone_Some", - (param => { - return { - TAG: "Eq", - _0: false, - _1: false - }; - }) + (param => ({ + TAG: "Eq", + _0: false, + _1: false + })) ], tl: { hd: [ "option_isNone_None", - (param => { - return { - TAG: "Eq", - _0: true, - _1: true - }; - }) + (param => ({ + TAG: "Eq", + _0: true, + _1: true + })) ], tl: { hd: [ "option_isSomeValue_Eq", - (param => { - return { - TAG: "Eq", - _0: true, - _1: Js_option.isSomeValue(simpleEq, 2, 2) - }; - }) + (param => ({ + TAG: "Eq", + _0: true, + _1: Js_option.isSomeValue(simpleEq, 2, 2) + })) ], tl: { hd: [ "option_isSomeValue_Diff", - (param => { - return { - TAG: "Eq", - _0: false, - _1: Js_option.isSomeValue(simpleEq, 1, 2) - }; - }) + (param => ({ + TAG: "Eq", + _0: false, + _1: Js_option.isSomeValue(simpleEq, 1, 2) + })) ], tl: { hd: [ "option_isSomeValue_DiffNone", - (param => { - return { - TAG: "Eq", - _0: false, - _1: Js_option.isSomeValue(simpleEq, 1, undefined) - }; - }) + (param => ({ + TAG: "Eq", + _0: false, + _1: Js_option.isSomeValue(simpleEq, 1, undefined) + })) ], tl: { hd: [ "option_getExn_Some", - (param => { - return { - TAG: "Eq", - _0: 2, - _1: Js_option.getExn(2) - }; - }) + (param => ({ + TAG: "Eq", + _0: 2, + _1: Js_option.getExn(2) + })) ], tl: { hd: [ "option_equal_Eq", - (param => { - return { - TAG: "Eq", - _0: true, - _1: Js_option.equal(simpleEq, 2, 2) - }; - }) + (param => ({ + TAG: "Eq", + _0: true, + _1: Js_option.equal(simpleEq, 2, 2) + })) ], tl: { hd: [ "option_equal_Diff", - (param => { - return { - TAG: "Eq", - _0: false, - _1: Js_option.equal(simpleEq, 1, 2) - }; - }) + (param => ({ + TAG: "Eq", + _0: false, + _1: Js_option.equal(simpleEq, 1, 2) + })) ], tl: { hd: [ "option_equal_DiffNone", - (param => { - return { - TAG: "Eq", - _0: false, - _1: Js_option.equal(simpleEq, 1, undefined) - }; - }) + (param => ({ + TAG: "Eq", + _0: false, + _1: Js_option.equal(simpleEq, 1, undefined) + })) ], tl: { hd: [ "option_andThen_SomeSome", - (param => { - return { - TAG: "Eq", - _0: true, - _1: Js_option.isSomeValue(simpleEq, 3, Js_option.andThen((a => { - return a + 1 | 0; - }), 2)) - }; - }) + (param => ({ + TAG: "Eq", + _0: true, + _1: Js_option.isSomeValue(simpleEq, 3, Js_option.andThen((a => a + 1 | 0), 2)) + })) ], tl: { hd: [ "option_andThen_SomeNone", - (param => { - return { - TAG: "Eq", - _0: false, - _1: Js_option.isSomeValue(simpleEq, 3, Js_option.andThen((param => { - - }), 2)) - }; - }) + (param => ({ + TAG: "Eq", + _0: false, + _1: Js_option.isSomeValue(simpleEq, 3, Js_option.andThen((param => {}), 2)) + })) ], tl: { hd: [ "option_map_Some", - (param => { - return { - TAG: "Eq", - _0: true, - _1: Js_option.isSomeValue(simpleEq, 3, Js_option.map((a => { - return a + 1 | 0; - }), 2)) - }; - }) + (param => ({ + TAG: "Eq", + _0: true, + _1: Js_option.isSomeValue(simpleEq, 3, Js_option.map((a => a + 1 | 0), 2)) + })) ], tl: { hd: [ "option_map_None", - (param => { - return { - TAG: "Eq", - _0: undefined, - _1: Js_option.map((a => { - return a + 1 | 0; - }), undefined) - }; - }) + (param => ({ + TAG: "Eq", + _0: undefined, + _1: Js_option.map((a => a + 1 | 0), undefined) + })) ], tl: { hd: [ "option_default_Some", - (param => { - return { - TAG: "Eq", - _0: 2, - _1: Js_option.getWithDefault(3, 2) - }; - }) + (param => ({ + TAG: "Eq", + _0: 2, + _1: Js_option.getWithDefault(3, 2) + })) ], tl: { hd: [ "option_default_None", - (param => { - return { - TAG: "Eq", - _0: 3, - _1: Js_option.getWithDefault(3, undefined) - }; - }) + (param => ({ + TAG: "Eq", + _0: 3, + _1: Js_option.getWithDefault(3, undefined) + })) ], tl: { hd: [ "option_filter_Pass", - (param => { - return { - TAG: "Eq", - _0: true, - _1: Js_option.isSomeValue(simpleEq, 2, Js_option.filter((a => { - return a % 2 === 0; - }), 2)) - }; - }) + (param => ({ + TAG: "Eq", + _0: true, + _1: Js_option.isSomeValue(simpleEq, 2, Js_option.filter((a => a % 2 === 0), 2)) + })) ], tl: { hd: [ "option_filter_Reject", - (param => { - return { - TAG: "Eq", - _0: undefined, - _1: Js_option.filter((a => { - return a % 3 === 0; - }), 2) - }; - }) + (param => ({ + TAG: "Eq", + _0: undefined, + _1: Js_option.filter((a => a % 3 === 0), 2) + })) ], tl: { hd: [ "option_filter_None", - (param => { - return { - TAG: "Eq", - _0: undefined, - _1: Js_option.filter((a => { - return a % 3 === 0; - }), undefined) - }; - }) + (param => ({ + TAG: "Eq", + _0: undefined, + _1: Js_option.filter((a => a % 3 === 0), undefined) + })) ], tl: { hd: [ "option_firstSome_First", - (param => { - return { - TAG: "Eq", - _0: true, - _1: Js_option.isSomeValue(simpleEq, 3, Js_option.firstSome(3, 2)) - }; - }) + (param => ({ + TAG: "Eq", + _0: true, + _1: Js_option.isSomeValue(simpleEq, 3, Js_option.firstSome(3, 2)) + })) ], tl: { hd: [ "option_firstSome_First", - (param => { - return { - TAG: "Eq", - _0: true, - _1: Js_option.isSomeValue(simpleEq, 2, Js_option.firstSome(undefined, 2)) - }; - }) + (param => ({ + TAG: "Eq", + _0: true, + _1: Js_option.isSomeValue(simpleEq, 2, Js_option.firstSome(undefined, 2)) + })) ], tl: { hd: [ "option_firstSome_None", - (param => { - return { - TAG: "Eq", - _0: undefined, - _1: Js_option.firstSome(undefined, undefined) - }; - }) + (param => ({ + TAG: "Eq", + _0: undefined, + _1: Js_option.firstSome(undefined, undefined) + })) ], tl: /* [] */0 } diff --git a/jscomp/test/js_re_test.js b/jscomp/test/js_re_test.js index ddaa4892f94..836a53cddea 100644 --- a/jscomp/test/js_re_test.js +++ b/jscomp/test/js_re_test.js @@ -153,35 +153,29 @@ let suites_1 = { tl: { hd: [ "t_flags", - (param => { - return { - TAG: "Eq", - _0: "gi", - _1: /./ig.flags - }; - }) + (param => ({ + TAG: "Eq", + _0: "gi", + _1: /./ig.flags + })) ], tl: { hd: [ "t_global", - (param => { - return { - TAG: "Eq", - _0: true, - _1: /./ig.global - }; - }) + (param => ({ + TAG: "Eq", + _0: true, + _1: /./ig.global + })) ], tl: { hd: [ "t_ignoreCase", - (param => { - return { - TAG: "Eq", - _0: true, - _1: /./ig.ignoreCase - }; - }) + (param => ({ + TAG: "Eq", + _0: true, + _1: /./ig.ignoreCase + })) ], tl: { hd: [ @@ -220,46 +214,38 @@ let suites_1 = { tl: { hd: [ "t_multiline", - (param => { - return { - TAG: "Eq", - _0: false, - _1: /./ig.multiline - }; - }) + (param => ({ + TAG: "Eq", + _0: false, + _1: /./ig.multiline + })) ], tl: { hd: [ "t_source", - (param => { - return { - TAG: "Eq", - _0: "f.+o", - _1: /f.+o/ig.source - }; - }) + (param => ({ + TAG: "Eq", + _0: "f.+o", + _1: /f.+o/ig.source + })) ], tl: { hd: [ "t_sticky", - (param => { - return { - TAG: "Eq", - _0: true, - _1: /./yg.sticky - }; - }) + (param => ({ + TAG: "Eq", + _0: true, + _1: /./yg.sticky + })) ], tl: { hd: [ "t_unicode", - (param => { - return { - TAG: "Eq", - _0: false, - _1: /./yg.unicode - }; - }) + (param => ({ + TAG: "Eq", + _0: false, + _1: /./yg.unicode + })) ], tl: /* [] */0 } diff --git a/jscomp/test/js_string_test.js b/jscomp/test/js_string_test.js index 8826fa03c8b..4b6b9d69983 100644 --- a/jscomp/test/js_string_test.js +++ b/jscomp/test/js_string_test.js @@ -7,341 +7,279 @@ let Caml_option = require("../../lib/js/caml_option.js"); let suites_0 = [ "make", - (param => { - return { - TAG: "Eq", - _0: "null", - _1: String(null).concat("") - }; - }) + (param => ({ + TAG: "Eq", + _0: "null", + _1: String(null).concat("") + })) ]; let suites_1 = { hd: [ "fromCharCode", - (param => { - return { - TAG: "Eq", - _0: "a", - _1: String.fromCharCode(97) - }; - }) + (param => ({ + TAG: "Eq", + _0: "a", + _1: String.fromCharCode(97) + })) ], tl: { hd: [ "fromCharCodeMany", - (param => { - return { - TAG: "Eq", - _0: "az", - _1: String.fromCharCode(97, 122) - }; - }) + (param => ({ + TAG: "Eq", + _0: "az", + _1: String.fromCharCode(97, 122) + })) ], tl: { hd: [ "fromCodePoint", - (param => { - return { - TAG: "Eq", - _0: "a", - _1: String.fromCodePoint(97) - }; - }) + (param => ({ + TAG: "Eq", + _0: "a", + _1: String.fromCodePoint(97) + })) ], tl: { hd: [ "fromCodePointMany", - (param => { - return { - TAG: "Eq", - _0: "az", - _1: String.fromCodePoint(97, 122) - }; - }) + (param => ({ + TAG: "Eq", + _0: "az", + _1: String.fromCodePoint(97, 122) + })) ], tl: { hd: [ "length", - (param => { - return { - TAG: "Eq", - _0: 3, - _1: "foo".length - }; - }) + (param => ({ + TAG: "Eq", + _0: 3, + _1: "foo".length + })) ], tl: { hd: [ "get", - (param => { - return { - TAG: "Eq", - _0: "a", - _1: "foobar"[4] - }; - }) + (param => ({ + TAG: "Eq", + _0: "a", + _1: "foobar"[4] + })) ], tl: { hd: [ "charAt", - (param => { - return { - TAG: "Eq", - _0: "a", - _1: "foobar".charAt(4) - }; - }) + (param => ({ + TAG: "Eq", + _0: "a", + _1: "foobar".charAt(4) + })) ], tl: { hd: [ "charCodeAt", - (param => { - return { - TAG: "Eq", - _0: 97, - _1: "foobar".charCodeAt(4) - }; - }) + (param => ({ + TAG: "Eq", + _0: 97, + _1: "foobar".charCodeAt(4) + })) ], tl: { hd: [ "codePointAt", - (param => { - return { - TAG: "Eq", - _0: 97, - _1: "foobar".codePointAt(4) - }; - }) + (param => ({ + TAG: "Eq", + _0: 97, + _1: "foobar".codePointAt(4) + })) ], tl: { hd: [ "codePointAt - out of bounds", - (param => { - return { - TAG: "Eq", - _0: undefined, - _1: "foobar".codePointAt(98) - }; - }) + (param => ({ + TAG: "Eq", + _0: undefined, + _1: "foobar".codePointAt(98) + })) ], tl: { hd: [ "concat", - (param => { - return { - TAG: "Eq", - _0: "foobar", - _1: "foo".concat("bar") - }; - }) + (param => ({ + TAG: "Eq", + _0: "foobar", + _1: "foo".concat("bar") + })) ], tl: { hd: [ "concatMany", - (param => { - return { - TAG: "Eq", - _0: "foobarbaz", - _1: "foo".concat("bar", "baz") - }; - }) + (param => ({ + TAG: "Eq", + _0: "foobarbaz", + _1: "foo".concat("bar", "baz") + })) ], tl: { hd: [ "endsWith", - (param => { - return { - TAG: "Eq", - _0: true, - _1: "foobar".endsWith("bar") - }; - }) + (param => ({ + TAG: "Eq", + _0: true, + _1: "foobar".endsWith("bar") + })) ], tl: { hd: [ "endsWithFrom", - (param => { - return { - TAG: "Eq", - _0: false, - _1: "foobar".endsWith("bar", 1) - }; - }) + (param => ({ + TAG: "Eq", + _0: false, + _1: "foobar".endsWith("bar", 1) + })) ], tl: { hd: [ "includes", - (param => { - return { - TAG: "Eq", - _0: true, - _1: "foobarbaz".includes("bar") - }; - }) + (param => ({ + TAG: "Eq", + _0: true, + _1: "foobarbaz".includes("bar") + })) ], tl: { hd: [ "includesFrom", - (param => { - return { - TAG: "Eq", - _0: false, - _1: "foobarbaz".includes("bar", 4) - }; - }) + (param => ({ + TAG: "Eq", + _0: false, + _1: "foobarbaz".includes("bar", 4) + })) ], tl: { hd: [ "indexOf", - (param => { - return { - TAG: "Eq", - _0: 3, - _1: "foobarbaz".indexOf("bar") - }; - }) + (param => ({ + TAG: "Eq", + _0: 3, + _1: "foobarbaz".indexOf("bar") + })) ], tl: { hd: [ "indexOfFrom", - (param => { - return { - TAG: "Eq", - _0: -1, - _1: "foobarbaz".indexOf("bar", 4) - }; - }) + (param => ({ + TAG: "Eq", + _0: -1, + _1: "foobarbaz".indexOf("bar", 4) + })) ], tl: { hd: [ "lastIndexOf", - (param => { - return { - TAG: "Eq", - _0: 3, - _1: "foobarbaz".lastIndexOf("bar") - }; - }) + (param => ({ + TAG: "Eq", + _0: 3, + _1: "foobarbaz".lastIndexOf("bar") + })) ], tl: { hd: [ "lastIndexOfFrom", - (param => { - return { - TAG: "Eq", - _0: 3, - _1: "foobarbaz".lastIndexOf("bar", 4) - }; - }) + (param => ({ + TAG: "Eq", + _0: 3, + _1: "foobarbaz".lastIndexOf("bar", 4) + })) ], tl: { hd: [ "localeCompare", - (param => { - return { - TAG: "Eq", - _0: 0, - _1: "foo".localeCompare("foo") - }; - }) + (param => ({ + TAG: "Eq", + _0: 0, + _1: "foo".localeCompare("foo") + })) ], tl: { hd: [ "match", - (param => { - return { - TAG: "Eq", - _0: [ - "na", - "na" - ], - _1: Caml_option.null_to_opt("banana".match(/na+/g)) - }; - }) + (param => ({ + TAG: "Eq", + _0: [ + "na", + "na" + ], + _1: Caml_option.null_to_opt("banana".match(/na+/g)) + })) ], tl: { hd: [ "match - no match", - (param => { - return { - TAG: "Eq", - _0: undefined, - _1: Caml_option.null_to_opt("banana".match(/nanana+/g)) - }; - }) + (param => ({ + TAG: "Eq", + _0: undefined, + _1: Caml_option.null_to_opt("banana".match(/nanana+/g)) + })) ], tl: { hd: [ "match - not found capture groups", - (param => { - return { - TAG: "Eq", - _0: [ - "hello ", - undefined - ], - _1: Belt_Option.map(Caml_option.null_to_opt("hello word".match(/hello (world)?/)), (prim => { - return prim.slice(); - })) - }; - }) + (param => ({ + TAG: "Eq", + _0: [ + "hello ", + undefined + ], + _1: Belt_Option.map(Caml_option.null_to_opt("hello word".match(/hello (world)?/)), (prim => prim.slice())) + })) ], tl: { hd: [ "normalize", - (param => { - return { - TAG: "Eq", - _0: "foo", - _1: "foo".normalize() - }; - }) + (param => ({ + TAG: "Eq", + _0: "foo", + _1: "foo".normalize() + })) ], tl: { hd: [ "normalizeByForm", - (param => { - return { - TAG: "Eq", - _0: "foo", - _1: "foo".normalize("NFKD") - }; - }) + (param => ({ + TAG: "Eq", + _0: "foo", + _1: "foo".normalize("NFKD") + })) ], tl: { hd: [ "repeat", - (param => { - return { - TAG: "Eq", - _0: "foofoofoo", - _1: "foo".repeat(3) - }; - }) + (param => ({ + TAG: "Eq", + _0: "foofoofoo", + _1: "foo".repeat(3) + })) ], tl: { hd: [ "replace", - (param => { - return { - TAG: "Eq", - _0: "fooBORKbaz", - _1: "foobarbaz".replace("bar", "BORK") - }; - }) + (param => ({ + TAG: "Eq", + _0: "fooBORKbaz", + _1: "foobarbaz".replace("bar", "BORK") + })) ], tl: { hd: [ "replaceByRe", - (param => { - return { - TAG: "Eq", - _0: "fooBORKBORK", - _1: "foobarbaz".replace(/ba./g, "BORK") - }; - }) + (param => ({ + TAG: "Eq", + _0: "fooBORKBORK", + _1: "foobarbaz".replace(/ba./g, "BORK") + })) ], tl: { hd: [ @@ -418,251 +356,209 @@ let suites_1 = { tl: { hd: [ "search", - (param => { - return { - TAG: "Eq", - _0: 3, - _1: "foobarbaz".search(/ba./g) - }; - }) + (param => ({ + TAG: "Eq", + _0: 3, + _1: "foobarbaz".search(/ba./g) + })) ], tl: { hd: [ "slice", - (param => { - return { - TAG: "Eq", - _0: "bar", - _1: "foobarbaz".slice(3, 6) - }; - }) + (param => ({ + TAG: "Eq", + _0: "bar", + _1: "foobarbaz".slice(3, 6) + })) ], tl: { hd: [ "sliceToEnd", - (param => { - return { - TAG: "Eq", - _0: "barbaz", - _1: "foobarbaz".slice(3) - }; - }) + (param => ({ + TAG: "Eq", + _0: "barbaz", + _1: "foobarbaz".slice(3) + })) ], tl: { hd: [ "split", - (param => { - return { - TAG: "Eq", - _0: [ - "foo", - "bar", - "baz" - ], - _1: "foo bar baz".split(" ") - }; - }) + (param => ({ + TAG: "Eq", + _0: [ + "foo", + "bar", + "baz" + ], + _1: "foo bar baz".split(" ") + })) ], tl: { hd: [ "splitAtMost", - (param => { - return { - TAG: "Eq", - _0: [ - "foo", - "bar" - ], - _1: "foo bar baz".split(" ", 2) - }; - }) + (param => ({ + TAG: "Eq", + _0: [ + "foo", + "bar" + ], + _1: "foo bar baz".split(" ", 2) + })) ], tl: { hd: [ "splitByRe", - (param => { - return { + (param => ({ + TAG: "Eq", + _0: [ + "a", + "#", + undefined, + "b", + "#", + ":", + "c" + ], + _1: "a#b#:c".split(/(#)(:)?/) + })) + ], + tl: { + hd: [ + "splitByReAtMost", + (param => ({ TAG: "Eq", _0: [ "a", "#", - undefined, - "b", - "#", - ":", - "c" + undefined ], - _1: "a#b#:c".split(/(#)(:)?/) - }; - }) - ], - tl: { - hd: [ - "splitByReAtMost", - (param => { - return { - TAG: "Eq", - _0: [ - "a", - "#", - undefined - ], - _1: "a#b#:c".split(/(#)(:)?/, 3) - }; - }) + _1: "a#b#:c".split(/(#)(:)?/, 3) + })) ], tl: { hd: [ "startsWith", - (param => { - return { - TAG: "Eq", - _0: true, - _1: "foobarbaz".startsWith("foo") - }; - }) + (param => ({ + TAG: "Eq", + _0: true, + _1: "foobarbaz".startsWith("foo") + })) ], tl: { hd: [ "startsWithFrom", - (param => { - return { - TAG: "Eq", - _0: false, - _1: "foobarbaz".startsWith("foo", 1) - }; - }) + (param => ({ + TAG: "Eq", + _0: false, + _1: "foobarbaz".startsWith("foo", 1) + })) ], tl: { hd: [ "substr", - (param => { - return { - TAG: "Eq", - _0: "barbaz", - _1: "foobarbaz".substr(3) - }; - }) + (param => ({ + TAG: "Eq", + _0: "barbaz", + _1: "foobarbaz".substr(3) + })) ], tl: { hd: [ "substrAtMost", - (param => { - return { - TAG: "Eq", - _0: "bar", - _1: "foobarbaz".substr(3, 3) - }; - }) + (param => ({ + TAG: "Eq", + _0: "bar", + _1: "foobarbaz".substr(3, 3) + })) ], tl: { hd: [ "substring", - (param => { - return { - TAG: "Eq", - _0: "bar", - _1: "foobarbaz".substring(3, 6) - }; - }) + (param => ({ + TAG: "Eq", + _0: "bar", + _1: "foobarbaz".substring(3, 6) + })) ], tl: { hd: [ "substringToEnd", - (param => { - return { - TAG: "Eq", - _0: "barbaz", - _1: "foobarbaz".substring(3) - }; - }) + (param => ({ + TAG: "Eq", + _0: "barbaz", + _1: "foobarbaz".substring(3) + })) ], tl: { hd: [ "toLowerCase", - (param => { - return { - TAG: "Eq", - _0: "bork", - _1: "BORK".toLowerCase() - }; - }) + (param => ({ + TAG: "Eq", + _0: "bork", + _1: "BORK".toLowerCase() + })) ], tl: { hd: [ "toLocaleLowerCase", - (param => { - return { - TAG: "Eq", - _0: "bork", - _1: "BORK".toLocaleLowerCase() - }; - }) + (param => ({ + TAG: "Eq", + _0: "bork", + _1: "BORK".toLocaleLowerCase() + })) ], tl: { hd: [ "toUpperCase", - (param => { - return { - TAG: "Eq", - _0: "FUBAR", - _1: "fubar".toUpperCase() - }; - }) + (param => ({ + TAG: "Eq", + _0: "FUBAR", + _1: "fubar".toUpperCase() + })) ], tl: { hd: [ "toLocaleUpperCase", - (param => { - return { - TAG: "Eq", - _0: "FUBAR", - _1: "fubar".toLocaleUpperCase() - }; - }) + (param => ({ + TAG: "Eq", + _0: "FUBAR", + _1: "fubar".toLocaleUpperCase() + })) ], tl: { hd: [ "trim", - (param => { - return { - TAG: "Eq", - _0: "foo", - _1: " foo ".trim() - }; - }) + (param => ({ + TAG: "Eq", + _0: "foo", + _1: " foo ".trim() + })) ], tl: { hd: [ "anchor", - (param => { - return { - TAG: "Eq", - _0: "foo", - _1: "foo".anchor("bar") - }; - }) + (param => ({ + TAG: "Eq", + _0: "foo", + _1: "foo".anchor("bar") + })) ], tl: { hd: [ "link", - (param => { - return { - TAG: "Eq", - _0: "foo", - _1: "foo".link("https://reason.ml") - }; - }) + (param => ({ + TAG: "Eq", + _0: "foo", + _1: "foo".link("https://reason.ml") + })) ], tl: { hd: [ "File \"js_string_test.res\", line 138, characters 5-12", - (param => { - return { - TAG: "Ok", - _0: "ab".includes("a") - }; - }) + (param => ({ + TAG: "Ok", + _0: "ab".includes("a") + })) ], tl: /* [] */0 } diff --git a/jscomp/test/js_undefined_test.js b/jscomp/test/js_undefined_test.js index 3cd186f9353..89d249321aa 100644 --- a/jscomp/test/js_undefined_test.js +++ b/jscomp/test/js_undefined_test.js @@ -7,84 +7,66 @@ let Js_undefined = require("../../lib/js/js_undefined.js"); let suites_0 = [ "toOption - empty", - (param => { - return { - TAG: "Eq", - _0: undefined, - _1: undefined - }; - }) + (param => ({ + TAG: "Eq", + _0: undefined, + _1: undefined + })) ]; let suites_1 = { hd: [ "File \"js_undefined_test.res\", line 7, characters 5-12", - (param => { - return { - TAG: "Eq", - _0: undefined, - _1: undefined - }; - }) + (param => ({ + TAG: "Eq", + _0: undefined, + _1: undefined + })) ], tl: { hd: [ "return", - (param => { - return { - TAG: "Eq", - _0: "something", - _1: Caml_option.undefined_to_opt("something") - }; - }) + (param => ({ + TAG: "Eq", + _0: "something", + _1: Caml_option.undefined_to_opt("something") + })) ], tl: { hd: [ "test - empty", - (param => { - return { - TAG: "Eq", - _0: true, - _1: true - }; - }) + (param => ({ + TAG: "Eq", + _0: true, + _1: true + })) ], tl: { hd: [ "File \"js_undefined_test.res\", line 10, characters 5-12", - (param => { - return { - TAG: "Eq", - _0: true, - _1: true - }; - }) + (param => ({ + TAG: "Eq", + _0: true, + _1: true + })) ], tl: { hd: [ "bind - empty", - (param => { - return { - TAG: "Eq", - _0: undefined, - _1: Js_undefined.bind(undefined, (v => { - return v; - })) - }; - }) + (param => ({ + TAG: "Eq", + _0: undefined, + _1: Js_undefined.bind(undefined, (v => v)) + })) ], tl: { hd: [ "bind - 'a", - (param => { - return { - TAG: "Eq", - _0: 4, - _1: Js_undefined.bind(2, (n => { - return (n << 1); - })) - }; - }) + (param => ({ + TAG: "Eq", + _0: 4, + _1: Js_undefined.bind(2, (n => (n << 1))) + })) ], tl: { hd: [ @@ -123,24 +105,20 @@ let suites_1 = { tl: { hd: [ "fromOption - None", - (param => { - return { - TAG: "Eq", - _0: undefined, - _1: Js_undefined.fromOption(undefined) - }; - }) + (param => ({ + TAG: "Eq", + _0: undefined, + _1: Js_undefined.fromOption(undefined) + })) ], tl: { hd: [ "fromOption - Some", - (param => { - return { - TAG: "Eq", - _0: 2, - _1: Js_undefined.fromOption(2) - }; - }) + (param => ({ + TAG: "Eq", + _0: 2, + _1: Js_undefined.fromOption(2) + })) ], tl: /* [] */0 } diff --git a/jscomp/test/jsoo_400_test.js b/jscomp/test/jsoo_400_test.js index 1a87368d185..52bdb58ba65 100644 --- a/jscomp/test/jsoo_400_test.js +++ b/jscomp/test/jsoo_400_test.js @@ -17,14 +17,12 @@ function u() { Mt.from_pair_suites("Jsoo_400_test", { hd: [ "File \"jsoo_400_test.res\", line 7, characters 38-45", - (() => { - return { - TAG: "ThrowAny", - _0: (() => { - u(); - }) - }; - }) + (() => ({ + TAG: "ThrowAny", + _0: (() => { + u(); + }) + })) ], tl: /* [] */0 }); diff --git a/jscomp/test/key_word_property_plus_test.js b/jscomp/test/key_word_property_plus_test.js index ee0bb4c307c..3b204f503ed 100644 --- a/jscomp/test/key_word_property_plus_test.js +++ b/jscomp/test/key_word_property_plus_test.js @@ -17,13 +17,11 @@ function eq(loc, x, y) { suites.contents = { hd: [ loc + (" id " + String(test_id.contents)), - (() => { - return { - TAG: "Eq", - _0: x, - _1: y - }; - }) + (() => ({ + TAG: "Eq", + _0: x, + _1: y + })) ], tl: suites.contents }; @@ -34,9 +32,7 @@ eq("File \"key_word_property_plus_test.res\", line 10, characters 2-9", [ 2, 3, 4 -].reduce(((prim0, prim1) => { - return prim0 + prim1 | 0; -}), 0), ((Global_mangles.$$__dirname + Global_mangles.$$__filename | 0) + Global_mangles.$$exports | 0) + Global_mangles.$$require | 0); +].reduce(((prim0, prim1) => prim0 + prim1 | 0), 0), ((Global_mangles.$$__dirname + Global_mangles.$$__filename | 0) + Global_mangles.$$exports | 0) + Global_mangles.$$require | 0); Mt.from_pair_suites("Key_word_property_plus_test", suites.contents); diff --git a/jscomp/test/lazy_demo.js b/jscomp/test/lazy_demo.js index 356c5123243..03915b1d788 100644 --- a/jscomp/test/lazy_demo.js +++ b/jscomp/test/lazy_demo.js @@ -8,9 +8,7 @@ let lazy1 = CamlinternalLazy.from_fun(() => { return 1; }); -let lazy2 = CamlinternalLazy.from_fun(() => { - return 3; -}); +let lazy2 = CamlinternalLazy.from_fun(() => 3); console.log(lazy1, lazy2); diff --git a/jscomp/test/lazy_test.js b/jscomp/test/lazy_test.js index fa7dbee45b7..ed4b679fb72 100644 --- a/jscomp/test/lazy_test.js +++ b/jscomp/test/lazy_test.js @@ -35,9 +35,7 @@ CamlinternalLazy.force(u$1); let exotic = CamlinternalLazy.force; -let l_from_fun = CamlinternalLazy.from_fun(() => { - return 3; -}); +let l_from_fun = CamlinternalLazy.from_fun(() => 3); function f() { let u = 3; @@ -45,19 +43,11 @@ function f() { return u; } -let forward_test = CamlinternalLazy.from_fun(() => { - return f(); -}); +let forward_test = CamlinternalLazy.from_fun(() => f()); -let f005 = CamlinternalLazy.from_fun(() => { - return 6; -}); +let f005 = CamlinternalLazy.from_fun(() => 6); -let f006 = CamlinternalLazy.from_fun(() => { - return () => { - return 3; - }; -}); +let f006 = CamlinternalLazy.from_fun(() => ((() => 3))); let f007 = CamlinternalLazy.from_fun(() => { throw new Error("Not_found", { @@ -76,9 +66,7 @@ function f$1() { }); } -let f008 = CamlinternalLazy.from_fun(() => { - return f$1(); -}); +let f008 = CamlinternalLazy.from_fun(() => f$1()); let a2 = CamlinternalLazy.from_val; @@ -97,62 +85,50 @@ let a8 = CamlinternalLazy.force(a6); Mt.from_pair_suites("Lazy_test", { hd: [ "simple", - (() => { - return { - TAG: "Eq", - _0: lazy_test(), - _1: [ - 3, - 32 - ] - }; - }) + (() => ({ + TAG: "Eq", + _0: lazy_test(), + _1: [ + 3, + 32 + ] + })) ], tl: { hd: [ "lazy_force", - (() => { - return { - TAG: "Eq", - _0: u_v.contents, - _1: 2 - }; - }) + (() => ({ + TAG: "Eq", + _0: u_v.contents, + _1: 2 + })) ], tl: { hd: [ "lazy_from_fun", - (() => { - return { - TAG: "Eq", - _0: CamlinternalLazy.force(l_from_fun), - _1: 3 - }; - }) + (() => ({ + TAG: "Eq", + _0: CamlinternalLazy.force(l_from_fun), + _1: 3 + })) ], tl: { hd: [ "lazy_from_val", - (() => { - return { - TAG: "Eq", - _0: CamlinternalLazy.force(CamlinternalLazy.from_val(3)), - _1: 3 - }; - }) + (() => ({ + TAG: "Eq", + _0: CamlinternalLazy.force(CamlinternalLazy.from_val(3)), + _1: 3 + })) ], tl: { hd: [ "lazy_from_val2", - (() => { - return { - TAG: "Eq", - _0: CamlinternalLazy.force(CamlinternalLazy.force(CamlinternalLazy.from_val(CamlinternalLazy.from_fun(() => { - return 3; - })))), - _1: 3 - }; - }) + (() => ({ + TAG: "Eq", + _0: CamlinternalLazy.force(CamlinternalLazy.force(CamlinternalLazy.from_val(CamlinternalLazy.from_fun(() => 3)))), + _1: 3 + })) ], tl: { hd: [ @@ -169,61 +145,51 @@ Mt.from_pair_suites("Lazy_test", { tl: { hd: [ "lazy_test.res", - (() => { - return { - TAG: "Eq", - _0: a3, - _1: a4 - }; - }) + (() => ({ + TAG: "Eq", + _0: a3, + _1: a4 + })) ], tl: { hd: [ "lazy_test.res", - (() => { - return { - TAG: "Eq", - _0: a7, - _1: undefined - }; - }) + (() => ({ + TAG: "Eq", + _0: a7, + _1: undefined + })) ], tl: { hd: [ "lazy_test.res", - (() => { - return { - TAG: "Eq", - _0: a8, - _1: undefined - }; - }) + (() => ({ + TAG: "Eq", + _0: a8, + _1: undefined + })) ], tl: { hd: [ "File \"lazy_test.res\", line 95, characters 7-14", - (() => { - return { - TAG: "Ok", - _0: Lazy.is_val(CamlinternalLazy.from_val(3)) - }; - }) + (() => ({ + TAG: "Ok", + _0: Lazy.is_val(CamlinternalLazy.from_val(3)) + })) ], tl: { hd: [ "File \"lazy_test.res\", line 96, characters 7-14", - (() => { - return { - TAG: "Ok", - _0: !Lazy.is_val(CamlinternalLazy.from_fun(() => { - throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); - })) - }; - }) + (() => ({ + TAG: "Ok", + _0: !Lazy.is_val(CamlinternalLazy.from_fun(() => { + throw new Error("Not_found", { + cause: { + RE_EXN_ID: "Not_found" + } + }); + })) + })) ], tl: /* [] */0 } diff --git a/jscomp/test/lib_js_test.js b/jscomp/test/lib_js_test.js index dfd81f14c94..d8341a10838 100644 --- a/jscomp/test/lib_js_test.js +++ b/jscomp/test/lib_js_test.js @@ -18,13 +18,11 @@ console.log("hey"); let suites_0 = [ "anything_to_string", - (param => { - return { - TAG: "Eq", - _0: "3", - _1: String(3) - }; - }) + (param => ({ + TAG: "Eq", + _0: "3", + _1: String(3) + })) ]; let suites = { diff --git a/jscomp/test/libqueue_test.js b/jscomp/test/libqueue_test.js index a5b4db1200f..a1f99f9be0d 100644 --- a/jscomp/test/libqueue_test.js +++ b/jscomp/test/libqueue_test.js @@ -7,12 +7,10 @@ let Caml_obj = require("../../lib/js/caml_obj.js"); let Caml_js_exceptions = require("../../lib/js/caml_js_exceptions.js"); function to_list(q) { - return List.rev(Queue.fold(((l, x) => { - return { - hd: x, - tl: l - }; - }), /* [] */0, q)); + return List.rev(Queue.fold(((l, x) => ({ + hd: x, + tl: l + })), /* [] */0, q)); } let Q = { diff --git a/jscomp/test/limits_test.js b/jscomp/test/limits_test.js index e23425dc558..f1aeb8d8ded 100644 --- a/jscomp/test/limits_test.js +++ b/jscomp/test/limits_test.js @@ -18,13 +18,11 @@ function eq(loc, x, y) { suites.contents = { hd: [ loc + (" id " + String(test_id.contents)), - (() => { - return { - TAG: "Eq", - _0: x, - _1: y - }; - }) + (() => ({ + TAG: "Eq", + _0: x, + _1: y + })) ], tl: suites.contents }; diff --git a/jscomp/test/list_stack.js b/jscomp/test/list_stack.js index 702f611f91e..f3a7d15f495 100644 --- a/jscomp/test/list_stack.js +++ b/jscomp/test/list_stack.js @@ -3,8 +3,6 @@ let List = require("../../lib/js/list.js"); -List.find((x => { - return x > 3; -}), /* [] */0); +List.find((x => x > 3), /* [] */0); /* Not a pure module */ diff --git a/jscomp/test/list_test.js b/jscomp/test/list_test.js index a70a346cac8..b0af46e3f6a 100644 --- a/jscomp/test/list_test.js +++ b/jscomp/test/list_test.js @@ -8,106 +8,113 @@ let $$Array = require("../../lib/js/array.js"); let list_suites_0 = [ "length", - (param => { - return { - TAG: "Eq", - _0: 1, - _1: List.length({ - hd: [ - 0, - 1, - 2, - 3, - 4 - ], - tl: /* [] */0 - }) - }; - }) + (param => ({ + TAG: "Eq", + _0: 1, + _1: List.length({ + hd: [ + 0, + 1, + 2, + 3, + 4 + ], + tl: /* [] */0 + }) + })) ]; let list_suites_1 = { hd: [ "length2", - (param => { - return { - TAG: "Eq", - _0: 5, - _1: List.length({ - hd: 0, + (param => ({ + TAG: "Eq", + _0: 5, + _1: List.length({ + hd: 0, + tl: { + hd: 1, tl: { - hd: 1, + hd: 2, tl: { - hd: 2, + hd: 3, tl: { - hd: 3, - tl: { - hd: 4, - tl: /* [] */0 - } + hd: 4, + tl: /* [] */0 } } } - }) - }; - }) + } + }) + })) ], tl: { hd: [ "long_length", - (param => { - return { - TAG: "Eq", - _0: 30000, - _1: List.length($$Array.to_list($$Array.init(30000, (param => { - return 0; - })))) - }; - }) + (param => ({ + TAG: "Eq", + _0: 30000, + _1: List.length($$Array.to_list($$Array.init(30000, (param => 0)))) + })) ], tl: { hd: [ "sort", - (param => { - return { - TAG: "Eq", - _0: List.sort(Caml.int_compare, { - hd: 4, + (param => ({ + TAG: "Eq", + _0: List.sort(Caml.int_compare, { + hd: 4, + tl: { + hd: 1, tl: { - hd: 1, + hd: 2, tl: { - hd: 2, - tl: { - hd: 3, - tl: /* [] */0 - } + hd: 3, + tl: /* [] */0 } } - }), - _1: { - hd: 1, + } + }), + _1: { + hd: 1, + tl: { + hd: 2, tl: { - hd: 2, + hd: 3, tl: { - hd: 3, - tl: { - hd: 4, - tl: /* [] */0 - } + hd: 4, + tl: /* [] */0 } } } - }; - }) + } + })) ], tl: { hd: [ "File \"list_test.res\", line 20, characters 5-12", - (param => { - return { + (param => ({ + TAG: "Eq", + _0: true, + _1: List.mem(3, { + hd: 1, + tl: { + hd: 2, + tl: { + hd: 3, + tl: /* [] */0 + } + } + }) + })) + ], + tl: { + hd: [ + "File \"list_test.res\", line 21, characters 5-12", + (param => ({ TAG: "Eq", - _0: true, - _1: List.mem(3, { + _0: false, + _1: List.mem(4, { hd: 1, tl: { hd: 2, @@ -117,51 +124,28 @@ let list_suites_1 = { } } }) - }; - }) - ], - tl: { - hd: [ - "File \"list_test.res\", line 21, characters 5-12", - (param => { - return { - TAG: "Eq", - _0: false, - _1: List.mem(4, { - hd: 1, - tl: { - hd: 2, - tl: { - hd: 3, - tl: /* [] */0 - } - } - }) - }; - }) + })) ], tl: { hd: [ "File \"list_test.res\", line 22, characters 5-12", - (param => { - return { - TAG: "Eq", - _0: 9, - _1: List.assoc(4, { + (param => ({ + TAG: "Eq", + _0: 9, + _1: List.assoc(4, { + hd: [ + 1, + 2 + ], + tl: { hd: [ - 1, - 2 + 4, + 9 ], - tl: { - hd: [ - 4, - 9 - ], - tl: /* [] */0 - } - }) - }; - }) + tl: /* [] */0 + } + }) + })) ], tl: /* [] */0 } diff --git a/jscomp/test/loop_regression_test.js b/jscomp/test/loop_regression_test.js index d713e781d42..b3264f5b744 100644 --- a/jscomp/test/loop_regression_test.js +++ b/jscomp/test/loop_regression_test.js @@ -23,13 +23,11 @@ function f() { let suites_0 = [ "sum", - (param => { - return { - TAG: "Eq", - _0: 55, - _1: f() - }; - }) + (param => ({ + TAG: "Eq", + _0: 55, + _1: f() + })) ]; let suites = { diff --git a/jscomp/test/map_find_test.js b/jscomp/test/map_find_test.js index b192424ea8d..90a30b36011 100644 --- a/jscomp/test/map_find_test.js +++ b/jscomp/test/map_find_test.js @@ -158,9 +158,7 @@ function find(x, _param) { }; } -let m = List.fold_left(((acc, param) => { - return add(param[0], param[1], acc); -}), "Empty", { +let m = List.fold_left(((acc, param) => add(param[0], param[1], acc)), "Empty", { hd: [ 10, /* 'a' */97 @@ -339,9 +337,7 @@ function find$1(x, _param) { }; } -let s = List.fold_left(((acc, param) => { - return add$1(param[0], param[1], acc); -}), "Empty", { +let s = List.fold_left(((acc, param) => add$1(param[0], param[1], acc)), "Empty", { hd: [ "10", /* 'a' */97 @@ -370,24 +366,20 @@ let s = List.fold_left(((acc, param) => { Mt.from_pair_suites("Map_find_test", { hd: [ "int", - (() => { - return { - TAG: "Eq", - _0: find(10, m), - _1: /* 'a' */97 - }; - }) + (() => ({ + TAG: "Eq", + _0: find(10, m), + _1: /* 'a' */97 + })) ], tl: { hd: [ "string", - (() => { - return { - TAG: "Eq", - _0: find$1("10", s), - _1: /* 'a' */97 - }; - }) + (() => ({ + TAG: "Eq", + _0: find$1("10", s), + _1: /* 'a' */97 + })) ], tl: /* [] */0 } diff --git a/jscomp/test/map_test.js b/jscomp/test/map_test.js index 3468d3828bc..eac6bbdcc24 100644 --- a/jscomp/test/map_test.js +++ b/jscomp/test/map_test.js @@ -2001,9 +2001,7 @@ let String_map = { }; function of_list(kvs) { - return List.fold_left(((acc, param) => { - return add(param[0], param[1], acc); - }), "Empty", kvs); + return List.fold_left(((acc, param) => add(param[0], param[1], acc)), "Empty", kvs); } let int_map_suites_0 = [ @@ -2130,9 +2128,7 @@ let int_map_suites_1 = { return { TAG: "Eq", _0: true, - _1: equal(((x, y) => { - return x === y; - }), u, v) + _1: equal(((x, y) => x === y), u, v) }; }) ], diff --git a/jscomp/test/mario_game.js b/jscomp/test/mario_game.js index 7e7a786225c..f4fdf051483 100644 --- a/jscomp/test/mario_game.js +++ b/jscomp/test/mario_game.js @@ -2321,9 +2321,7 @@ function update_loop(canvas, param, map_dim) { }), parts); fps(canvas, fps$1); hud(canvas, state$1.score, state$1.coins); - requestAnimationFrame(t => { - update_helper(t, state$1, player$1, collid_objs.contents, particles.contents); - }); + requestAnimationFrame(t => update_helper(t, state$1, player$1, collid_objs.contents, particles.contents)); }; update_helper(0, state, player, param[1], /* [] */0); } diff --git a/jscomp/test/method_name_test.js b/jscomp/test/method_name_test.js index 98649f7af65..4ddab5af07e 100644 --- a/jscomp/test/method_name_test.js +++ b/jscomp/test/method_name_test.js @@ -16,13 +16,11 @@ function eq(loc, x, y) { suites.contents = { hd: [ loc + (" id " + String(test_id.contents)), - (() => { - return { - TAG: "Eq", - _0: x, - _1: y - }; - }) + (() => ({ + TAG: "Eq", + _0: x, + _1: y + })) ], tl: suites.contents }; diff --git a/jscomp/test/module_alias_test.js b/jscomp/test/module_alias_test.js index eb8e82994c6..4e116da9fd5 100644 --- a/jscomp/test/module_alias_test.js +++ b/jscomp/test/module_alias_test.js @@ -17,13 +17,11 @@ function eq(loc, x, y) { suites.contents = { hd: [ loc + (" id " + String(test_id.contents)), - (() => { - return { - TAG: "Eq", - _0: x, - _1: y - }; - }) + (() => ({ + TAG: "Eq", + _0: x, + _1: y + })) ], tl: suites.contents }; diff --git a/jscomp/test/module_parameter_test.js b/jscomp/test/module_parameter_test.js index 9a1652a54b4..49c3302bd7d 100644 --- a/jscomp/test/module_parameter_test.js +++ b/jscomp/test/module_parameter_test.js @@ -22,25 +22,21 @@ function v(x) { let suites_0 = [ "const", - (param => { - return { - TAG: "Eq", - _0: 1, - _1: v0 - }; - }) + (param => ({ + TAG: "Eq", + _0: 1, + _1: v0 + })) ]; let suites_1 = { hd: [ "other", - (param => { - return { - TAG: "Eq", - _0: 3, - _1: v("abc") - }; - }) + (param => ({ + TAG: "Eq", + _0: 3, + _1: v("abc") + })) ], tl: /* [] */0 }; diff --git a/jscomp/test/module_splice_test.js b/jscomp/test/module_splice_test.js index 43d58cc59e4..5b0664da091 100644 --- a/jscomp/test/module_splice_test.js +++ b/jscomp/test/module_splice_test.js @@ -20,13 +20,11 @@ function eq(loc, param) { suites.contents = { hd: [ loc + (" id " + String(test_id.contents)), - (() => { - return { - TAG: "Eq", - _0: x, - _1: y - }; - }) + (() => ({ + TAG: "Eq", + _0: x, + _1: y + })) ], tl: suites.contents }; diff --git a/jscomp/test/mpr_6033_test.js b/jscomp/test/mpr_6033_test.js index d8777d916bb..c52692dd5ae 100644 --- a/jscomp/test/mpr_6033_test.js +++ b/jscomp/test/mpr_6033_test.js @@ -17,13 +17,11 @@ function eq(loc, x, y) { suites.contents = { hd: [ loc + (" id " + String(test_id.contents)), - (() => { - return { - TAG: "Eq", - _0: x, - _1: y - }; - }) + (() => ({ + TAG: "Eq", + _0: x, + _1: y + })) ], tl: suites.contents }; @@ -33,9 +31,7 @@ function f(x) { return CamlinternalLazy.force(x) + "abc"; } -let x = CamlinternalLazy.from_fun(() => { - return "def"; -}); +let x = CamlinternalLazy.from_fun(() => "def"); CamlinternalLazy.force(x); diff --git a/jscomp/test/mt.js b/jscomp/test/mt.js index fbf0eeb5132..052e0f61ee9 100644 --- a/jscomp/test/mt.js +++ b/jscomp/test/mt.js @@ -220,17 +220,13 @@ function old_from_promise_suites_donotuse(name, suites) { let match = $$Array.to_list(Process.argv); if (match) { if (is_mocha()) { - describe(name, (() => { - List.iter((param => { - let code = param[1]; - it(param[0], (() => { - return code.then(x => { - handleCode(x); - return val_unit; - }); - })); - }), suites); - })); + describe(name, (() => List.iter((param => { + let code = param[1]; + it(param[0], (() => code.then(x => { + handleCode(x); + return val_unit; + }))); + }), suites))); } else { console.log("promise suites"); } @@ -244,13 +240,11 @@ function eq_suites(test_id, suites, loc, x, y) { suites.contents = { hd: [ loc + (" id " + String(test_id.contents)), - (param => { - return { - TAG: "Eq", - _0: x, - _1: y - }; - }) + (param => ({ + TAG: "Eq", + _0: x, + _1: y + })) ], tl: suites.contents }; @@ -261,12 +255,10 @@ function bool_suites(test_id, suites, loc, x) { suites.contents = { hd: [ loc + (" id " + String(test_id.contents)), - (param => { - return { - TAG: "Ok", - _0: x - }; - }) + (param => ({ + TAG: "Ok", + _0: x + })) ], tl: suites.contents }; @@ -277,12 +269,10 @@ function throw_suites(test_id, suites, loc, x) { suites.contents = { hd: [ loc + (" id " + String(test_id.contents)), - (param => { - return { - TAG: "ThrowAny", - _0: x - }; - }) + (param => ({ + TAG: "ThrowAny", + _0: x + })) ], tl: suites.contents }; diff --git a/jscomp/test/mt_global.js b/jscomp/test/mt_global.js index 62e7a3d06c0..2c4315ca7bd 100644 --- a/jscomp/test/mt_global.js +++ b/jscomp/test/mt_global.js @@ -7,13 +7,11 @@ function collect_eq(test_id, suites, loc, x, y) { suites.contents = { hd: [ loc + (" id " + String(test_id.contents)), - (param => { - return { - TAG: "Eq", - _0: x, - _1: y - }; - }) + (param => ({ + TAG: "Eq", + _0: x, + _1: y + })) ], tl: suites.contents }; @@ -24,13 +22,11 @@ function collect_neq(test_id, suites, loc, x, y) { suites.contents = { hd: [ loc + (" id " + String(test_id.contents)), - (param => { - return { - TAG: "Neq", - _0: x, - _1: y - }; - }) + (param => ({ + TAG: "Neq", + _0: x, + _1: y + })) ], tl: suites.contents }; @@ -41,13 +37,11 @@ function collect_approx(test_id, suites, loc, x, y) { suites.contents = { hd: [ loc + (" id " + String(test_id.contents)), - (param => { - return { - TAG: "Approx", - _0: x, - _1: y - }; - }) + (param => ({ + TAG: "Approx", + _0: x, + _1: y + })) ], tl: suites.contents }; diff --git a/jscomp/test/mutable_obj_test.js b/jscomp/test/mutable_obj_test.js index b6f6640bcc2..1baa2d4647e 100644 --- a/jscomp/test/mutable_obj_test.js +++ b/jscomp/test/mutable_obj_test.js @@ -3,12 +3,10 @@ function f(x) { - x.dec = (x => { - return { - x: x, - y: x - }; - }); + x.dec = (x => ({ + x: x, + y: x + })); } exports.f = f; diff --git a/jscomp/test/name_mangle_test.js b/jscomp/test/name_mangle_test.js index 7d16f2ad4fd..328148dedaa 100644 --- a/jscomp/test/name_mangle_test.js +++ b/jscomp/test/name_mangle_test.js @@ -16,13 +16,11 @@ function eq(loc, x, y) { suites.contents = { hd: [ loc + (" id " + String(test_id.contents)), - (() => { - return { - TAG: "Eq", - _0: x, - _1: y - }; - }) + (() => ({ + TAG: "Eq", + _0: x, + _1: y + })) ], tl: suites.contents }; diff --git a/jscomp/test/obj_literal_ppx.js b/jscomp/test/obj_literal_ppx.js index e818d5dce49..7e561a3188d 100644 --- a/jscomp/test/obj_literal_ppx.js +++ b/jscomp/test/obj_literal_ppx.js @@ -11,9 +11,7 @@ let b = { x: 3, y: [1], z: 3, - u: ((x, y) => { - return x + y | 0; - }) + u: ((x, y) => x + y | 0) }; function f(obj) { diff --git a/jscomp/test/obj_magic_test.js b/jscomp/test/obj_magic_test.js index 4871a33694a..49b6dfbe3f9 100644 --- a/jscomp/test/obj_magic_test.js +++ b/jscomp/test/obj_magic_test.js @@ -9,50 +9,42 @@ function is_block(x) { let suites_0 = [ "is_block_test1", - (param => { - return { - TAG: "Eq", - _0: false, - _1: "number" !== "number" - }; - }) + (param => ({ + TAG: "Eq", + _0: false, + _1: "number" !== "number" + })) ]; let suites_1 = { hd: [ "is_block_test2", - (param => { - return { - TAG: "Eq", - _0: true, - _1: typeof ({ - hd: 3, - tl: /* [] */0 - }) !== "number" - }; - }) + (param => ({ + TAG: "Eq", + _0: true, + _1: typeof ({ + hd: 3, + tl: /* [] */0 + }) !== "number" + })) ], tl: { hd: [ "is_block_test3", - (param => { - return { - TAG: "Eq", - _0: true, - _1: "string" !== "number" - }; - }) + (param => ({ + TAG: "Eq", + _0: true, + _1: "string" !== "number" + })) ], tl: { hd: [ "is_block_test4", - (param => { - return { - TAG: "Eq", - _0: false, - _1: "number" !== "number" - }; - }) + (param => ({ + TAG: "Eq", + _0: false, + _1: "number" !== "number" + })) ], tl: /* [] */0 } diff --git a/jscomp/test/ocaml_re_test.js b/jscomp/test/ocaml_re_test.js index 47c806a112c..86f33fecb6e 100644 --- a/jscomp/test/ocaml_re_test.js +++ b/jscomp/test/ocaml_re_test.js @@ -31,13 +31,11 @@ function eq(loc, x, y) { suites.contents = { hd: [ loc + (" id " + String(test_id.contents)), - (() => { - return { - TAG: "Eq", - _0: x, - _1: y - }; - }) + (() => ({ + TAG: "Eq", + _0: x, + _1: y + })) ], tl: suites.contents }; @@ -790,9 +788,7 @@ function rename(ids, x) { case "Alt" : return mk_expr(ids, { TAG: "Alt", - _0: List.map((extra => { - return rename(ids, extra); - }), l._0) + _0: List.map((extra => rename(ids, extra)), l._0) }); case "Seq" : return mk_expr(ids, { @@ -1001,24 +997,22 @@ function reset_table(a) { } function mark_used_indices(tbl) { - return extra => { - return List.iter((x => { - switch (x.TAG) { - case "TSeq" : - return mark_used_indices(tbl)(x._0); - case "TExp" : - case "TMatch" : - break; + return extra => List.iter((x => { + switch (x.TAG) { + case "TSeq" : + return mark_used_indices(tbl)(x._0); + case "TExp" : + case "TMatch" : + break; + } + List.iter((param => { + let i = param[1]; + if (i >= 0) { + return Caml_array.set(tbl, i, true); } - List.iter((param => { - let i = param[1]; - if (i >= 0) { - return Caml_array.set(tbl, i, true); - } - - }), x._0.marks); - }), extra); - }; + + }), x._0.marks); + }), extra); } function find_free(tbl, _idx, len) { @@ -1409,13 +1403,9 @@ function delta(tbl_ref, next_cat, char, st) { } function flatten_match(m) { - let ma = List.fold_left(((ma, param) => { - return Caml.int_max(ma, param[0]); - }), -1, m); + let ma = List.fold_left(((ma, param) => Caml.int_max(ma, param[0])), -1, m); let res = Caml_array.make(ma + 1 | 0, -1); - List.iter((param => { - Caml_array.set(res, param[0], param[1]); - }), m); + List.iter((param => Caml_array.set(res, param[0], param[1])), m); return res; } @@ -1747,9 +1737,7 @@ function trans_set(cache, cm, s) { } catch (raw_exn) { let exn = Caml_js_exceptions.internalToOCamlException(raw_exn); if (exn.RE_EXN_ID === "Not_found") { - let l = List.fold_right(((param, l) => { - return union(seq(Caml_bytes.get(cm, param[0]), Caml_bytes.get(cm, param[1])), l); - }), s, /* [] */0); + let l = List.fold_right(((param, l) => union(seq(Caml_bytes.get(cm, param[0]), Caml_bytes.get(cm, param[1])), l)), s, /* [] */0); cache.contents = add(v, l, cache.contents); return l; } @@ -2422,31 +2410,25 @@ function translate(ids, kind, _ign_group, ign_case, _greedy, pos, cache, c, _x) let cr = match$1[0]; let rem; if (j !== undefined) { - let f = greedy === "Non_greedy" ? (rem => { - return alt(ids, { - hd: mk_expr(ids, "Eps"), - tl: { - hd: seq$1(ids, kind$p, rename(ids, cr), rem), - tl: /* [] */0 - } - }); - }) : (rem => { - return alt(ids, { + let f = greedy === "Non_greedy" ? (rem => alt(ids, { + hd: mk_expr(ids, "Eps"), + tl: { hd: seq$1(ids, kind$p, rename(ids, cr), rem), - tl: { - hd: mk_expr(ids, "Eps"), - tl: /* [] */0 - } - }); - }); + tl: /* [] */0 + } + })) : (rem => alt(ids, { + hd: seq$1(ids, kind$p, rename(ids, cr), rem), + tl: { + hd: mk_expr(ids, "Eps"), + tl: /* [] */0 + } + })); rem = iter(j - i | 0, f, mk_expr(ids, "Eps")); } else { rem = rep(ids, greedy, kind$p, cr); } return [ - iter(i, (rem => { - return seq$1(ids, kind$p, rename(ids, cr), rem); - }), rem), + iter(i, (rem => seq$1(ids, kind$p, rename(ids, cr), rem)), rem), kind ]; case "Sem" : @@ -2596,23 +2578,17 @@ function handle_case(_ign_case, _x) { case "Sequence" : return { TAG: "Sequence", - _0: List.map((extra => { - return handle_case(ign_case, extra); - }), x._0) + _0: List.map((extra => handle_case(ign_case, extra)), x._0) }; case "Alternative" : - let l$p = List.map((extra => { - return handle_case(ign_case, extra); - }), x._0); + let l$p = List.map((extra => handle_case(ign_case, extra)), x._0); if (is_charset({ TAG: "Alternative", _0: l$p })) { return { TAG: "Set", - _0: List.fold_left(((s, r) => { - return union(s, as_set(r)); - }), /* [] */0, l$p) + _0: List.fold_left(((s, r) => union(s, as_set(r))), /* [] */0, l$p) }; } else { return { @@ -2683,24 +2659,16 @@ function handle_case(_ign_case, _x) { _ign_case = true; continue; case "Intersection" : - let l$p$1 = List.map((r => { - return handle_case(ign_case, r); - }), x._0); + let l$p$1 = List.map((r => handle_case(ign_case, r)), x._0); return { TAG: "Set", - _0: List.fold_left(((s, r) => { - return inter(s, as_set(r)); - }), cany, l$p$1) + _0: List.fold_left(((s, r) => inter(s, as_set(r))), cany, l$p$1) }; case "Complement" : - let l$p$2 = List.map((r => { - return handle_case(ign_case, r); - }), x._0); + let l$p$2 = List.map((r => handle_case(ign_case, r)), x._0); return { TAG: "Set", - _0: diff(cany, List.fold_left(((s, r) => { - return union(s, as_set(r)); - }), /* [] */0, l$p$2)) + _0: diff(cany, List.fold_left(((s, r) => union(s, as_set(r))), /* [] */0, l$p$2)) }; case "Difference" : return { @@ -4147,9 +4115,7 @@ function parse(multiline, dollar_endonly, dotall, ungreedy, s) { continue; }; }; - let branch = () => { - return branch$p(/* [] */0); - }; + let branch = () => branch$p(/* [] */0); let comment = () => { while (true) { if (accept(/* ')' */41)) { diff --git a/jscomp/test/of_string_test.js b/jscomp/test/of_string_test.js index e01b8357462..0e945b0ea7b 100644 --- a/jscomp/test/of_string_test.js +++ b/jscomp/test/of_string_test.js @@ -6,36 +6,30 @@ let Pervasives = require("../../lib/js/pervasives.js"); let suites_0 = [ "string_of_float_1", - (param => { - return { - TAG: "Eq", - _0: "10.", - _1: Pervasives.string_of_float(10) - }; - }) + (param => ({ + TAG: "Eq", + _0: "10.", + _1: Pervasives.string_of_float(10) + })) ]; let suites_1 = { hd: [ "string_of_int", - (param => { - return { - TAG: "Eq", - _0: "10", - _1: String(10) - }; - }) + (param => ({ + TAG: "Eq", + _0: "10", + _1: String(10) + })) ], tl: { hd: [ "valid_float_lexem", - (param => { - return { - TAG: "Eq", - _0: "10.", - _1: Pervasives.valid_float_lexem("10") - }; - }) + (param => ({ + TAG: "Eq", + _0: "10.", + _1: Pervasives.valid_float_lexem("10") + })) ], tl: /* [] */0 } diff --git a/jscomp/test/option_repr_test.js b/jscomp/test/option_repr_test.js index 90594a5f8c6..1e63ed6743b 100644 --- a/jscomp/test/option_repr_test.js +++ b/jscomp/test/option_repr_test.js @@ -104,13 +104,9 @@ function f12(x) { return x; } -let length_8_id = Belt_List.makeBy(8, (x => { - return x; -})); +let length_8_id = Belt_List.makeBy(8, (x => x)); -let length_10_id = Belt_List.makeBy(10, (x => { - return x; -})); +let length_10_id = Belt_List.makeBy(10, (x => x)); function f13$1() { return Caml_obj.equal(Belt_List.take(length_10_id, 8), { @@ -170,9 +166,7 @@ function neqx(a, b) { } function all_true(xs) { - return Belt_List.every(xs, (x => { - return x; - })); + return Belt_List.every(xs, (x => x)); } let xs_0 = gtx(Caml_option.some(null), Caml_option.some(undefined)); @@ -182,9 +176,7 @@ let xs = { tl: /* [] */0 }; -b("File \"option_repr_test.res\", line 125, characters 8-15", Belt_List.every(xs, (x => { - return x; -}))); +b("File \"option_repr_test.res\", line 125, characters 8-15", Belt_List.every(xs, (x => x))); let xs_0$1 = ltx(Caml_option.some(undefined), 3); @@ -205,9 +197,7 @@ let xs_1 = { tl: { hd: ltx(undefined, null), tl: { - hd: ltx(undefined, (x => { - return x; - })), + hd: ltx(undefined, (x => x)), tl: { hd: ltx(null, 3), tl: /* [] */0 @@ -227,9 +217,7 @@ let xs$1 = { tl: xs_1 }; -b("File \"option_repr_test.res\", line 128, characters 4-11", Belt_List.every(xs$1, (x => { - return x; -}))); +b("File \"option_repr_test.res\", line 128, characters 4-11", Belt_List.every(xs$1, (x => x))); let xs_0$2 = eqx(undefined, undefined); @@ -252,9 +240,7 @@ let xs$2 = { tl: xs_1$1 }; -b("File \"option_repr_test.res\", line 145, characters 4-11", Belt_List.every(xs$2, (x => { - return x; -}))); +b("File \"option_repr_test.res\", line 145, characters 4-11", Belt_List.every(xs$2, (x => x))); function v(x) { return x; diff --git a/jscomp/test/optional_ffi_test.js b/jscomp/test/optional_ffi_test.js index 1dfdfd3a3c9..893f71b4f02 100644 --- a/jscomp/test/optional_ffi_test.js +++ b/jscomp/test/optional_ffi_test.js @@ -19,13 +19,11 @@ function eq(loc, param) { suites.contents = { hd: [ loc + (" id " + String(test_id.contents)), - (() => { - return { - TAG: "Eq", - _0: x, - _1: y - }; - }) + (() => ({ + TAG: "Eq", + _0: x, + _1: y + })) ], tl: suites.contents }; diff --git a/jscomp/test/poly_variant_test.js b/jscomp/test/poly_variant_test.js index 927d594d255..18550b9914d 100644 --- a/jscomp/test/poly_variant_test.js +++ b/jscomp/test/poly_variant_test.js @@ -16,13 +16,11 @@ function eq(loc, x, y) { suites.contents = { hd: [ loc + (" id " + String(test_id.contents)), - (() => { - return { - TAG: "Eq", - _0: x, - _1: y - }; - }) + (() => ({ + TAG: "Eq", + _0: x, + _1: y + })) ], tl: suites.contents }; diff --git a/jscomp/test/polymorphic_raw_test.js b/jscomp/test/polymorphic_raw_test.js index 38420875431..2ed59b38025 100644 --- a/jscomp/test/polymorphic_raw_test.js +++ b/jscomp/test/polymorphic_raw_test.js @@ -16,13 +16,11 @@ function eq(loc, x, y) { suites.contents = { hd: [ loc + (" id " + String(test_id.contents)), - (() => { - return { - TAG: "Eq", - _0: x, - _1: y - }; - }) + (() => ({ + TAG: "Eq", + _0: x, + _1: y + })) ], tl: suites.contents }; diff --git a/jscomp/test/ppx_apply_test.js b/jscomp/test/ppx_apply_test.js index 85111049837..c357e35921c 100644 --- a/jscomp/test/ppx_apply_test.js +++ b/jscomp/test/ppx_apply_test.js @@ -16,13 +16,11 @@ function eq(loc, x, y) { suites.contents = { hd: [ loc + (" id " + String(test_id.contents)), - (() => { - return { - TAG: "Eq", - _0: x, - _1: y - }; - }) + (() => ({ + TAG: "Eq", + _0: x, + _1: y + })) ], tl: suites.contents }; diff --git a/jscomp/test/prepend_data_ffi.js b/jscomp/test/prepend_data_ffi.js index 9fbe6e602db..db22b3f52e4 100644 --- a/jscomp/test/prepend_data_ffi.js +++ b/jscomp/test/prepend_data_ffi.js @@ -12,21 +12,13 @@ let v2 = { v: 2 }; -process.on("exit", (exit_code => { - return String(exit_code); -})); +process.on("exit", (exit_code => String(exit_code))); -process.on(1, (param => { - -})); +process.on(1, (param => {})); -process.on((i => { - return String(i); -}), "exit"); +process.on((i => String(i)), "exit"); -process.on((i => { - return String(i); -}), 1); +process.on((i => String(i)), 1); xx(3, 3, "xxx", "a", "b"); diff --git a/jscomp/test/print_alpha_test.js b/jscomp/test/print_alpha_test.js index 065ef49aa08..8d029466004 100644 --- a/jscomp/test/print_alpha_test.js +++ b/jscomp/test/print_alpha_test.js @@ -5,23 +5,17 @@ let Mt = require("./mt.js"); function f(h, param) { console.log(3); - return (x, y) => { - return h(x, y); - }; + return (x, y) => h(x, y); } Mt.from_pair_suites("Print_alpha_test", { hd: [ "File \"print_alpha_test.res\", line 16, characters 10-17", - (() => { - return { - TAG: "Eq", - _0: f(((prim0, prim1) => { - return prim0 + prim1 | 0; - }), undefined)(1, 2), - _1: 3 - }; - }) + (() => ({ + TAG: "Eq", + _0: f(((prim0, prim1) => prim0 + prim1 | 0), undefined)(1, 2), + _1: 3 + })) ], tl: /* [] */0 }); diff --git a/jscomp/test/queue_test.js b/jscomp/test/queue_test.js index 9d6e62b33b0..a80fa32cfcf 100644 --- a/jscomp/test/queue_test.js +++ b/jscomp/test/queue_test.js @@ -18,9 +18,7 @@ function Test(Queue) { }; let queue_1 = x => { let q = Queue.create(); - $$Array.iter((x => { - Queue.add(x, q); - }), x); + $$Array.iter((x => Queue.add(x, q)), x); return to_array(q); }; return { @@ -44,9 +42,7 @@ function queue_1(x) { first: "Nil", last: "Nil" }; - $$Array.iter((x => { - Queue.add(x, q); - }), x); + $$Array.iter((x => Queue.add(x, q)), x); return to_array(q); } @@ -69,9 +65,7 @@ function queue_1$1(x) { length: 0, tail: undefined }; - $$Array.iter((x => { - Queue_402.add(x, q); - }), x); + $$Array.iter((x => Queue_402.add(x, q)), x); return to_array$1(q); } diff --git a/jscomp/test/random_test.js b/jscomp/test/random_test.js index 90f285c7255..1e59086117c 100644 --- a/jscomp/test/random_test.js +++ b/jscomp/test/random_test.js @@ -16,21 +16,15 @@ let suites = { }; function eq(f) { - return (extra, extra$1) => { - return Mt_global.collect_eq(id, suites, f, extra, extra$1); - }; + return (extra, extra$1) => Mt_global.collect_eq(id, suites, f, extra, extra$1); } function neq(f) { - return (extra, extra$1) => { - return Mt_global.collect_neq(id, suites, f, extra, extra$1); - }; + return (extra, extra$1) => Mt_global.collect_neq(id, suites, f, extra, extra$1); } function approx(f) { - return (extra, extra$1) => { - return Mt_global.collect_approx(id, suites, f, extra, extra$1); - }; + return (extra, extra$1) => Mt_global.collect_approx(id, suites, f, extra, extra$1); } Mt_global.collect_neq(id, suites, "File \"random_test.res\", line 9, characters 2-9", (Random.self_init(), Random.int(10000)), (Random.self_init(), Random.int(1000))); diff --git a/jscomp/test/reactTestUtils.js b/jscomp/test/reactTestUtils.js index e329678e5a3..8f37e360d5f 100644 --- a/jscomp/test/reactTestUtils.js +++ b/jscomp/test/reactTestUtils.js @@ -14,9 +14,7 @@ function act(func) { } function actAsync(func) { - return TestUtils.act(() => { - return func(); - }); + return TestUtils.act(() => func()); } function changeWithValue(element, value) { @@ -51,15 +49,11 @@ function findByAllSelector(element, selector) { } function findBySelectorAndTextContent(element, selector, content) { - return Belt_Array.getBy(Array.from(element.querySelectorAll(selector)), (node => { - return node.textContent === content; - })); + return Belt_Array.getBy(Array.from(element.querySelectorAll(selector)), (node => node.textContent === content)); } function findBySelectorAndPartialTextContent(element, selector, content) { - return Belt_Array.getBy(Array.from(element.querySelectorAll(selector)), (node => { - return node.textContent.includes(content); - })); + return Belt_Array.getBy(Array.from(element.querySelectorAll(selector)), (node => node.textContent.includes(content))); } let DOM = { @@ -71,9 +65,7 @@ let DOM = { function prepareContainer(container, param) { let containerElement = document.createElement("div"); - Belt_Option.map(document.body, (body => { - return body.appendChild(containerElement); - })); + Belt_Option.map(document.body, (body => body.appendChild(containerElement))); container.contents = Caml_option.some(containerElement); } diff --git a/jscomp/test/reasonReact.js b/jscomp/test/reasonReact.js index 00daab31f91..840e9cfae66 100644 --- a/jscomp/test/reasonReact.js +++ b/jscomp/test/reasonReact.js @@ -84,9 +84,7 @@ function element(keyOpt, refOpt, component) { } function wrapReasonForJs(component, jsPropsToReason) { - let uncurriedJsPropsToReason = jsProps => { - return jsPropsToReason(jsProps); - }; + let uncurriedJsPropsToReason = jsProps => jsPropsToReason(jsProps); component.reactClassInternal.prototype.jsPropsToReason = uncurriedJsPropsToReason; return component.reactClassInternal; } diff --git a/jscomp/test/reasonReactRouter.js b/jscomp/test/reasonReactRouter.js index 2ce9ba6669d..5c2ca324920 100644 --- a/jscomp/test/reasonReactRouter.js +++ b/jscomp/test/reasonReactRouter.js @@ -138,13 +138,9 @@ function url() { function watchUrl(callback) { let window = globalThis.window; if (window === undefined) { - return () => { - - }; + return () => {}; } - let watcherID = () => { - callback(url()); - }; + let watcherID = () => callback(url()); Caml_option.valFromOption(window).addEventListener("popstate", watcherID); return watcherID; } @@ -169,20 +165,12 @@ function useUrl(serverUrl, param) { let setUrl = match[1]; let url$1 = match[0]; React.useEffect((() => { - let watcherId = watchUrl(url => { - setUrl(param => { - return url; - }); - }); + let watcherId = watchUrl(url => setUrl(param => url)); let newUrl = url(); if (urlNotEqual(newUrl, url$1)) { - setUrl(param => { - return newUrl; - }); + setUrl(param => newUrl); } - return (() => { - unwatchUrl(watcherId); - }); + return (() => unwatchUrl(watcherId)); }), []); return url$1; } diff --git a/jscomp/test/rec_fun_test.js b/jscomp/test/rec_fun_test.js index e18ed50860b..d435a8a47bf 100644 --- a/jscomp/test/rec_fun_test.js +++ b/jscomp/test/rec_fun_test.js @@ -17,13 +17,11 @@ function eq(loc, x, y) { suites.contents = { hd: [ loc + (" id " + String(test_id.contents)), - (() => { - return { - TAG: "Eq", - _0: x, - _1: y - }; - }) + (() => ({ + TAG: "Eq", + _0: x, + _1: y + })) ], tl: suites.contents }; diff --git a/jscomp/test/rec_module_test.js b/jscomp/test/rec_module_test.js index a81a93b48e3..705c40613bd 100644 --- a/jscomp/test/rec_module_test.js +++ b/jscomp/test/rec_module_test.js @@ -1218,108 +1218,94 @@ Caml_module.update_mod({ let suites_0 = [ "test1", - (param => { - return { - TAG: "Eq", - _0: [ - true, - true, - false, - false - ], - _1: [ - A.even(2), - AA.even(4), - B.odd(2), - BB.odd(4) - ] - }; - }) + (param => ({ + TAG: "Eq", + _0: [ + true, + true, + false, + false + ], + _1: [ + A.even(2), + AA.even(4), + B.odd(2), + BB.odd(4) + ] + })) ]; let suites_1 = { hd: [ "test2", - (param => { - return { - TAG: "Eq", - _0: BB.y(), - _1: 32 - }; - }) + (param => ({ + TAG: "Eq", + _0: BB.y(), + _1: 32 + })) ], tl: { hd: [ "test3", - (param => { - return { - TAG: "Eq", - _0: AA.x(), - _1: 35 - }; - }) + (param => ({ + TAG: "Eq", + _0: AA.x(), + _1: 35 + })) ], tl: { hd: [ "test4", - (param => { - return { - TAG: "Eq", - _0: true, - _1: A.even(2) - }; - }) + (param => ({ + TAG: "Eq", + _0: true, + _1: A.even(2) + })) ], tl: { hd: [ "test4", - (param => { - return { - TAG: "Eq", - _0: true, - _1: AA.even(4) - }; - }) + (param => ({ + TAG: "Eq", + _0: true, + _1: AA.even(4) + })) ], tl: { hd: [ "test5", - (param => { - return { - TAG: "Eq", - _0: false, - _1: B.odd(2) - }; - }) + (param => ({ + TAG: "Eq", + _0: false, + _1: B.odd(2) + })) ], tl: { hd: [ "test6", - (param => { - return { - TAG: "Eq", - _0: 2, - _1: cardinal(of_list({ + (param => ({ + TAG: "Eq", + _0: 2, + _1: cardinal(of_list({ + hd: { + TAG: "Leaf", + _0: "a" + }, + tl: { hd: { TAG: "Leaf", - _0: "a" + _0: "b" }, tl: { hd: { TAG: "Leaf", - _0: "b" + _0: "a" }, - tl: { - hd: { - TAG: "Leaf", - _0: "a" - }, - tl: /* [] */0 - } + tl: /* [] */0 } - })) - }; - }) + } + })) + })) ], tl: /* [] */0 } diff --git a/jscomp/test/recmodule.js b/jscomp/test/recmodule.js index 41c02166035..c940c8ea143 100644 --- a/jscomp/test/recmodule.js +++ b/jscomp/test/recmodule.js @@ -6,12 +6,10 @@ let Caml_module = require("../../lib/js/caml_module.js"); let Entity = {}; function MakeLayer(Deps) { - let getLight = id => { - return Deps.presentLight({ - id: id, - name: "Light 1" - }); - }; + let getLight = id => Deps.presentLight({ + id: id, + name: "Light 1" + }); return { getLight: getLight }; @@ -22,12 +20,8 @@ let UseCase = { }; function MakeLayer$1(Deps, UC) { - let presentLight = light => { - return Deps.presentJson(light, 200); - }; - let handleGetLight = req => { - return UC.getLight(req.params.id); - }; + let presentLight = light => Deps.presentJson(light, 200); + let handleGetLight = req => UC.getLight(req.params.id); return { handleGetLight: handleGetLight, presentLight: presentLight @@ -51,12 +45,10 @@ function MakeLayer$2(Deps) { } }); }; - let routes = () => { - return [[ - "/lights", - Deps.handleGetLight - ]]; - }; + let routes = () => [[ + "/lights", + Deps.handleGetLight + ]]; return { presentJson: presentJson, routes: routes diff --git a/jscomp/test/record_with_test.js b/jscomp/test/record_with_test.js index f64ab7d5a5a..86dba75c33e 100644 --- a/jscomp/test/record_with_test.js +++ b/jscomp/test/record_with_test.js @@ -38,13 +38,11 @@ function f(g, h) { let suites_0 = [ "eq_with", - (param => { - return { - TAG: "Eq", - _0: v, - _1: u_v - }; - }) + (param => ({ + TAG: "Eq", + _0: v, + _1: u_v + })) ]; let suites = { diff --git a/jscomp/test/recursive_module.js b/jscomp/test/recursive_module.js index 520fdc8f5f6..d7b13eb7601 100644 --- a/jscomp/test/recursive_module.js +++ b/jscomp/test/recursive_module.js @@ -20,9 +20,7 @@ function eq(loc, x, y) { } let Xx = { - f: ((prim0, prim1) => { - return hfiehi(prim0, prim1); - }) + f: ((prim0, prim1) => hfiehi(prim0, prim1)) }; let Int3 = Caml_module.init_mod([ @@ -69,9 +67,7 @@ let Intb = Caml_module.init_mod([ ]] }); -let a = CamlinternalLazy.from_fun(() => { - return CamlinternalLazy.force(Intb.a); -}); +let a = CamlinternalLazy.from_fun(() => CamlinternalLazy.force(Intb.a)); Caml_module.update_mod({ TAG: "Module", @@ -83,9 +79,7 @@ Caml_module.update_mod({ a: a }); -let a$1 = CamlinternalLazy.from_fun(() => { - return CamlinternalLazy.force(Inta.a) + 1 | 0; -}); +let a$1 = CamlinternalLazy.from_fun(() => CamlinternalLazy.force(Inta.a) + 1 | 0); Caml_module.update_mod({ TAG: "Module", @@ -138,9 +132,7 @@ let Intb$1 = Caml_module.init_mod([ ]] }); -let a$2 = CamlinternalLazy.from_fun(() => { - return CamlinternalLazy.force(Intb$1.a) + 1 | 0; -}); +let a$2 = CamlinternalLazy.from_fun(() => CamlinternalLazy.force(Intb$1.a) + 1 | 0); Caml_module.update_mod({ TAG: "Module", @@ -152,9 +144,7 @@ Caml_module.update_mod({ a: a$2 }); -let a$3 = CamlinternalLazy.from_fun(() => { - return 2; -}); +let a$3 = CamlinternalLazy.from_fun(() => 2); Caml_module.update_mod({ TAG: "Module", diff --git a/jscomp/test/recursive_module_test.js b/jscomp/test/recursive_module_test.js index ac1b0d2d8f0..db13ddaea60 100644 --- a/jscomp/test/recursive_module_test.js +++ b/jscomp/test/recursive_module_test.js @@ -17,13 +17,11 @@ function eq(loc, x, y) { suites.contents = { hd: [ loc + (" id " + String(test_id.contents)), - (() => { - return { - TAG: "Eq", - _0: x, - _1: y - }; - }) + (() => ({ + TAG: "Eq", + _0: x, + _1: y + })) ], tl: suites.contents }; @@ -97,14 +95,12 @@ eq("File \"recursive_module_test.res\", line 29, characters 12-19", 120, fact$1( add([ "File \"recursive_module_test.res\", line 31, characters 14-21", - (() => { - return { - TAG: "ThrowAny", - _0: (() => { - Int3.u(3); - }) - }; - }) + (() => ({ + TAG: "ThrowAny", + _0: (() => { + Int3.u(3); + }) + })) ]); Mt.from_pair_suites("Recursive_module_test", suites.contents); diff --git a/jscomp/test/recursive_unbound_module_test.js b/jscomp/test/recursive_unbound_module_test.js index 07a59a41376..333345ada6d 100644 --- a/jscomp/test/recursive_unbound_module_test.js +++ b/jscomp/test/recursive_unbound_module_test.js @@ -4,9 +4,7 @@ let Caml_module = require("../../lib/js/caml_module.js"); function Make(X) { - let f = () => { - - }; + let f = () => {}; let M = { f: f }; diff --git a/jscomp/test/res_debug.js b/jscomp/test/res_debug.js index 298be402863..b432508cf66 100644 --- a/jscomp/test/res_debug.js +++ b/jscomp/test/res_debug.js @@ -33,17 +33,13 @@ function optionMap(x, f) { } -let ok_name = optionMap(undefined, (x => { - return x; -})); +let ok_name = optionMap(undefined, (x => x)); let ok = { name: ok_name }; -let bad_name = optionMap(undefined, (x => { - return x; -})); +let bad_name = optionMap(undefined, (x => x)); let bad = { name: bad_name diff --git a/jscomp/test/sexp.js b/jscomp/test/sexp.js index 12aa33fea60..5be61afb379 100644 --- a/jscomp/test/sexp.js +++ b/jscomp/test/sexp.js @@ -136,9 +136,7 @@ function of_field(name, t) { function of_record(l) { return { NAME: "List", - VAL: List.map((param => { - return of_field(param[0], param[1]); - }), l) + VAL: List.map((param => of_field(param[0], param[1])), l) }; } @@ -253,9 +251,7 @@ function to_float(e) { } function to_string(e) { - return _try_atom(e, (x => { - return x; - })); + return _try_atom(e, (x => x)); } function to_pair(e) { @@ -280,19 +276,13 @@ function to_pair(e) { } function to_pair_with(f1, f2) { - return e => { - return $great$great$eq(to_pair(e), (param => { - let y = param[1]; - return $great$great$eq(f1(param[0]), (x => { - return $great$great$eq(f2(y), (y => { - return [ - x, - y - ]; - })); - })); - })); - }; + return e => $great$great$eq(to_pair(e), (param => { + let y = param[1]; + return $great$great$eq(f1(param[0]), (x => $great$great$eq(f2(y), (y => [ + x, + y + ])))); + })); } function to_triple(e) { @@ -322,23 +312,15 @@ function to_triple(e) { } function to_triple_with(f1, f2, f3) { - return e => { - return $great$great$eq(to_triple(e), (param => { - let z = param[2]; - let y = param[1]; - return $great$great$eq(f1(param[0]), (x => { - return $great$great$eq(f2(y), (y => { - return $great$great$eq(f3(z), (z => { - return [ - x, - y, - z - ]; - })); - })); - })); - })); - }; + return e => $great$great$eq(to_triple(e), (param => { + let z = param[2]; + let y = param[1]; + return $great$great$eq(f1(param[0]), (x => $great$great$eq(f2(y), (y => $great$great$eq(f3(z), (z => [ + x, + y, + z + ])))))); + })); } function to_list(e) { @@ -410,9 +392,7 @@ function get_field(name) { } function field(name, f) { - return e => { - return $great$great$eq(get_field(name)(e), f); - }; + return e => $great$great$eq(get_field(name)(e), f); } function _get_field_list(name, _l) { diff --git a/jscomp/test/sexpm.js b/jscomp/test/sexpm.js index 88d082e7b03..19cf40d943d 100644 --- a/jscomp/test/sexpm.js +++ b/jscomp/test/sexpm.js @@ -203,9 +203,7 @@ function _error_eof(t) { function expr(k, t) { while (true) { if (t.i === t.len) { - return _refill(t, (extra => { - return expr(k, extra); - }), _error_eof); + return _refill(t, (extra => expr(k, extra)), _error_eof); } let c = _get(t); if (c >= 11) { @@ -224,9 +222,7 @@ function expr(k, t) { function expr_starting_with(c, k, t) { if (c >= 42) { if (c === 59) { - return skip_comment(((param, param$1) => { - return expr(k, t); - }), t); + return skip_comment(((param, param$1) => expr(k, t)), t); } if (c === 92) { return _error(t, "unexpected '\\'"); @@ -281,9 +277,7 @@ function expr_starting_with(c, k, t) { function expr_list(acc, k, t) { while (true) { if (t.i === t.len) { - return _refill(t, (extra => { - return expr_list(acc, k, extra); - }), _error_eof); + return _refill(t, (extra => expr_list(acc, k, extra)), _error_eof); } let c = _get(t); if (c > 32 || c < 9) { @@ -315,12 +309,10 @@ function expr_list(acc, k, t) { }); } } else { - return expr_list(/* [] */0, ((param, l) => { - return expr_list({ - hd: l, - tl: acc - }, k, t); - }), t); + return expr_list(/* [] */0, ((param, l) => expr_list({ + hd: l, + tl: acc + }, k, t)), t); } } else { return expr_list({ @@ -344,11 +336,7 @@ function _return_atom(last, k, t) { function atom(k, t) { while (true) { if (t.i === t.len) { - return _refill(t, (extra => { - return atom(k, extra); - }), (extra => { - return _return_atom(undefined, k, extra); - })); + return _refill(t, (extra => atom(k, extra)), (extra => _return_atom(undefined, k, extra))); } let c = _get(t); let exit = 0; @@ -392,9 +380,7 @@ function atom(k, t) { function quoted(k, t) { while (true) { if (t.i === t.len) { - return _refill(t, (extra => { - return quoted(k, extra); - }), _error_eof); + return _refill(t, (extra => quoted(k, extra)), _error_eof); } let c = _get(t); if (c === 34) { @@ -413,9 +399,7 @@ function quoted(k, t) { function escaped(k, t) { if (t.i === t.len) { - return _refill(t, (extra => { - return escaped(k, extra); - }), _error_eof); + return _refill(t, (extra => escaped(k, extra)), _error_eof); } let c = _get(t); if (c >= 92) { @@ -459,9 +443,7 @@ function escaped(k, t) { return k(/* '"' */34); } if (_is_digit(c)) { - return read2int(c - /* '0' */48 | 0, (n => { - return k(Char.chr(n)); - }), t); + return read2int(c - /* '0' */48 | 0, (n => k(Char.chr(n))), t); } else { return _error(t, "unexpected escaped char '" + (c + "'")); } @@ -469,9 +451,7 @@ function escaped(k, t) { function read2int(i, k, t) { if (t.i === t.len) { - return _refill(t, (extra => { - return read2int(i, k, extra); - }), _error_eof); + return _refill(t, (extra => read2int(i, k, extra)), _error_eof); } let c = _get(t); if (_is_digit(c)) { @@ -483,9 +463,7 @@ function read2int(i, k, t) { function read1int(i, k, t) { if (t.i === t.len) { - return _refill(t, (extra => { - return read1int(i, k, extra); - }), _error_eof); + return _refill(t, (extra => read1int(i, k, extra)), _error_eof); } let c = _get(t); if (_is_digit(c)) { @@ -498,9 +476,7 @@ function read1int(i, k, t) { function skip_comment(k, t) { while (true) { if (t.i === t.len) { - return _refill(t, (extra => { - return skip_comment(k, extra); - }), _error_eof); + return _refill(t, (extra => skip_comment(k, extra)), _error_eof); } let match = _get(t); if (match === 10) { @@ -513,11 +489,7 @@ function skip_comment(k, t) { function expr_or_end(k, t) { while (true) { if (t.i === t.len) { - return _refill(t, (extra => { - return expr_or_end(k, extra); - }), (param => { - return "End"; - })); + return _refill(t, (extra => expr_or_end(k, extra)), (param => "End")); } let c = _get(t); if (c >= 11) { @@ -534,12 +506,10 @@ function expr_or_end(k, t) { } function next(t) { - return expr_or_end(((param, x) => { - return { - NAME: "Ok", - VAL: x - }; - }), t); + return expr_or_end(((param, x) => ({ + NAME: "Ok", + VAL: x + })), t); } function parse_string(s) { diff --git a/jscomp/test/sexpm_test.js b/jscomp/test/sexpm_test.js index b7fe2e9a45b..642975259dc 100644 --- a/jscomp/test/sexpm_test.js +++ b/jscomp/test/sexpm_test.js @@ -19,13 +19,11 @@ function eq(loc, param) { suites.contents = { hd: [ loc + (" id " + String(test_id.contents)), - (() => { - return { - TAG: "Eq", - _0: x, - _1: y - }; - }) + (() => ({ + TAG: "Eq", + _0: x, + _1: y + })) ], tl: suites.contents }; diff --git a/jscomp/test/side_effect2.js b/jscomp/test/side_effect2.js index c75b270f041..59a117f9f19 100644 --- a/jscomp/test/side_effect2.js +++ b/jscomp/test/side_effect2.js @@ -3,9 +3,7 @@ let Belt_Array = require("../../lib/js/belt_Array.js"); -let a = Belt_Array.map([1], (x => { - return x; -})); +let a = Belt_Array.map([1], (x => x)); exports.a = a; /* a Not a pure module */ diff --git a/jscomp/test/stack_test.js b/jscomp/test/stack_test.js index 4b750909c0c..7ced4562591 100644 --- a/jscomp/test/stack_test.js +++ b/jscomp/test/stack_test.js @@ -29,22 +29,20 @@ function v() { let suites_0 = [ "push_test", - (param => { - return { - TAG: "Eq", - _0: { - hd: 1, + (param => ({ + TAG: "Eq", + _0: { + hd: 1, + tl: { + hd: 4, tl: { - hd: 4, - tl: { - hd: 3, - tl: /* [] */0 - } + hd: 3, + tl: /* [] */0 } - }, - _1: v() - }; - }) + } + }, + _1: v() + })) ]; let suites = { diff --git a/jscomp/test/stream_parser_test.js b/jscomp/test/stream_parser_test.js index 82937db7e45..31ace2f643d 100644 --- a/jscomp/test/stream_parser_test.js +++ b/jscomp/test/stream_parser_test.js @@ -73,9 +73,7 @@ function parse(token) { }); } }; - let parse_term = () => { - return parse_term_aux(parse_atom()); - }; + let parse_term = () => parse_term_aux(parse_atom()); let parse_expr_aux = e1 => { let e = token$1(); if (e.TAG === "Kwd") { @@ -113,12 +111,10 @@ function parse(token) { let r = parse_expr_aux(parse_term()); return [ r, - Queue.fold(((acc, x) => { - return { - hd: x, - tl: acc - }; - }), /* [] */0, look_ahead) + Queue.fold(((acc, x) => ({ + hd: x, + tl: acc + })), /* [] */0, look_ahead) ]; } @@ -144,9 +140,7 @@ let lexer = Genlex.make_lexer({ function token(chars) { let strm = lexer(chars); - return () => { - return Stream.next(strm); - }; + return () => Stream.next(strm); } function l_parse(token) { @@ -254,18 +248,14 @@ function l_parse(token) { } }; }; - let parse_t = () => { - return parse_f_aux(parse_f()); - }; + let parse_t = () => parse_f_aux(parse_f()); let r = parse_t_aux(parse_t()); return [ r, - Queue.fold(((acc, x) => { - return { - hd: x, - tl: acc - }; - }), /* [] */0, look_ahead) + Queue.fold(((acc, x) => ({ + hd: x, + tl: acc + })), /* [] */0, look_ahead) ]; } @@ -282,13 +272,11 @@ function eq(loc, x, y) { suites.contents = { hd: [ loc + (" id " + String(test_id.contents)), - (() => { - return { - TAG: "Eq", - _0: x, - _1: y - }; - }) + (() => ({ + TAG: "Eq", + _0: x, + _1: y + })) ], tl: suites.contents }; diff --git a/jscomp/test/string_get_set_test.js b/jscomp/test/string_get_set_test.js index 9276cb6f214..9f9eda11496 100644 --- a/jscomp/test/string_get_set_test.js +++ b/jscomp/test/string_get_set_test.js @@ -7,13 +7,11 @@ let Caml_string = require("../../lib/js/caml_string.js"); Mt.from_pair_suites("string_get_set_test.res", { hd: [ "File \"string_get_set_test.res\", line 4, characters 36-43", - (() => { - return { - TAG: "Eq", - _0: Caml_string.get("h", 0), - _1: /* 'h' */104 - }; - }) + (() => ({ + TAG: "Eq", + _0: Caml_string.get("h", 0), + _1: /* 'h' */104 + })) ], tl: /* [] */0 }); diff --git a/jscomp/test/string_runtime_test.js b/jscomp/test/string_runtime_test.js index d2dde8a9b70..05cd2877b03 100644 --- a/jscomp/test/string_runtime_test.js +++ b/jscomp/test/string_runtime_test.js @@ -9,13 +9,11 @@ let Caml_bytes = require("../../lib/js/caml_bytes.js"); let suites_0 = [ "?is_printable", - (param => { - return { - TAG: "Eq", - _0: Test_char.caml_is_printable(/* 'a' */97), - _1: true - }; - }) + (param => ({ + TAG: "Eq", + _0: Test_char.caml_is_printable(/* 'a' */97), + _1: true + })) ]; let suites_1 = { @@ -27,9 +25,7 @@ let suites_1 = { Bytes.fill(b, 0, x, /* 'c' */99); return [ Bytes.to_string(b), - Bytes.unsafe_to_string(Bytes.init(x, (param => { - return /* 'c' */99; - }))) + Bytes.unsafe_to_string(Bytes.init(x, (param => /* 'c' */99))) ]; }), { hd: 1000, diff --git a/jscomp/test/string_set.js b/jscomp/test/string_set.js index 8544f564dfe..2ffde8842a7 100644 --- a/jscomp/test/string_set.js +++ b/jscomp/test/string_set.js @@ -272,9 +272,7 @@ function of_list(l) { } function of_array(l) { - return $$Array.fold_left(((acc, x) => { - return add(x, acc); - }), "Empty", l); + return $$Array.fold_left(((acc, x) => add(x, acc)), "Empty", l); } function invariant(t) { diff --git a/jscomp/test/string_set_test.js b/jscomp/test/string_set_test.js index 053a989154a..f767c0fab0b 100644 --- a/jscomp/test/string_set_test.js +++ b/jscomp/test/string_set_test.js @@ -17,13 +17,11 @@ function eq(loc, x, y) { suites.contents = { hd: [ loc + (" id " + String(test_id.contents)), - (() => { - return { - TAG: "Eq", - _0: x, - _1: y - }; - }) + (() => ({ + TAG: "Eq", + _0: x, + _1: y + })) ], tl: suites.contents }; diff --git a/jscomp/test/string_test.js b/jscomp/test/string_test.js index ce4db3e398b..d0a5bc55a9b 100644 --- a/jscomp/test/string_test.js +++ b/jscomp/test/string_test.js @@ -125,242 +125,204 @@ function xsplit(delim, s) { } function string_of_chars(x) { - let xs = List.map((prim => { - return String.fromCharCode(prim); - }), x); + let xs = List.map((prim => String.fromCharCode(prim)), x); return $$Array.of_list(xs).join(""); } Mt.from_pair_suites("String_test", { hd: [ "mutliple switch", - (() => { - return { - TAG: "Eq", - _0: 9, - _1: ff("4") - }; - }) + (() => ({ + TAG: "Eq", + _0: 9, + _1: ff("4") + })) ], tl: { hd: [ "int switch", - (() => { - return { - TAG: "Eq", - _0: 9, - _1: gg(4) - }; - }) + (() => ({ + TAG: "Eq", + _0: 9, + _1: gg(4) + })) ], tl: { hd: [ "escape_normal", - (() => { - return { - TAG: "Eq", - _0: "haha", - _1: $$String.escaped("haha") - }; - }) + (() => ({ + TAG: "Eq", + _0: "haha", + _1: $$String.escaped("haha") + })) ], tl: { hd: [ "escape_bytes", - (() => { - return { - TAG: "Eq", - _0: Bytes.of_string("haha"), - _1: Bytes.escaped(Bytes.of_string("haha")) - }; - }) + (() => ({ + TAG: "Eq", + _0: Bytes.of_string("haha"), + _1: Bytes.escaped(Bytes.of_string("haha")) + })) ], tl: { hd: [ "escape_quote", - (() => { - return { - TAG: "Eq", - _0: "\\\"\\\"", - _1: $$String.escaped("\"\"") - }; - }) + (() => ({ + TAG: "Eq", + _0: "\\\"\\\"", + _1: $$String.escaped("\"\"") + })) ], tl: { hd: [ "rev_split_by_char", - (() => { - return { - TAG: "Eq", - _0: { - hd: "", + (() => ({ + TAG: "Eq", + _0: { + hd: "", + tl: { + hd: "bbbb", tl: { hd: "bbbb", - tl: { - hd: "bbbb", - tl: /* [] */0 - } + tl: /* [] */0 } - }, - _1: rev_split_by_char(/* 'a' */97, "bbbbabbbba") - }; - }) + } + }, + _1: rev_split_by_char(/* 'a' */97, "bbbbabbbba") + })) ], tl: { hd: [ "File \"string_test.res\", line 86, characters 5-12", - (() => { - return { - TAG: "Eq", - _0: { - hd: "aaaa", - tl: /* [] */0 - }, - _1: rev_split_by_char(/* ',' */44, "aaaa") - }; - }) + (() => ({ + TAG: "Eq", + _0: { + hd: "aaaa", + tl: /* [] */0 + }, + _1: rev_split_by_char(/* ',' */44, "aaaa") + })) ], tl: { hd: [ "xsplit", - (() => { - return { - TAG: "Eq", - _0: { - hd: "a", + (() => ({ + TAG: "Eq", + _0: { + hd: "a", + tl: { + hd: "b", tl: { - hd: "b", - tl: { - hd: "c", - tl: /* [] */0 - } + hd: "c", + tl: /* [] */0 } - }, - _1: xsplit(/* '.' */46, "a.b.c") - }; - }) + } + }, + _1: xsplit(/* '.' */46, "a.b.c") + })) ], tl: { hd: [ "split_empty", - (() => { - return { - TAG: "Eq", - _0: /* [] */0, - _1: Ext_string_test.split(undefined, "", /* '_' */95) - }; - }) + (() => ({ + TAG: "Eq", + _0: /* [] */0, + _1: Ext_string_test.split(undefined, "", /* '_' */95) + })) ], tl: { hd: [ "split_empty2", - (() => { - return { - TAG: "Eq", - _0: { - hd: "test_unsafe_obj_ffi_ppx.cmi", - tl: /* [] */0 - }, - _1: Ext_string_test.split(false, " test_unsafe_obj_ffi_ppx.cmi", /* ' ' */32) - }; - }) + (() => ({ + TAG: "Eq", + _0: { + hd: "test_unsafe_obj_ffi_ppx.cmi", + tl: /* [] */0 + }, + _1: Ext_string_test.split(false, " test_unsafe_obj_ffi_ppx.cmi", /* ' ' */32) + })) ], tl: { hd: [ "rfind", - (() => { - return { - TAG: "Eq", - _0: 7, - _1: Ext_string_test.rfind("__", "__index__js") - }; - }) + (() => ({ + TAG: "Eq", + _0: 7, + _1: Ext_string_test.rfind("__", "__index__js") + })) ], tl: { hd: [ "rfind_2", - (() => { - return { - TAG: "Eq", - _0: 0, - _1: Ext_string_test.rfind("__", "__index_js") - }; - }) + (() => ({ + TAG: "Eq", + _0: 0, + _1: Ext_string_test.rfind("__", "__index_js") + })) ], tl: { hd: [ "rfind_3", - (() => { - return { - TAG: "Eq", - _0: -1, - _1: Ext_string_test.rfind("__", "_index_js") - }; - }) + (() => ({ + TAG: "Eq", + _0: -1, + _1: Ext_string_test.rfind("__", "_index_js") + })) ], tl: { hd: [ "find", - (() => { - return { - TAG: "Eq", - _0: 0, - _1: Ext_string_test.find(undefined, "__", "__index__js") - }; - }) + (() => ({ + TAG: "Eq", + _0: 0, + _1: Ext_string_test.find(undefined, "__", "__index__js") + })) ], tl: { hd: [ "find_2", - (() => { - return { - TAG: "Eq", - _0: 6, - _1: Ext_string_test.find(undefined, "__", "_index__js") - }; - }) + (() => ({ + TAG: "Eq", + _0: 6, + _1: Ext_string_test.find(undefined, "__", "_index__js") + })) ], tl: { hd: [ "find_3", - (() => { - return { - TAG: "Eq", - _0: -1, - _1: Ext_string_test.find(undefined, "__", "_index_js") - }; - }) + (() => ({ + TAG: "Eq", + _0: -1, + _1: Ext_string_test.find(undefined, "__", "_index_js") + })) ], tl: { hd: [ "of_char", - (() => { - return { - TAG: "Eq", - _0: String.fromCharCode(/* '0' */48), - _1: "0" - }; - }) + (() => ({ + TAG: "Eq", + _0: String.fromCharCode(/* '0' */48), + _1: "0" + })) ], tl: { hd: [ "of_chars", - (() => { - return { - TAG: "Eq", - _0: string_of_chars({ - hd: /* '0' */48, + (() => ({ + TAG: "Eq", + _0: string_of_chars({ + hd: /* '0' */48, + tl: { + hd: /* '1' */49, tl: { - hd: /* '1' */49, - tl: { - hd: /* '2' */50, - tl: /* [] */0 - } + hd: /* '2' */50, + tl: /* [] */0 } - }), - _1: "012" - }; - }) + } + }), + _1: "012" + })) ], tl: /* [] */0 } diff --git a/jscomp/test/string_unicode_test.js b/jscomp/test/string_unicode_test.js index a39d67f38cf..f3f6683e25f 100644 --- a/jscomp/test/string_unicode_test.js +++ b/jscomp/test/string_unicode_test.js @@ -16,13 +16,11 @@ function eq(loc, x, y) { suites.contents = { hd: [ loc + (" id " + String(test_id.contents)), - (() => { - return { - TAG: "Eq", - _0: x, - _1: y - }; - }) + (() => ({ + TAG: "Eq", + _0: x, + _1: y + })) ], tl: suites.contents }; diff --git a/jscomp/test/switch_case_test.js b/jscomp/test/switch_case_test.js index 0d7cbfa6ac3..a0eafaf70ef 100644 --- a/jscomp/test/switch_case_test.js +++ b/jscomp/test/switch_case_test.js @@ -16,13 +16,11 @@ function eq(loc, x, y) { suites.contents = { hd: [ loc + (" id " + String(test_id.contents)), - (() => { - return { - TAG: "Eq", - _0: x, - _1: y - }; - }) + (() => ({ + TAG: "Eq", + _0: x, + _1: y + })) ], tl: suites.contents }; diff --git a/jscomp/test/tagged_template_test.js b/jscomp/test/tagged_template_test.js index 3079326d5cd..fa694368b41 100644 --- a/jscomp/test/tagged_template_test.js +++ b/jscomp/test/tagged_template_test.js @@ -44,68 +44,56 @@ let res = foo([ Mt.from_pair_suites("tagged templates", { hd: [ "with externals, it should return a string with the correct interpolations", - (() => { - return { - TAG: "Eq", - _0: query, - _1: "SELECT * FROM 'users' WHERE id = '5'" - }; - }) + (() => ({ + TAG: "Eq", + _0: query, + _1: "SELECT * FROM 'users' WHERE id = '5'" + })) ], tl: { hd: [ "with module scoped externals, it should also return a string with the correct interpolations", - (() => { - return { - TAG: "Eq", - _0: queryWithModule, - _1: "SELECT * FROM 'users' WHERE id = '5'" - }; - }) + (() => ({ + TAG: "Eq", + _0: queryWithModule, + _1: "SELECT * FROM 'users' WHERE id = '5'" + })) ], tl: { hd: [ "with externals, it should return the result of the function", - (() => { - return { - TAG: "Eq", - _0: length, - _1: 52 - }; - }) + (() => ({ + TAG: "Eq", + _0: length, + _1: 52 + })) ], tl: { hd: [ "with rescript function, it should return a string with the correct encoding and interpolations", - (() => { - return { - TAG: "Eq", - _0: res, - _1: "| 5 × 10 = 50 |" - }; - }) + (() => ({ + TAG: "Eq", + _0: res, + _1: "| 5 × 10 = 50 |" + })) ], tl: { hd: [ "a template literal tagged with json should generate a regular string interpolation for now", - (() => { - return { - TAG: "Eq", - _0: "some random " + "string", - _1: "some random string" - }; - }) + (() => ({ + TAG: "Eq", + _0: "some random " + "string", + _1: "some random string" + })) ], tl: { hd: [ "a regular string interpolation should continue working", - (() => { - return { - TAG: "Eq", - _0: "some random string interpolation", - _1: "some random string interpolation" - }; - }) + (() => ({ + TAG: "Eq", + _0: "some random string interpolation", + _1: "some random string interpolation" + })) ], tl: /* [] */0 } diff --git a/jscomp/test/tailcall_inline_test.js b/jscomp/test/tailcall_inline_test.js index 470787b1165..cd87f5f3b94 100644 --- a/jscomp/test/tailcall_inline_test.js +++ b/jscomp/test/tailcall_inline_test.js @@ -27,49 +27,45 @@ function f() { let suites_0 = [ "acc", - (param => { - return { - TAG: "Eq", - _0: f(), - _1: [ - 0, - 1, - 3, - 6, - 10, - 15, - 21, - 28, - 36, - 45 - ] - }; - }) + (param => ({ + TAG: "Eq", + _0: f(), + _1: [ + 0, + 1, + 3, + 6, + 10, + 15, + 21, + 28, + 36, + 45 + ] + })) ]; let suites_1 = { hd: [ "array_to_list", - (param => { - return { - TAG: "Eq", - _0: { - hd: 1, + (param => ({ + TAG: "Eq", + _0: { + hd: 1, + tl: { + hd: 2, tl: { - hd: 2, - tl: { - hd: 3, - tl: /* [] */0 - } + hd: 3, + tl: /* [] */0 } - }, - _1: $$Array.to_list([ - 1, - 2, - 3 - ]) - }; - }) + } + }, + _1: $$Array.to_list([ + 1, + 2, + 3 + ]) + })) ], tl: /* [] */0 }; diff --git a/jscomp/test/test_closure.js b/jscomp/test/test_closure.js index c2f5f8fe07e..6a794c4d6e8 100644 --- a/jscomp/test/test_closure.js +++ b/jscomp/test/test_closure.js @@ -9,9 +9,7 @@ let v = { }; function f() { - let arr = Caml_array.make(10, (param => { - - })); + let arr = Caml_array.make(10, (param => {})); for (let i = 0; i <= 9; ++i) { Caml_array.set(arr, i, (param => { v.contents = v.contents + i | 0; @@ -22,9 +20,7 @@ function f() { let u = f(); -$$Array.iter((x => { - x(); -}), u); +$$Array.iter((x => x()), u); if (v.contents !== 45) { throw new Error("Assert_failure", { diff --git a/jscomp/test/test_cps.js b/jscomp/test/test_cps.js index 704aae39b74..4debc9c34fa 100644 --- a/jscomp/test/test_cps.js +++ b/jscomp/test/test_cps.js @@ -20,20 +20,14 @@ function f(_n, _acc) { } function test_closure() { - let arr = Caml_array.make(6, (x => { - return x; - })); + let arr = Caml_array.make(6, (x => x)); for (let i = 0; i <= 6; ++i) { - Caml_array.set(arr, i, (param => { - return i; - })); + Caml_array.set(arr, i, (param => i)); } return arr; } -f(10, (() => { - -})); +f(10, (() => {})); exports.f = f; exports.test_closure = test_closure; diff --git a/jscomp/test/test_demo.js b/jscomp/test/test_demo.js index cf2aa94e1ed..f3100bae74f 100644 --- a/jscomp/test/test_demo.js +++ b/jscomp/test/test_demo.js @@ -45,16 +45,12 @@ function f(x, y, z) { function g(x, y) { let u = x + y | 0; - return z => { - return u + z | 0; - }; + return z => u + z | 0; } function g1(x, y) { let u = x + y | 0; - return (xx, yy) => { - return (xx + yy | 0) + u | 0; - }; + return (xx, yy) => (xx + yy | 0) + u | 0; } let u = 8; diff --git a/jscomp/test/test_for_loop.js b/jscomp/test/test_for_loop.js index 18e017d4fe2..3355b631f5d 100644 --- a/jscomp/test/test_for_loop.js +++ b/jscomp/test/test_for_loop.js @@ -20,20 +20,14 @@ function for_3(x) { let v = { contents: 0 }; - let arr = $$Array.map((param => { - return () => { - - }; - }), x); + let arr = $$Array.map((param => ((() => {}))), x); for (let i = 0, i_finish = x.length; i <= i_finish; ++i) { let j = (i << 1); Caml_array.set(arr, i, (() => { v.contents = v.contents + j | 0; })); } - $$Array.iter((x => { - x(); - }), arr); + $$Array.iter((x => x()), arr); return v.contents; } @@ -41,11 +35,7 @@ function for_4(x) { let v = { contents: 0 }; - let arr = $$Array.map((param => { - return () => { - - }; - }), x); + let arr = $$Array.map((param => ((() => {}))), x); for (let i = 0, i_finish = x.length; i <= i_finish; ++i) { let j = (i << 1); let k = (j << 1); @@ -53,9 +43,7 @@ function for_4(x) { v.contents = v.contents + k | 0; })); } - $$Array.iter((x => { - x(); - }), arr); + $$Array.iter((x => x()), arr); return v.contents; } @@ -63,20 +51,14 @@ function for_5(x, u) { let v = { contents: 0 }; - let arr = $$Array.map((param => { - return () => { - - }; - }), x); + let arr = $$Array.map((param => ((() => {}))), x); for (let i = 0, i_finish = x.length; i <= i_finish; ++i) { let k = Math.imul((u << 1), u); Caml_array.set(arr, i, (() => { v.contents = v.contents + k | 0; })); } - $$Array.iter((x => { - x(); - }), arr); + $$Array.iter((x => x()), arr); return v.contents; } @@ -84,11 +66,7 @@ function for_6(x, u) { let v = { contents: 0 }; - let arr = $$Array.map((param => { - return () => { - - }; - }), x); + let arr = $$Array.map((param => ((() => {}))), x); let v4 = { contents: 0 }; @@ -110,9 +88,7 @@ function for_6(x, u) { })); } } - $$Array.iter((x => { - x(); - }), arr); + $$Array.iter((x => x()), arr); return v.contents; } diff --git a/jscomp/test/test_google_closure.js b/jscomp/test/test_google_closure.js index 6e7c8049ffb..a06184cbe54 100644 --- a/jscomp/test/test_google_closure.js +++ b/jscomp/test/test_google_closure.js @@ -9,9 +9,7 @@ function f(a, b, param) { } function f2(a) { - return extra => { - return a + 1 | 0; - }; + return extra => a + 1 | 0; } let a = String(3); @@ -22,14 +20,10 @@ function f3(extra) { let b = f3(2); -let arr = $$Array.init(2, (param => { - return 0; -})); +let arr = $$Array.init(2, (param => 0)); for (let i = 0; i <= 1; ++i) { - let f3$1 = extra => { - return i + 1 | 0; - }; + let f3$1 = extra => i + 1 | 0; Caml_array.set(arr, i, f3$1(2)); } diff --git a/jscomp/test/test_int_map_find.js b/jscomp/test/test_int_map_find.js index c535c747601..677c695320c 100644 --- a/jscomp/test/test_int_map_find.js +++ b/jscomp/test/test_int_map_find.js @@ -138,9 +138,7 @@ function add(x, data, param) { } } -List.fold_left(((acc, param) => { - return add(param[0], param[1], acc); -}), "Empty", { +List.fold_left(((acc, param) => add(param[0], param[1], acc)), "Empty", { hd: [ 10, /* 'a' */97 diff --git a/jscomp/test/test_react.js b/jscomp/test/test_react.js index 4d77a56a6a6..36e8789b47d 100644 --- a/jscomp/test/test_react.js +++ b/jscomp/test/test_react.js @@ -11,11 +11,9 @@ let ReactDom = require("react-dom"); console.log(32); ReactDom.render(React.createClass({ - render: (() => { - return React.DOM.div({ - alt: "pic" - }, React.DOM.h1(undefined, "hello react"), React.DOM.h2(undefined, "type safe!"), React.DOM.h3(undefined, "type safe!")); - }) + render: (() => React.DOM.div({ + alt: "pic" + }, React.DOM.h1(undefined, "hello react"), React.DOM.h2(undefined, "type safe!"), React.DOM.h3(undefined, "type safe!"))) }), document.getElementById("hi")); function f() { diff --git a/jscomp/test/test_set.js b/jscomp/test/test_set.js index 96cb62d115d..ff3dca7cfa1 100644 --- a/jscomp/test/test_set.js +++ b/jscomp/test/test_set.js @@ -109,15 +109,13 @@ function Make(Ord) { return bal(l, v, add(x, r)); } }; - let singleton = x => { - return { - TAG: "Node", - _0: "Empty", - _1: x, - _2: "Empty", - _3: 1 - }; - }; + let singleton = x => ({ + TAG: "Node", + _0: "Empty", + _1: x, + _2: "Empty", + _3: 1 + }); let add_min_element = (v, x) => { if (typeof x !== "object") { return singleton(v); @@ -390,12 +388,8 @@ function Make(Ord) { continue; }; }; - let compare = (s1, s2) => { - return compare_aux(cons_enum(s1, "End"), cons_enum(s2, "End")); - }; - let equal = (s1, s2) => { - return compare(s1, s2) === 0; - }; + let compare = (s1, s2) => compare_aux(cons_enum(s1, "End"), cons_enum(s2, "End")); + let equal = (s1, s2) => compare(s1, s2) === 0; let subset = (_s1, _s2) => { while (true) { let s2 = _s2; @@ -565,9 +559,7 @@ function Make(Ord) { continue; }; }; - let elements = s => { - return elements_aux(/* [] */0, s); - }; + let elements = s => elements_aux(/* [] */0, s); let find = (x, _x_) => { while (true) { let x_ = _x_; diff --git a/jscomp/test/test_while_closure.js b/jscomp/test/test_while_closure.js index 82be816ae37..1662d6d3f05 100644 --- a/jscomp/test/test_while_closure.js +++ b/jscomp/test/test_while_closure.js @@ -8,9 +8,7 @@ let v = { contents: 0 }; -let arr = Caml_array.make(10, (() => { - -})); +let arr = Caml_array.make(10, (() => {})); function f() { let n = 0; @@ -25,9 +23,7 @@ function f() { f(); -$$Array.iter((x => { - x(); -}), arr); +$$Array.iter((x => x()), arr); console.log(String(v.contents)); diff --git a/jscomp/test/test_zero_nullable.js b/jscomp/test/test_zero_nullable.js index e5e03244a06..ceef20a2c9e 100644 --- a/jscomp/test/test_zero_nullable.js +++ b/jscomp/test/test_zero_nullable.js @@ -17,13 +17,11 @@ function eq(loc, x, y) { suites.contents = { hd: [ loc + (" id " + String(test_id.contents)), - (() => { - return { - TAG: "Eq", - _0: x, - _1: y - }; - }) + (() => ({ + TAG: "Eq", + _0: x, + _1: y + })) ], tl: suites.contents }; diff --git a/jscomp/test/ticker.js b/jscomp/test/ticker.js index 74ba62dbc01..26c0d269cd7 100644 --- a/jscomp/test/ticker.js +++ b/jscomp/test/ticker.js @@ -80,9 +80,7 @@ function string_of_rank(x) { } function find_ticker_by_name(all_tickers, ticker) { - return List.find((param => { - return param.ticker_name === ticker; - }), all_tickers); + return List.find((param => param.ticker_name === ticker), all_tickers); } function print_all_composite(all_tickers) { diff --git a/jscomp/test/to_string_test.js b/jscomp/test/to_string_test.js index f7b21692b88..d2f9631c420 100644 --- a/jscomp/test/to_string_test.js +++ b/jscomp/test/to_string_test.js @@ -13,24 +13,20 @@ function f(v) { Mt.from_pair_suites("To_string_test", { hd: [ "File \"to_string_test.res\", line 6, characters 8-15", - (() => { - return { - TAG: "Eq", - _0: Pervasives.string_of_float(Pervasives.infinity), - _1: "inf" - }; - }) + (() => ({ + TAG: "Eq", + _0: Pervasives.string_of_float(Pervasives.infinity), + _1: "inf" + })) ], tl: { hd: [ "File \"to_string_test.res\", line 6, characters 49-56", - (() => { - return { - TAG: "Eq", - _0: Pervasives.string_of_float(Pervasives.neg_infinity), - _1: "-inf" - }; - }) + (() => ({ + TAG: "Eq", + _0: Pervasives.string_of_float(Pervasives.neg_infinity), + _1: "-inf" + })) ], tl: /* [] */0 } diff --git a/jscomp/test/topsort_test.js b/jscomp/test/topsort_test.js index d947170a4eb..abad6b818b6 100644 --- a/jscomp/test/topsort_test.js +++ b/jscomp/test/topsort_test.js @@ -281,15 +281,11 @@ function dfs3(nodes, graph) { hd: node, tl: visited.contents }; - return List.iter((x => { - aux(x, graph); - }), nexts(node, graph)); + return List.iter((x => aux(x, graph)), nexts(node, graph)); } }; - List.iter((node => { - aux(node, graph); - }), nodes); + List.iter((node => aux(node, graph)), nodes); return List.rev(visited.contents); } @@ -420,9 +416,7 @@ function unsafe_topsort(graph) { tl: visited.contents }; }; - List.iter((param => { - sort_node(param[0]); - }), graph); + List.iter((param => sort_node(param[0])), graph); return visited.contents; } @@ -1496,11 +1490,7 @@ function pathsort(graph) { } ]; }; - let sort_nodes = (path, nodes) => { - List.iter((node => { - sort_node(path, node); - }), nodes); - }; + let sort_nodes = (path, nodes) => List.iter((node => sort_node(path, node)), nodes); let sort_node = (path, node) => { if (!List.mem(node, visited.contents)) { sort_nodes($plus$great(node, path), nexts(node, graph)); @@ -1512,9 +1502,7 @@ function pathsort(graph) { } }; - List.iter((param => { - sort_node(empty_path, param[0]); - }), graph); + List.iter((param => sort_node(empty_path, param[0])), graph); return visited.contents; } diff --git a/jscomp/test/tramp_fib.js b/jscomp/test/tramp_fib.js index 727a4ad150e..ed6a66445ca 100644 --- a/jscomp/test/tramp_fib.js +++ b/jscomp/test/tramp_fib.js @@ -21,23 +21,15 @@ function fib(n, k) { } else { return { TAG: "Suspend", - _0: (() => { - return fib(n - 1 | 0, (v0 => { - return fib(n - 2 | 0, (v1 => { - return k(v0 + v1 | 0); - })); - })); - }) + _0: (() => fib(n - 1 | 0, (v0 => fib(n - 2 | 0, (v1 => k(v0 + v1 | 0)))))) }; } } -let u = fib(10, (x => { - return { - TAG: "Continue", - _0: x - }; -})); +let u = fib(10, (x => ({ + TAG: "Continue", + _0: x +}))); function iter(_bounce) { while (true) { @@ -55,9 +47,7 @@ function isEven(n) { if (n !== 1) { return { TAG: "Suspend", - _0: (() => { - return isOdd(n - 1 | 0); - }) + _0: (() => isOdd(n - 1 | 0)) }; } else { return { diff --git a/jscomp/test/tuple_alloc.js b/jscomp/test/tuple_alloc.js index 7d7ca08a96b..23e9647cd12 100644 --- a/jscomp/test/tuple_alloc.js +++ b/jscomp/test/tuple_alloc.js @@ -39,9 +39,7 @@ function kf(cb, v) { } function ikf(v) { - return kf((prim => { - - }), v); + return kf((prim => {}), v); } exports.v = v; diff --git a/jscomp/test/typeof_test.js b/jscomp/test/typeof_test.js index 4491674f251..592d3f407a7 100644 --- a/jscomp/test/typeof_test.js +++ b/jscomp/test/typeof_test.js @@ -33,141 +33,113 @@ function string_or_number(x) { let suites_0 = [ "int_type", - (param => { - return { - TAG: "Eq", - _0: "number", - _1: "number" - }; - }) + (param => ({ + TAG: "Eq", + _0: "number", + _1: "number" + })) ]; let suites_1 = { hd: [ "string_type", - (param => { - return { - TAG: "Eq", - _0: "string", - _1: "string" - }; - }) + (param => ({ + TAG: "Eq", + _0: "string", + _1: "string" + })) ], tl: { hd: [ "number_gadt_test", - (param => { - return { - TAG: "Eq", - _0: Js_types.test(3, "Number"), - _1: true - }; - }) + (param => ({ + TAG: "Eq", + _0: Js_types.test(3, "Number"), + _1: true + })) ], tl: { hd: [ "boolean_gadt_test", - (param => { - return { - TAG: "Eq", - _0: Js_types.test(true, "Boolean"), - _1: true - }; - }) + (param => ({ + TAG: "Eq", + _0: Js_types.test(true, "Boolean"), + _1: true + })) ], tl: { hd: [ "undefined_gadt_test", - (param => { - return { - TAG: "Eq", - _0: Js_types.test(undefined, "Undefined"), - _1: true - }; - }) + (param => ({ + TAG: "Eq", + _0: Js_types.test(undefined, "Undefined"), + _1: true + })) ], tl: { hd: [ "string_on_number1", - (param => { - return { - TAG: "Eq", - _0: string_or_number("xx"), - _1: true - }; - }) + (param => ({ + TAG: "Eq", + _0: string_or_number("xx"), + _1: true + })) ], tl: { hd: [ "string_on_number2", - (param => { - return { - TAG: "Eq", - _0: string_or_number(3.02), - _1: true - }; - }) + (param => ({ + TAG: "Eq", + _0: string_or_number(3.02), + _1: true + })) ], tl: { hd: [ "string_on_number3", - (param => { - return { - TAG: "Eq", - _0: string_or_number(x => { - return x; - }), - _1: false - }; - }) + (param => ({ + TAG: "Eq", + _0: string_or_number(x => x), + _1: false + })) ], tl: { hd: [ "string_gadt_test", - (param => { - return { - TAG: "Eq", - _0: Js_types.test("3", "String"), - _1: true - }; - }) + (param => ({ + TAG: "Eq", + _0: Js_types.test("3", "String"), + _1: true + })) ], tl: { hd: [ "string_gadt_test_neg", - (param => { - return { - TAG: "Eq", - _0: Js_types.test(3, "String"), - _1: false - }; - }) + (param => ({ + TAG: "Eq", + _0: Js_types.test(3, "String"), + _1: false + })) ], tl: { hd: [ "function_gadt_test", - (param => { - return { - TAG: "Eq", - _0: Js_types.test((x => { - return x; - }), "Function"), - _1: true - }; - }) + (param => ({ + TAG: "Eq", + _0: Js_types.test((x => x), "Function"), + _1: true + })) ], tl: { hd: [ "object_gadt_test", - (param => { - return { - TAG: "Eq", - _0: Js_types.test({ - x: 3 - }, "Object"), - _1: true - }; - }) + (param => ({ + TAG: "Eq", + _0: Js_types.test({ + x: 3 + }, "Object"), + _1: true + })) ], tl: /* [] */0 } diff --git a/jscomp/test/uncurried_cast.js b/jscomp/test/uncurried_cast.js index 0125360513d..d71ffebbaac 100644 --- a/jscomp/test/uncurried_cast.js +++ b/jscomp/test/uncurried_cast.js @@ -37,9 +37,7 @@ let l = Belt_List.map({ hd: 2, tl: /* [] */0 } -}, (x => { - return x + 1 | 0; -})); +}, (x => x + 1 | 0)); function partial(x) { return Belt_List.map({ @@ -51,9 +49,7 @@ function partial(x) { }, x); } -let ll = partial(x => { - return x + 1 | 0; -}); +let ll = partial(x => x + 1 | 0); function withOpts(xOpt, y, zOpt, w) { let x = xOpt !== undefined ? xOpt : 3; @@ -83,9 +79,7 @@ let l$1 = Belt_List.map({ hd: 2, tl: /* [] */0 } -}, (x => { - return x + 1 | 0; -})); +}, (x => x + 1 | 0)); function partial$1(extra) { return Belt_List.map({ @@ -97,9 +91,7 @@ function partial$1(extra) { }, extra); } -let ll$1 = partial$1(x => { - return x + 1 | 0; -}); +let ll$1 = partial$1(x => x + 1 | 0); function withOpts$1(xOpt, y, zOpt, w) { let x = xOpt !== undefined ? xOpt : 3; diff --git a/jscomp/test/uncurry_external_test.js b/jscomp/test/uncurry_external_test.js index aff84062be4..2e657206548 100644 --- a/jscomp/test/uncurry_external_test.js +++ b/jscomp/test/uncurry_external_test.js @@ -16,13 +16,11 @@ function eq(loc, x, y) { suites.contents = { hd: [ loc + (" id " + String(test_id.contents)), - (() => { - return { - TAG: "Eq", - _0: x, - _1: y - }; - }) + (() => ({ + TAG: "Eq", + _0: x, + _1: y + })) ], tl: suites.contents }; diff --git a/jscomp/test/unsafe_ppx_test.js b/jscomp/test/unsafe_ppx_test.js index 0a68dbcf670..41f2ee2083a 100644 --- a/jscomp/test/unsafe_ppx_test.js +++ b/jscomp/test/unsafe_ppx_test.js @@ -26,9 +26,7 @@ function g(a) { regression(a, Pervasives.failwith); regression2(3, 2); regression3(3, 2); - regression4(3, (x => { - return x; - })); + regression4(3, (x => x)); } let max2 = Math.max; @@ -54,46 +52,38 @@ let v = $$test(1, 2); Mt.from_pair_suites("Unsafe_ppx_test", { hd: [ "unsafe_max", - (() => { - return { - TAG: "Eq", - _0: 2, - _1: max(1, 2) - }; - }) + (() => ({ + TAG: "Eq", + _0: 2, + _1: max(1, 2) + })) ], tl: { hd: [ "unsafe_test", - (() => { - return { - TAG: "Eq", - _0: 3, - _1: v - }; - }) + (() => ({ + TAG: "Eq", + _0: 3, + _1: v + })) ], tl: { hd: [ "unsafe_max2", - (() => { - return { - TAG: "Eq", - _0: 2, - _1: Math.max(1, 2) - }; - }) + (() => ({ + TAG: "Eq", + _0: 2, + _1: Math.max(1, 2) + })) ], tl: { hd: [ "ffi_keys", - (() => { - return { - TAG: "Eq", - _0: ["a"], - _1: Ffi_js_test.keys({a : 3}) - }; - }) + (() => ({ + TAG: "Eq", + _0: ["a"], + _1: Ffi_js_test.keys({a : 3}) + })) ], tl: /* [] */0 } diff --git a/jscomp/test/update_record_test.js b/jscomp/test/update_record_test.js index e5b00c5971b..f5ee68ae629 100644 --- a/jscomp/test/update_record_test.js +++ b/jscomp/test/update_record_test.js @@ -21,13 +21,11 @@ function eq(loc, x, y) { suites.contents = { hd: [ loc + (" id " + String(test_id.contents)), - (() => { - return { - TAG: "Eq", - _0: x, - _1: y - }; - }) + (() => ({ + TAG: "Eq", + _0: x, + _1: y + })) ], tl: suites.contents }; diff --git a/jscomp/test/variant.js b/jscomp/test/variant.js index 78b47ebe827..d184ff60617 100644 --- a/jscomp/test/variant.js +++ b/jscomp/test/variant.js @@ -63,9 +63,7 @@ let Path = { }; function Make(M) { - let find = x => { - - }; + let find = x => {}; return { find: find }; diff --git a/lib/es6/arg.js b/lib/es6/arg.js index 58a61ce5b54..4562b3b8a55 100644 --- a/lib/es6/arg.js +++ b/lib/es6/arg.js @@ -50,9 +50,7 @@ function split(s) { function make_symlist(prefix, sep, suffix, l) { if (l) { - return List.fold_left(((x, y) => { - return x + (sep + y); - }), prefix + l.hd, l.tl) + suffix; + return List.fold_left(((x, y) => x + (sep + y)), prefix + l.hd, l.tl) + suffix; } else { return ""; } diff --git a/lib/es6/belt_Array.js b/lib/es6/belt_Array.js index 02adc733df1..c3d940cbf5c 100644 --- a/lib/es6/belt_Array.js +++ b/lib/es6/belt_Array.js @@ -59,9 +59,7 @@ function swapUnsafe(xs, i, j) { function shuffleInPlace(xs) { let len = xs.length; - let random_int = (min, max) => { - return Math.floor(Math.random() * (max - min | 0)) + min | 0; - }; + let random_int = (min, max) => Math.floor(Math.random() * (max - min | 0)) + min | 0; for (let i = 0; i < len; ++i) { swapUnsafe(xs, i, random_int(i, len)); } diff --git a/lib/es6/belt_MapDict.js b/lib/es6/belt_MapDict.js index d091d6f4021..4366e9de421 100644 --- a/lib/es6/belt_MapDict.js +++ b/lib/es6/belt_MapDict.js @@ -196,17 +196,13 @@ function split(n, x, cmp) { function merge(s1, s2, f, cmp) { if (s1 === undefined) { if (s2 !== undefined) { - return Belt_internalAVLtree.keepMap(s2, ((k, v) => { - return f(k, undefined, Caml_option.some(v)); - })); + return Belt_internalAVLtree.keepMap(s2, ((k, v) => f(k, undefined, Caml_option.some(v)))); } else { return; } } if (s2 === undefined) { - return Belt_internalAVLtree.keepMap(s1, ((k, v) => { - return f(k, Caml_option.some(v), undefined); - })); + return Belt_internalAVLtree.keepMap(s1, ((k, v) => f(k, Caml_option.some(v), undefined))); } if (s1.h >= s2.h) { let v1 = s1.k; diff --git a/lib/es6/belt_internalAVLset.js b/lib/es6/belt_internalAVLset.js index af5ff2f2254..49a2c83a99f 100644 --- a/lib/es6/belt_internalAVLset.js +++ b/lib/es6/belt_internalAVLset.js @@ -827,9 +827,7 @@ function fromArray(xs, cmp) { if (len === 0) { return; } - let next = Belt_SortArray.strictlySortedLength(xs, ((x, y) => { - return cmp(x, y) < 0; - })); + let next = Belt_SortArray.strictlySortedLength(xs, ((x, y) => cmp(x, y) < 0)); let result; if (next >= 0) { result = fromSortedArrayAux(xs, 0, next); diff --git a/lib/es6/belt_internalAVLtree.js b/lib/es6/belt_internalAVLtree.js index b1b434fe8fd..cdf3edeb9ee 100644 --- a/lib/es6/belt_internalAVLtree.js +++ b/lib/es6/belt_internalAVLtree.js @@ -1001,9 +1001,7 @@ function fromArray(xs, cmp) { if (len === 0) { return; } - let next = Belt_SortArray.strictlySortedLength(xs, ((param, param$1) => { - return cmp(param[0], param$1[0]) < 0; - })); + let next = Belt_SortArray.strictlySortedLength(xs, ((param, param$1) => cmp(param[0], param$1[0]) < 0)); let result; if (next >= 0) { result = fromSortedArrayAux(xs, 0, next); diff --git a/lib/es6/belt_internalBuckets.js b/lib/es6/belt_internalBuckets.js index 72ebdc5eeda..498b0963e55 100644 --- a/lib/es6/belt_internalBuckets.js +++ b/lib/es6/belt_internalBuckets.js @@ -120,9 +120,7 @@ function getMaxBucketLength(h) { function getBucketHistogram(h) { let mbl = getMaxBucketLength(h); - let histo = Belt_Array.makeBy(mbl + 1 | 0, (param => { - return 0; - })); + let histo = Belt_Array.makeBy(mbl + 1 | 0, (param => 0)); Belt_Array.forEach(h.buckets, (b => { let l = bucketLength(0, b); histo[l] = histo[l] + 1 | 0; @@ -233,24 +231,18 @@ function linear(h, f) { } function keysToArray(h) { - return linear(h, (x => { - return x.key; - })); + return linear(h, (x => x.key)); } function valuesToArray(h) { - return linear(h, (x => { - return x.value; - })); + return linear(h, (x => x.value)); } function toArray(h) { - return linear(h, (x => { - return [ - x.key, - x.value - ]; - })); + return linear(h, (x => [ + x.key, + x.value + ])); } let C; diff --git a/lib/es6/belt_internalMapInt.js b/lib/es6/belt_internalMapInt.js index 05211ebed51..0080d087d61 100644 --- a/lib/es6/belt_internalMapInt.js +++ b/lib/es6/belt_internalMapInt.js @@ -303,9 +303,7 @@ function fromArray(xs) { if (len === 0) { return; } - let next = Belt_SortArray.strictlySortedLength(xs, ((param, param$1) => { - return param[0] < param$1[0]; - })); + let next = Belt_SortArray.strictlySortedLength(xs, ((param, param$1) => param[0] < param$1[0])); let result; if (next >= 0) { result = Belt_internalAVLtree.fromSortedArrayAux(xs, 0, next); diff --git a/lib/es6/belt_internalMapString.js b/lib/es6/belt_internalMapString.js index 474ebdc131e..2fdb3856e1b 100644 --- a/lib/es6/belt_internalMapString.js +++ b/lib/es6/belt_internalMapString.js @@ -303,9 +303,7 @@ function fromArray(xs) { if (len === 0) { return; } - let next = Belt_SortArray.strictlySortedLength(xs, ((param, param$1) => { - return param[0] < param$1[0]; - })); + let next = Belt_SortArray.strictlySortedLength(xs, ((param, param$1) => param[0] < param$1[0])); let result; if (next >= 0) { result = Belt_internalAVLtree.fromSortedArrayAux(xs, 0, next); diff --git a/lib/es6/belt_internalSetBuckets.js b/lib/es6/belt_internalSetBuckets.js index 3142eb3fb85..7971eed6167 100644 --- a/lib/es6/belt_internalSetBuckets.js +++ b/lib/es6/belt_internalSetBuckets.js @@ -146,9 +146,7 @@ function getMaxBucketLength(h) { function getBucketHistogram(h) { let mbl = getMaxBucketLength(h); - let histo = Belt_Array.makeBy(mbl + 1 | 0, (param => { - return 0; - })); + let histo = Belt_Array.makeBy(mbl + 1 | 0, (param => 0)); Belt_Array.forEach(h.buckets, (b => { let l = bucketLength(0, b); histo[l] = histo[l] + 1 | 0; diff --git a/lib/es6/caml_hash.js b/lib/es6/caml_hash.js index e0c70256dd9..fcf71d9eb60 100644 --- a/lib/es6/caml_hash.js +++ b/lib/es6/caml_hash.js @@ -84,9 +84,7 @@ function hash(count, _limit, seed, obj) { ++ size } return size - })(obj$1, (v => { - push_back(queue, v); - })); + })(obj$1, (v => push_back(queue, v))); s = Caml_hash_primitive.hash_mix_int(s, (size$1 << 10) | 0); } } diff --git a/lib/es6/caml_int64.js b/lib/es6/caml_int64.js index 5220aad0486..7e0be85c455 100644 --- a/lib/es6/caml_int64.js +++ b/lib/es6/caml_int64.js @@ -527,9 +527,7 @@ function to_int32(x) { function to_hex(x) { let x_lo = x[1]; let x_hi = x[0]; - let aux = v => { - return (v >>> 0).toString(16); - }; + let aux = v => (v >>> 0).toString(16); if (x_hi === 0 && x_lo === 0) { return "0"; } diff --git a/lib/es6/caml_obj.js b/lib/es6/caml_obj.js index c6cf02bbc8d..9d025bf5178 100644 --- a/lib/es6/caml_obj.js +++ b/lib/es6/caml_obj.js @@ -225,20 +225,16 @@ function aux_obj_compare(a, b) { return; } }; - let do_key_a = key => { - do_key([ - a, - b, - min_key_rhs - ], key); - }; - let do_key_b = key => { - do_key([ - b, - a, - min_key_lhs - ], key); - }; + let do_key_a = key => do_key([ + a, + b, + min_key_rhs + ], key); + let do_key_b = key => do_key([ + b, + a, + min_key_lhs + ], key); for_in(a, do_key_a); for_in(b, do_key_b); let match = min_key_lhs.contents; diff --git a/lib/es6/curry.js b/lib/es6/curry.js index 82fa3891111..793b2d7f9ab 100644 --- a/lib/es6/curry.js +++ b/lib/es6/curry.js @@ -14,9 +14,7 @@ function app(_f, _args) { return f.apply(null, args); } if (d >= 0) { - return x => { - return app(f, args.concat([x])); - }; + return x => app(f, args.concat([x])); } _args = Caml_array.sub(args, arity, -d | 0); _f = f.apply(null, Caml_array.sub(args, 0, arity)); @@ -33,29 +31,17 @@ function _1(o, a0) { case 1 : return o(a0); case 2 : - return param => { - return o(a0, param); - }; + return param => o(a0, param); case 3 : - return (param, param$1) => { - return o(a0, param, param$1); - }; + return (param, param$1) => o(a0, param, param$1); case 4 : - return (param, param$1, param$2) => { - return o(a0, param, param$1, param$2); - }; + return (param, param$1, param$2) => o(a0, param, param$1, param$2); case 5 : - return (param, param$1, param$2, param$3) => { - return o(a0, param, param$1, param$2, param$3); - }; + return (param, param$1, param$2, param$3) => o(a0, param, param$1, param$2, param$3); case 6 : - return (param, param$1, param$2, param$3, param$4) => { - return o(a0, param, param$1, param$2, param$3, param$4); - }; + return (param, param$1, param$2, param$3, param$4) => o(a0, param, param$1, param$2, param$3, param$4); case 7 : - return (param, param$1, param$2, param$3, param$4, param$5) => { - return o(a0, param, param$1, param$2, param$3, param$4, param$5); - }; + return (param, param$1, param$2, param$3, param$4, param$5) => o(a0, param, param$1, param$2, param$3, param$4, param$5); default: return app(o, [a0]); } @@ -67,9 +53,7 @@ function __1(o) { if (arity === 1) { return o; } else { - return a0 => { - return _1(o, a0); - }; + return a0 => _1(o, a0); } } @@ -84,25 +68,15 @@ function _2(o, a0, a1) { case 2 : return o(a0, a1); case 3 : - return param => { - return o(a0, a1, param); - }; + return param => o(a0, a1, param); case 4 : - return (param, param$1) => { - return o(a0, a1, param, param$1); - }; + return (param, param$1) => o(a0, a1, param, param$1); case 5 : - return (param, param$1, param$2) => { - return o(a0, a1, param, param$1, param$2); - }; + return (param, param$1, param$2) => o(a0, a1, param, param$1, param$2); case 6 : - return (param, param$1, param$2, param$3) => { - return o(a0, a1, param, param$1, param$2, param$3); - }; + return (param, param$1, param$2, param$3) => o(a0, a1, param, param$1, param$2, param$3); case 7 : - return (param, param$1, param$2, param$3, param$4) => { - return o(a0, a1, param, param$1, param$2, param$3, param$4); - }; + return (param, param$1, param$2, param$3, param$4) => o(a0, a1, param, param$1, param$2, param$3, param$4); default: return app(o, [ a0, @@ -117,9 +91,7 @@ function __2(o) { if (arity === 2) { return o; } else { - return (a0, a1) => { - return _2(o, a0, a1); - }; + return (a0, a1) => _2(o, a0, a1); } } @@ -139,21 +111,13 @@ function _3(o, a0, a1, a2) { case 3 : return o(a0, a1, a2); case 4 : - return param => { - return o(a0, a1, a2, param); - }; + return param => o(a0, a1, a2, param); case 5 : - return (param, param$1) => { - return o(a0, a1, a2, param, param$1); - }; + return (param, param$1) => o(a0, a1, a2, param, param$1); case 6 : - return (param, param$1, param$2) => { - return o(a0, a1, a2, param, param$1, param$2); - }; + return (param, param$1, param$2) => o(a0, a1, a2, param, param$1, param$2); case 7 : - return (param, param$1, param$2, param$3) => { - return o(a0, a1, a2, param, param$1, param$2, param$3); - }; + return (param, param$1, param$2, param$3) => o(a0, a1, a2, param, param$1, param$2, param$3); default: return app(o, [ a0, @@ -169,9 +133,7 @@ function __3(o) { if (arity === 3) { return o; } else { - return (a0, a1, a2) => { - return _3(o, a0, a1, a2); - }; + return (a0, a1, a2) => _3(o, a0, a1, a2); } } @@ -197,17 +159,11 @@ function _4(o, a0, a1, a2, a3) { case 4 : return o(a0, a1, a2, a3); case 5 : - return param => { - return o(a0, a1, a2, a3, param); - }; + return param => o(a0, a1, a2, a3, param); case 6 : - return (param, param$1) => { - return o(a0, a1, a2, a3, param, param$1); - }; + return (param, param$1) => o(a0, a1, a2, a3, param, param$1); case 7 : - return (param, param$1, param$2) => { - return o(a0, a1, a2, a3, param, param$1, param$2); - }; + return (param, param$1, param$2) => o(a0, a1, a2, a3, param, param$1, param$2); default: return app(o, [ a0, @@ -224,9 +180,7 @@ function __4(o) { if (arity === 4) { return o; } else { - return (a0, a1, a2, a3) => { - return _4(o, a0, a1, a2, a3); - }; + return (a0, a1, a2, a3) => _4(o, a0, a1, a2, a3); } } @@ -259,13 +213,9 @@ function _5(o, a0, a1, a2, a3, a4) { case 5 : return o(a0, a1, a2, a3, a4); case 6 : - return param => { - return o(a0, a1, a2, a3, a4, param); - }; + return param => o(a0, a1, a2, a3, a4, param); case 7 : - return (param, param$1) => { - return o(a0, a1, a2, a3, a4, param, param$1); - }; + return (param, param$1) => o(a0, a1, a2, a3, a4, param, param$1); default: return app(o, [ a0, @@ -283,9 +233,7 @@ function __5(o) { if (arity === 5) { return o; } else { - return (a0, a1, a2, a3, a4) => { - return _5(o, a0, a1, a2, a3, a4); - }; + return (a0, a1, a2, a3, a4) => _5(o, a0, a1, a2, a3, a4); } } @@ -326,9 +274,7 @@ function _6(o, a0, a1, a2, a3, a4, a5) { case 6 : return o(a0, a1, a2, a3, a4, a5); case 7 : - return param => { - return o(a0, a1, a2, a3, a4, a5, param); - }; + return param => o(a0, a1, a2, a3, a4, a5, param); default: return app(o, [ a0, @@ -347,9 +293,7 @@ function __6(o) { if (arity === 6) { return o; } else { - return (a0, a1, a2, a3, a4, a5) => { - return _6(o, a0, a1, a2, a3, a4, a5); - }; + return (a0, a1, a2, a3, a4, a5) => _6(o, a0, a1, a2, a3, a4, a5); } } @@ -417,9 +361,7 @@ function __7(o) { if (arity === 7) { return o; } else { - return (a0, a1, a2, a3, a4, a5, a6) => { - return _7(o, a0, a1, a2, a3, a4, a5, a6); - }; + return (a0, a1, a2, a3, a4, a5, a6) => _7(o, a0, a1, a2, a3, a4, a5, a6); } } @@ -496,9 +438,7 @@ function __8(o) { if (arity === 8) { return o; } else { - return (a0, a1, a2, a3, a4, a5, a6, a7) => { - return _8(o, a0, a1, a2, a3, a4, a5, a6, a7); - }; + return (a0, a1, a2, a3, a4, a5, a6, a7) => _8(o, a0, a1, a2, a3, a4, a5, a6, a7); } } diff --git a/lib/es6/digest.js b/lib/es6/digest.js index 596279934da..1eded13e8a8 100644 --- a/lib/es6/digest.js +++ b/lib/es6/digest.js @@ -97,9 +97,7 @@ function from_hex(s) { } return c - /* '0' */48 | 0; }; - let byte = i => { - return (digit(Caml_string.get(s, i)) << 4) + digit(Caml_string.get(s, i + 1 | 0)) | 0; - }; + let byte = i => (digit(Caml_string.get(s, i)) << 4) + digit(Caml_string.get(s, i + 1 | 0)) | 0; let result = Caml_bytes.create(16); for (let i = 0; i <= 15; ++i) { Caml_bytes.set(result, i, Char.chr(byte((i << 1)))); diff --git a/lib/es6/genlex.js b/lib/es6/genlex.js index 09440345c5e..1a1fc4b0094 100644 --- a/lib/es6/genlex.js +++ b/lib/es6/genlex.js @@ -43,12 +43,10 @@ function get_string() { function make_lexer(keywords) { let kwd_table = Hashtbl.create(undefined, 17); - List.iter((s => { - Hashtbl.add(kwd_table, s, { - TAG: "Kwd", - _0: s - }); - }), keywords); + List.iter((s => Hashtbl.add(kwd_table, s, { + TAG: "Kwd", + _0: s + })), keywords); let ident_or_keyword = id => { try { return Hashtbl.find(kwd_table, id); @@ -659,11 +657,7 @@ function make_lexer(keywords) { } }; }; - return input => { - return Stream.from(_count => { - return next_token(input); - }); - }; + return input => Stream.from(_count => next_token(input)); } export { diff --git a/lib/es6/hashtbl.js b/lib/es6/hashtbl.js index 7945c57bad3..4b074047bb9 100644 --- a/lib/es6/hashtbl.js +++ b/lib/es6/hashtbl.js @@ -38,9 +38,7 @@ function is_randomized() { return randomized.contents; } -let prng = CamlinternalLazy.from_fun(() => { - return Random.State.make_self_init(); -}); +let prng = CamlinternalLazy.from_fun(() => Random.State.make_self_init()); function power_2_above(_x, n) { while (true) { @@ -596,9 +594,7 @@ function bucket_length(_accu, _param) { } function stats(h) { - let mbl = $$Array.fold_left(((m, b) => { - return Caml.int_max(m, bucket_length(0, b)); - }), 0, h.data); + let mbl = $$Array.fold_left(((m, b) => Caml.int_max(m, bucket_length(0, b))), 0, h.data); let histo = Caml_array.make(mbl + 1 | 0, 0); $$Array.iter((b => { let l = bucket_length(0, b); @@ -613,9 +609,7 @@ function stats(h) { } function MakeSeeded(H) { - let key_index = (h, key) => { - return H.hash(h.seed, key) & (h.data.length - 1 | 0); - }; + let key_index = (h, key) => H.hash(h.seed, key) & (h.data.length - 1 | 0); let add = (h, key, data) => { let i = key_index(h, key); let bucket = { @@ -861,9 +855,7 @@ function MakeSeeded(H) { function Make(H) { let equal = H.equal; - let key_index = (h, key) => { - return H.hash(key) & (h.data.length - 1 | 0); - }; + let key_index = (h, key) => H.hash(key) & (h.data.length - 1 | 0); let add = (h, key, data) => { let i = key_index(h, key); let bucket = { @@ -1087,9 +1079,7 @@ function Make(H) { continue; }; }; - let create$1 = sz => { - return create(false, sz); - }; + let create$1 = sz => create(false, sz); return { create: create$1, clear: clear, diff --git a/lib/es6/hashtblLabels.js b/lib/es6/hashtblLabels.js index f52c2197341..3d27d7beaca 100644 --- a/lib/es6/hashtblLabels.js +++ b/lib/es6/hashtblLabels.js @@ -11,21 +11,15 @@ function replace(tbl, key, data) { } function iter(f, tbl) { - Hashtbl.iter(((key, data) => { - f(key, data); - }), tbl); + Hashtbl.iter(((key, data) => f(key, data)), tbl); } function filter_map_inplace(f, tbl) { - Hashtbl.filter_map_inplace(((key, data) => { - return f(key, data); - }), tbl); + Hashtbl.filter_map_inplace(((key, data) => f(key, data)), tbl); } function fold(f, tbl, init) { - return Hashtbl.fold(((key, data, acc) => { - return f(key, data, acc); - }), tbl, init); + return Hashtbl.fold(((key, data, acc) => f(key, data, acc)), tbl, init); } function MakeSeeded(H) { @@ -35,27 +29,11 @@ function MakeSeeded(H) { let iter = include.iter; let filter_map_inplace = include.filter_map_inplace; let fold = include.fold; - let add$1 = (tbl, key, data) => { - add(tbl, key, data); - }; - let replace$1 = (tbl, key, data) => { - replace(tbl, key, data); - }; - let iter$1 = (f, tbl) => { - iter(((key, data) => { - f(key, data); - }), tbl); - }; - let filter_map_inplace$1 = (f, tbl) => { - filter_map_inplace(((key, data) => { - return f(key, data); - }), tbl); - }; - let fold$1 = (f, tbl, init) => { - return fold(((key, data, acc) => { - return f(key, data, acc); - }), tbl, init); - }; + let add$1 = (tbl, key, data) => add(tbl, key, data); + let replace$1 = (tbl, key, data) => replace(tbl, key, data); + let iter$1 = (f, tbl) => iter(((key, data) => f(key, data)), tbl); + let filter_map_inplace$1 = (f, tbl) => filter_map_inplace(((key, data) => f(key, data)), tbl); + let fold$1 = (f, tbl, init) => fold(((key, data, acc) => f(key, data, acc)), tbl, init); return { create: include.create, clear: include.clear, @@ -77,9 +55,7 @@ function MakeSeeded(H) { } function Make(H) { - let hash = (_seed, x) => { - return H.hash(x); - }; + let hash = (_seed, x) => H.hash(x); let H_equal = H.equal; let H$1 = { equal: H_equal, @@ -92,30 +68,12 @@ function Make(H) { let iter = include.iter; let filter_map_inplace = include.filter_map_inplace; let fold = include.fold; - let add$1 = (tbl, key, data) => { - add(tbl, key, data); - }; - let replace$1 = (tbl, key, data) => { - replace(tbl, key, data); - }; - let iter$1 = (f, tbl) => { - iter(((key, data) => { - f(key, data); - }), tbl); - }; - let filter_map_inplace$1 = (f, tbl) => { - filter_map_inplace(((key, data) => { - return f(key, data); - }), tbl); - }; - let fold$1 = (f, tbl, init) => { - return fold(((key, data, acc) => { - return f(key, data, acc); - }), tbl, init); - }; - let create$1 = sz => { - return create(false, sz); - }; + let add$1 = (tbl, key, data) => add(tbl, key, data); + let replace$1 = (tbl, key, data) => replace(tbl, key, data); + let iter$1 = (f, tbl) => iter(((key, data) => f(key, data)), tbl); + let filter_map_inplace$1 = (f, tbl) => filter_map_inplace(((key, data) => f(key, data)), tbl); + let fold$1 = (f, tbl, init) => fold(((key, data, acc) => f(key, data, acc)), tbl, init); + let create$1 = sz => create(false, sz); return { create: create$1, clear: include.clear, diff --git a/lib/es6/lazy.js b/lib/es6/lazy.js index 4ff76a62bd5..e858dde9b27 100644 --- a/lib/es6/lazy.js +++ b/lib/es6/lazy.js @@ -3,9 +3,7 @@ import * as CamlinternalLazy from "./camlinternalLazy.js"; function from_fun(f) { - return CamlinternalLazy.from_fun(() => { - return f(); - }); + return CamlinternalLazy.from_fun(() => f()); } let from_val = CamlinternalLazy.from_val; diff --git a/lib/es6/map.js b/lib/es6/map.js index a5c7435b600..2052415d992 100644 --- a/lib/es6/map.js +++ b/lib/es6/map.js @@ -22,16 +22,14 @@ function Make(funarg) { h: hl >= hr ? hl + 1 | 0 : hr + 1 | 0 }; }; - let singleton = (x, d) => { - return { - TAG: "Node", - l: "Empty", - v: x, - d: d, - r: "Empty", - h: 1 - }; - }; + let singleton = (x, d) => ({ + TAG: "Node", + l: "Empty", + v: x, + d: d, + r: "Empty", + h: 1 + }); let bal = (l, x, d, r) => { let hl; hl = typeof l !== "object" ? 0 : l.h; @@ -914,9 +912,7 @@ function Make(funarg) { continue; }; }; - let bindings = s => { - return bindings_aux(/* [] */0, s); - }; + let bindings = s => bindings_aux(/* [] */0, s); return { empty: "Empty", is_empty: is_empty, diff --git a/lib/es6/mapLabels.js b/lib/es6/mapLabels.js index 356c307e1ef..c791c85f85a 100644 --- a/lib/es6/mapLabels.js +++ b/lib/es6/mapLabels.js @@ -22,16 +22,14 @@ function Make(Ord) { h: hl >= hr ? hl + 1 | 0 : hr + 1 | 0 }; }; - let singleton = (x, d) => { - return { - TAG: "Node", - l: "Empty", - v: x, - d: d, - r: "Empty", - h: 1 - }; - }; + let singleton = (x, d) => ({ + TAG: "Node", + l: "Empty", + v: x, + d: d, + r: "Empty", + h: 1 + }); let bal = (l, x, d, r) => { let hl; hl = typeof l !== "object" ? 0 : l.h; @@ -914,9 +912,7 @@ function Make(Ord) { continue; }; }; - let bindings = s => { - return bindings_aux(/* [] */0, s); - }; + let bindings = s => bindings_aux(/* [] */0, s); return { height: height, create: create, diff --git a/lib/es6/moreLabels.js b/lib/es6/moreLabels.js index d88d487e95f..dbddb144109 100644 --- a/lib/es6/moreLabels.js +++ b/lib/es6/moreLabels.js @@ -52,16 +52,14 @@ let $$Map = { h: hl >= hr ? hl + 1 | 0 : hr + 1 | 0 }; }; - let singleton = (x, d) => { - return { - TAG: "Node", - l: "Empty", - v: x, - d: d, - r: "Empty", - h: 1 - }; - }; + let singleton = (x, d) => ({ + TAG: "Node", + l: "Empty", + v: x, + d: d, + r: "Empty", + h: 1 + }); let bal = (l, x, d, r) => { let hl; hl = typeof l !== "object" ? 0 : l.h; @@ -944,9 +942,7 @@ let $$Map = { continue; }; }; - let bindings = s => { - return bindings_aux(/* [] */0, s); - }; + let bindings = s => bindings_aux(/* [] */0, s); return { empty: "Empty", is_empty: is_empty, @@ -1103,15 +1099,13 @@ let $$Set = { return bal(l, v, rr); } }; - let singleton = x => { - return { - TAG: "Node", - l: "Empty", - v: x, - r: "Empty", - h: 1 - }; - }; + let singleton = x => ({ + TAG: "Node", + l: "Empty", + v: x, + r: "Empty", + h: 1 + }); let add_min_element = (x, param) => { if (typeof param !== "object") { return singleton(x); @@ -1422,12 +1416,8 @@ let $$Set = { continue; }; }; - let compare = (s1, s2) => { - return compare_aux(cons_enum(s1, "End"), cons_enum(s2, "End")); - }; - let equal = (s1, s2) => { - return compare(s1, s2) === 0; - }; + let compare = (s1, s2) => compare_aux(cons_enum(s1, "End"), cons_enum(s2, "End")); + let equal = (s1, s2) => compare(s1, s2) === 0; let subset = (_s1, _s2) => { while (true) { let s2 = _s2; @@ -1603,9 +1593,7 @@ let $$Set = { continue; }; }; - let elements = s => { - return elements_aux(/* [] */0, s); - }; + let elements = s => elements_aux(/* [] */0, s); let find = (x, _param) => { while (true) { let param = _param; diff --git a/lib/es6/parsing.js b/lib/es6/parsing.js index 37cf4a69f71..eac6d6f2274 100644 --- a/lib/es6/parsing.js +++ b/lib/es6/parsing.js @@ -55,9 +55,7 @@ function clear_parser() { } let current_lookahead_fun = { - contents: (param => { - return false; - }) + contents: (param => false) }; function yyparse(tables, start, lexer, lexbuf) { diff --git a/lib/es6/pervasives.js b/lib/es6/pervasives.js index 3a0b4735c4a..26e76d54f3c 100644 --- a/lib/es6/pervasives.js +++ b/lib/es6/pervasives.js @@ -191,9 +191,7 @@ function print_string(prim) { } let exit_function = { - contents: (prim => { - - }) + contents: (prim => {}) }; function at_exit(f) { diff --git a/lib/es6/random.js b/lib/es6/random.js index 13d20d242ac..eecb439f2f7 100644 --- a/lib/es6/random.js +++ b/lib/es6/random.js @@ -19,12 +19,8 @@ function assign(st1, st2) { } function full_init(s, seed) { - let combine = (accu, x) => { - return Digest.string(accu + String(x)); - }; - let extract = d => { - return ((Caml_string.get(d, 0) + (Caml_string.get(d, 1) << 8) | 0) + (Caml_string.get(d, 2) << 16) | 0) + (Caml_string.get(d, 3) << 24) | 0; - }; + let combine = (accu, x) => Digest.string(accu + String(x)); + let extract = d => ((Caml_string.get(d, 0) + (Caml_string.get(d, 1) << 8) | 0) + (Caml_string.get(d, 2) << 16) | 0) + (Caml_string.get(d, 3) << 24) | 0; let seed$1 = seed.length === 0 ? [0] : seed; let l = seed$1.length; for (let i = 0; i <= 54; ++i) { diff --git a/lib/es6/set.js b/lib/es6/set.js index 16b3a4ce289..214de70318b 100644 --- a/lib/es6/set.js +++ b/lib/es6/set.js @@ -119,15 +119,13 @@ function Make(funarg) { return bal(l, v, rr); } }; - let singleton = x => { - return { - TAG: "Node", - l: "Empty", - v: x, - r: "Empty", - h: 1 - }; - }; + let singleton = x => ({ + TAG: "Node", + l: "Empty", + v: x, + r: "Empty", + h: 1 + }); let add_min_element = (x, param) => { if (typeof param !== "object") { return singleton(x); @@ -437,9 +435,7 @@ function Make(funarg) { continue; }; }; - let equal = (s1, s2) => { - return compare(s1, s2) === 0; - }; + let equal = (s1, s2) => compare(s1, s2) === 0; let subset = (_s1, _s2) => { while (true) { let s2 = _s2; @@ -615,9 +611,7 @@ function Make(funarg) { continue; }; }; - let elements = s => { - return elements_aux(/* [] */0, s); - }; + let elements = s => elements_aux(/* [] */0, s); let find = (x, _param) => { while (true) { let param = _param; diff --git a/lib/es6/setLabels.js b/lib/es6/setLabels.js index 47a320da7f3..604cad1ec74 100644 --- a/lib/es6/setLabels.js +++ b/lib/es6/setLabels.js @@ -119,15 +119,13 @@ function Make(Ord) { return bal(l, v, rr); } }; - let singleton = x => { - return { - TAG: "Node", - l: "Empty", - v: x, - r: "Empty", - h: 1 - }; - }; + let singleton = x => ({ + TAG: "Node", + l: "Empty", + v: x, + r: "Empty", + h: 1 + }); let add_min_element = (x, param) => { if (typeof param !== "object") { return singleton(x); @@ -438,12 +436,8 @@ function Make(Ord) { continue; }; }; - let compare = (s1, s2) => { - return compare_aux(cons_enum(s1, "End"), cons_enum(s2, "End")); - }; - let equal = (s1, s2) => { - return compare(s1, s2) === 0; - }; + let compare = (s1, s2) => compare_aux(cons_enum(s1, "End"), cons_enum(s2, "End")); + let equal = (s1, s2) => compare(s1, s2) === 0; let subset = (_s1, _s2) => { while (true) { let s2 = _s2; @@ -619,9 +613,7 @@ function Make(Ord) { continue; }; }; - let elements = s => { - return elements_aux(/* [] */0, s); - }; + let elements = s => elements_aux(/* [] */0, s); let find = (x, _param) => { while (true) { let param = _param; diff --git a/lib/es6/stream.js b/lib/es6/stream.js index a4956466ef4..29ea43dfad8 100644 --- a/lib/es6/stream.js +++ b/lib/es6/stream.js @@ -284,13 +284,11 @@ function from(f) { function of_list(l) { return { count: 0, - data: List.fold_right(((x, l) => { - return { - TAG: "Scons", - _0: x, - _1: l - }; - }), l, "Sempty") + data: List.fold_right(((x, l) => ({ + TAG: "Scons", + _0: x, + _1: l + })), l, "Sempty") }; } @@ -356,39 +354,31 @@ function ising(i) { } function lapp(f, s) { - let f$1 = () => { - return { - TAG: "Sapp", - _0: data(f()), - _1: data(s) - }; - }; + let f$1 = () => ({ + TAG: "Sapp", + _0: data(f()), + _1: data(s) + }); return { count: 0, data: { TAG: "Slazy", - _0: CamlinternalLazy.from_fun(() => { - return f$1(); - }) + _0: CamlinternalLazy.from_fun(() => f$1()) } }; } function lcons(f, s) { - let f$1 = () => { - return { - TAG: "Scons", - _0: f(), - _1: data(s) - }; - }; + let f$1 = () => ({ + TAG: "Scons", + _0: f(), + _1: data(s) + }); return { count: 0, data: { TAG: "Slazy", - _0: CamlinternalLazy.from_fun(() => { - return f$1(); - }) + _0: CamlinternalLazy.from_fun(() => f$1()) } }; } @@ -398,13 +388,11 @@ function lsing(f) { count: 0, data: { TAG: "Slazy", - _0: CamlinternalLazy.from_fun(() => { - return { - TAG: "Scons", - _0: f(), - _1: "Sempty" - }; - }) + _0: CamlinternalLazy.from_fun(() => ({ + TAG: "Scons", + _0: f(), + _1: "Sempty" + })) } }; } @@ -414,9 +402,7 @@ function slazy(f) { count: 0, data: { TAG: "Slazy", - _0: CamlinternalLazy.from_fun(() => { - return data(f()); - }) + _0: CamlinternalLazy.from_fun(() => data(f())) } }; } diff --git a/lib/js/arg.js b/lib/js/arg.js index 78e88123b9d..242f7643ab4 100644 --- a/lib/js/arg.js +++ b/lib/js/arg.js @@ -50,9 +50,7 @@ function split(s) { function make_symlist(prefix, sep, suffix, l) { if (l) { - return List.fold_left(((x, y) => { - return x + (sep + y); - }), prefix + l.hd, l.tl) + suffix; + return List.fold_left(((x, y) => x + (sep + y)), prefix + l.hd, l.tl) + suffix; } else { return ""; } diff --git a/lib/js/belt_Array.js b/lib/js/belt_Array.js index 358382b7468..db7b6440a28 100644 --- a/lib/js/belt_Array.js +++ b/lib/js/belt_Array.js @@ -59,9 +59,7 @@ function swapUnsafe(xs, i, j) { function shuffleInPlace(xs) { let len = xs.length; - let random_int = (min, max) => { - return Math.floor(Math.random() * (max - min | 0)) + min | 0; - }; + let random_int = (min, max) => Math.floor(Math.random() * (max - min | 0)) + min | 0; for (let i = 0; i < len; ++i) { swapUnsafe(xs, i, random_int(i, len)); } diff --git a/lib/js/belt_MapDict.js b/lib/js/belt_MapDict.js index 98c89e13a9f..fc98f4b09c7 100644 --- a/lib/js/belt_MapDict.js +++ b/lib/js/belt_MapDict.js @@ -196,17 +196,13 @@ function split(n, x, cmp) { function merge(s1, s2, f, cmp) { if (s1 === undefined) { if (s2 !== undefined) { - return Belt_internalAVLtree.keepMap(s2, ((k, v) => { - return f(k, undefined, Caml_option.some(v)); - })); + return Belt_internalAVLtree.keepMap(s2, ((k, v) => f(k, undefined, Caml_option.some(v)))); } else { return; } } if (s2 === undefined) { - return Belt_internalAVLtree.keepMap(s1, ((k, v) => { - return f(k, Caml_option.some(v), undefined); - })); + return Belt_internalAVLtree.keepMap(s1, ((k, v) => f(k, Caml_option.some(v), undefined))); } if (s1.h >= s2.h) { let v1 = s1.k; diff --git a/lib/js/belt_internalAVLset.js b/lib/js/belt_internalAVLset.js index 8d6682e394a..883fd807f3b 100644 --- a/lib/js/belt_internalAVLset.js +++ b/lib/js/belt_internalAVLset.js @@ -827,9 +827,7 @@ function fromArray(xs, cmp) { if (len === 0) { return; } - let next = Belt_SortArray.strictlySortedLength(xs, ((x, y) => { - return cmp(x, y) < 0; - })); + let next = Belt_SortArray.strictlySortedLength(xs, ((x, y) => cmp(x, y) < 0)); let result; if (next >= 0) { result = fromSortedArrayAux(xs, 0, next); diff --git a/lib/js/belt_internalAVLtree.js b/lib/js/belt_internalAVLtree.js index 06b5a6ffab1..5294437d9e0 100644 --- a/lib/js/belt_internalAVLtree.js +++ b/lib/js/belt_internalAVLtree.js @@ -1001,9 +1001,7 @@ function fromArray(xs, cmp) { if (len === 0) { return; } - let next = Belt_SortArray.strictlySortedLength(xs, ((param, param$1) => { - return cmp(param[0], param$1[0]) < 0; - })); + let next = Belt_SortArray.strictlySortedLength(xs, ((param, param$1) => cmp(param[0], param$1[0]) < 0)); let result; if (next >= 0) { result = fromSortedArrayAux(xs, 0, next); diff --git a/lib/js/belt_internalBuckets.js b/lib/js/belt_internalBuckets.js index e5e13b966fe..94a321b95f7 100644 --- a/lib/js/belt_internalBuckets.js +++ b/lib/js/belt_internalBuckets.js @@ -120,9 +120,7 @@ function getMaxBucketLength(h) { function getBucketHistogram(h) { let mbl = getMaxBucketLength(h); - let histo = Belt_Array.makeBy(mbl + 1 | 0, (param => { - return 0; - })); + let histo = Belt_Array.makeBy(mbl + 1 | 0, (param => 0)); Belt_Array.forEach(h.buckets, (b => { let l = bucketLength(0, b); histo[l] = histo[l] + 1 | 0; @@ -233,24 +231,18 @@ function linear(h, f) { } function keysToArray(h) { - return linear(h, (x => { - return x.key; - })); + return linear(h, (x => x.key)); } function valuesToArray(h) { - return linear(h, (x => { - return x.value; - })); + return linear(h, (x => x.value)); } function toArray(h) { - return linear(h, (x => { - return [ - x.key, - x.value - ]; - })); + return linear(h, (x => [ + x.key, + x.value + ])); } let C; diff --git a/lib/js/belt_internalMapInt.js b/lib/js/belt_internalMapInt.js index f40b805ac3a..39afb187463 100644 --- a/lib/js/belt_internalMapInt.js +++ b/lib/js/belt_internalMapInt.js @@ -303,9 +303,7 @@ function fromArray(xs) { if (len === 0) { return; } - let next = Belt_SortArray.strictlySortedLength(xs, ((param, param$1) => { - return param[0] < param$1[0]; - })); + let next = Belt_SortArray.strictlySortedLength(xs, ((param, param$1) => param[0] < param$1[0])); let result; if (next >= 0) { result = Belt_internalAVLtree.fromSortedArrayAux(xs, 0, next); diff --git a/lib/js/belt_internalMapString.js b/lib/js/belt_internalMapString.js index ffb2909c1c7..26d2d497314 100644 --- a/lib/js/belt_internalMapString.js +++ b/lib/js/belt_internalMapString.js @@ -303,9 +303,7 @@ function fromArray(xs) { if (len === 0) { return; } - let next = Belt_SortArray.strictlySortedLength(xs, ((param, param$1) => { - return param[0] < param$1[0]; - })); + let next = Belt_SortArray.strictlySortedLength(xs, ((param, param$1) => param[0] < param$1[0])); let result; if (next >= 0) { result = Belt_internalAVLtree.fromSortedArrayAux(xs, 0, next); diff --git a/lib/js/belt_internalSetBuckets.js b/lib/js/belt_internalSetBuckets.js index 5547c7db46a..89cd83d0fa6 100644 --- a/lib/js/belt_internalSetBuckets.js +++ b/lib/js/belt_internalSetBuckets.js @@ -146,9 +146,7 @@ function getMaxBucketLength(h) { function getBucketHistogram(h) { let mbl = getMaxBucketLength(h); - let histo = Belt_Array.makeBy(mbl + 1 | 0, (param => { - return 0; - })); + let histo = Belt_Array.makeBy(mbl + 1 | 0, (param => 0)); Belt_Array.forEach(h.buckets, (b => { let l = bucketLength(0, b); histo[l] = histo[l] + 1 | 0; diff --git a/lib/js/caml_hash.js b/lib/js/caml_hash.js index 7bb90b757c5..6faffbdce90 100644 --- a/lib/js/caml_hash.js +++ b/lib/js/caml_hash.js @@ -84,9 +84,7 @@ function hash(count, _limit, seed, obj) { ++ size } return size - })(obj$1, (v => { - push_back(queue, v); - })); + })(obj$1, (v => push_back(queue, v))); s = Caml_hash_primitive.hash_mix_int(s, (size$1 << 10) | 0); } } diff --git a/lib/js/caml_int64.js b/lib/js/caml_int64.js index ef504d11747..dcb3f8e08c4 100644 --- a/lib/js/caml_int64.js +++ b/lib/js/caml_int64.js @@ -527,9 +527,7 @@ function to_int32(x) { function to_hex(x) { let x_lo = x[1]; let x_hi = x[0]; - let aux = v => { - return (v >>> 0).toString(16); - }; + let aux = v => (v >>> 0).toString(16); if (x_hi === 0 && x_lo === 0) { return "0"; } diff --git a/lib/js/caml_obj.js b/lib/js/caml_obj.js index 284e315fc32..0b3f182a112 100644 --- a/lib/js/caml_obj.js +++ b/lib/js/caml_obj.js @@ -225,20 +225,16 @@ function aux_obj_compare(a, b) { return; } }; - let do_key_a = key => { - do_key([ - a, - b, - min_key_rhs - ], key); - }; - let do_key_b = key => { - do_key([ - b, - a, - min_key_lhs - ], key); - }; + let do_key_a = key => do_key([ + a, + b, + min_key_rhs + ], key); + let do_key_b = key => do_key([ + b, + a, + min_key_lhs + ], key); for_in(a, do_key_a); for_in(b, do_key_b); let match = min_key_lhs.contents; diff --git a/lib/js/curry.js b/lib/js/curry.js index d78ca61ed78..5b6f7bd1eb8 100644 --- a/lib/js/curry.js +++ b/lib/js/curry.js @@ -14,9 +14,7 @@ function app(_f, _args) { return f.apply(null, args); } if (d >= 0) { - return x => { - return app(f, args.concat([x])); - }; + return x => app(f, args.concat([x])); } _args = Caml_array.sub(args, arity, -d | 0); _f = f.apply(null, Caml_array.sub(args, 0, arity)); @@ -33,29 +31,17 @@ function _1(o, a0) { case 1 : return o(a0); case 2 : - return param => { - return o(a0, param); - }; + return param => o(a0, param); case 3 : - return (param, param$1) => { - return o(a0, param, param$1); - }; + return (param, param$1) => o(a0, param, param$1); case 4 : - return (param, param$1, param$2) => { - return o(a0, param, param$1, param$2); - }; + return (param, param$1, param$2) => o(a0, param, param$1, param$2); case 5 : - return (param, param$1, param$2, param$3) => { - return o(a0, param, param$1, param$2, param$3); - }; + return (param, param$1, param$2, param$3) => o(a0, param, param$1, param$2, param$3); case 6 : - return (param, param$1, param$2, param$3, param$4) => { - return o(a0, param, param$1, param$2, param$3, param$4); - }; + return (param, param$1, param$2, param$3, param$4) => o(a0, param, param$1, param$2, param$3, param$4); case 7 : - return (param, param$1, param$2, param$3, param$4, param$5) => { - return o(a0, param, param$1, param$2, param$3, param$4, param$5); - }; + return (param, param$1, param$2, param$3, param$4, param$5) => o(a0, param, param$1, param$2, param$3, param$4, param$5); default: return app(o, [a0]); } @@ -67,9 +53,7 @@ function __1(o) { if (arity === 1) { return o; } else { - return a0 => { - return _1(o, a0); - }; + return a0 => _1(o, a0); } } @@ -84,25 +68,15 @@ function _2(o, a0, a1) { case 2 : return o(a0, a1); case 3 : - return param => { - return o(a0, a1, param); - }; + return param => o(a0, a1, param); case 4 : - return (param, param$1) => { - return o(a0, a1, param, param$1); - }; + return (param, param$1) => o(a0, a1, param, param$1); case 5 : - return (param, param$1, param$2) => { - return o(a0, a1, param, param$1, param$2); - }; + return (param, param$1, param$2) => o(a0, a1, param, param$1, param$2); case 6 : - return (param, param$1, param$2, param$3) => { - return o(a0, a1, param, param$1, param$2, param$3); - }; + return (param, param$1, param$2, param$3) => o(a0, a1, param, param$1, param$2, param$3); case 7 : - return (param, param$1, param$2, param$3, param$4) => { - return o(a0, a1, param, param$1, param$2, param$3, param$4); - }; + return (param, param$1, param$2, param$3, param$4) => o(a0, a1, param, param$1, param$2, param$3, param$4); default: return app(o, [ a0, @@ -117,9 +91,7 @@ function __2(o) { if (arity === 2) { return o; } else { - return (a0, a1) => { - return _2(o, a0, a1); - }; + return (a0, a1) => _2(o, a0, a1); } } @@ -139,21 +111,13 @@ function _3(o, a0, a1, a2) { case 3 : return o(a0, a1, a2); case 4 : - return param => { - return o(a0, a1, a2, param); - }; + return param => o(a0, a1, a2, param); case 5 : - return (param, param$1) => { - return o(a0, a1, a2, param, param$1); - }; + return (param, param$1) => o(a0, a1, a2, param, param$1); case 6 : - return (param, param$1, param$2) => { - return o(a0, a1, a2, param, param$1, param$2); - }; + return (param, param$1, param$2) => o(a0, a1, a2, param, param$1, param$2); case 7 : - return (param, param$1, param$2, param$3) => { - return o(a0, a1, a2, param, param$1, param$2, param$3); - }; + return (param, param$1, param$2, param$3) => o(a0, a1, a2, param, param$1, param$2, param$3); default: return app(o, [ a0, @@ -169,9 +133,7 @@ function __3(o) { if (arity === 3) { return o; } else { - return (a0, a1, a2) => { - return _3(o, a0, a1, a2); - }; + return (a0, a1, a2) => _3(o, a0, a1, a2); } } @@ -197,17 +159,11 @@ function _4(o, a0, a1, a2, a3) { case 4 : return o(a0, a1, a2, a3); case 5 : - return param => { - return o(a0, a1, a2, a3, param); - }; + return param => o(a0, a1, a2, a3, param); case 6 : - return (param, param$1) => { - return o(a0, a1, a2, a3, param, param$1); - }; + return (param, param$1) => o(a0, a1, a2, a3, param, param$1); case 7 : - return (param, param$1, param$2) => { - return o(a0, a1, a2, a3, param, param$1, param$2); - }; + return (param, param$1, param$2) => o(a0, a1, a2, a3, param, param$1, param$2); default: return app(o, [ a0, @@ -224,9 +180,7 @@ function __4(o) { if (arity === 4) { return o; } else { - return (a0, a1, a2, a3) => { - return _4(o, a0, a1, a2, a3); - }; + return (a0, a1, a2, a3) => _4(o, a0, a1, a2, a3); } } @@ -259,13 +213,9 @@ function _5(o, a0, a1, a2, a3, a4) { case 5 : return o(a0, a1, a2, a3, a4); case 6 : - return param => { - return o(a0, a1, a2, a3, a4, param); - }; + return param => o(a0, a1, a2, a3, a4, param); case 7 : - return (param, param$1) => { - return o(a0, a1, a2, a3, a4, param, param$1); - }; + return (param, param$1) => o(a0, a1, a2, a3, a4, param, param$1); default: return app(o, [ a0, @@ -283,9 +233,7 @@ function __5(o) { if (arity === 5) { return o; } else { - return (a0, a1, a2, a3, a4) => { - return _5(o, a0, a1, a2, a3, a4); - }; + return (a0, a1, a2, a3, a4) => _5(o, a0, a1, a2, a3, a4); } } @@ -326,9 +274,7 @@ function _6(o, a0, a1, a2, a3, a4, a5) { case 6 : return o(a0, a1, a2, a3, a4, a5); case 7 : - return param => { - return o(a0, a1, a2, a3, a4, a5, param); - }; + return param => o(a0, a1, a2, a3, a4, a5, param); default: return app(o, [ a0, @@ -347,9 +293,7 @@ function __6(o) { if (arity === 6) { return o; } else { - return (a0, a1, a2, a3, a4, a5) => { - return _6(o, a0, a1, a2, a3, a4, a5); - }; + return (a0, a1, a2, a3, a4, a5) => _6(o, a0, a1, a2, a3, a4, a5); } } @@ -417,9 +361,7 @@ function __7(o) { if (arity === 7) { return o; } else { - return (a0, a1, a2, a3, a4, a5, a6) => { - return _7(o, a0, a1, a2, a3, a4, a5, a6); - }; + return (a0, a1, a2, a3, a4, a5, a6) => _7(o, a0, a1, a2, a3, a4, a5, a6); } } @@ -496,9 +438,7 @@ function __8(o) { if (arity === 8) { return o; } else { - return (a0, a1, a2, a3, a4, a5, a6, a7) => { - return _8(o, a0, a1, a2, a3, a4, a5, a6, a7); - }; + return (a0, a1, a2, a3, a4, a5, a6, a7) => _8(o, a0, a1, a2, a3, a4, a5, a6, a7); } } diff --git a/lib/js/digest.js b/lib/js/digest.js index fa6f5be545a..1630c5a8a80 100644 --- a/lib/js/digest.js +++ b/lib/js/digest.js @@ -97,9 +97,7 @@ function from_hex(s) { } return c - /* '0' */48 | 0; }; - let byte = i => { - return (digit(Caml_string.get(s, i)) << 4) + digit(Caml_string.get(s, i + 1 | 0)) | 0; - }; + let byte = i => (digit(Caml_string.get(s, i)) << 4) + digit(Caml_string.get(s, i + 1 | 0)) | 0; let result = Caml_bytes.create(16); for (let i = 0; i <= 15; ++i) { Caml_bytes.set(result, i, Char.chr(byte((i << 1)))); diff --git a/lib/js/genlex.js b/lib/js/genlex.js index fee85432f10..df0c1c90b70 100644 --- a/lib/js/genlex.js +++ b/lib/js/genlex.js @@ -43,12 +43,10 @@ function get_string() { function make_lexer(keywords) { let kwd_table = Hashtbl.create(undefined, 17); - List.iter((s => { - Hashtbl.add(kwd_table, s, { - TAG: "Kwd", - _0: s - }); - }), keywords); + List.iter((s => Hashtbl.add(kwd_table, s, { + TAG: "Kwd", + _0: s + })), keywords); let ident_or_keyword = id => { try { return Hashtbl.find(kwd_table, id); @@ -659,11 +657,7 @@ function make_lexer(keywords) { } }; }; - return input => { - return Stream.from(_count => { - return next_token(input); - }); - }; + return input => Stream.from(_count => next_token(input)); } exports.make_lexer = make_lexer; diff --git a/lib/js/hashtbl.js b/lib/js/hashtbl.js index 1c48973046e..9b1c3f98c66 100644 --- a/lib/js/hashtbl.js +++ b/lib/js/hashtbl.js @@ -38,9 +38,7 @@ function is_randomized() { return randomized.contents; } -let prng = CamlinternalLazy.from_fun(() => { - return Random.State.make_self_init(); -}); +let prng = CamlinternalLazy.from_fun(() => Random.State.make_self_init()); function power_2_above(_x, n) { while (true) { @@ -596,9 +594,7 @@ function bucket_length(_accu, _param) { } function stats(h) { - let mbl = $$Array.fold_left(((m, b) => { - return Caml.int_max(m, bucket_length(0, b)); - }), 0, h.data); + let mbl = $$Array.fold_left(((m, b) => Caml.int_max(m, bucket_length(0, b))), 0, h.data); let histo = Caml_array.make(mbl + 1 | 0, 0); $$Array.iter((b => { let l = bucket_length(0, b); @@ -613,9 +609,7 @@ function stats(h) { } function MakeSeeded(H) { - let key_index = (h, key) => { - return H.hash(h.seed, key) & (h.data.length - 1 | 0); - }; + let key_index = (h, key) => H.hash(h.seed, key) & (h.data.length - 1 | 0); let add = (h, key, data) => { let i = key_index(h, key); let bucket = { @@ -861,9 +855,7 @@ function MakeSeeded(H) { function Make(H) { let equal = H.equal; - let key_index = (h, key) => { - return H.hash(key) & (h.data.length - 1 | 0); - }; + let key_index = (h, key) => H.hash(key) & (h.data.length - 1 | 0); let add = (h, key, data) => { let i = key_index(h, key); let bucket = { @@ -1087,9 +1079,7 @@ function Make(H) { continue; }; }; - let create$1 = sz => { - return create(false, sz); - }; + let create$1 = sz => create(false, sz); return { create: create$1, clear: clear, diff --git a/lib/js/hashtblLabels.js b/lib/js/hashtblLabels.js index 6112d7fb199..b0aae8f594e 100644 --- a/lib/js/hashtblLabels.js +++ b/lib/js/hashtblLabels.js @@ -11,21 +11,15 @@ function replace(tbl, key, data) { } function iter(f, tbl) { - Hashtbl.iter(((key, data) => { - f(key, data); - }), tbl); + Hashtbl.iter(((key, data) => f(key, data)), tbl); } function filter_map_inplace(f, tbl) { - Hashtbl.filter_map_inplace(((key, data) => { - return f(key, data); - }), tbl); + Hashtbl.filter_map_inplace(((key, data) => f(key, data)), tbl); } function fold(f, tbl, init) { - return Hashtbl.fold(((key, data, acc) => { - return f(key, data, acc); - }), tbl, init); + return Hashtbl.fold(((key, data, acc) => f(key, data, acc)), tbl, init); } function MakeSeeded(H) { @@ -35,27 +29,11 @@ function MakeSeeded(H) { let iter = include.iter; let filter_map_inplace = include.filter_map_inplace; let fold = include.fold; - let add$1 = (tbl, key, data) => { - add(tbl, key, data); - }; - let replace$1 = (tbl, key, data) => { - replace(tbl, key, data); - }; - let iter$1 = (f, tbl) => { - iter(((key, data) => { - f(key, data); - }), tbl); - }; - let filter_map_inplace$1 = (f, tbl) => { - filter_map_inplace(((key, data) => { - return f(key, data); - }), tbl); - }; - let fold$1 = (f, tbl, init) => { - return fold(((key, data, acc) => { - return f(key, data, acc); - }), tbl, init); - }; + let add$1 = (tbl, key, data) => add(tbl, key, data); + let replace$1 = (tbl, key, data) => replace(tbl, key, data); + let iter$1 = (f, tbl) => iter(((key, data) => f(key, data)), tbl); + let filter_map_inplace$1 = (f, tbl) => filter_map_inplace(((key, data) => f(key, data)), tbl); + let fold$1 = (f, tbl, init) => fold(((key, data, acc) => f(key, data, acc)), tbl, init); return { create: include.create, clear: include.clear, @@ -77,9 +55,7 @@ function MakeSeeded(H) { } function Make(H) { - let hash = (_seed, x) => { - return H.hash(x); - }; + let hash = (_seed, x) => H.hash(x); let H_equal = H.equal; let H$1 = { equal: H_equal, @@ -92,30 +68,12 @@ function Make(H) { let iter = include.iter; let filter_map_inplace = include.filter_map_inplace; let fold = include.fold; - let add$1 = (tbl, key, data) => { - add(tbl, key, data); - }; - let replace$1 = (tbl, key, data) => { - replace(tbl, key, data); - }; - let iter$1 = (f, tbl) => { - iter(((key, data) => { - f(key, data); - }), tbl); - }; - let filter_map_inplace$1 = (f, tbl) => { - filter_map_inplace(((key, data) => { - return f(key, data); - }), tbl); - }; - let fold$1 = (f, tbl, init) => { - return fold(((key, data, acc) => { - return f(key, data, acc); - }), tbl, init); - }; - let create$1 = sz => { - return create(false, sz); - }; + let add$1 = (tbl, key, data) => add(tbl, key, data); + let replace$1 = (tbl, key, data) => replace(tbl, key, data); + let iter$1 = (f, tbl) => iter(((key, data) => f(key, data)), tbl); + let filter_map_inplace$1 = (f, tbl) => filter_map_inplace(((key, data) => f(key, data)), tbl); + let fold$1 = (f, tbl, init) => fold(((key, data, acc) => f(key, data, acc)), tbl, init); + let create$1 = sz => create(false, sz); return { create: create$1, clear: include.clear, diff --git a/lib/js/lazy.js b/lib/js/lazy.js index d95578bd561..5425717915d 100644 --- a/lib/js/lazy.js +++ b/lib/js/lazy.js @@ -3,9 +3,7 @@ let CamlinternalLazy = require("./camlinternalLazy.js"); function from_fun(f) { - return CamlinternalLazy.from_fun(() => { - return f(); - }); + return CamlinternalLazy.from_fun(() => f()); } let from_val = CamlinternalLazy.from_val; diff --git a/lib/js/map.js b/lib/js/map.js index 93c7e65415b..3588ee00244 100644 --- a/lib/js/map.js +++ b/lib/js/map.js @@ -22,16 +22,14 @@ function Make(funarg) { h: hl >= hr ? hl + 1 | 0 : hr + 1 | 0 }; }; - let singleton = (x, d) => { - return { - TAG: "Node", - l: "Empty", - v: x, - d: d, - r: "Empty", - h: 1 - }; - }; + let singleton = (x, d) => ({ + TAG: "Node", + l: "Empty", + v: x, + d: d, + r: "Empty", + h: 1 + }); let bal = (l, x, d, r) => { let hl; hl = typeof l !== "object" ? 0 : l.h; @@ -914,9 +912,7 @@ function Make(funarg) { continue; }; }; - let bindings = s => { - return bindings_aux(/* [] */0, s); - }; + let bindings = s => bindings_aux(/* [] */0, s); return { empty: "Empty", is_empty: is_empty, diff --git a/lib/js/mapLabels.js b/lib/js/mapLabels.js index acbe9942ab6..4094b6e60e8 100644 --- a/lib/js/mapLabels.js +++ b/lib/js/mapLabels.js @@ -22,16 +22,14 @@ function Make(Ord) { h: hl >= hr ? hl + 1 | 0 : hr + 1 | 0 }; }; - let singleton = (x, d) => { - return { - TAG: "Node", - l: "Empty", - v: x, - d: d, - r: "Empty", - h: 1 - }; - }; + let singleton = (x, d) => ({ + TAG: "Node", + l: "Empty", + v: x, + d: d, + r: "Empty", + h: 1 + }); let bal = (l, x, d, r) => { let hl; hl = typeof l !== "object" ? 0 : l.h; @@ -914,9 +912,7 @@ function Make(Ord) { continue; }; }; - let bindings = s => { - return bindings_aux(/* [] */0, s); - }; + let bindings = s => bindings_aux(/* [] */0, s); return { height: height, create: create, diff --git a/lib/js/moreLabels.js b/lib/js/moreLabels.js index 10b3c4839af..199e9967575 100644 --- a/lib/js/moreLabels.js +++ b/lib/js/moreLabels.js @@ -52,16 +52,14 @@ let $$Map = { h: hl >= hr ? hl + 1 | 0 : hr + 1 | 0 }; }; - let singleton = (x, d) => { - return { - TAG: "Node", - l: "Empty", - v: x, - d: d, - r: "Empty", - h: 1 - }; - }; + let singleton = (x, d) => ({ + TAG: "Node", + l: "Empty", + v: x, + d: d, + r: "Empty", + h: 1 + }); let bal = (l, x, d, r) => { let hl; hl = typeof l !== "object" ? 0 : l.h; @@ -944,9 +942,7 @@ let $$Map = { continue; }; }; - let bindings = s => { - return bindings_aux(/* [] */0, s); - }; + let bindings = s => bindings_aux(/* [] */0, s); return { empty: "Empty", is_empty: is_empty, @@ -1103,15 +1099,13 @@ let $$Set = { return bal(l, v, rr); } }; - let singleton = x => { - return { - TAG: "Node", - l: "Empty", - v: x, - r: "Empty", - h: 1 - }; - }; + let singleton = x => ({ + TAG: "Node", + l: "Empty", + v: x, + r: "Empty", + h: 1 + }); let add_min_element = (x, param) => { if (typeof param !== "object") { return singleton(x); @@ -1422,12 +1416,8 @@ let $$Set = { continue; }; }; - let compare = (s1, s2) => { - return compare_aux(cons_enum(s1, "End"), cons_enum(s2, "End")); - }; - let equal = (s1, s2) => { - return compare(s1, s2) === 0; - }; + let compare = (s1, s2) => compare_aux(cons_enum(s1, "End"), cons_enum(s2, "End")); + let equal = (s1, s2) => compare(s1, s2) === 0; let subset = (_s1, _s2) => { while (true) { let s2 = _s2; @@ -1603,9 +1593,7 @@ let $$Set = { continue; }; }; - let elements = s => { - return elements_aux(/* [] */0, s); - }; + let elements = s => elements_aux(/* [] */0, s); let find = (x, _param) => { while (true) { let param = _param; diff --git a/lib/js/parsing.js b/lib/js/parsing.js index 6fe73fbeeda..44fb74a6d2d 100644 --- a/lib/js/parsing.js +++ b/lib/js/parsing.js @@ -55,9 +55,7 @@ function clear_parser() { } let current_lookahead_fun = { - contents: (param => { - return false; - }) + contents: (param => false) }; function yyparse(tables, start, lexer, lexbuf) { diff --git a/lib/js/pervasives.js b/lib/js/pervasives.js index a981e2d60f2..d95a78d5785 100644 --- a/lib/js/pervasives.js +++ b/lib/js/pervasives.js @@ -191,9 +191,7 @@ function print_string(prim) { } let exit_function = { - contents: (prim => { - - }) + contents: (prim => {}) }; function at_exit(f) { diff --git a/lib/js/random.js b/lib/js/random.js index cbb0df589c2..0b844d4e699 100644 --- a/lib/js/random.js +++ b/lib/js/random.js @@ -19,12 +19,8 @@ function assign(st1, st2) { } function full_init(s, seed) { - let combine = (accu, x) => { - return Digest.string(accu + String(x)); - }; - let extract = d => { - return ((Caml_string.get(d, 0) + (Caml_string.get(d, 1) << 8) | 0) + (Caml_string.get(d, 2) << 16) | 0) + (Caml_string.get(d, 3) << 24) | 0; - }; + let combine = (accu, x) => Digest.string(accu + String(x)); + let extract = d => ((Caml_string.get(d, 0) + (Caml_string.get(d, 1) << 8) | 0) + (Caml_string.get(d, 2) << 16) | 0) + (Caml_string.get(d, 3) << 24) | 0; let seed$1 = seed.length === 0 ? [0] : seed; let l = seed$1.length; for (let i = 0; i <= 54; ++i) { diff --git a/lib/js/set.js b/lib/js/set.js index 3662ac51be3..3b5ca118c98 100644 --- a/lib/js/set.js +++ b/lib/js/set.js @@ -119,15 +119,13 @@ function Make(funarg) { return bal(l, v, rr); } }; - let singleton = x => { - return { - TAG: "Node", - l: "Empty", - v: x, - r: "Empty", - h: 1 - }; - }; + let singleton = x => ({ + TAG: "Node", + l: "Empty", + v: x, + r: "Empty", + h: 1 + }); let add_min_element = (x, param) => { if (typeof param !== "object") { return singleton(x); @@ -437,9 +435,7 @@ function Make(funarg) { continue; }; }; - let equal = (s1, s2) => { - return compare(s1, s2) === 0; - }; + let equal = (s1, s2) => compare(s1, s2) === 0; let subset = (_s1, _s2) => { while (true) { let s2 = _s2; @@ -615,9 +611,7 @@ function Make(funarg) { continue; }; }; - let elements = s => { - return elements_aux(/* [] */0, s); - }; + let elements = s => elements_aux(/* [] */0, s); let find = (x, _param) => { while (true) { let param = _param; diff --git a/lib/js/setLabels.js b/lib/js/setLabels.js index 7a2006b5d71..85c913e920b 100644 --- a/lib/js/setLabels.js +++ b/lib/js/setLabels.js @@ -119,15 +119,13 @@ function Make(Ord) { return bal(l, v, rr); } }; - let singleton = x => { - return { - TAG: "Node", - l: "Empty", - v: x, - r: "Empty", - h: 1 - }; - }; + let singleton = x => ({ + TAG: "Node", + l: "Empty", + v: x, + r: "Empty", + h: 1 + }); let add_min_element = (x, param) => { if (typeof param !== "object") { return singleton(x); @@ -438,12 +436,8 @@ function Make(Ord) { continue; }; }; - let compare = (s1, s2) => { - return compare_aux(cons_enum(s1, "End"), cons_enum(s2, "End")); - }; - let equal = (s1, s2) => { - return compare(s1, s2) === 0; - }; + let compare = (s1, s2) => compare_aux(cons_enum(s1, "End"), cons_enum(s2, "End")); + let equal = (s1, s2) => compare(s1, s2) === 0; let subset = (_s1, _s2) => { while (true) { let s2 = _s2; @@ -619,9 +613,7 @@ function Make(Ord) { continue; }; }; - let elements = s => { - return elements_aux(/* [] */0, s); - }; + let elements = s => elements_aux(/* [] */0, s); let find = (x, _param) => { while (true) { let param = _param; diff --git a/lib/js/stream.js b/lib/js/stream.js index eb60504e7e9..7bca04f1b4d 100644 --- a/lib/js/stream.js +++ b/lib/js/stream.js @@ -284,13 +284,11 @@ function from(f) { function of_list(l) { return { count: 0, - data: List.fold_right(((x, l) => { - return { - TAG: "Scons", - _0: x, - _1: l - }; - }), l, "Sempty") + data: List.fold_right(((x, l) => ({ + TAG: "Scons", + _0: x, + _1: l + })), l, "Sempty") }; } @@ -356,39 +354,31 @@ function ising(i) { } function lapp(f, s) { - let f$1 = () => { - return { - TAG: "Sapp", - _0: data(f()), - _1: data(s) - }; - }; + let f$1 = () => ({ + TAG: "Sapp", + _0: data(f()), + _1: data(s) + }); return { count: 0, data: { TAG: "Slazy", - _0: CamlinternalLazy.from_fun(() => { - return f$1(); - }) + _0: CamlinternalLazy.from_fun(() => f$1()) } }; } function lcons(f, s) { - let f$1 = () => { - return { - TAG: "Scons", - _0: f(), - _1: data(s) - }; - }; + let f$1 = () => ({ + TAG: "Scons", + _0: f(), + _1: data(s) + }); return { count: 0, data: { TAG: "Slazy", - _0: CamlinternalLazy.from_fun(() => { - return f$1(); - }) + _0: CamlinternalLazy.from_fun(() => f$1()) } }; } @@ -398,13 +388,11 @@ function lsing(f) { count: 0, data: { TAG: "Slazy", - _0: CamlinternalLazy.from_fun(() => { - return { - TAG: "Scons", - _0: f(), - _1: "Sempty" - }; - }) + _0: CamlinternalLazy.from_fun(() => ({ + TAG: "Scons", + _0: f(), + _1: "Sempty" + })) } }; } @@ -414,9 +402,7 @@ function slazy(f) { count: 0, data: { TAG: "Slazy", - _0: CamlinternalLazy.from_fun(() => { - return data(f()); - }) + _0: CamlinternalLazy.from_fun(() => data(f())) } }; } From 1969587da3e8e04e358f6da5a5ecdad3039b49d5 Mon Sep 17 00:00:00 2001 From: Hyeseong Kim Date: Wed, 21 Aug 2024 06:51:46 +0900 Subject: [PATCH 6/8] remove unnecessary parens on function literals --- jscomp/core/j.ml | 1 + jscomp/core/js_dump.ml | 26 +- jscomp/core/js_exp_make.ml | 7 +- jscomp/core/js_exp_make.mli | 4 +- .../typescript-react-example/src/Hooks.res.js | 6 +- .../src/ImmutableArray.res.js | 38 +-- .../src/Records.res.js | 20 +- .../src/TestPromise.res.js | 4 +- .../src/nested/Tuples.res.js | 4 +- .../src/nested/Types.res.js | 2 +- jscomp/test/Import.js | 8 +- jscomp/test/SafePromises.js | 6 +- jscomp/test/UncurriedExternals.js | 10 +- jscomp/test/UntaggedVariants.js | 6 +- jscomp/test/a_filename_test.js | 4 +- jscomp/test/a_list_test.js | 16 +- jscomp/test/a_string_test.js | 24 +- jscomp/test/and_or_tailcall_test.js | 8 +- jscomp/test/ari_regress_test.js | 16 +- jscomp/test/arith_parser.js | 40 +-- jscomp/test/arity_deopt.js | 4 +- jscomp/test/arity_infer.js | 10 +- jscomp/test/array_data_util.js | 4 +- jscomp/test/array_subtle_test.js | 4 +- jscomp/test/array_test.js | 66 ++--- jscomp/test/ast_abstract_test.js | 4 +- jscomp/test/attr_test.js | 4 +- jscomp/test/belt_float_ntest.js | 24 +- jscomp/test/belt_int_ntest.js | 24 +- jscomp/test/belt_mapint_ntest.js | 8 +- jscomp/test/belt_result_alias_test.js | 4 +- jscomp/test/bench.js | 6 +- jscomp/test/bs_abstract_test.js | 2 +- jscomp/test/bs_array_test.js | 114 ++++---- jscomp/test/bs_auto_uncurry.js | 12 +- jscomp/test/bs_auto_uncurry_test.js | 8 +- jscomp/test/bs_hashmap_test.js | 2 +- jscomp/test/bs_hashset_int_test.js | 4 +- jscomp/test/bs_ignore_effect.js | 4 +- jscomp/test/bs_list_test.js | 170 +++++------ jscomp/test/bs_map_set_dict_test.js | 26 +- jscomp/test/bs_map_test.js | 14 +- jscomp/test/bs_mutable_set_test.js | 52 ++-- jscomp/test/bs_poly_map_test.js | 50 ++-- jscomp/test/bs_poly_mutable_map_test.js | 8 +- jscomp/test/bs_poly_mutable_set_test.js | 32 +-- jscomp/test/bs_poly_set_test.js | 44 +-- jscomp/test/bs_queue_test.js | 10 +- jscomp/test/bs_set_int_test.js | 16 +- jscomp/test/bs_sort_test.js | 20 +- jscomp/test/bs_stack_test.js | 4 +- jscomp/test/bs_string_test.js | 6 +- jscomp/test/buffer_test.js | 12 +- jscomp/test/bytes_split_gpr_743_test.js | 4 +- jscomp/test/caml_compare_bigint_test.js | 136 ++++----- jscomp/test/caml_compare_test.js | 210 +++++++------- jscomp/test/caml_format_test.js | 68 ++--- jscomp/test/chain_code_test.js | 4 +- jscomp/test/chn_test.js | 8 +- jscomp/test/coercion_module_alias_test.js | 2 +- jscomp/test/complex_if_test.js | 4 +- jscomp/test/complex_test.js | 4 +- jscomp/test/complex_while_loop.js | 8 +- jscomp/test/condition_compilation_test.js | 4 +- jscomp/test/const_block_test.js | 4 +- jscomp/test/cps_test.js | 34 +-- jscomp/test/demo_page.js | 4 +- jscomp/test/demo_pipe.js | 6 +- jscomp/test/digest_test.js | 32 +-- jscomp/test/div_by_zero_test.js | 52 ++-- jscomp/test/dollar_escape_test.js | 4 +- jscomp/test/earger_curry_test.js | 10 +- jscomp/test/epsilon_test.js | 8 +- jscomp/test/es6_module_test.js | 8 +- jscomp/test/exception_raise_test.js | 8 +- jscomp/test/exception_rebound_err_test.js | 4 +- jscomp/test/ext_array_test.js | 4 +- jscomp/test/ext_bytes_test.js | 4 +- jscomp/test/ext_filename_test.js | 8 +- jscomp/test/ext_list_test.js | 4 +- jscomp/test/ext_string_test.js | 32 +-- jscomp/test/extensible_variant_test.js | 12 +- jscomp/test/ffi_arity_test.js | 12 +- jscomp/test/ffi_array_test.js | 4 +- jscomp/test/ffi_js_test.js | 4 +- jscomp/test/ffi_splice_test.js | 4 +- jscomp/test/flexible_array_test.js | 8 +- jscomp/test/float_of_bits_test.js | 20 +- jscomp/test/float_test.js | 28 +- jscomp/test/for_loop_test.js | 92 +++--- jscomp/test/for_side_effect_test.js | 4 +- jscomp/test/format_test.js | 10 +- jscomp/test/functor_app_test.js | 4 +- jscomp/test/functors.js | 4 +- jscomp/test/genlex_test.js | 4 +- .../test/global_exception_regression_test.js | 8 +- jscomp/test/global_module_alias_test.js | 4 +- jscomp/test/google_closure_test.js | 4 +- jscomp/test/gpr496_test.js | 4 +- jscomp/test/gpr_1154_test.js | 4 +- jscomp/test/gpr_1409_test.js | 6 +- jscomp/test/gpr_1423_app_test.js | 4 +- jscomp/test/gpr_1503_test.js | 4 +- jscomp/test/gpr_1539_test.js | 2 +- jscomp/test/gpr_1658_test.js | 4 +- jscomp/test/gpr_1667_test.js | 4 +- jscomp/test/gpr_1716_test.js | 4 +- jscomp/test/gpr_1728_test.js | 4 +- jscomp/test/gpr_1749_test.js | 4 +- jscomp/test/gpr_1760_test.js | 4 +- jscomp/test/gpr_1762_test.js | 4 +- jscomp/test/gpr_1817_test.js | 4 +- jscomp/test/gpr_1822_test.js | 4 +- jscomp/test/gpr_1943_test.js | 4 +- jscomp/test/gpr_2316_test.js | 4 +- jscomp/test/gpr_2487.js | 2 +- jscomp/test/gpr_2608_test.js | 4 +- jscomp/test/gpr_2682_test.js | 8 +- jscomp/test/gpr_3536_test.js | 2 +- jscomp/test/gpr_3875_test.js | 2 +- jscomp/test/gpr_4274_test.js | 10 +- jscomp/test/gpr_459_test.js | 4 +- jscomp/test/gpr_858_unit2_test.js | 6 +- jscomp/test/gpr_904_test.js | 4 +- jscomp/test/gpr_977_test.js | 4 +- jscomp/test/hash_test.js | 2 +- jscomp/test/hashtbl_test.js | 24 +- jscomp/test/ignore_test.js | 4 +- jscomp/test/inline_map2_test.js | 12 +- jscomp/test/inline_map_demo.js | 6 +- jscomp/test/inline_map_test.js | 6 +- jscomp/test/inline_record_test.js | 4 +- jscomp/test/inline_regression_test.js | 6 +- jscomp/test/installation_test.js | 4 +- jscomp/test/int32_test.js | 34 +-- jscomp/test/int64_mul_div_test.js | 62 ++-- jscomp/test/int64_string_test.js | 4 +- jscomp/test/int64_test.js | 200 ++++++------- jscomp/test/int_hashtbl_test.js | 24 +- jscomp/test/int_overflow_test.js | 56 ++-- jscomp/test/js_array_test.js | 240 ++++++++-------- jscomp/test/js_bool_test.js | 12 +- jscomp/test/js_cast_test.js | 4 +- jscomp/test/js_date_test.js | 268 +++++++++--------- jscomp/test/js_dict_test.js | 54 ++-- jscomp/test/js_exception_catch_test.js | 20 +- jscomp/test/js_float_test.js | 208 +++++++------- jscomp/test/js_global_test.js | 28 +- jscomp/test/js_int_test.js | 104 +++---- jscomp/test/js_json_test.js | 188 ++++++------ jscomp/test/js_math_test.js | 232 +++++++-------- jscomp/test/js_null_test.js | 56 ++-- jscomp/test/js_null_undefined_test.js | 116 ++++---- jscomp/test/js_nullable_test.js | 4 +- jscomp/test/js_obj_test.js | 8 +- jscomp/test/js_option_test.js | 106 +++---- jscomp/test/js_re_test.js | 68 ++--- jscomp/test/js_string_test.js | 222 +++++++-------- jscomp/test/js_undefined_test.js | 56 ++-- jscomp/test/jsoo_400_test.js | 8 +- jscomp/test/key_word_property_plus_test.js | 6 +- jscomp/test/lazy_test.js | 46 +-- jscomp/test/lib_js_test.js | 4 +- jscomp/test/libqueue_test.js | 8 +- jscomp/test/limits_test.js | 4 +- jscomp/test/list_stack.js | 2 +- jscomp/test/list_test.js | 30 +- jscomp/test/loop_regression_test.js | 4 +- jscomp/test/map_find_test.js | 12 +- jscomp/test/map_test.js | 20 +- jscomp/test/mario_game.js | 32 +-- jscomp/test/method_name_test.js | 4 +- jscomp/test/mock_mt.js | 4 +- jscomp/test/module_alias_test.js | 4 +- jscomp/test/module_parameter_test.js | 8 +- jscomp/test/module_splice_test.js | 4 +- jscomp/test/mpr_6033_test.js | 4 +- jscomp/test/mt.js | 20 +- jscomp/test/mt_global.js | 12 +- jscomp/test/mutable_obj_test.js | 4 +- jscomp/test/name_mangle_test.js | 4 +- jscomp/test/obj_literal_ppx.js | 2 +- jscomp/test/obj_magic_test.js | 16 +- jscomp/test/ocaml_re_test.js | 66 ++--- jscomp/test/of_string_test.js | 12 +- jscomp/test/option_repr_test.js | 14 +- jscomp/test/optional_ffi_test.js | 4 +- jscomp/test/pipe_send_readline.js | 6 +- jscomp/test/poly_variant_test.js | 4 +- jscomp/test/polymorphic_raw_test.js | 4 +- jscomp/test/ppx_apply_test.js | 4 +- jscomp/test/prepend_data_ffi.js | 16 +- jscomp/test/print_alpha_test.js | 6 +- jscomp/test/queue_test.js | 26 +- jscomp/test/reactTestUtils.js | 10 +- jscomp/test/reasonReact.js | 4 +- jscomp/test/reasonReactRouter.js | 6 +- jscomp/test/rec_fun_test.js | 4 +- jscomp/test/rec_module_test.js | 28 +- jscomp/test/record_with_test.js | 4 +- jscomp/test/recursive_module.js | 2 +- jscomp/test/recursive_module_test.js | 12 +- jscomp/test/res_debug.js | 4 +- jscomp/test/sexp.js | 20 +- jscomp/test/sexpm.js | 42 +-- jscomp/test/sexpm_test.js | 4 +- jscomp/test/side_effect2.js | 2 +- jscomp/test/stack_comp_test.js | 8 +- jscomp/test/stack_test.js | 4 +- jscomp/test/stream_parser_test.js | 12 +- jscomp/test/string_get_set_test.js | 4 +- jscomp/test/string_runtime_test.js | 14 +- jscomp/test/string_set.js | 2 +- jscomp/test/string_set_test.js | 4 +- jscomp/test/string_test.js | 74 ++--- jscomp/test/string_unicode_test.js | 4 +- jscomp/test/switch_case_test.js | 4 +- jscomp/test/tagged_template_test.js | 24 +- jscomp/test/tailcall_inline_test.js | 8 +- jscomp/test/test_bs_this.js | 12 +- jscomp/test/test_closure.js | 8 +- jscomp/test/test_cps.js | 10 +- jscomp/test/test_for_loop.js | 32 +-- jscomp/test/test_google_closure.js | 2 +- jscomp/test/test_int_map_find.js | 2 +- jscomp/test/test_react.js | 4 +- jscomp/test/test_string_map.js | 8 +- jscomp/test/test_while_closure.js | 8 +- jscomp/test/test_while_side_effect.js | 4 +- jscomp/test/test_zero_nullable.js | 4 +- jscomp/test/ticker.js | 26 +- jscomp/test/to_string_test.js | 8 +- jscomp/test/topsort_test.js | 14 +- jscomp/test/tramp_fib.js | 8 +- jscomp/test/tuple_alloc.js | 2 +- jscomp/test/typeof_test.js | 50 ++-- jscomp/test/uncurried_cast.js | 4 +- jscomp/test/uncurry_external_test.js | 4 +- jscomp/test/unsafe_ppx_test.js | 18 +- jscomp/test/update_record_test.js | 4 +- jscomp/test/webpack_config.js | 16 +- lib/es6/arg.js | 14 +- lib/es6/belt_MapDict.js | 4 +- lib/es6/belt_internalAVLset.js | 2 +- lib/es6/belt_internalAVLtree.js | 2 +- lib/es6/belt_internalBuckets.js | 18 +- lib/es6/belt_internalMapInt.js | 2 +- lib/es6/belt_internalMapString.js | 2 +- lib/es6/belt_internalSetBuckets.js | 10 +- lib/es6/caml_format.js | 12 +- lib/es6/caml_hash.js | 2 +- lib/es6/camlinternalLazy.js | 4 +- lib/es6/genlex.js | 4 +- lib/es6/hashtbl.js | 6 +- lib/es6/hashtblLabels.js | 18 +- lib/es6/lexing.js | 8 +- lib/es6/moreLabels.js | 8 +- lib/es6/parsing.js | 6 +- lib/es6/pervasives.js | 6 +- lib/es6/stream.js | 4 +- lib/js/arg.js | 14 +- lib/js/belt_MapDict.js | 4 +- lib/js/belt_internalAVLset.js | 2 +- lib/js/belt_internalAVLtree.js | 2 +- lib/js/belt_internalBuckets.js | 18 +- lib/js/belt_internalMapInt.js | 2 +- lib/js/belt_internalMapString.js | 2 +- lib/js/belt_internalSetBuckets.js | 10 +- lib/js/caml_format.js | 12 +- lib/js/caml_hash.js | 2 +- lib/js/camlinternalLazy.js | 4 +- lib/js/genlex.js | 4 +- lib/js/hashtbl.js | 6 +- lib/js/hashtblLabels.js | 18 +- lib/js/lexing.js | 8 +- lib/js/moreLabels.js | 8 +- lib/js/parsing.js | 6 +- lib/js/pervasives.js | 6 +- lib/js/stream.js | 4 +- 279 files changed, 2865 insertions(+), 2857 deletions(-) diff --git a/jscomp/core/j.ml b/jscomp/core/j.ml index 3ab61124957..b1bc39659f5 100644 --- a/jscomp/core/j.ml +++ b/jscomp/core/j.ml @@ -135,6 +135,7 @@ and expression_desc = env : Js_fun_env.t; return_unit : bool; async : bool; + iife : bool; directive : string option; } | Str of { delim : delim; txt : string } diff --git a/jscomp/core/js_dump.ml b/jscomp/core/js_dump.ml index a01bfc0aca0..2fe52b35eb4 100644 --- a/jscomp/core/js_dump.ml +++ b/jscomp/core/js_dump.ml @@ -301,7 +301,7 @@ let rec try_optimize_curry cxt f len function_id = Curry_gen.pp_optimize_curry f len; P.paren_group f 1 (fun _ -> expression ~level:1 cxt f function_id) -and pp_function ~return_unit ~async ~is_method ~need_paren ?directive cxt (f : P.t) ~fn_state +and pp_function ~return_unit ~async ~is_method ~iife ?directive cxt (f : P.t) ~fn_state (l : Ident.t list) (b : J.block) (env : Js_fun_env.t) : cxt = match b with | [ @@ -426,8 +426,7 @@ and pp_function ~return_unit ~async ~is_method ~need_paren ?directive cxt (f : P P.string f (L.function_ ~async ~arrow); param_body () | No_name _ -> - (* see # 1692, add a paren for annoymous function for safety *) - P.cond_paren_group f (need_paren) (fun _ -> + P.cond_paren_group f (iife) (fun _ -> P.string f (L.function_ ~async ~arrow); param_body ()) | Name_non_top x -> @@ -525,10 +524,9 @@ and expression_desc cxt ~(level : int) f x : cxt = let cxt = expression ~level:0 cxt f e1 in comma_sp f; expression ~level:0 cxt f e2) - | Fun { is_method; params; body; env; return_unit; async; directive } -> + | Fun { is_method; params; body; env; return_unit; async; iife; directive } -> (* TODO: dump for comments *) - pp_function ?directive ~is_method ~return_unit ~async - ~need_paren:true + pp_function ?directive ~is_method ~return_unit ~async ~iife ~fn_state:default_fn_exp_state cxt f params body env (* TODO: @@ -545,7 +543,11 @@ and expression_desc cxt ~(level : int) f x : cxt = P.group f 0 (fun _ -> match (info, el) with | { arity = Full }, _ | _, [] -> - let cxt = expression ~level:15 cxt f e in + let cxt = + P.cond_paren_group f + (match e.expression_desc with Fun _ -> true | _ -> false) + (fun () -> expression ~level:15 cxt f e ) + in P.paren_group f 0 (fun _ -> match el with | [ @@ -559,12 +561,12 @@ and expression_desc cxt ~(level : int) f x : cxt = env; return_unit; async; + iife; directive; }; }; ] -> - pp_function ?directive ~is_method ~return_unit ~async - ~need_paren:false + pp_function ?directive ~is_method ~return_unit ~async ~iife ~fn_state:(No_name { single_arg = true }) cxt f params body env | _ -> @@ -968,7 +970,7 @@ and variable_declaration top cxt f (variable : J.variable_declaration) : cxt = match e.expression_desc with | Fun { is_method; params; body; env; return_unit; async; directive } -> pp_function ?directive ~is_method ~return_unit ~async - ~need_paren:false + ~iife:false ~fn_state:(if top then Name_top name else Name_non_top name) cxt f params body env | _ -> @@ -1176,10 +1178,10 @@ and statement_desc top cxt f (s : J.statement_desc) : cxt = cxt | Return e -> ( match e.expression_desc with - | Fun { is_method; params; body; env; return_unit; async; directive } -> + | Fun { is_method; params; body; env; return_unit; async; iife; directive } -> let cxt = pp_function ?directive ~return_unit ~is_method ~async - ~need_paren:false + ~iife ~fn_state:Is_return cxt f params body env in diff --git a/jscomp/core/js_exp_make.ml b/jscomp/core/js_exp_make.ml index 229a99337b9..b320a6a9479 100644 --- a/jscomp/core/js_exp_make.ml +++ b/jscomp/core/js_exp_make.ml @@ -207,7 +207,7 @@ let unit : t = { expression_desc = Undefined {is_unit = true}; comment = None } [Js_fun_env.empty] is a mutable state .. *) -let ocaml_fun ?comment ?immutable_mask ~return_unit ~async ~one_unit_arg ?directive params body : t = +let ocaml_fun ?comment ?immutable_mask ?(iife = false) ?directive ~return_unit ~async ~one_unit_arg params body : t = let params = if one_unit_arg then [] else params in let len = List.length params in { @@ -220,12 +220,13 @@ let ocaml_fun ?comment ?immutable_mask ~return_unit ~async ~one_unit_arg ?direct env = Js_fun_env.make ?immutable_mask len; return_unit; async; + iife; directive; }; comment; } -let method_ ?comment ?immutable_mask ~return_unit params body : t = +let method_ ?comment ?immutable_mask ?(iife = false) ~return_unit params body : t = let len = List.length params in { expression_desc = @@ -237,6 +238,7 @@ let method_ ?comment ?immutable_mask ~return_unit params body : t = env = Js_fun_env.make ?immutable_mask len; return_unit; async = false; + iife; directive = None; }; comment; @@ -1303,6 +1305,7 @@ let of_block ?comment ?e block : t = env = Js_fun_env.make 0; return_unit; async = false; + iife = true; directive = None; }; } diff --git a/jscomp/core/js_exp_make.mli b/jscomp/core/js_exp_make.mli index 63b50a916dc..b15cbe1ddc4 100644 --- a/jscomp/core/js_exp_make.mli +++ b/jscomp/core/js_exp_make.mli @@ -88,10 +88,11 @@ val str : ?delim: J.delim -> ?comment: string -> string -> t val ocaml_fun : ?comment:string -> ?immutable_mask:bool array -> + ?iife:bool -> + ?directive:string -> return_unit:bool -> async:bool -> one_unit_arg:bool -> - ?directive:string -> J.ident list -> J.block -> t @@ -99,6 +100,7 @@ val ocaml_fun : val method_ : ?comment:string -> ?immutable_mask:bool array -> + ?iife:bool -> return_unit:bool -> J.ident list -> J.block -> diff --git a/jscomp/gentype_tests/typescript-react-example/src/Hooks.res.js b/jscomp/gentype_tests/typescript-react-example/src/Hooks.res.js index 39155944655..1a0a3edf281 100644 --- a/jscomp/gentype_tests/typescript-react-example/src/Hooks.res.js +++ b/jscomp/gentype_tests/typescript-react-example/src/Hooks.res.js @@ -10,21 +10,21 @@ function Hooks(Props) { let setCount = match[1]; let count = match[0]; return React.createElement("div", undefined, React.createElement("p", undefined, "Hooks example " + (vehicle.name + (" clicked " + (String(count) + " times")))), React.createElement("button", { - onClick: (param => setCount(param => count + 1 | 0)) + onClick: param => setCount(param => count + 1 | 0) }, "Click me"), React.createElement(ImportHooks.make, { person: { name: "Mary", age: 71 }, children: null, - renderMe: (x => x.randomString) + renderMe: x => x.randomString }, "child1", "child2"), React.createElement(ImportHookDefault.make, { person: { name: "DefaultImport", age: 42 }, children: null, - renderMe: (x => x.randomString) + renderMe: x => x.randomString }, "child1", "child2")); } diff --git a/jscomp/gentype_tests/typescript-react-example/src/ImmutableArray.res.js b/jscomp/gentype_tests/typescript-react-example/src/ImmutableArray.res.js index e7f7da18d88..d056c1477f5 100644 --- a/jscomp/gentype_tests/typescript-react-example/src/ImmutableArray.res.js +++ b/jscomp/gentype_tests/typescript-react-example/src/ImmutableArray.res.js @@ -51,13 +51,13 @@ let rangeBy = Belt_Array.rangeBy; let makeByU = Belt_Array.makeByU; function makeBy(c, f) { - return Belt_Array.makeBy(c, (x => f(x))); + return Belt_Array.makeBy(c, x => f(x)); } let makeByAndShuffleU = Belt_Array.makeByAndShuffleU; function makeByAndShuffle(c, f) { - return Belt_Array.makeByAndShuffle(c, (x => f(x))); + return Belt_Array.makeByAndShuffle(c, x => f(x)); } let zip = Belt_Array.zip; @@ -65,7 +65,7 @@ let zip = Belt_Array.zip; let zipByU = Belt_Array.zipByU; function zipBy(a1, a2, f) { - return Belt_Array.zipBy(a1, a2, ((x, y) => f(x, y))); + return Belt_Array.zipBy(a1, a2, (x, y) => f(x, y)); } let unzip = Belt_Array.unzip; @@ -85,97 +85,97 @@ function copy(a) { let forEachU = Belt_Array.forEachU; function forEach(a, f) { - Belt_Array.forEach(a, (x => f(x))); + Belt_Array.forEach(a, x => f(x)); } let mapU = Belt_Array.mapU; function map(a, f) { - return Belt_Array.map(a, (x => f(x))); + return Belt_Array.map(a, x => f(x)); } let keepWithIndexU = Belt_Array.keepWithIndexU; function keepWithIndex(a, f) { - return Belt_Array.keepWithIndex(a, ((x, y) => f(x, y))); + return Belt_Array.keepWithIndex(a, (x, y) => f(x, y)); } let keepMapU = Belt_Array.keepMapU; function keepMap(a, f) { - return Belt_Array.keepMap(a, (x => f(x))); + return Belt_Array.keepMap(a, x => f(x)); } let forEachWithIndexU = Belt_Array.forEachWithIndexU; function forEachWithIndex(a, f) { - Belt_Array.forEachWithIndex(a, ((x, y) => f(x, y))); + Belt_Array.forEachWithIndex(a, (x, y) => f(x, y)); } let mapWithIndexU = Belt_Array.mapWithIndexU; function mapWithIndex(a, f) { - return Belt_Array.mapWithIndex(a, ((x, y) => f(x, y))); + return Belt_Array.mapWithIndex(a, (x, y) => f(x, y)); } let partitionU = Belt_Array.partitionU; function partition(a, f) { - return Belt_Array.partition(a, (x => f(x))); + return Belt_Array.partition(a, x => f(x)); } let reduceU = Belt_Array.reduceU; function reduce(a, b, f) { - return Belt_Array.reduce(a, b, ((x, y) => f(x, y))); + return Belt_Array.reduce(a, b, (x, y) => f(x, y)); } let reduceReverseU = Belt_Array.reduceReverseU; function reduceReverse(a, b, f) { - return Belt_Array.reduceReverse(a, b, ((x, y) => f(x, y))); + return Belt_Array.reduceReverse(a, b, (x, y) => f(x, y)); } let reduceReverse2U = Belt_Array.reduceReverse2U; function reduceReverse2(a1, a2, c, f) { - return Belt_Array.reduceReverse2(a1, a2, c, ((x, y, z) => f(x, y, z))); + return Belt_Array.reduceReverse2(a1, a2, c, (x, y, z) => f(x, y, z)); } let someU = Belt_Array.someU; function some(a, f) { - return Belt_Array.some(a, (x => f(x))); + return Belt_Array.some(a, x => f(x)); } let everyU = Belt_Array.everyU; function every(a, f) { - return Belt_Array.every(a, (x => f(x))); + return Belt_Array.every(a, x => f(x)); } let every2U = Belt_Array.every2U; function every2(a1, a2, f) { - return Belt_Array.every2(a1, a2, ((x, y) => f(x, y))); + return Belt_Array.every2(a1, a2, (x, y) => f(x, y)); } let some2U = Belt_Array.some2U; function some2(a1, a2, f) { - return Belt_Array.some2(a1, a2, ((x, y) => f(x, y))); + return Belt_Array.some2(a1, a2, (x, y) => f(x, y)); } let cmpU = Belt_Array.cmpU; function cmp(a1, a2, f) { - return Belt_Array.cmp(a1, a2, ((x, y) => f(x, y))); + return Belt_Array.cmp(a1, a2, (x, y) => f(x, y)); } let eqU = Belt_Array.eqU; function eq(a1, a2, f) { - return Belt_Array.eq(a1, a2, ((x, y) => f(x, y))); + return Belt_Array.eq(a1, a2, (x, y) => f(x, y)); } let $$Array$1 = { diff --git a/jscomp/gentype_tests/typescript-react-example/src/Records.res.js b/jscomp/gentype_tests/typescript-react-example/src/Records.res.js index 9a7084d7701..8ad1df10ae0 100644 --- a/jscomp/gentype_tests/typescript-react-example/src/Records.res.js +++ b/jscomp/gentype_tests/typescript-react-example/src/Records.res.js @@ -6,7 +6,7 @@ import * as Belt_Option from "rescript/lib/es6/belt_Option.js"; import * as Caml_option from "rescript/lib/es6/caml_option.js"; function computeArea(param) { - return Math.imul(Math.imul(param.x, param.y), Belt_Option.mapWithDefault(param.z, 1, (n => n))); + return Math.imul(Math.imul(param.x, param.y), Belt_Option.mapWithDefault(param.z, 1, n => n)); } function coord2d(x, y) { @@ -20,20 +20,20 @@ function coord2d(x, y) { let getOpt = Belt_Option.mapWithDefault; function findAddress(business) { - return Belt_Option.mapWithDefault(business.address, /* [] */0, (a => ({ + return Belt_Option.mapWithDefault(business.address, /* [] */0, a => ({ hd: a, tl: /* [] */0 - }))); + })); } function findAllAddresses(businesses) { - return Belt_List.toArray(Belt_List.flatten(Belt_List.fromArray(Belt_Array.map(businesses, (business => Belt_List.concat(Belt_Option.mapWithDefault(business.address, /* [] */0, (a => ({ + return Belt_List.toArray(Belt_List.flatten(Belt_List.fromArray(Belt_Array.map(businesses, business => Belt_List.concat(Belt_Option.mapWithDefault(business.address, /* [] */0, a => ({ hd: a, tl: /* [] */0 - }))), Belt_Option.mapWithDefault(business.owner, /* [] */0, (p => Belt_Option.mapWithDefault(p.address, /* [] */0, (a => ({ + })), Belt_Option.mapWithDefault(business.owner, /* [] */0, p => Belt_Option.mapWithDefault(p.address, /* [] */0, a => ({ hd: a, tl: /* [] */0 - }))))))))))); + })))))))); } function getPayload(param) { @@ -63,10 +63,10 @@ function getPayloadRecordPlusOne(param) { } function findAddress2(business) { - return Belt_Option.mapWithDefault(Caml_option.nullable_to_opt(business.address2), /* [] */0, (a => ({ + return Belt_Option.mapWithDefault(Caml_option.nullable_to_opt(business.address2), /* [] */0, a => ({ hd: a, tl: /* [] */0 - }))); + })); } let someBusiness2_owner = null; @@ -80,11 +80,11 @@ let someBusiness2 = { }; function computeArea3(o) { - return Math.imul(Math.imul(o.x, o.y), Belt_Option.mapWithDefault(Caml_option.nullable_to_opt(o.z), 1, (n => n))); + return Math.imul(Math.imul(o.x, o.y), Belt_Option.mapWithDefault(Caml_option.nullable_to_opt(o.z), 1, n => n)); } function computeArea4(o) { - return Math.imul(Math.imul(o.x, o.y), Belt_Option.mapWithDefault(o.z, 1, (n => n))); + return Math.imul(Math.imul(o.x, o.y), Belt_Option.mapWithDefault(o.z, 1, n => n)); } function testMyRec(x) { diff --git a/jscomp/gentype_tests/typescript-react-example/src/TestPromise.res.js b/jscomp/gentype_tests/typescript-react-example/src/TestPromise.res.js index ddbae407af3..153c834adc8 100644 --- a/jscomp/gentype_tests/typescript-react-example/src/TestPromise.res.js +++ b/jscomp/gentype_tests/typescript-react-example/src/TestPromise.res.js @@ -5,9 +5,9 @@ import * as Js_promise from "rescript/lib/es6/js_promise.js"; import * as Caml_option from "rescript/lib/es6/caml_option.js"; function convert(p) { - return Js_promise.then_((param => Promise.resolve({ + return Js_promise.then_(param => Promise.resolve({ result: param.s - })), p); + }), p); } function barx(xOpt, param) { diff --git a/jscomp/gentype_tests/typescript-react-example/src/nested/Tuples.res.js b/jscomp/gentype_tests/typescript-react-example/src/nested/Tuples.res.js index 63527fc787d..71b9cb5d026 100644 --- a/jscomp/gentype_tests/typescript-react-example/src/nested/Tuples.res.js +++ b/jscomp/gentype_tests/typescript-react-example/src/nested/Tuples.res.js @@ -7,11 +7,11 @@ function testTuple(param) { } function computeArea(param) { - return Math.imul(Math.imul(param[0], param[1]), Belt_Option.mapWithDefault(param[2], 1, (n => n))); + return Math.imul(Math.imul(param[0], param[1]), Belt_Option.mapWithDefault(param[2], 1, n => n)); } function computeAreaWithIdent(param) { - return Math.imul(Math.imul(param[0], param[1]), Belt_Option.mapWithDefault(param[2], 1, (n => n))); + return Math.imul(Math.imul(param[0], param[1]), Belt_Option.mapWithDefault(param[2], 1, n => n)); } function computeAreaNoConverters(param) { diff --git a/jscomp/gentype_tests/typescript-react-example/src/nested/Types.res.js b/jscomp/gentype_tests/typescript-react-example/src/nested/Types.res.js index 3b1def4885a..11917c6506c 100644 --- a/jscomp/gentype_tests/typescript-react-example/src/nested/Types.res.js +++ b/jscomp/gentype_tests/typescript-react-example/src/nested/Types.res.js @@ -57,7 +57,7 @@ function testInstantiateTypeParameter(x) { let currentTime = new Date(); -let optFunction = (() => 3); +let optFunction = () => 3; let ObjectId = {}; diff --git a/jscomp/test/Import.js b/jscomp/test/Import.js index bc3190de151..56c5384054d 100644 --- a/jscomp/test/Import.js +++ b/jscomp/test/Import.js @@ -19,9 +19,9 @@ eachIntLazy({ tl: /* [] */0 } } -}, (n => { +}, n => { console.log("lazy", n); -})); +}); eachIntAsync({ hd: 1, @@ -32,9 +32,9 @@ eachIntAsync({ tl: /* [] */0 } } -}, (n => { +}, n => { console.log("async", n); -})); +}); let beltAsModule = await import("../../lib/js/belt_List.js"); diff --git a/jscomp/test/SafePromises.js b/jscomp/test/SafePromises.js index 1d6bf5dec81..91227a4005a 100644 --- a/jscomp/test/SafePromises.js +++ b/jscomp/test/SafePromises.js @@ -5,11 +5,11 @@ let Js_promise2 = require("../../lib/js/js_promise2.js"); async function nestedPromise(xxx) { let xx = await xxx; - Js_promise2.then(xx, (x => Promise.resolve((console.log("Promise2.then", x), undefined)))); - Js_promise2.$$catch(xx, (x => { + Js_promise2.then(xx, x => Promise.resolve((console.log("Promise2.then", x), undefined))); + Js_promise2.$$catch(xx, x => { console.log("Promise2.catch_", x); return Promise.resolve(0); - })); + }); xx.then(x => Promise.resolve((console.log("Promise.then_", x), undefined))); } diff --git a/jscomp/test/UncurriedExternals.js b/jscomp/test/UncurriedExternals.js index 4d44e40dcaa..5ec20d40736 100644 --- a/jscomp/test/UncurriedExternals.js +++ b/jscomp/test/UncurriedExternals.js @@ -14,7 +14,7 @@ function dd() { let h = sum(1.0, 2.0); let M = { - sum: ((prim0, prim1) => sum(prim0, prim1)) + sum: (prim0, prim1) => sum(prim0, prim1) }; let hh = M.sum(1.0, 2.0); @@ -34,17 +34,17 @@ let te = { let tcr = {}; function tsiC(c) { - c.increment = (function (amount) { + c.increment = function (amount) { let me = this ; console.log(me); - }); + }; } function tsiU(c) { - c.increment = (function (amount) { + c.increment = function (amount) { let me = this ; console.log(me); - }); + }; } let match = React.useState(() => 3); diff --git a/jscomp/test/UntaggedVariants.js b/jscomp/test/UntaggedVariants.js index 399d6a5ca48..6dab75df61c 100644 --- a/jscomp/test/UntaggedVariants.js +++ b/jscomp/test/UntaggedVariants.js @@ -367,7 +367,7 @@ function classify$9(v) { } } -let ff = (x => x + 1 | 0); +let ff = x => x + 1 | 0; let TestFunctionCase = { classify: classify$9, @@ -486,7 +486,7 @@ async function classify$10(a) { return; } else { if (Array.isArray(a)) { - console.log(Belt_Array.joinWith(a, "-", (x => x))); + console.log(Belt_Array.joinWith(a, "-", x => x)); return; } if (a instanceof Promise) { @@ -510,7 +510,7 @@ let Arr = { async function classifyAll(t) { if (Array.isArray(t)) { - console.log(Belt_Array.joinWith(t, "-", (x => x))); + console.log(Belt_Array.joinWith(t, "-", x => x)); return; } if (t instanceof Promise) { diff --git a/jscomp/test/a_filename_test.js b/jscomp/test/a_filename_test.js index 1acd60ec615..1c8fda7a7ee 100644 --- a/jscomp/test/a_filename_test.js +++ b/jscomp/test/a_filename_test.js @@ -18,11 +18,11 @@ function eq(loc, x, y) { suites.contents = { hd: [ loc + (" id " + String(test_id.contents)), - (() => ({ + () => ({ TAG: "Eq", _0: x, _1: y - })) + }) ], tl: suites.contents }; diff --git a/jscomp/test/a_list_test.js b/jscomp/test/a_list_test.js index bc2560ebc12..7bef3fdfe52 100644 --- a/jscomp/test/a_list_test.js +++ b/jscomp/test/a_list_test.js @@ -6,7 +6,7 @@ let Ext_list_test = require("./ext_list_test.js"); let suites_0 = [ "drop", - (param => ({ + param => ({ TAG: "Eq", _0: Ext_list_test.drop(3, { hd: 0, @@ -19,13 +19,13 @@ let suites_0 = [ } }), _1: /* [] */0 - })) + }) ]; let suites_1 = { hd: [ "drop1", - (param => ({ + param => ({ TAG: "Eq", _0: Ext_list_test.drop(2, { hd: 0, @@ -41,12 +41,12 @@ let suites_1 = { hd: 2, tl: /* [] */0 } - })) + }) ], tl: { hd: [ "flat_map", - (param => ({ + param => ({ TAG: "Eq", _0: { hd: 0, @@ -64,7 +64,7 @@ let suites_1 = { } } }, - _1: Ext_list_test.flat_map((x => { + _1: Ext_list_test.flat_map(x => { if (x % 2 === 0) { return { hd: 0, @@ -79,7 +79,7 @@ let suites_1 = { } }; } - }), { + }, { hd: 0, tl: { hd: 0, @@ -92,7 +92,7 @@ let suites_1 = { } } }) - })) + }) ], tl: /* [] */0 } diff --git a/jscomp/test/a_string_test.js b/jscomp/test/a_string_test.js index 159d973ba30..904650af26b 100644 --- a/jscomp/test/a_string_test.js +++ b/jscomp/test/a_string_test.js @@ -7,7 +7,7 @@ let Ext_string_test = require("./ext_string_test.js"); let suites_0 = [ "split", - (param => ({ + param => ({ TAG: "Eq", _0: Ext_string_test.split(true, "hihi", /* 'i' */105), _1: { @@ -20,13 +20,13 @@ let suites_0 = [ } } } - })) + }) ]; let suites_1 = { hd: [ "split_non_empty", - (param => ({ + param => ({ TAG: "Eq", _0: Ext_string_test.split(undefined, "hihi", /* 'i' */105), _1: { @@ -36,21 +36,21 @@ let suites_1 = { tl: /* [] */0 } } - })) + }) ], tl: { hd: [ "split_empty", - (param => ({ + param => ({ TAG: "Eq", _0: Ext_string_test.split(true, "", /* 'i' */105), _1: /* [] */0 - })) + }) ], tl: { hd: [ "split_normal", - (param => ({ + param => ({ TAG: "Eq", _0: Ext_string_test.split(true, "h i i", /* ' ' */32), _1: { @@ -63,20 +63,20 @@ let suites_1 = { } } } - })) + }) ], tl: { hd: [ "split_by", - (param => ({ + param => ({ TAG: "Eq", - _0: List.filter((s => s !== ""), Ext_string_test.split_by(undefined, (x => { + _0: List.filter(s => s !== "", Ext_string_test.split_by(undefined, x => { if (x === /* ' ' */32) { return true; } else { return x === /* '\t' */9; } - }), "h hgso hgso \t hi")), + }, "h hgso hgso \t hi")), _1: { hd: "h", tl: { @@ -90,7 +90,7 @@ let suites_1 = { } } } - })) + }) ], tl: /* [] */0 } diff --git a/jscomp/test/and_or_tailcall_test.js b/jscomp/test/and_or_tailcall_test.js index a5352f2c0a9..19a442c44fb 100644 --- a/jscomp/test/and_or_tailcall_test.js +++ b/jscomp/test/and_or_tailcall_test.js @@ -33,21 +33,21 @@ function or_f(b, x, _n) { let suites_0 = [ "and_tail", - (param => ({ + param => ({ TAG: "Eq", _0: false, _1: f(true, 1, 0) - })) + }) ]; let suites_1 = { hd: [ "or_tail", - (param => ({ + param => ({ TAG: "Eq", _0: false, _1: or_f(false, 1, 0) - })) + }) ], tl: /* [] */0 }; diff --git a/jscomp/test/ari_regress_test.js b/jscomp/test/ari_regress_test.js index 089dd39d88e..20043923ee3 100644 --- a/jscomp/test/ari_regress_test.js +++ b/jscomp/test/ari_regress_test.js @@ -25,39 +25,39 @@ function v(__x) { let suites_0 = [ "curry", - (param => ({ + param => ({ TAG: "Eq", _0: g, _1: 7 - })) + }) ]; let suites_1 = { hd: [ "curry2", - (param => ({ + param => ({ TAG: "Eq", _0: 14, _1: (v(1), v(1)) - })) + }) ], tl: { hd: [ "curry3", - (param => ({ + param => ({ TAG: "Eq", _0: x, _1: 14 - })) + }) ], tl: { hd: [ "File \"ari_regress_test.res\", line 35, characters 5-12", - (param => ({ + param => ({ TAG: "Eq", _0: h.contents, _1: 2 - })) + }) ], tl: /* [] */0 } diff --git a/jscomp/test/arith_parser.js b/jscomp/test/arith_parser.js index c13f393f534..7520e20b28d 100644 --- a/jscomp/test/arith_parser.js +++ b/jscomp/test/arith_parser.js @@ -139,30 +139,30 @@ let yynames_block = "\ "; let yyact = [ - (param => { + param => { throw new Error("Failure", { cause: { RE_EXN_ID: "Failure", _1: "parser" } }); - }), - (__caml_parser_env => Parsing.peek_val(__caml_parser_env, 1)), - (__caml_parser_env => { + }, + __caml_parser_env => Parsing.peek_val(__caml_parser_env, 1), + __caml_parser_env => { let _1 = Parsing.peek_val(__caml_parser_env, 0); return { TAG: "Numeral", _0: _1 }; - }), - (__caml_parser_env => { + }, + __caml_parser_env => { let _1 = Parsing.peek_val(__caml_parser_env, 0); return { TAG: "Variable", _0: _1 }; - }), - (__caml_parser_env => { + }, + __caml_parser_env => { let _1 = Parsing.peek_val(__caml_parser_env, 2); let _3 = Parsing.peek_val(__caml_parser_env, 0); return { @@ -170,8 +170,8 @@ let yyact = [ _0: _1, _1: _3 }; - }), - (__caml_parser_env => { + }, + __caml_parser_env => { let _1 = Parsing.peek_val(__caml_parser_env, 2); let _3 = Parsing.peek_val(__caml_parser_env, 0); return { @@ -179,8 +179,8 @@ let yyact = [ _0: _1, _1: _3 }; - }), - (__caml_parser_env => { + }, + __caml_parser_env => { let _1 = Parsing.peek_val(__caml_parser_env, 2); let _3 = Parsing.peek_val(__caml_parser_env, 0); return { @@ -188,8 +188,8 @@ let yyact = [ _0: _1, _1: _3 }; - }), - (__caml_parser_env => { + }, + __caml_parser_env => { let _1 = Parsing.peek_val(__caml_parser_env, 2); let _3 = Parsing.peek_val(__caml_parser_env, 0); return { @@ -197,23 +197,23 @@ let yyact = [ _0: _1, _1: _3 }; - }), - (__caml_parser_env => { + }, + __caml_parser_env => { let _2 = Parsing.peek_val(__caml_parser_env, 0); return { TAG: "Negate", _0: _2 }; - }), - (__caml_parser_env => Parsing.peek_val(__caml_parser_env, 1)), - (__caml_parser_env => { + }, + __caml_parser_env => Parsing.peek_val(__caml_parser_env, 1), + __caml_parser_env => { throw new Error(Parsing.YYexit, { cause: { RE_EXN_ID: Parsing.YYexit, _1: Parsing.peek_val(__caml_parser_env, 0) } }); - }) + } ]; let yytables = { diff --git a/jscomp/test/arity_deopt.js b/jscomp/test/arity_deopt.js index aefb476f331..c742f2512db 100644 --- a/jscomp/test/arity_deopt.js +++ b/jscomp/test/arity_deopt.js @@ -16,11 +16,11 @@ function eq(loc, x, y) { suites.contents = { hd: [ loc + (" id " + String(test_id.contents)), - (() => ({ + () => ({ TAG: "Eq", _0: x, _1: y - })) + }) ], tl: suites.contents }; diff --git a/jscomp/test/arity_infer.js b/jscomp/test/arity_infer.js index 87b96264a46..18da9fe57b0 100644 --- a/jscomp/test/arity_infer.js +++ b/jscomp/test/arity_infer.js @@ -5,7 +5,7 @@ function f0(x) { let tmp; if (x > 3) { - tmp = (x => x + 1 | 0); + tmp = x => x + 1 | 0; } else { throw new Error("Not_found", { cause: { @@ -29,16 +29,16 @@ function f3(x) { let tmp; switch (x) { case 0 : - tmp = (x => x + 1 | 0); + tmp = x => x + 1 | 0; break; case 1 : - tmp = (x => x + 2 | 0); + tmp = x => x + 2 | 0; break; case 2 : - tmp = (x => x + 3 | 0); + tmp = x => x + 3 | 0; break; case 3 : - tmp = (x => x + 4 | 0); + tmp = x => x + 4 | 0; break; default: throw new Error("Not_found", { diff --git a/jscomp/test/array_data_util.js b/jscomp/test/array_data_util.js index ff74d0ad4af..98acf7b5e8e 100644 --- a/jscomp/test/array_data_util.js +++ b/jscomp/test/array_data_util.js @@ -4,11 +4,11 @@ let Belt_Array = require("../../lib/js/belt_Array.js"); function range(i, j) { - return Belt_Array.makeBy((j - i | 0) + 1 | 0, (k => k + i | 0)); + return Belt_Array.makeBy((j - i | 0) + 1 | 0, k => k + i | 0); } function randomRange(i, j) { - let v = Belt_Array.makeBy((j - i | 0) + 1 | 0, (k => k + i | 0)); + let v = Belt_Array.makeBy((j - i | 0) + 1 | 0, k => k + i | 0); Belt_Array.shuffleInPlace(v); return v; } diff --git a/jscomp/test/array_subtle_test.js b/jscomp/test/array_subtle_test.js index f94d4bc6432..4233f2ef8dc 100644 --- a/jscomp/test/array_subtle_test.js +++ b/jscomp/test/array_subtle_test.js @@ -19,11 +19,11 @@ function eq(loc, param) { suites.contents = { hd: [ loc + (" id " + String(test_id.contents)), - (() => ({ + () => ({ TAG: "Eq", _0: x, _1: y - })) + }) ], tl: suites.contents }; diff --git a/jscomp/test/array_test.js b/jscomp/test/array_test.js index 53b64b07281..f84793a3f51 100644 --- a/jscomp/test/array_test.js +++ b/jscomp/test/array_test.js @@ -58,9 +58,9 @@ function is_sorted(x) { let array_suites_0 = [ "init", - (param => ({ + param => ({ TAG: "Eq", - _0: $$Array.init(5, (x => x)), + _0: $$Array.init(5, x => x), _1: [ 0, 1, @@ -68,20 +68,20 @@ let array_suites_0 = [ 3, 4 ] - })) + }) ]; let array_suites_1 = { hd: [ "toList", - (param => { - let aux = xs => List.fold_left(((acc, param) => ({ + param => { + let aux = xs => List.fold_left((acc, param) => ({ hd: [ $$Array.to_list(param[0]), param[1] ], tl: acc - })), /* [] */0, xs); + }), /* [] */0, xs); let match = List.split(aux({ hd: [ [], @@ -94,12 +94,12 @@ let array_suites_1 = { _0: match[0], _1: match[1] }; - }) + } ], tl: { hd: [ "concat", - (param => ({ + param => ({ TAG: "Eq", _0: [ 0, @@ -129,27 +129,27 @@ let array_suites_1 = { } } }) - })) + }) ], tl: { hd: [ "make", - (param => ({ + param => ({ TAG: "Eq", _0: [ Caml_array.make(100, /* 'a' */97), Caml_array.make_float(100) ], _1: [ - $$Array.init(100, (param => /* 'a' */97)), - $$Array.init(100, (param => 0)) + $$Array.init(100, param => /* 'a' */97), + $$Array.init(100, param => 0) ] - })) + }) ], tl: { hd: [ "sub", - (param => ({ + param => ({ TAG: "Eq", _0: $$Array.sub([ 0, @@ -162,18 +162,18 @@ let array_suites_1 = { 2, 3 ] - })) + }) ], tl: { hd: [ "blit", - (param => { + param => { let u = [ 100, 0, 0 ]; - let v = $$Array.init(3, (x => (x << 1))); + let v = $$Array.init(3, x => (x << 1)); $$Array.blit(v, 1, u, 1, 2); return { TAG: "Eq", @@ -194,13 +194,13 @@ let array_suites_1 = { u ] }; - }) + } ], tl: { hd: [ "File \"array_test.res\", line 75, characters 8-15", - (param => { - let a0 = $$Array.init(100, (i => (i << 0))); + param => { + let a0 = $$Array.init(100, i => (i << 0)); $$Array.blit(a0, 10, a0, 5, 20); return { TAG: "Eq", @@ -230,15 +230,15 @@ let array_suites_1 = { 26, 27, 28 - ], ((prim0, prim1) => prim0 === prim1)) + ], (prim0, prim1) => prim0 === prim1) }; - }) + } ], tl: { hd: [ "File \"array_test.res\", line 118, characters 8-15", - (param => { - let a0 = $$Array.init(100, (i => (i << 0))); + param => { + let a0 = $$Array.init(100, i => (i << 0)); $$Array.blit(a0, 5, a0, 10, 20); return { TAG: "Eq", @@ -270,26 +270,26 @@ let array_suites_1 = { 18, 19, 20 - ], ((prim0, prim1) => prim0 === prim1)) + ], (prim0, prim1) => prim0 === prim1) }; - }) + } ], tl: { hd: [ "make", - (param => ({ + param => ({ TAG: "Eq", _0: Caml_array.make(2, 1), _1: [ 1, 1 ] - })) + }) ], tl: { hd: [ "sort", - (param => { + param => { let u = [ 3, 0, @@ -305,20 +305,20 @@ let array_suites_1 = { ], u), _1: true }; - }) + } ], tl: { hd: [ "sort_large", - (param => { - let v = $$Array.init(4, (i => i % 17)); + param => { + let v = $$Array.init(4, i => i % 17); $$Array.sort(Caml.int_compare, v); return { TAG: "Eq", _0: true, _1: is_sorted(v) }; - }) + } ], tl: /* [] */0 } diff --git a/jscomp/test/ast_abstract_test.js b/jscomp/test/ast_abstract_test.js index d3fd140d208..c8f1e54872a 100644 --- a/jscomp/test/ast_abstract_test.js +++ b/jscomp/test/ast_abstract_test.js @@ -17,11 +17,11 @@ function eq(loc, x, y) { suites.contents = { hd: [ loc + (" id " + String(test_id.contents)), - (() => ({ + () => ({ TAG: "Eq", _0: x, _1: y - })) + }) ], tl: suites.contents }; diff --git a/jscomp/test/attr_test.js b/jscomp/test/attr_test.js index 684edfb40ee..646d4e7de1c 100644 --- a/jscomp/test/attr_test.js +++ b/jscomp/test/attr_test.js @@ -15,9 +15,9 @@ function max2(x, y) { let hh = 1 + 2; function f(x) { - des(x, (() => { + des(x, () => { console.log("hei"); - })); + }); } exports.u = u; diff --git a/jscomp/test/belt_float_ntest.js b/jscomp/test/belt_float_ntest.js index e81041b9184..701b894b4ce 100644 --- a/jscomp/test/belt_float_ntest.js +++ b/jscomp/test/belt_float_ntest.js @@ -9,20 +9,20 @@ function eq(loc, a, b) { Nodeassert.strictEqual(a, b, loc); } -Nodetest.describe("Belt.Float", (() => { - Nodetest.test("fromInt", (() => { +Nodetest.describe("Belt.Float", () => { + Nodetest.test("fromInt", () => { eq("File \"belt_float_ntest.res\", line 9, characters 7-14", 1, 1.0); eq("File \"belt_float_ntest.res\", line 10, characters 7-14", -1, -1.0); - })); - Nodetest.test("toInt", (() => { + }); + Nodetest.test("toInt", () => { eq("File \"belt_float_ntest.res\", line 14, characters 7-14", 1, 1); eq("File \"belt_float_ntest.res\", line 15, characters 7-14", 1, 1); eq("File \"belt_float_ntest.res\", line 16, characters 7-14", 1, 1); eq("File \"belt_float_ntest.res\", line 17, characters 7-14", -1, -1); eq("File \"belt_float_ntest.res\", line 18, characters 7-14", -1, -1); eq("File \"belt_float_ntest.res\", line 19, characters 7-14", -1, -1); - })); - Nodetest.test("fromString", (() => { + }); + Nodetest.test("fromString", () => { eq("File \"belt_float_ntest.res\", line 23, characters 7-14", Belt_Float.fromString("1"), 1.0); eq("File \"belt_float_ntest.res\", line 24, characters 7-14", Belt_Float.fromString("-1"), -1.0); eq("File \"belt_float_ntest.res\", line 25, characters 7-14", Belt_Float.fromString("1.7"), 1.7); @@ -30,19 +30,19 @@ Nodetest.describe("Belt.Float", (() => { eq("File \"belt_float_ntest.res\", line 27, characters 7-14", Belt_Float.fromString("-1.5"), -1.5); eq("File \"belt_float_ntest.res\", line 28, characters 7-14", Belt_Float.fromString("-1.7"), -1.7); eq("File \"belt_float_ntest.res\", line 29, characters 7-14", Belt_Float.fromString("not a float"), undefined); - })); - Nodetest.test("toString", (() => { + }); + Nodetest.test("toString", () => { eq("File \"belt_float_ntest.res\", line 33, characters 7-14", String(1.0), "1"); eq("File \"belt_float_ntest.res\", line 34, characters 7-14", String(-1.0), "-1"); eq("File \"belt_float_ntest.res\", line 35, characters 7-14", String(-1.5), "-1.5"); - })); - Nodetest.test("operators", (() => { + }); + Nodetest.test("operators", () => { eq("File \"belt_float_ntest.res\", line 40, characters 7-14", 2.0 + 3.0, 5.0); eq("File \"belt_float_ntest.res\", line 41, characters 7-14", 2.0 - 3.0, -1.0); eq("File \"belt_float_ntest.res\", line 42, characters 7-14", 2.0 * 3.0, 6.0); eq("File \"belt_float_ntest.res\", line 43, characters 7-14", 3.0 / 2.0, 1.5); - })); -})); + }); +}); let F; diff --git a/jscomp/test/belt_int_ntest.js b/jscomp/test/belt_int_ntest.js index 1448cf0ee9c..823f399f5ad 100644 --- a/jscomp/test/belt_int_ntest.js +++ b/jscomp/test/belt_int_ntest.js @@ -9,20 +9,20 @@ function eq(loc, a, b) { Nodeassert.strictEqual(a, b, loc); } -Nodetest.describe("Belt.Int", (() => { - Nodetest.test("toFloat", (() => { +Nodetest.describe("Belt.Int", () => { + Nodetest.test("toFloat", () => { eq("File \"belt_int_ntest.res\", line 9, characters 7-14", 1, 1.0); eq("File \"belt_int_ntest.res\", line 10, characters 7-14", -1, -1.0); - })); - Nodetest.test("fromFloat", (() => { + }); + Nodetest.test("fromFloat", () => { eq("File \"belt_int_ntest.res\", line 14, characters 7-14", 1, 1); eq("File \"belt_int_ntest.res\", line 15, characters 7-14", 1, 1); eq("File \"belt_int_ntest.res\", line 16, characters 7-14", 1, 1); eq("File \"belt_int_ntest.res\", line 17, characters 7-14", -1, -1); eq("File \"belt_int_ntest.res\", line 18, characters 7-14", -1, -1); eq("File \"belt_int_ntest.res\", line 19, characters 7-14", -1, -1); - })); - Nodetest.test("fromString", (() => { + }); + Nodetest.test("fromString", () => { eq("File \"belt_int_ntest.res\", line 23, characters 7-14", Belt_Int.fromString("1"), 1); eq("File \"belt_int_ntest.res\", line 24, characters 7-14", Belt_Int.fromString("-1"), -1); eq("File \"belt_int_ntest.res\", line 25, characters 7-14", Belt_Int.fromString("1.7"), 1); @@ -30,18 +30,18 @@ Nodetest.describe("Belt.Int", (() => { eq("File \"belt_int_ntest.res\", line 27, characters 7-14", Belt_Int.fromString("-1.5"), -1); eq("File \"belt_int_ntest.res\", line 28, characters 7-14", Belt_Int.fromString("-1.7"), -1); eq("File \"belt_int_ntest.res\", line 29, characters 7-14", Belt_Int.fromString("not an int"), undefined); - })); - Nodetest.test("toString", (() => { + }); + Nodetest.test("toString", () => { eq("File \"belt_int_ntest.res\", line 33, characters 7-14", String(1), "1"); eq("File \"belt_int_ntest.res\", line 34, characters 7-14", String(-1), "-1"); - })); - Nodetest.test("operators", (() => { + }); + Nodetest.test("operators", () => { eq("File \"belt_int_ntest.res\", line 40, characters 7-14", 5, 5); eq("File \"belt_int_ntest.res\", line 41, characters 7-14", -1, -1); eq("File \"belt_int_ntest.res\", line 42, characters 7-14", 6, 6); eq("File \"belt_int_ntest.res\", line 43, characters 7-14", 0, 0); - })); -})); + }); +}); let I; diff --git a/jscomp/test/belt_mapint_ntest.js b/jscomp/test/belt_mapint_ntest.js index bc6c8b9fd75..eac12a4e461 100644 --- a/jscomp/test/belt_mapint_ntest.js +++ b/jscomp/test/belt_mapint_ntest.js @@ -9,8 +9,8 @@ function ok(loc, a) { Nodeassert.ok(a, loc); } -Nodetest.describe("Belt.Map.Int", (() => { - Nodetest.test("set", (() => { +Nodetest.describe("Belt.Map.Int", () => { + Nodetest.test("set", () => { let m; for (let i = 0; i <= 999999; ++i) { m = Belt_MapInt.set(m, i, i); @@ -22,8 +22,8 @@ Nodetest.describe("Belt.Map.Int", (() => { m = Belt_MapInt.remove(m, i$2); } ok("File \"belt_mapint_ntest.res\", line 24, characters 7-14", Belt_MapInt.isEmpty(m)); - })); -})); + }); +}); let M; diff --git a/jscomp/test/belt_result_alias_test.js b/jscomp/test/belt_result_alias_test.js index a8d01baab6d..b857620b878 100644 --- a/jscomp/test/belt_result_alias_test.js +++ b/jscomp/test/belt_result_alias_test.js @@ -6,11 +6,11 @@ let Belt_Result = require("../../lib/js/belt_Result.js"); Belt_Result.map({ TAG: "Ok", _0: "Test" -}, (r => "Value: " + r)); +}, r => "Value: " + r); Belt_Result.getWithDefault(Belt_Result.map({ TAG: "Error", _0: "error" -}, (r => "Value: " + r)), "success"); +}, r => "Value: " + r), "success"); /* Not a pure module */ diff --git a/jscomp/test/bench.js b/jscomp/test/bench.js index 6fcee9bdb5e..8223ef24712 100644 --- a/jscomp/test/bench.js +++ b/jscomp/test/bench.js @@ -47,9 +47,9 @@ function fold_left(f, x, a) { } function f2() { - let arr = init(3000000, (i => i)); - let b = map((i => i + i - 1), arr); - let v = fold_left(((prim0, prim1) => prim0 + prim1), 0, b); + let arr = init(3000000, i => i); + let b = map(i => i + i - 1, arr); + let v = fold_left((prim0, prim1) => prim0 + prim1, 0, b); console.log(Pervasives.string_of_float(v)); } diff --git a/jscomp/test/bs_abstract_test.js b/jscomp/test/bs_abstract_test.js index 000d990d458..9ce29796a9e 100644 --- a/jscomp/test/bs_abstract_test.js +++ b/jscomp/test/bs_abstract_test.js @@ -10,7 +10,7 @@ let v = { v.tl = v; let f = { - k: ((x, y) => x === y), + k: (x, y) => x === y, y: "x" }; diff --git a/jscomp/test/bs_array_test.js b/jscomp/test/bs_array_test.js index 81a93b18953..610ef1fa8bc 100644 --- a/jscomp/test/bs_array_test.js +++ b/jscomp/test/bs_array_test.js @@ -32,11 +32,11 @@ function neq(loc, x, y) { suites.contents = { hd: [ loc + (" id " + String(test_id.contents)), - (() => ({ + () => ({ TAG: "Neq", _0: x, _1: y - })) + }) ], tl: suites.contents }; @@ -51,7 +51,7 @@ console.log([ 2, 3, 4 -].filter(x => x > 2).map((x, i) => x + i | 0).reduce(((x, y) => x + y | 0), 0)); +].filter(x => x > 2).map((x, i) => x + i | 0).reduce((x, y) => x + y | 0, 0)); let v = [ 1, @@ -72,19 +72,19 @@ eq("File \"bs_array_test.res\", line 31, characters 4-11", [ undefined ]); -$$throw("File \"bs_array_test.res\", line 35, characters 8-15", (() => { +$$throw("File \"bs_array_test.res\", line 35, characters 8-15", () => { Belt_Array.getExn([ 0, 1 ], -1); -})); +}); -$$throw("File \"bs_array_test.res\", line 36, characters 8-15", (() => { +$$throw("File \"bs_array_test.res\", line 36, characters 8-15", () => { Belt_Array.getExn([ 0, 1 ], 2); -})); +}); function f(extra) { return Belt_Array.getExn([ @@ -101,15 +101,15 @@ b("File \"bs_array_test.res\", line 38, characters 4-11", Caml_obj.equal([ 1 ])); -$$throw("File \"bs_array_test.res\", line 44, characters 8-15", (() => Belt_Array.setExn([ +$$throw("File \"bs_array_test.res\", line 44, characters 8-15", () => Belt_Array.setExn([ 0, 1 -], -1, 0))); +], -1, 0)); -$$throw("File \"bs_array_test.res\", line 45, characters 8-15", (() => Belt_Array.setExn([ +$$throw("File \"bs_array_test.res\", line 45, characters 8-15", () => Belt_Array.setExn([ 0, 1 -], 2, 0))); +], 2, 0)); b("File \"bs_array_test.res\", line 46, characters 4-11", !Belt_Array.set([ 1, @@ -174,7 +174,7 @@ function add(x, y) { return x + y | 0; } -let v$5 = Belt_Array.makeBy(3000, (i => i)); +let v$5 = Belt_Array.makeBy(3000, i => i); let u = Belt_Array.shuffle(v$5); @@ -218,26 +218,26 @@ b("File \"bs_array_test.res\", line 101, characters 4-11", Caml_obj.equal(Belt_A b("File \"bs_array_test.res\", line 102, characters 4-11", Caml_obj.equal(Belt_Array.rangeBy(3, 3, 1), [3])); -eq("File \"bs_array_test.res\", line 106, characters 5-12", Belt_Array.reduceReverse([], 100, ((prim0, prim1) => prim0 - prim1 | 0)), 100); +eq("File \"bs_array_test.res\", line 106, characters 5-12", Belt_Array.reduceReverse([], 100, (prim0, prim1) => prim0 - prim1 | 0), 100); eq("File \"bs_array_test.res\", line 107, characters 5-12", Belt_Array.reduceReverse([ 1, 2 -], 100, ((prim0, prim1) => prim0 - prim1 | 0)), 97); +], 100, (prim0, prim1) => prim0 - prim1 | 0), 97); eq("File \"bs_array_test.res\", line 108, characters 5-12", Belt_Array.reduceReverse([ 1, 2, 3, 4 -], 100, ((prim0, prim1) => prim0 - prim1 | 0)), 90); +], 100, (prim0, prim1) => prim0 - prim1 | 0), 90); eq("File \"bs_array_test.res\", line 109, characters 5-12", Belt_Array.reduceWithIndex([ 1, 2, 3, 4 -], 0, ((acc, x, i) => (acc + x | 0) + i | 0)), 16); +], 0, (acc, x, i) => (acc + x | 0) + i | 0), 16); b("File \"bs_array_test.res\", line 110, characters 4-11", Belt_Array.reduceReverse2([ 1, @@ -246,7 +246,7 @@ b("File \"bs_array_test.res\", line 110, characters 4-11", Belt_Array.reduceReve ], [ 1, 2 -], 0, ((acc, x, y) => (acc + x | 0) + y | 0)) === 6); +], 0, (acc, x, y) => (acc + x | 0) + y | 0) === 6); function addone(x) { return x + 1 | 0; @@ -276,9 +276,9 @@ function makeMatrixExn(sx, sy, init) { return res; } -eq("File \"bs_array_test.res\", line 129, characters 5-12", Belt_Array.makeBy(0, (param => 1)), []); +eq("File \"bs_array_test.res\", line 129, characters 5-12", Belt_Array.makeBy(0, param => 1), []); -eq("File \"bs_array_test.res\", line 130, characters 5-12", Belt_Array.makeBy(3, (i => i)), [ +eq("File \"bs_array_test.res\", line 130, characters 5-12", Belt_Array.makeBy(3, i => i), [ 0, 1, 2 @@ -317,7 +317,7 @@ eq("File \"bs_array_test.res\", line 134, characters 5-12", makeMatrixExn(1, 1, eq("File \"bs_array_test.res\", line 135, characters 5-12", [].slice(0), []); -eq("File \"bs_array_test.res\", line 136, characters 5-12", Belt_Array.map([], (prim => prim + 1 | 0)), []); +eq("File \"bs_array_test.res\", line 136, characters 5-12", Belt_Array.map([], prim => prim + 1 | 0), []); eq("File \"bs_array_test.res\", line 137, characters 5-12", Belt_Array.mapWithIndex([], add), []); @@ -357,7 +357,7 @@ eq("File \"bs_array_test.res\", line 142, characters 5-12", Belt_Array.map([ 1, 2, 3 -], (prim => prim + 1 | 0)), [ +], prim => prim + 1 | 0), [ 2, 3, 4 @@ -396,18 +396,18 @@ eq("File \"bs_array_test.res\", line 146, characters 5-12", Belt_List.toArray({ 3 ]); -let v$6 = Belt_Array.makeBy(10, (i => i)); +let v$6 = Belt_Array.makeBy(10, i => i); -let v0 = Belt_Array.keep(v$6, (x => x % 2 === 0)); +let v0 = Belt_Array.keep(v$6, x => x % 2 === 0); -let v1 = Belt_Array.keep(v$6, (x => x % 3 === 0)); +let v1 = Belt_Array.keep(v$6, x => x % 3 === 0); -let v2 = Belt_Array.keepMap(v$6, (x => { +let v2 = Belt_Array.keepMap(v$6, x => { if (x % 2 === 0) { return x + 1 | 0; } -})); +}); eq("File \"bs_array_test.res\", line 160, characters 5-12", v0, [ 0, @@ -440,7 +440,7 @@ let a = [ 5 ]; -let match = Belt_Array.partition(a, (x => x % 2 === 0)); +let match = Belt_Array.partition(a, x => x % 2 === 0); eq("File \"bs_array_test.res\", line 168, characters 5-12", match[0], [ 2, @@ -453,7 +453,7 @@ eq("File \"bs_array_test.res\", line 169, characters 5-12", match[1], [ 5 ]); -let match$1 = Belt_Array.partition(a, (x => x === 2)); +let match$1 = Belt_Array.partition(a, x => x === 2); eq("File \"bs_array_test.res\", line 171, characters 5-12", match$1[0], [2]); @@ -464,7 +464,7 @@ eq("File \"bs_array_test.res\", line 172, characters 5-12", match$1[1], [ 5 ]); -let match$2 = Belt_Array.partition([], (x => false)); +let match$2 = Belt_Array.partition([], x => false); eq("File \"bs_array_test.res\", line 174, characters 5-12", match$2[0], []); @@ -589,7 +589,7 @@ eq("File \"bs_array_test.res\", line 205, characters 5-12", Belt_Array.sliceToEn eq("File \"bs_array_test.res\", line 206, characters 5-12", Belt_Array.sliceToEnd(a$2, 6), []); -let a$3 = Belt_Array.makeBy(10, (x => x)); +let a$3 = Belt_Array.makeBy(10, x => x); Belt_Array.fill(a$3, 0, 3, 0); @@ -756,7 +756,7 @@ eq("File \"bs_array_test.res\", line 236, characters 5-12", b$1, [ 3 ]); -let a0 = Belt_Array.makeBy(10, (x => x)); +let a0 = Belt_Array.makeBy(10, x => x); let b0 = Belt_Array.make(10, 3); @@ -828,7 +828,7 @@ Belt_Array.blit(a0, -11, b0, -11, 2); eq("File \"bs_array_test.res\", line 253, characters 5-12", b0.slice(0), a0); -let aa = Belt_Array.makeBy(10, (x => x)); +let aa = Belt_Array.makeBy(10, x => x); Belt_Array.blit(aa, -1, aa, 1, 2); @@ -965,7 +965,7 @@ eq("File \"bs_array_test.res\", line 273, characters 5-12", Belt_Array.zipBy([ 1, 2, 3 -], ((prim0, prim1) => prim0 - prim1 | 0)), [ +], (prim0, prim1) => prim0 - prim1 | 0), [ 1, 1, 1 @@ -980,11 +980,11 @@ eq("File \"bs_array_test.res\", line 274, characters 5-12", Belt_Array.zipBy([ 3, 4, 1 -], ((prim0, prim1) => prim0 - prim1 | 0)), Belt_Array.map([ +], (prim0, prim1) => prim0 - prim1 | 0), Belt_Array.map([ 1, 1, 1 -], (x => -x | 0))); +], x => -x | 0)); eq("File \"bs_array_test.res\", line 275, characters 5-12", Belt_Array.unzip([ [ @@ -1016,9 +1016,9 @@ function sumUsingForEach(xs) { let v = { contents: 0 }; - Belt_Array.forEach(xs, (x => { + Belt_Array.forEach(xs, x => { v.contents = v.contents + x | 0; - })); + }); return v.contents; } @@ -1036,25 +1036,25 @@ b("File \"bs_array_test.res\", line 288, characters 4-11", !Belt_Array.every([ 2, 3, 4 -], (x => x > 2))); +], x => x > 2)); b("File \"bs_array_test.res\", line 289, characters 4-11", Belt_Array.some([ 1, 3, 7, 8 -], (x => x % 2 === 0))); +], x => x % 2 === 0)); b("File \"bs_array_test.res\", line 290, characters 4-11", !Belt_Array.some([ 1, 3, 7 -], (x => x % 2 === 0))); +], x => x % 2 === 0)); b("File \"bs_array_test.res\", line 291, characters 4-11", !Belt_Array.eq([ 0, 1 -], [1], ((prim0, prim1) => prim0 === prim1))); +], [1], (prim0, prim1) => prim0 === prim1)); let c$1 = { contents: 0 @@ -1064,9 +1064,9 @@ b("File \"bs_array_test.res\", line 293, characters 4-11", (Belt_Array.forEachWi 1, 1, 1 -], ((i, v) => { +], (i, v) => { c$1.contents = (c$1.contents + i | 0) + v | 0; -})), c$1.contents === 6)); +}), c$1.contents === 6)); function id(loc, x) { let u = x.slice(0); @@ -1106,7 +1106,7 @@ function some2(xs, ys, x) { eq("File \"bs_array_test.res\", line 326, characters 5-12", every2(/* [] */0, { hd: 1, tl: /* [] */0 -}, ((x, y) => x > y)), true); +}, (x, y) => x > y), true); eq("File \"bs_array_test.res\", line 327, characters 5-12", every2({ hd: 2, @@ -1117,7 +1117,7 @@ eq("File \"bs_array_test.res\", line 327, characters 5-12", every2({ }, { hd: 1, tl: /* [] */0 -}, ((x, y) => x > y)), true); +}, (x, y) => x > y), true); eq("File \"bs_array_test.res\", line 328, characters 5-12", every2({ hd: 2, @@ -1125,7 +1125,7 @@ eq("File \"bs_array_test.res\", line 328, characters 5-12", every2({ }, { hd: 1, tl: /* [] */0 -}, ((x, y) => x > y)), true); +}, (x, y) => x > y), true); eq("File \"bs_array_test.res\", line 329, characters 5-12", every2({ hd: 2, @@ -1139,7 +1139,7 @@ eq("File \"bs_array_test.res\", line 329, characters 5-12", every2({ hd: 4, tl: /* [] */0 } -}, ((x, y) => x > y)), false); +}, (x, y) => x > y), false); eq("File \"bs_array_test.res\", line 330, characters 5-12", every2({ hd: 2, @@ -1153,12 +1153,12 @@ eq("File \"bs_array_test.res\", line 330, characters 5-12", every2({ hd: 0, tl: /* [] */0 } -}, ((x, y) => x > y)), true); +}, (x, y) => x > y), true); eq("File \"bs_array_test.res\", line 331, characters 5-12", some2(/* [] */0, { hd: 1, tl: /* [] */0 -}, ((x, y) => x > y)), false); +}, (x, y) => x > y), false); eq("File \"bs_array_test.res\", line 332, characters 5-12", some2({ hd: 2, @@ -1169,7 +1169,7 @@ eq("File \"bs_array_test.res\", line 332, characters 5-12", some2({ }, { hd: 1, tl: /* [] */0 -}, ((x, y) => x > y)), true); +}, (x, y) => x > y), true); eq("File \"bs_array_test.res\", line 333, characters 5-12", some2({ hd: 2, @@ -1183,7 +1183,7 @@ eq("File \"bs_array_test.res\", line 333, characters 5-12", some2({ hd: 4, tl: /* [] */0 } -}, ((x, y) => x > y)), true); +}, (x, y) => x > y), true); eq("File \"bs_array_test.res\", line 334, characters 5-12", some2({ hd: 0, @@ -1197,7 +1197,7 @@ eq("File \"bs_array_test.res\", line 334, characters 5-12", some2({ hd: 4, tl: /* [] */0 } -}, ((x, y) => x > y)), false); +}, (x, y) => x > y), false); eq("File \"bs_array_test.res\", line 335, characters 5-12", some2({ hd: 0, @@ -1211,7 +1211,7 @@ eq("File \"bs_array_test.res\", line 335, characters 5-12", some2({ hd: 2, tl: /* [] */0 } -}, ((x, y) => x > y)), true); +}, (x, y) => x > y), true); eq("File \"bs_array_test.res\", line 339, characters 5-12", Belt_Array.concat([], [ 1, @@ -1362,25 +1362,25 @@ eq("File \"bs_array_test.res\", line 357, characters 5-12", Belt_Array.getBy([ 1, 2, 3 -], (x => x > 1)), 2); +], x => x > 1), 2); eq("File \"bs_array_test.res\", line 358, characters 5-12", Belt_Array.getBy([ 1, 2, 3 -], (x => x > 3)), undefined); +], x => x > 3), undefined); eq("File \"bs_array_test.res\", line 362, characters 5-12", Belt_Array.getIndexBy([ 1, 2, 3 -], (x => x > 1)), 1); +], x => x > 1), 1); eq("File \"bs_array_test.res\", line 363, characters 5-12", Belt_Array.getIndexBy([ 1, 2, 3 -], (x => x > 3)), undefined); +], x => x > 3), undefined); let arr = []; diff --git a/jscomp/test/bs_auto_uncurry.js b/jscomp/test/bs_auto_uncurry.js index 29bf2d44b06..1b0f3d0dd94 100644 --- a/jscomp/test/bs_auto_uncurry.js +++ b/jscomp/test/bs_auto_uncurry.js @@ -12,7 +12,7 @@ let xbs = Array.prototype.map.call([ 2, 3, 5 -], (x => x + 1 | 0)); +], x => x + 1 | 0); function f(cb) { return Array.prototype.map.call([ @@ -36,7 +36,7 @@ let xs = Array.prototype.map.call([ 2, 1 ] -], (param => (param[1] + param[0] | 0) + 1 | 0)); +], param => (param[1] + param[0] | 0) + 1 | 0); function f_0() { return hi(() => {}); @@ -76,19 +76,19 @@ function add3(x) { } function h2(x) { - return ff(x, ((prim0, prim1) => prim0 + prim1 | 0)); + return ff(x, (prim0, prim1) => prim0 + prim1 | 0); } function h3(x) { - return ff(x, ((y, z) => (1 + y | 0) + z | 0)); + return ff(x, (y, z) => (1 + y | 0) + z | 0); } function h4(x) { - return ff1(x, 3, ((y, z) => (1 + y | 0) + z | 0)); + return ff1(x, 3, (y, z) => (1 + y | 0) + z | 0); } function h5(x) { - return ff2(x, "3", ((y, z) => (2 + y | 0) + z | 0)); + return ff2(x, "3", (y, z) => (2 + y | 0) + z | 0); } function add(x, y) { diff --git a/jscomp/test/bs_auto_uncurry_test.js b/jscomp/test/bs_auto_uncurry_test.js index d53f97dcf56..c44c98800e9 100644 --- a/jscomp/test/bs_auto_uncurry_test.js +++ b/jscomp/test/bs_auto_uncurry_test.js @@ -16,11 +16,11 @@ function eq(loc, x, y) { suites.contents = { hd: [ loc + (" id " + String(test_id.contents)), - (() => ({ + () => ({ TAG: "Eq", _0: x, _1: y - })) + }) ], tl: suites.contents }; @@ -82,13 +82,13 @@ eq("File \"bs_auto_uncurry_test.res\", line 31, characters 5-12", [ 1, 2, 3 -].reduce(((prim0, prim1) => prim0 + prim1 | 0), 0), 6); +].reduce((prim0, prim1) => prim0 + prim1 | 0, 0), 6); eq("File \"bs_auto_uncurry_test.res\", line 33, characters 5-12", [ 1, 2, 3 -].reduce(((x, y, i) => (x + y | 0) + i | 0), 0), 9); +].reduce((x, y, i) => (x + y | 0) + i | 0, 0), 9); eq("File \"bs_auto_uncurry_test.res\", line 35, characters 5-12", [ 1, diff --git a/jscomp/test/bs_hashmap_test.js b/jscomp/test/bs_hashmap_test.js index 6f395f89a52..62e1d947f61 100644 --- a/jscomp/test/bs_hashmap_test.js +++ b/jscomp/test/bs_hashmap_test.js @@ -98,7 +98,7 @@ for (let i$1 = 0; i$1 <= 2000; ++i$1) { eqx("File \"bs_hashmap_test.res\", line 57, characters 6-13", v$1.size, 98000); -b("File \"bs_hashmap_test.res\", line 58, characters 4-11", Belt_Array.every(Array_data_util.range(2001, 100000), (x => Belt_HashMap.has(v$1, x)))); +b("File \"bs_hashmap_test.res\", line 58, characters 4-11", Belt_Array.every(Array_data_util.range(2001, 100000), x => Belt_HashMap.has(v$1, x))); Mt.from_pair_suites("Bs_hashmap_test", suites.contents); diff --git a/jscomp/test/bs_hashset_int_test.js b/jscomp/test/bs_hashset_int_test.js index 6c14c79db41..cb3339dcec8 100644 --- a/jscomp/test/bs_hashset_int_test.js +++ b/jscomp/test/bs_hashset_int_test.js @@ -33,9 +33,9 @@ function sum2(h) { let v = { contents: 0 }; - Belt_HashSetInt.forEach(h, (x => { + Belt_HashSetInt.forEach(h, x => { v.contents = v.contents + x | 0; - })); + }); return v.contents; } diff --git a/jscomp/test/bs_ignore_effect.js b/jscomp/test/bs_ignore_effect.js index 37d1e9bd5c3..d432098c6bc 100644 --- a/jscomp/test/bs_ignore_effect.js +++ b/jscomp/test/bs_ignore_effect.js @@ -16,11 +16,11 @@ function eq(loc, x, y) { suites.contents = { hd: [ loc + (" id " + String(test_id.contents)), - (() => ({ + () => ({ TAG: "Eq", _0: x, _1: y - })) + }) ], tl: suites.contents }; diff --git a/jscomp/test/bs_list_test.js b/jscomp/test/bs_list_test.js index aa2a480c9a4..f5a308dd125 100644 --- a/jscomp/test/bs_list_test.js +++ b/jscomp/test/bs_list_test.js @@ -31,9 +31,9 @@ function sum(xs) { let v = { contents: 0 }; - Belt_List.forEach(xs, (x => { + Belt_List.forEach(xs, x => { v.contents = v.contents + x | 0; - })); + }); return v.contents; } @@ -41,13 +41,13 @@ function sum2(xs, ys) { let v = { contents: 0 }; - Belt_List.forEach2(xs, ys, ((x, y) => { + Belt_List.forEach2(xs, ys, (x, y) => { v.contents = (v.contents + x | 0) + y | 0; - })); + }); return v.contents; } -let u = Belt_List.makeBy(5, (i => Math.imul(i, i))); +let u = Belt_List.makeBy(5, i => Math.imul(i, i)); function f(i) { eq("File \"bs_list_test.res\", line 27, characters 18-25", Belt_List.getExn(u, i), Math.imul(i, i)); @@ -57,7 +57,7 @@ for (let i = 0; i <= 4; ++i) { f(i); } -eq("File \"bs_list_test.res\", line 31, characters 5-12", Belt_List.map(u, (i => i + 1 | 0)), { +eq("File \"bs_list_test.res\", line 31, characters 5-12", Belt_List.map(u, i => i + 1 | 0), { hd: 1, tl: { hd: 2, @@ -86,7 +86,7 @@ eq("File \"bs_list_test.res\", line 32, characters 5-12", Belt_List.getBy({ } } } -}, (x => x % 2 === 0)), 4); +}, x => x % 2 === 0), 4); eq("File \"bs_list_test.res\", line 33, characters 5-12", Belt_List.getBy({ hd: 1, @@ -100,7 +100,7 @@ eq("File \"bs_list_test.res\", line 33, characters 5-12", Belt_List.getBy({ } } } -}, (x => x % 5 === 0)), undefined); +}, x => x % 5 === 0), undefined); eq("FLATTEN", Belt_List.flatten({ hd: { @@ -120,7 +120,7 @@ eq("FLATTEN", Belt_List.flatten({ tl: { hd: /* [] */0, tl: { - hd: Belt_List.makeBy(4, (i => i)), + hd: Belt_List.makeBy(4, i => i), tl: /* [] */0 } } @@ -203,7 +203,7 @@ eq("CONCATMANY", Belt_List.concatMany([ tl: /* [] */0 }, /* [] */0, - Belt_List.makeBy(4, (i => i)) + Belt_List.makeBy(4, i => i) ]), { hd: 1, tl: { @@ -309,7 +309,7 @@ eq("CONCATMANY", Belt_List.concatMany([{ } }); -eq("File \"bs_list_test.res\", line 66, characters 2-9", Belt_List.toArray(Belt_List.concat(Belt_List.makeBy(100, (i => i)), Belt_List.makeBy(100, (i => i)))), Belt_Array.concat(Belt_Array.makeBy(100, (i => i)), Belt_Array.makeBy(100, (i => i)))); +eq("File \"bs_list_test.res\", line 66, characters 2-9", Belt_List.toArray(Belt_List.concat(Belt_List.makeBy(100, i => i), Belt_List.makeBy(100, i => i))), Belt_Array.concat(Belt_Array.makeBy(100, i => i), Belt_Array.makeBy(100, i => i))); eq("APPEND", Belt_List.concat({ hd: 1, @@ -502,7 +502,7 @@ eq("PARTITION", Belt_List.partition({ } } } -}, (x => !mod2(x))), [ +}, x => !mod2(x)), [ /* [] */0, { hd: 2, @@ -704,7 +704,7 @@ function id(x) { return x; } -eq("MAP", Belt_List.map(Belt_List.makeBy(5, id), (x => (x << 1))), { +eq("MAP", Belt_List.map(Belt_List.makeBy(5, id), x => (x << 1)), { hd: 0, tl: { hd: 2, @@ -726,7 +726,7 @@ eq("MAP", Belt_List.map(/* [] */0, id), /* [] */0); eq("MAP", Belt_List.map({ hd: 1, tl: /* [] */0 -}, (x => -x | 0)), { +}, x => -x | 0), { hd: -1, tl: /* [] */0 }); @@ -739,7 +739,7 @@ let length_10_id = Belt_List.makeBy(10, id); let length_8_id = Belt_List.makeBy(8, id); -let d = Belt_List.makeBy(10, (x => (x << 1))); +let d = Belt_List.makeBy(10, x => (x << 1)); eq("MAP2", Belt_List.zipBy(length_10_id, length_10_id, add), d); @@ -755,7 +755,7 @@ eq("MAP2", Belt_List.zipBy({ eq("MAP2", Belt_List.zipBy(/* [] */0, /* [] */0, add), /* [] */0); -eq("MAP2", Belt_List.zipBy(length_10_id, length_10_id, add), Belt_List.concat(Belt_List.map(length_8_id, (x => (x << 1))), { +eq("MAP2", Belt_List.zipBy(length_10_id, length_10_id, add), Belt_List.concat(Belt_List.map(length_8_id, x => (x << 1)), { hd: 16, tl: { hd: 18, @@ -763,9 +763,9 @@ eq("MAP2", Belt_List.zipBy(length_10_id, length_10_id, add), Belt_List.concat(Be } })); -eq("MAP2", Belt_List.zipBy(length_10_id, length_8_id, add), Belt_List.mapWithIndex(length_8_id, ((i, x) => i + x | 0))); +eq("MAP2", Belt_List.zipBy(length_10_id, length_8_id, add), Belt_List.mapWithIndex(length_8_id, (i, x) => i + x | 0)); -eq("MAP2", Belt_List.reverse(Belt_List.mapReverse2(length_10_id, length_10_id, add)), Belt_List.map(length_10_id, (x => (x << 1)))); +eq("MAP2", Belt_List.reverse(Belt_List.mapReverse2(length_10_id, length_10_id, add)), Belt_List.map(length_10_id, x => (x << 1))); let xs = Belt_List.reverse(Belt_List.mapReverse2(length_8_id, length_10_id, add)); @@ -788,7 +788,7 @@ eq("MAP2", Belt_List.mapReverse2({ hd: 2, tl: /* [] */0 } -}, ((x, y) => x + y | 0)), { +}, (x, y) => x + y | 0), { hd: 4, tl: { hd: 2, @@ -981,7 +981,7 @@ b("File \"bs_list_test.res\", line 205, characters 4-11", Belt_List.hasAssoc({ tl: /* [] */0 } } -}, 2, ((prim0, prim1) => prim0 === prim1))); +}, 2, (prim0, prim1) => prim0 === prim1)); b("File \"bs_list_test.res\", line 206, characters 4-11", !Belt_List.hasAssoc({ hd: [ @@ -1001,7 +1001,7 @@ b("File \"bs_list_test.res\", line 206, characters 4-11", !Belt_List.hasAssoc({ tl: /* [] */0 } } -}, 4, ((prim0, prim1) => prim0 === prim1))); +}, 4, (prim0, prim1) => prim0 === prim1)); b("File \"bs_list_test.res\", line 207, characters 4-11", Belt_List.hasAssoc({ hd: [ @@ -1021,7 +1021,7 @@ b("File \"bs_list_test.res\", line 207, characters 4-11", Belt_List.hasAssoc({ tl: /* [] */0 } } -}, 4, ((x, y) => (x + 1 | 0) === y))); +}, 4, (x, y) => (x + 1 | 0) === y)); eq("REMOVEASSOQ", Belt_List.removeAssoc({ hd: [ @@ -1041,7 +1041,7 @@ eq("REMOVEASSOQ", Belt_List.removeAssoc({ tl: /* [] */0 } } -}, 3, ((prim0, prim1) => prim0 === prim1)), { +}, 3, (prim0, prim1) => prim0 === prim1), { hd: [ 1, "1" @@ -1073,7 +1073,7 @@ eq("REMOVEASSOQ", Belt_List.removeAssoc({ tl: /* [] */0 } } -}, 1, ((prim0, prim1) => prim0 === prim1)), { +}, 1, (prim0, prim1) => prim0 === prim1), { hd: [ 2, "2" @@ -1105,7 +1105,7 @@ eq("REMOVEASSOQ", Belt_List.removeAssoc({ tl: /* [] */0 } } -}, 2, ((prim0, prim1) => prim0 === prim1)), { +}, 2, (prim0, prim1) => prim0 === prim1), { hd: [ 1, "1" @@ -1137,7 +1137,7 @@ eq("REMOVEASSOQ", Belt_List.removeAssoc({ tl: /* [] */0 } } -}, 0, ((prim0, prim1) => prim0 === prim1)), { +}, 0, (prim0, prim1) => prim0 === prim1), { hd: [ 1, "1" @@ -1279,7 +1279,7 @@ let ll0 = Belt_List.removeAssoc(ll, 0, eqx); b("File \"bs_list_test.res\", line 222, characters 4-11", ll === ll0); -let ll1 = Belt_List.setAssoc(ll, 2, "22", ((prim0, prim1) => prim0 === prim1)); +let ll1 = Belt_List.setAssoc(ll, 2, "22", (prim0, prim1) => prim0 === prim1); eq("File \"bs_list_test.res\", line 224, characters 5-12", ll1, { hd: [ @@ -1301,7 +1301,7 @@ eq("File \"bs_list_test.res\", line 224, characters 5-12", ll1, { } }); -let ll2 = Belt_List.setAssoc(ll1, 22, "2", ((prim0, prim1) => prim0 === prim1)); +let ll2 = Belt_List.setAssoc(ll1, 22, "2", (prim0, prim1) => prim0 === prim1); b("File \"bs_list_test.res\", line 226, characters 4-11", Caml_obj.equal(ll2, { hd: [ @@ -1331,7 +1331,7 @@ b("File \"bs_list_test.res\", line 229, characters 4-11", Caml_obj.equal(Belt_Li tl: /* [] */0 } } -}, 2, "x", ((prim0, prim1) => prim0 === prim1)), { +}, 2, "x", (prim0, prim1) => prim0 === prim1), { hd: [ 1, "a" @@ -1363,7 +1363,7 @@ b("File \"bs_list_test.res\", line 234, characters 4-11", Caml_obj.equal(Belt_Li ], tl: /* [] */0 } -}, 2, "2", ((prim0, prim1) => prim0 === prim1)), { +}, 2, "2", (prim0, prim1) => prim0 === prim1), { hd: [ 2, "2" @@ -1383,7 +1383,7 @@ b("File \"bs_list_test.res\", line 234, characters 4-11", Caml_obj.equal(Belt_Li } })); -eq("File \"bs_list_test.res\", line 237, characters 5-12", Belt_List.setAssoc(/* [] */0, 1, "1", ((prim0, prim1) => prim0 === prim1)), { +eq("File \"bs_list_test.res\", line 237, characters 5-12", Belt_List.setAssoc(/* [] */0, 1, "1", (prim0, prim1) => prim0 === prim1), { hd: [ 1, "1" @@ -1399,7 +1399,7 @@ eq("File \"bs_list_test.res\", line 239, characters 5-12", Belt_List.setAssoc({ "2" ], tl: /* [] */0 -}, 1, "1", ((prim0, prim1) => prim0 === prim1)), { +}, 1, "1", (prim0, prim1) => prim0 === prim1), { hd: [ 1, "1" @@ -1419,7 +1419,7 @@ eq("File \"bs_list_test.res\", line 241, characters 5-12", Belt_List.setAssoc({ ], tl: /* [] */0 } -}, 1, "1", ((prim0, prim1) => prim0 === prim1)), { +}, 1, "1", (prim0, prim1) => prim0 === prim1), { hd: [ 0, "0" @@ -1451,7 +1451,7 @@ b("File \"bs_list_test.res\", line 242, characters 4-11", Caml_obj.equal(Belt_Li tl: /* [] */0 } } -}, 2, ((prim0, prim1) => prim0 === prim1)), "b")); +}, 2, (prim0, prim1) => prim0 === prim1), "b")); b("File \"bs_list_test.res\", line 243, characters 4-11", Belt_List.getAssoc({ hd: [ @@ -1471,7 +1471,7 @@ b("File \"bs_list_test.res\", line 243, characters 4-11", Belt_List.getAssoc({ tl: /* [] */0 } } -}, 4, ((prim0, prim1) => prim0 === prim1)) === undefined); +}, 4, (prim0, prim1) => prim0 === prim1) === undefined); eq("File \"bs_list_test.res\", line 248, characters 4-11", [ Belt_List.head(length_10_id), @@ -1483,13 +1483,13 @@ eq("File \"bs_list_test.res\", line 248, characters 4-11", [ eq("File \"bs_list_test.res\", line 255, characters 5-12", Belt_List.head(/* [] */0), undefined); -$$throw("File \"bs_list_test.res\", line 256, characters 8-15", (() => Belt_List.headExn(/* [] */0))); +$$throw("File \"bs_list_test.res\", line 256, characters 8-15", () => Belt_List.headExn(/* [] */0)); -$$throw("File \"bs_list_test.res\", line 257, characters 8-15", (() => { +$$throw("File \"bs_list_test.res\", line 257, characters 8-15", () => { Belt_List.tailExn(/* [] */0); -})); +}); -$$throw("File \"bs_list_test.res\", line 258, characters 8-15", (() => { +$$throw("File \"bs_list_test.res\", line 258, characters 8-15", () => { Belt_List.getExn({ hd: 0, tl: { @@ -1497,9 +1497,9 @@ $$throw("File \"bs_list_test.res\", line 258, characters 8-15", (() => { tl: /* [] */0 } }, -1); -})); +}); -$$throw("File \"bs_list_test.res\", line 259, characters 8-15", (() => { +$$throw("File \"bs_list_test.res\", line 259, characters 8-15", () => { Belt_List.getExn({ hd: 0, tl: { @@ -1507,7 +1507,7 @@ $$throw("File \"bs_list_test.res\", line 259, characters 8-15", (() => { tl: /* [] */0 } }, 2); -})); +}); eq("File \"bs_list_test.res\", line 260, characters 5-12", Belt_List.map({ hd: 0, @@ -1515,13 +1515,13 @@ eq("File \"bs_list_test.res\", line 260, characters 5-12", Belt_List.map({ hd: 1, tl: /* [] */0 } -}, (i => Belt_List.getExn({ +}, i => Belt_List.getExn({ hd: 0, tl: { hd: 1, tl: /* [] */0 } -}, i))), { +}, i)), { hd: 0, tl: { hd: 1, @@ -1539,13 +1539,13 @@ eq("File \"bs_list_test.res\", line 262, characters 5-12", Belt_List.tailExn({ tl: /* [] */0 }), /* [] */0); -Belt_List.forEachWithIndex(length_10_id, ((i, x) => eq("File \"bs_list_test.res\", line 263, characters 48-55", Belt_List.get(length_10_id, i), x))); +Belt_List.forEachWithIndex(length_10_id, (i, x) => eq("File \"bs_list_test.res\", line 263, characters 48-55", Belt_List.get(length_10_id, i), x)); eq("File \"bs_list_test.res\", line 264, characters 5-12", Belt_List.tail(/* [] */0), undefined); eq("File \"bs_list_test.res\", line 265, characters 5-12", Belt_List.drop(/* [] */0, 3), undefined); -eq("File \"bs_list_test.res\", line 266, characters 5-12", Belt_List.mapWithIndex(/* [] */0, ((i, x) => i + x | 0)), /* [] */0); +eq("File \"bs_list_test.res\", line 266, characters 5-12", Belt_List.mapWithIndex(/* [] */0, (i, x) => i + x | 0), /* [] */0); eq("File \"bs_list_test.res\", line 267, characters 5-12", Belt_List.get(length_10_id, -1), undefined); @@ -1569,7 +1569,7 @@ eq("File \"bs_list_test.res\", line 290, characters 5-12", Belt_List.reduce(leng eq("File \"bs_list_test.res\", line 291, characters 5-12", Belt_List.reduceReverse(length_10_id, 0, add), 45); -eq("File \"bs_list_test.res\", line 292, characters 5-12", Belt_List.reduceReverse(Belt_List.makeBy(10000, (i => i)), 0, ((prim0, prim1) => prim0 + prim1 | 0)), 49995000); +eq("File \"bs_list_test.res\", line 292, characters 5-12", Belt_List.reduceReverse(Belt_List.makeBy(10000, i => i), 0, (prim0, prim1) => prim0 + prim1 | 0), 49995000); eq("File \"bs_list_test.res\", line 295, characters 5-12", sum2(length_10_id, length_10_id), 90); @@ -1577,7 +1577,7 @@ eq("File \"bs_list_test.res\", line 296, characters 5-12", sum2(length_8_id, len eq("File \"bs_list_test.res\", line 297, characters 5-12", sum2(length_10_id, length_8_id), 56); -eq("File \"bs_list_test.res\", line 298, characters 5-12", Belt_List.reduce2(length_10_id, length_8_id, 0, ((acc, x, y) => (acc + x | 0) + y | 0)), 56); +eq("File \"bs_list_test.res\", line 298, characters 5-12", Belt_List.reduce2(length_10_id, length_8_id, 0, (acc, x, y) => (acc + x | 0) + y | 0), 56); eq("File \"bs_list_test.res\", line 299, characters 5-12", Belt_List.reduce2({ hd: 1, @@ -1597,11 +1597,11 @@ eq("File \"bs_list_test.res\", line 299, characters 5-12", Belt_List.reduce2({ tl: /* [] */0 } } -}, 0, ((a, b, c) => (a + b | 0) + c | 0)), 18); +}, 0, (a, b, c) => (a + b | 0) + c | 0), 18); -eq("File \"bs_list_test.res\", line 300, characters 5-12", Belt_List.reduceReverse2(length_10_id, length_8_id, 0, ((acc, x, y) => (acc + x | 0) + y | 0)), 56); +eq("File \"bs_list_test.res\", line 300, characters 5-12", Belt_List.reduceReverse2(length_10_id, length_8_id, 0, (acc, x, y) => (acc + x | 0) + y | 0), 56); -eq("File \"bs_list_test.res\", line 301, characters 5-12", Belt_List.reduceReverse2(length_10_id, length_10_id, 0, ((acc, x, y) => (acc + x | 0) + y | 0)), 90); +eq("File \"bs_list_test.res\", line 301, characters 5-12", Belt_List.reduceReverse2(length_10_id, length_10_id, 0, (acc, x, y) => (acc + x | 0) + y | 0), 90); eq("File \"bs_list_test.res\", line 302, characters 5-12", Belt_List.reduceReverse2({ hd: 1, @@ -1618,7 +1618,7 @@ eq("File \"bs_list_test.res\", line 302, characters 5-12", Belt_List.reduceRever hd: 2, tl: /* [] */0 } -}, 0, ((acc, x, y) => (acc + x | 0) + y | 0)), 6); +}, 0, (acc, x, y) => (acc + x | 0) + y | 0), 6); eq("File \"bs_list_test.res\", line 303, characters 5-12", Belt_List.every({ hd: 2, @@ -1671,7 +1671,7 @@ eq("File \"bs_list_test.res\", line 309, characters 5-12", Belt_List.has({ tl: /* [] */0 } } -}, "2", ((x, s) => String(x) === s)), true); +}, "2", (x, s) => String(x) === s), true); eq("File \"bs_list_test.res\", line 310, characters 5-12", Belt_List.has({ hd: 1, @@ -1682,7 +1682,7 @@ eq("File \"bs_list_test.res\", line 310, characters 5-12", Belt_List.has({ tl: /* [] */0 } } -}, "0", ((x, s) => String(x) === s)), false); +}, "0", (x, s) => String(x) === s), false); b("File \"bs_list_test.res\", line 312, characters 4-11", Belt_List.reduceReverse({ hd: 1, @@ -1696,7 +1696,7 @@ b("File \"bs_list_test.res\", line 312, characters 4-11", Belt_List.reduceRevers } } } -}, 0, ((prim0, prim1) => prim0 + prim1 | 0)) === 10); +}, 0, (prim0, prim1) => prim0 + prim1 | 0) === 10); b("File \"bs_list_test.res\", line 313, characters 4-11", Belt_List.reduceReverse({ hd: 1, @@ -1710,7 +1710,7 @@ b("File \"bs_list_test.res\", line 313, characters 4-11", Belt_List.reduceRevers } } } -}, 10, ((prim0, prim1) => prim0 - prim1 | 0)) === 0); +}, 10, (prim0, prim1) => prim0 - prim1 | 0) === 0); b("File \"bs_list_test.res\", line 314, characters 4-11", Caml_obj.equal(Belt_List.reduceReverse({ hd: 1, @@ -1750,7 +1750,7 @@ b("File \"bs_list_test.res\", line 315, characters 4-11", Belt_List.reduce({ } } } -}, 0, ((prim0, prim1) => prim0 + prim1 | 0)) === 10); +}, 0, (prim0, prim1) => prim0 + prim1 | 0) === 10); b("File \"bs_list_test.res\", line 316, characters 4-11", Belt_List.reduce({ hd: 1, @@ -1764,7 +1764,7 @@ b("File \"bs_list_test.res\", line 316, characters 4-11", Belt_List.reduce({ } } } -}, 10, ((prim0, prim1) => prim0 - prim1 | 0)) === 0); +}, 10, (prim0, prim1) => prim0 - prim1 | 0) === 0); b("File \"bs_list_test.res\", line 317, characters 4-11", Caml_obj.equal(Belt_List.reduce({ hd: 1, @@ -1804,7 +1804,7 @@ b("File \"bs_list_test.res\", line 318, characters 4-11", Belt_List.reduceWithIn } } } -}, 0, ((acc, x, i) => (acc + x | 0) + i | 0)) === 16); +}, 0, (acc, x, i) => (acc + x | 0) + i | 0) === 16); b("File \"bs_list_test.res\", line 319, characters 4-11", Belt_List.reduceReverse2({ hd: 1, @@ -1821,19 +1821,19 @@ b("File \"bs_list_test.res\", line 319, characters 4-11", Belt_List.reduceRevers hd: 2, tl: /* [] */0 } -}, 0, ((acc, x, y) => (acc + x | 0) + y | 0)) === 6); +}, 0, (acc, x, y) => (acc + x | 0) + y | 0) === 6); -let a$1 = Belt_List.makeBy(10000, (i => i)); +let a$1 = Belt_List.makeBy(10000, i => i); b("File \"bs_list_test.res\", line 322, characters 4-11", Belt_List.reduceReverse2(a$1, { hd: 0, tl: a$1 -}, 0, ((acc, x, y) => (acc + x | 0) + y | 0)) === 99980001); +}, 0, (acc, x, y) => (acc + x | 0) + y | 0) === 99980001); eq("File \"bs_list_test.res\", line 328, characters 5-12", Belt_List.every2(/* [] */0, { hd: 1, tl: /* [] */0 -}, ((x, y) => x > y)), true); +}, (x, y) => x > y), true); eq("File \"bs_list_test.res\", line 329, characters 5-12", Belt_List.every2({ hd: 2, @@ -1844,7 +1844,7 @@ eq("File \"bs_list_test.res\", line 329, characters 5-12", Belt_List.every2({ }, { hd: 1, tl: /* [] */0 -}, ((x, y) => x > y)), true); +}, (x, y) => x > y), true); eq("File \"bs_list_test.res\", line 330, characters 5-12", Belt_List.every2({ hd: 2, @@ -1852,7 +1852,7 @@ eq("File \"bs_list_test.res\", line 330, characters 5-12", Belt_List.every2({ }, { hd: 1, tl: /* [] */0 -}, ((x, y) => x > y)), true); +}, (x, y) => x > y), true); eq("File \"bs_list_test.res\", line 331, characters 5-12", Belt_List.every2({ hd: 2, @@ -1866,7 +1866,7 @@ eq("File \"bs_list_test.res\", line 331, characters 5-12", Belt_List.every2({ hd: 4, tl: /* [] */0 } -}, ((x, y) => x > y)), false); +}, (x, y) => x > y), false); eq("File \"bs_list_test.res\", line 332, characters 5-12", Belt_List.every2({ hd: 2, @@ -1880,12 +1880,12 @@ eq("File \"bs_list_test.res\", line 332, characters 5-12", Belt_List.every2({ hd: 0, tl: /* [] */0 } -}, ((x, y) => x > y)), true); +}, (x, y) => x > y), true); eq("File \"bs_list_test.res\", line 333, characters 5-12", Belt_List.some2(/* [] */0, { hd: 1, tl: /* [] */0 -}, ((x, y) => x > y)), false); +}, (x, y) => x > y), false); eq("File \"bs_list_test.res\", line 334, characters 5-12", Belt_List.some2({ hd: 2, @@ -1896,7 +1896,7 @@ eq("File \"bs_list_test.res\", line 334, characters 5-12", Belt_List.some2({ }, { hd: 1, tl: /* [] */0 -}, ((x, y) => x > y)), true); +}, (x, y) => x > y), true); eq("File \"bs_list_test.res\", line 335, characters 5-12", Belt_List.some2({ hd: 2, @@ -1910,7 +1910,7 @@ eq("File \"bs_list_test.res\", line 335, characters 5-12", Belt_List.some2({ hd: 4, tl: /* [] */0 } -}, ((x, y) => x > y)), true); +}, (x, y) => x > y), true); eq("File \"bs_list_test.res\", line 336, characters 5-12", Belt_List.some2({ hd: 0, @@ -1924,7 +1924,7 @@ eq("File \"bs_list_test.res\", line 336, characters 5-12", Belt_List.some2({ hd: 4, tl: /* [] */0 } -}, ((x, y) => x > y)), false); +}, (x, y) => x > y), false); eq("File \"bs_list_test.res\", line 337, characters 5-12", Belt_List.some2({ hd: 0, @@ -1938,7 +1938,7 @@ eq("File \"bs_list_test.res\", line 337, characters 5-12", Belt_List.some2({ hd: 2, tl: /* [] */0 } -}, ((x, y) => x > y)), true); +}, (x, y) => x > y), true); eq("File \"bs_list_test.res\", line 338, characters 5-12", Belt_List.some2({ hd: 1, @@ -1955,10 +1955,10 @@ eq("File \"bs_list_test.res\", line 338, characters 5-12", Belt_List.some2({ hd: -2, tl: /* [] */0 } -}, ((x, y) => x === y)), false); +}, (x, y) => x === y), false); function makeTest(n) { - eq("File \"bs_list_test.res\", line 341, characters 23-30", Belt_List.make(n, 3), Belt_List.makeBy(n, (param => 3))); + eq("File \"bs_list_test.res\", line 341, characters 23-30", Belt_List.make(n, 3), Belt_List.makeBy(n, param => 3)); } eq("File \"bs_list_test.res\", line 343, characters 12-19", { @@ -2237,7 +2237,7 @@ b("File \"bs_list_test.res\", line 374, characters 4-11", !Belt_List.eq({ hd: 2, tl: /* [] */0 } -}, ((x, y) => x === y))); +}, (x, y) => x === y)); b("File \"bs_list_test.res\", line 375, characters 4-11", Belt_List.eq({ hd: 1, @@ -2257,7 +2257,7 @@ b("File \"bs_list_test.res\", line 375, characters 4-11", Belt_List.eq({ tl: /* [] */0 } } -}, ((x, y) => x === y))); +}, (x, y) => x === y)); b("File \"bs_list_test.res\", line 376, characters 4-11", !Belt_List.eq({ hd: 1, @@ -2277,7 +2277,7 @@ b("File \"bs_list_test.res\", line 376, characters 4-11", !Belt_List.eq({ tl: /* [] */0 } } -}, ((x, y) => x === y))); +}, (x, y) => x === y)); b("File \"bs_list_test.res\", line 377, characters 4-11", !Belt_List.eq({ hd: 1, @@ -2300,16 +2300,16 @@ b("File \"bs_list_test.res\", line 377, characters 4-11", !Belt_List.eq({ } } } -}, ((prim0, prim1) => prim0 === prim1))); +}, (prim0, prim1) => prim0 === prim1)); -let u0 = Belt_List.makeBy(20, (x => x)); +let u0 = Belt_List.makeBy(20, x => x); -let u1 = Belt_List.keepMap(u0, (x => { +let u1 = Belt_List.keepMap(u0, x => { if (x % 7 === 0) { return x + 1 | 0; } -})); +}); eq("File \"bs_list_test.res\", line 388, characters 5-12", u1, { hd: 1, @@ -2334,12 +2334,12 @@ b("File \"bs_list_test.res\", line 390, characters 4-11", Caml_obj.equal(Belt_Li } } } -}, (x => { +}, x => { if (x % 2 === 0) { return -x | 0; } -})), { +}), { hd: -2, tl: { hd: -4, @@ -2359,12 +2359,12 @@ b("File \"bs_list_test.res\", line 404, characters 4-11", Belt_List.keepMap({ } } } -}, (x => { +}, x => { if (x % 5 === 0) { return x; } -})) === /* [] */0); +}) === /* [] */0); Mt.from_pair_suites("Bs_list_test", suites.contents); diff --git a/jscomp/test/bs_map_set_dict_test.js b/jscomp/test/bs_map_set_dict_test.js index fcd75b390ec..5cc84fab8d0 100644 --- a/jscomp/test/bs_map_set_dict_test.js +++ b/jscomp/test/bs_map_set_dict_test.js @@ -53,7 +53,7 @@ let m00 = { }; let I2 = { - cmp: ((x, y) => Caml.int_compare(y, x)) + cmp: (x, y) => Caml.int_compare(y, x) }; let m_cmp = Icmp2.cmp; @@ -115,48 +115,48 @@ function $eq$tilde(a, b) { return extra => Belt_Map.eq(a, b, extra); } -let u0 = Belt_Map.fromArray(Belt_Array.map(Array_data_util.randomRange(0, 39), (x => [ +let u0 = Belt_Map.fromArray(Belt_Array.map(Array_data_util.randomRange(0, 39), x => [ x, x -])), Icmp); +]), Icmp); let u1 = Belt_Map.set(u0, 39, 120); -b("File \"bs_map_set_dict_test.res\", line 72, characters 4-11", Belt_Array.every2(Belt_MapDict.toArray(u0.data), Belt_Array.map(Array_data_util.range(0, 39), (x => [ +b("File \"bs_map_set_dict_test.res\", line 72, characters 4-11", Belt_Array.every2(Belt_MapDict.toArray(u0.data), Belt_Array.map(Array_data_util.range(0, 39), x => [ x, x -])), ((param, param$1) => { +]), (param, param$1) => { if (param[0] === param$1[0]) { return param[1] === param$1[1]; } else { return false; } -}))); +})); -b("File \"bs_map_set_dict_test.res\", line 79, characters 4-11", Belt_List.every2(Belt_MapDict.toList(u0.data), Belt_List.fromArray(Belt_Array.map(Array_data_util.range(0, 39), (x => [ +b("File \"bs_map_set_dict_test.res\", line 79, characters 4-11", Belt_List.every2(Belt_MapDict.toList(u0.data), Belt_List.fromArray(Belt_Array.map(Array_data_util.range(0, 39), x => [ x, x -]))), ((param, param$1) => { +])), (param, param$1) => { if (param[0] === param$1[0]) { return param[1] === param$1[1]; } else { return false; } -}))); +})); eq("File \"bs_map_set_dict_test.res\", line 84, characters 5-12", Belt_Map.get(u0, 39), 39); eq("File \"bs_map_set_dict_test.res\", line 85, characters 5-12", Belt_Map.get(u1, 39), 120); -let u = Belt_Map.fromArray(Belt_Array.makeByAndShuffle(10000, (x => [ +let u = Belt_Map.fromArray(Belt_Array.makeByAndShuffle(10000, x => [ x, x -])), Icmp); +]), Icmp); -eq("File \"bs_map_set_dict_test.res\", line 90, characters 5-12", Belt_Array.makeBy(10000, (x => [ +eq("File \"bs_map_set_dict_test.res\", line 90, characters 5-12", Belt_Array.makeBy(10000, x => [ x, x -])), Belt_MapDict.toArray(u.data)); +]), Belt_MapDict.toArray(u.data)); Mt.from_pair_suites("Bs_map_set_dict_test", suites.contents); diff --git a/jscomp/test/bs_map_test.js b/jscomp/test/bs_map_test.js index d2c39887d72..585b8956f47 100644 --- a/jscomp/test/bs_map_test.js +++ b/jscomp/test/bs_map_test.js @@ -19,11 +19,11 @@ function eq(loc, x, y) { suites.contents = { hd: [ loc + (" id " + String(test_id.contents)), - (() => ({ + () => ({ TAG: "Eq", _0: x, _1: y - })) + }) ], tl: suites.contents }; @@ -34,10 +34,10 @@ function b(loc, v) { suites.contents = { hd: [ loc + (" id " + String(test_id.contents)), - (() => ({ + () => ({ TAG: "Ok", _0: v - })) + }) ], tl: suites.contents }; @@ -51,10 +51,10 @@ function emptyMap() { } -let v = Belt_Array.makeByAndShuffle(1000000, (i => [ +let v = Belt_Array.makeByAndShuffle(1000000, i => [ i, i -])); +]); let u = Belt_MapInt.fromArray(v); @@ -62,7 +62,7 @@ Belt_MapInt.checkInvariantInternal(u); let firstHalf = Belt_Array.slice(v, 0, 2000); -let xx = Belt_Array.reduce(firstHalf, u, ((acc, param) => Belt_MapInt.remove(acc, param[0]))); +let xx = Belt_Array.reduce(firstHalf, u, (acc, param) => Belt_MapInt.remove(acc, param[0])); Belt_MapInt.checkInvariantInternal(u); diff --git a/jscomp/test/bs_mutable_set_test.js b/jscomp/test/bs_mutable_set_test.js index df324b23ed2..8c17ab5ba92 100644 --- a/jscomp/test/bs_mutable_set_test.js +++ b/jscomp/test/bs_mutable_set_test.js @@ -113,29 +113,29 @@ let v = { data: Belt_internalSetInt.fromArray(xs$1) }; -let bs = Belt_Array.map(Array_data_util.randomRange(500, 1499), (x => Belt_MutableSetInt.removeCheck(v, x))); +let bs = Belt_Array.map(Array_data_util.randomRange(500, 1499), x => Belt_MutableSetInt.removeCheck(v, x)); -let indeedRemoved = Belt_Array.reduce(bs, 0, ((acc, x) => { +let indeedRemoved = Belt_Array.reduce(bs, 0, (acc, x) => { if (x) { return acc + 1 | 0; } else { return acc; } -})); +}); eq("File \"bs_mutable_set_test.res\", line 72, characters 9-16", indeedRemoved, 500); eq("File \"bs_mutable_set_test.res\", line 73, characters 9-16", Belt_internalAVLset.size(v.data), 501); -let cs = Belt_Array.map(Array_data_util.randomRange(500, 2000), (x => Belt_MutableSetInt.addCheck(v, x))); +let cs = Belt_Array.map(Array_data_util.randomRange(500, 2000), x => Belt_MutableSetInt.addCheck(v, x)); -let indeedAded = Belt_Array.reduce(cs, 0, ((acc, x) => { +let indeedAded = Belt_Array.reduce(cs, 0, (acc, x) => { if (x) { return acc + 1 | 0; } else { return acc; } -})); +}); eq("File \"bs_mutable_set_test.res\", line 82, characters 9-16", indeedAded, 1000); @@ -153,9 +153,9 @@ eq("File \"bs_mutable_set_test.res\", line 87, characters 9-16", Belt_internalAV eq("File \"bs_mutable_set_test.res\", line 88, characters 9-16", Belt_internalAVLset.maxUndefined(v.data), 2000); -eq("File \"bs_mutable_set_test.res\", line 89, characters 9-16", Belt_MutableSetInt.reduce(v, 0, ((x, y) => x + y | 0)), 1876250); +eq("File \"bs_mutable_set_test.res\", line 89, characters 9-16", Belt_MutableSetInt.reduce(v, 0, (x, y) => x + y | 0), 1876250); -b("File \"bs_mutable_set_test.res\", line 90, characters 8-15", Belt_List.eq(Belt_internalAVLset.toList(v.data), Belt_List.makeBy(1501, (i => i + 500 | 0)), ((x, y) => x === y))); +b("File \"bs_mutable_set_test.res\", line 90, characters 8-15", Belt_List.eq(Belt_internalAVLset.toList(v.data), Belt_List.makeBy(1501, i => i + 500 | 0), (x, y) => x === y)); eq("File \"bs_mutable_set_test.res\", line 91, characters 9-16", Belt_internalAVLset.toArray(v.data), Array_data_util.range(500, 2000)); @@ -175,9 +175,9 @@ let aa = match$1[0]; b("File \"bs_mutable_set_test.res\", line 96, characters 8-15", match[1]); -b("File \"bs_mutable_set_test.res\", line 97, characters 8-15", Belt_Array.eq(Belt_internalAVLset.toArray(aa.data), Array_data_util.range(500, 999), ((x, y) => x === y))); +b("File \"bs_mutable_set_test.res\", line 97, characters 8-15", Belt_Array.eq(Belt_internalAVLset.toArray(aa.data), Array_data_util.range(500, 999), (x, y) => x === y)); -b("File \"bs_mutable_set_test.res\", line 98, characters 8-15", Belt_Array.eq(Belt_internalAVLset.toArray(bb.data), Array_data_util.range(1001, 2000), ((prim0, prim1) => prim0 === prim1))); +b("File \"bs_mutable_set_test.res\", line 98, characters 8-15", Belt_Array.eq(Belt_internalAVLset.toArray(bb.data), Array_data_util.range(1001, 2000), (prim0, prim1) => prim0 === prim1)); b("File \"bs_mutable_set_test.res\", line 99, characters 8-15", Belt_MutableSetInt.subset(aa, v)); @@ -199,9 +199,9 @@ let aa$1 = match$3[0]; b("File \"bs_mutable_set_test.res\", line 105, characters 8-15", !match$2[1]); -b("File \"bs_mutable_set_test.res\", line 106, characters 8-15", Belt_Array.eq(Belt_internalAVLset.toArray(aa$1.data), Array_data_util.range(500, 999), ((prim0, prim1) => prim0 === prim1))); +b("File \"bs_mutable_set_test.res\", line 106, characters 8-15", Belt_Array.eq(Belt_internalAVLset.toArray(aa$1.data), Array_data_util.range(500, 999), (prim0, prim1) => prim0 === prim1)); -b("File \"bs_mutable_set_test.res\", line 107, characters 8-15", Belt_Array.eq(Belt_internalAVLset.toArray(bb$1.data), Array_data_util.range(1001, 2000), ((prim0, prim1) => prim0 === prim1))); +b("File \"bs_mutable_set_test.res\", line 107, characters 8-15", Belt_Array.eq(Belt_internalAVLset.toArray(bb$1.data), Array_data_util.range(1001, 2000), (prim0, prim1) => prim0 === prim1)); b("File \"bs_mutable_set_test.res\", line 108, characters 8-15", Belt_MutableSetInt.subset(aa$1, v)); @@ -360,11 +360,11 @@ let a0 = { data: Belt_internalSetInt.fromArray(xs$24) }; -let a1 = Belt_MutableSetInt.keep(a0, (x => x % 2 === 0)); +let a1 = Belt_MutableSetInt.keep(a0, x => x % 2 === 0); -let a2 = Belt_MutableSetInt.keep(a0, (x => x % 2 !== 0)); +let a2 = Belt_MutableSetInt.keep(a0, x => x % 2 !== 0); -let match$4 = Belt_MutableSetInt.partition(a0, (x => x % 2 === 0)); +let match$4 = Belt_MutableSetInt.partition(a0, x => x % 2 === 0); let a4 = match$4[1]; @@ -389,7 +389,7 @@ Belt_List.forEach({ } } } -}, (x => Belt_internalAVLset.checkInvariantInternal(x.data))); +}, x => Belt_internalAVLset.checkInvariantInternal(x.data)); let v$1 = { data: undefined @@ -401,7 +401,7 @@ for (let i$2 = 0; i$2 <= 100000; ++i$2) { Belt_internalAVLset.checkInvariantInternal(v$1.data); -b("File \"bs_mutable_set_test.res\", line 188, characters 10-17", Belt_Range.every(0, 100000, (i => Belt_internalSetInt.has(v$1.data, i)))); +b("File \"bs_mutable_set_test.res\", line 188, characters 10-17", Belt_Range.every(0, 100000, i => Belt_internalSetInt.has(v$1.data, i))); eq("File \"bs_mutable_set_test.res\", line 189, characters 5-12", Belt_internalAVLset.size(v$1.data), 100001); @@ -443,7 +443,7 @@ eq("File \"bs_mutable_set_test.res\", line 216, characters 5-12", Belt_internalA b("File \"bs_mutable_set_test.res\", line 217, characters 4-11", Belt_MutableSetInt.isEmpty(v$3)); -let xs$25 = Belt_Array.makeBy(30, (i => i)); +let xs$25 = Belt_Array.makeBy(30, i => i); let v$4 = { data: Belt_internalSetInt.fromArray(xs$25) @@ -474,7 +474,7 @@ function id(loc, x) { data: Belt_internalAVLset.fromSortedArrayUnsafe(x) }; Belt_internalAVLset.checkInvariantInternal(u.data); - b(loc, Belt_Array.every2(Belt_internalAVLset.toArray(u.data), x, ((prim0, prim1) => prim0 === prim1))); + b(loc, Belt_Array.every2(Belt_internalAVLset.toArray(u.data), x, (prim0, prim1) => prim0 === prim1)); } id("File \"bs_mutable_set_test.res\", line 242, characters 5-12", []); @@ -566,11 +566,11 @@ let v$5 = { data: Belt_internalSetInt.fromArray(xs$26) }; -let copyV = Belt_MutableSetInt.keep(v$5, (x => x % 8 === 0)); +let copyV = Belt_MutableSetInt.keep(v$5, x => x % 8 === 0); -let match$5 = Belt_MutableSetInt.partition(v$5, (x => x % 8 === 0)); +let match$5 = Belt_MutableSetInt.partition(v$5, x => x % 8 === 0); -let cc$1 = Belt_MutableSetInt.keep(v$5, (x => x % 8 !== 0)); +let cc$1 = Belt_MutableSetInt.keep(v$5, x => x % 8 !== 0); for (let i$6 = 0; i$6 <= 200; ++i$6) { Belt_MutableSetInt.remove(v$5, i$6); @@ -578,7 +578,7 @@ for (let i$6 = 0; i$6 <= 200; ++i$6) { eq("File \"bs_mutable_set_test.res\", line 264, characters 5-12", Belt_internalAVLset.size(copyV.data), 126); -eq("File \"bs_mutable_set_test.res\", line 265, characters 5-12", Belt_internalAVLset.toArray(copyV.data), Belt_Array.makeBy(126, (i => (i << 3)))); +eq("File \"bs_mutable_set_test.res\", line 265, characters 5-12", Belt_internalAVLset.toArray(copyV.data), Belt_Array.makeBy(126, i => (i << 3))); eq("File \"bs_mutable_set_test.res\", line 266, characters 5-12", Belt_internalAVLset.size(v$5.data), 800); @@ -608,7 +608,7 @@ b("File \"bs_mutable_set_test.res\", line 275, characters 4-11", Belt_MutableSet data: Belt_internalSetInt.fromArray(xs$29) })); -let xs$30 = Belt_Array.map(Array_data_util.randomRange(0, 1000), (x => (x << 1))); +let xs$30 = Belt_Array.map(Array_data_util.randomRange(0, 1000), x => (x << 1)); let d = { data: Belt_internalSetInt.fromArray(xs$30) @@ -618,13 +618,13 @@ let match$8 = Belt_MutableSetInt.split(d, 1001); let match$9 = match$8[0]; -let xs$31 = Belt_Array.makeBy(501, (x => (x << 1))); +let xs$31 = Belt_Array.makeBy(501, x => (x << 1)); b("File \"bs_mutable_set_test.res\", line 278, characters 4-11", Belt_MutableSetInt.eq(match$9[0], { data: Belt_internalSetInt.fromArray(xs$31) })); -let xs$32 = Belt_Array.makeBy(500, (x => 1002 + (x << 1) | 0)); +let xs$32 = Belt_Array.makeBy(500, x => 1002 + (x << 1) | 0); b("File \"bs_mutable_set_test.res\", line 279, characters 4-11", Belt_MutableSetInt.eq(match$9[1], { data: Belt_internalSetInt.fromArray(xs$32) diff --git a/jscomp/test/bs_poly_map_test.js b/jscomp/test/bs_poly_map_test.js index 1f5475162ae..b1d01724bbe 100644 --- a/jscomp/test/bs_poly_map_test.js +++ b/jscomp/test/bs_poly_map_test.js @@ -46,40 +46,40 @@ function emptyMap() { } function mergeInter(s1, s2) { - let m = Belt_Map.merge(s1, s2, ((k, v1, v2) => { + let m = Belt_Map.merge(s1, s2, (k, v1, v2) => { if (v1 !== undefined && v2 !== undefined) { return Caml_option.some(undefined); } - })); + }); return Belt_Set.fromArray(Belt_MapDict.keysToArray(m.data), Icmp); } function mergeUnion(s1, s2) { - let m = Belt_Map.merge(s1, s2, ((k, v1, v2) => { + let m = Belt_Map.merge(s1, s2, (k, v1, v2) => { if (v1 !== undefined || v2 !== undefined) { return Caml_option.some(undefined); } - })); + }); return Belt_Set.fromArray(Belt_MapDict.keysToArray(m.data), Icmp); } function mergeDiff(s1, s2) { - let m = Belt_Map.merge(s1, s2, ((k, v1, v2) => { + let m = Belt_Map.merge(s1, s2, (k, v1, v2) => { if (v1 !== undefined && v2 === undefined) { return Caml_option.some(undefined); } - })); + }); return Belt_Set.fromArray(Belt_MapDict.keysToArray(m.data), Icmp); } function randomRange(i, j) { - return Belt_Array.map(Array_data_util.randomRange(i, j), (x => [ + return Belt_Array.map(Array_data_util.randomRange(i, j), x => [ x, x - ])); + ]); } let u0 = Belt_Map.fromArray(randomRange(0, 100), Icmp); @@ -100,20 +100,20 @@ let a1 = Belt_Map.set(a0, 3, 33); let a2 = Belt_Map.remove(a1, 3); -let a3 = Belt_Map.update(a2, 3, (k => { +let a3 = Belt_Map.update(a2, 3, k => { if (k !== undefined) { return k + 1 | 0; } else { return 11; } -})); +}); -let a4 = Belt_Map.update(a2, 3, (k => { +let a4 = Belt_Map.update(a2, 3, k => { if (k !== undefined) { return k + 1 | 0; } -})); +}); let a5 = Belt_Map.remove(a0, 3); @@ -167,13 +167,13 @@ eq("File \"bs_poly_map_test.res\", line 108, characters 5-12", Belt_Map.get(u1$1 eq("File \"bs_poly_map_test.res\", line 109, characters 5-12", Belt_Map.get(u0$1, 3), 3); function acc(m, is) { - return Belt_Array.reduce(is, m, ((a, i) => Belt_Map.update(a, i, (n => { + return Belt_Array.reduce(is, m, (a, i) => Belt_Map.update(a, i, n => { if (n !== undefined) { return n + 1 | 0; } else { return 1; } - })))); + })); } let m_cmp = Icmp.cmp; @@ -185,10 +185,10 @@ let m = { let m1 = acc(m, Belt_Array.concat(Array_data_util.randomRange(0, 20), Array_data_util.randomRange(10, 30))); -b("File \"bs_poly_map_test.res\", line 126, characters 4-11", Belt_Map.eq(m1, Belt_Map.fromArray(Belt_Array.makeBy(31, (i => [ +b("File \"bs_poly_map_test.res\", line 126, characters 4-11", Belt_Map.eq(m1, Belt_Map.fromArray(Belt_Array.makeBy(31, i => [ i, i >= 10 && i <= 20 ? 2 : 1 -])), Icmp), ((x, y) => x === y))); +]), Icmp), (x, y) => x === y)); let v0_cmp = Icmp.cmp; @@ -197,17 +197,17 @@ let v0 = { data: undefined }; -let v1 = Belt_Map.mergeMany(v0, Belt_Array.map(Array_data_util.randomRange(0, 10000), (x => [ +let v1 = Belt_Map.mergeMany(v0, Belt_Array.map(Array_data_util.randomRange(0, 10000), x => [ x, x -]))); +])); -let v2 = Belt_Map.fromArray(Belt_Array.map(Array_data_util.randomRange(0, 10000), (x => [ +let v2 = Belt_Map.fromArray(Belt_Array.map(Array_data_util.randomRange(0, 10000), x => [ x, x -])), Icmp); +]), Icmp); -b("File \"bs_poly_map_test.res\", line 150, characters 4-11", Belt_Map.eq(v1, v2, ((x, y) => x === y))); +b("File \"bs_poly_map_test.res\", line 150, characters 4-11", Belt_Map.eq(v1, v2, (x, y) => x === y)); function inc(x) { if (x !== undefined) { @@ -255,9 +255,9 @@ b("File \"bs_poly_map_test.res\", line 182, characters 4-11", Belt_MapDict.isEmp b("File \"bs_poly_map_test.res\", line 184, characters 4-11", pres !== undefined ? pres === 5000 : false); -b("File \"bs_poly_map_test.res\", line 190, characters 4-11", Belt_Array.eq(Belt_MapDict.keysToArray(match$1[0].data), Belt_Array.makeBy(5000, (i => i)), ((prim0, prim1) => prim0 === prim1))); +b("File \"bs_poly_map_test.res\", line 190, characters 4-11", Belt_Array.eq(Belt_MapDict.keysToArray(match$1[0].data), Belt_Array.makeBy(5000, i => i), (prim0, prim1) => prim0 === prim1)); -b("File \"bs_poly_map_test.res\", line 191, characters 4-11", Belt_Array.eq(Belt_MapDict.keysToArray(match$1[1].data), Belt_Array.makeBy(5000, (i => 5001 + i | 0)), ((prim0, prim1) => prim0 === prim1))); +b("File \"bs_poly_map_test.res\", line 191, characters 4-11", Belt_Array.eq(Belt_MapDict.keysToArray(match$1[1].data), Belt_Array.makeBy(5000, i => 5001 + i | 0), (prim0, prim1) => prim0 === prim1)); let v7 = Belt_Map.remove(v3, 5000); @@ -267,9 +267,9 @@ let match$6 = match$5[0]; b("File \"bs_poly_map_test.res\", line 196, characters 4-11", match$5[1] === undefined); -b("File \"bs_poly_map_test.res\", line 202, characters 4-11", Belt_Array.eq(Belt_MapDict.keysToArray(match$6[0].data), Belt_Array.makeBy(5000, (i => i)), ((prim0, prim1) => prim0 === prim1))); +b("File \"bs_poly_map_test.res\", line 202, characters 4-11", Belt_Array.eq(Belt_MapDict.keysToArray(match$6[0].data), Belt_Array.makeBy(5000, i => i), (prim0, prim1) => prim0 === prim1)); -b("File \"bs_poly_map_test.res\", line 203, characters 4-11", Belt_Array.eq(Belt_MapDict.keysToArray(match$6[1].data), Belt_Array.makeBy(5000, (i => 5001 + i | 0)), ((prim0, prim1) => prim0 === prim1))); +b("File \"bs_poly_map_test.res\", line 203, characters 4-11", Belt_Array.eq(Belt_MapDict.keysToArray(match$6[1].data), Belt_Array.makeBy(5000, i => 5001 + i | 0), (prim0, prim1) => prim0 === prim1)); Mt.from_pair_suites("Bs_poly_map_test", suites.contents); diff --git a/jscomp/test/bs_poly_mutable_map_test.js b/jscomp/test/bs_poly_mutable_map_test.js index 5fdbb8f04c3..5d8d490da62 100644 --- a/jscomp/test/bs_poly_mutable_map_test.js +++ b/jscomp/test/bs_poly_mutable_map_test.js @@ -38,10 +38,10 @@ function ff(x) { } function randomRange(i, j) { - return Belt_Array.map(Array_data_util.randomRange(i, j), (x => [ + return Belt_Array.map(Array_data_util.randomRange(i, j), x => [ x, x - ])); + ]); } let a0 = Belt_MutableMap.fromArray(randomRange(0, 10), Icmp); @@ -77,9 +77,9 @@ let a0$1 = Belt_MutableMap.fromArray(randomRange(0, 10000), Icmp); Belt_MutableMap.set(a0$1, 2000, 33); -Belt_MutableMap.removeMany(a0$1, Belt_Array.map(randomRange(0, 1998), (prim => prim[0]))); +Belt_MutableMap.removeMany(a0$1, Belt_Array.map(randomRange(0, 1998), prim => prim[0])); -Belt_MutableMap.removeMany(a0$1, Belt_Array.map(randomRange(2002, 11000), (prim => prim[0]))); +Belt_MutableMap.removeMany(a0$1, Belt_Array.map(randomRange(2002, 11000), prim => prim[0])); eq("File \"bs_poly_mutable_map_test.res\", line 39, characters 5-12", Belt_internalAVLtree.toArray(a0$1.data), [ [ diff --git a/jscomp/test/bs_poly_mutable_set_test.js b/jscomp/test/bs_poly_mutable_set_test.js index fb51a8dda49..02a95bc8e51 100644 --- a/jscomp/test/bs_poly_mutable_set_test.js +++ b/jscomp/test/bs_poly_mutable_set_test.js @@ -118,29 +118,29 @@ b("File \"bs_poly_mutable_set_test.res\", line 54, characters 4-11", Belt_Mutabl let v = Belt_MutableSet.fromArray(Array_data_util.randomRange(1000, 2000), IntCmp); -let bs = Belt_Array.map(Array_data_util.randomRange(500, 1499), (x => Belt_MutableSet.removeCheck(v, x))); +let bs = Belt_Array.map(Array_data_util.randomRange(500, 1499), x => Belt_MutableSet.removeCheck(v, x)); -let indeedRemoved = Belt_Array.reduce(bs, 0, ((acc, x) => { +let indeedRemoved = Belt_Array.reduce(bs, 0, (acc, x) => { if (x) { return acc + 1 | 0; } else { return acc; } -})); +}); eq("File \"bs_poly_mutable_set_test.res\", line 67, characters 5-12", indeedRemoved, 500); eq("File \"bs_poly_mutable_set_test.res\", line 68, characters 5-12", Belt_internalAVLset.size(v.data), 501); -let cs = Belt_Array.map(Array_data_util.randomRange(500, 2000), (x => Belt_MutableSet.addCheck(v, x))); +let cs = Belt_Array.map(Array_data_util.randomRange(500, 2000), x => Belt_MutableSet.addCheck(v, x)); -let indeedAded = Belt_Array.reduce(cs, 0, ((acc, x) => { +let indeedAded = Belt_Array.reduce(cs, 0, (acc, x) => { if (x) { return acc + 1 | 0; } else { return acc; } -})); +}); eq("File \"bs_poly_mutable_set_test.res\", line 77, characters 5-12", indeedAded, 1000); @@ -159,9 +159,9 @@ eq("File \"bs_poly_mutable_set_test.res\", line 82, characters 5-12", Belt_inter eq("File \"bs_poly_mutable_set_test.res\", line 83, characters 5-12", Belt_internalAVLset.maxUndefined(v.data), 2000); -eq("File \"bs_poly_mutable_set_test.res\", line 84, characters 5-12", Belt_MutableSet.reduce(v, 0, ((x, y) => x + y | 0)), 1876250); +eq("File \"bs_poly_mutable_set_test.res\", line 84, characters 5-12", Belt_MutableSet.reduce(v, 0, (x, y) => x + y | 0), 1876250); -b("File \"bs_poly_mutable_set_test.res\", line 85, characters 4-11", Belt_List.eq(Belt_internalAVLset.toList(v.data), Belt_List.makeBy(1501, (i => i + 500 | 0)), ((x, y) => x === y))); +b("File \"bs_poly_mutable_set_test.res\", line 85, characters 4-11", Belt_List.eq(Belt_internalAVLset.toList(v.data), Belt_List.makeBy(1501, i => i + 500 | 0), (x, y) => x === y)); eq("File \"bs_poly_mutable_set_test.res\", line 86, characters 5-12", Belt_internalAVLset.toArray(v.data), Array_data_util.range(500, 2000)); @@ -181,9 +181,9 @@ let aa = match$1[0]; b("File \"bs_poly_mutable_set_test.res\", line 91, characters 4-11", match[1]); -b("File \"bs_poly_mutable_set_test.res\", line 92, characters 4-11", Belt_Array.eq(Belt_internalAVLset.toArray(aa.data), Array_data_util.range(500, 999), ((prim0, prim1) => prim0 === prim1))); +b("File \"bs_poly_mutable_set_test.res\", line 92, characters 4-11", Belt_Array.eq(Belt_internalAVLset.toArray(aa.data), Array_data_util.range(500, 999), (prim0, prim1) => prim0 === prim1)); -b("File \"bs_poly_mutable_set_test.res\", line 93, characters 4-11", Belt_Array.eq(Belt_internalAVLset.toArray(bb.data), Array_data_util.range(1001, 2000), ((prim0, prim1) => prim0 === prim1))); +b("File \"bs_poly_mutable_set_test.res\", line 93, characters 4-11", Belt_Array.eq(Belt_internalAVLset.toArray(bb.data), Array_data_util.range(1001, 2000), (prim0, prim1) => prim0 === prim1)); b("File \"bs_poly_mutable_set_test.res\", line 94, characters 4-11", Belt_MutableSet.subset(aa, v)); @@ -205,9 +205,9 @@ let aa$1 = match$3[0]; b("File \"bs_poly_mutable_set_test.res\", line 100, characters 4-11", !match$2[1]); -b("File \"bs_poly_mutable_set_test.res\", line 101, characters 4-11", Belt_Array.eq(Belt_internalAVLset.toArray(aa$1.data), Array_data_util.range(500, 999), ((prim0, prim1) => prim0 === prim1))); +b("File \"bs_poly_mutable_set_test.res\", line 101, characters 4-11", Belt_Array.eq(Belt_internalAVLset.toArray(aa$1.data), Array_data_util.range(500, 999), (prim0, prim1) => prim0 === prim1)); -b("File \"bs_poly_mutable_set_test.res\", line 102, characters 4-11", Belt_Array.eq(Belt_internalAVLset.toArray(bb$1.data), Array_data_util.range(1001, 2000), ((prim0, prim1) => prim0 === prim1))); +b("File \"bs_poly_mutable_set_test.res\", line 102, characters 4-11", Belt_Array.eq(Belt_internalAVLset.toArray(bb$1.data), Array_data_util.range(1001, 2000), (prim0, prim1) => prim0 === prim1)); b("File \"bs_poly_mutable_set_test.res\", line 103, characters 4-11", Belt_MutableSet.subset(aa$1, v)); @@ -270,11 +270,11 @@ b("File \"bs_poly_mutable_set_test.res\", line 150, characters 4-11", Belt_Mutab let a0 = Belt_MutableSet.fromArray(Array_data_util.randomRange(0, 1000), IntCmp); -let a1 = Belt_MutableSet.keep(a0, (x => x % 2 === 0)); +let a1 = Belt_MutableSet.keep(a0, x => x % 2 === 0); -let a2 = Belt_MutableSet.keep(a0, (x => x % 2 !== 0)); +let a2 = Belt_MutableSet.keep(a0, x => x % 2 !== 0); -let match$4 = Belt_MutableSet.partition(a0, (x => x % 2 === 0)); +let match$4 = Belt_MutableSet.partition(a0, x => x % 2 === 0); let a4 = match$4[1]; @@ -299,7 +299,7 @@ Belt_List.forEach({ } } } -}, (x => Belt_internalAVLset.checkInvariantInternal(x.data))); +}, x => Belt_internalAVLset.checkInvariantInternal(x.data)); Mt.from_pair_suites("Bs_poly_mutable_set_test", suites.contents); diff --git a/jscomp/test/bs_poly_set_test.js b/jscomp/test/bs_poly_set_test.js index 637fe6e6d7a..1645d3d1bdf 100644 --- a/jscomp/test/bs_poly_set_test.js +++ b/jscomp/test/bs_poly_set_test.js @@ -146,7 +146,7 @@ let u26 = Belt_Set.add({ data: undefined }, 3); -let ss = Belt_Array.makeByAndShuffle(100, (i => (i << 1))); +let ss = Belt_Array.makeByAndShuffle(100, i => (i << 1)); let u27 = Belt_Set.fromArray(ss, IntCmp); @@ -198,12 +198,12 @@ function testIterToList(xs) { let v = { contents: /* [] */0 }; - Belt_SetDict.forEach(xs.data, (x => { + Belt_SetDict.forEach(xs.data, x => { v.contents = { hd: x, tl: v.contents }; - })); + }); return Belt_List.reverse(v.contents); } @@ -211,12 +211,12 @@ function testIterToList2(xs) { let v = { contents: /* [] */0 }; - Belt_SetDict.forEach(xs.data, (x => { + Belt_SetDict.forEach(xs.data, x => { v.contents = { hd: x, tl: v.contents }; - })); + }); return Belt_List.reverse(v.contents); } @@ -226,11 +226,11 @@ let u1$1 = Belt_Set.remove(u0$1, 17); let u2$1 = Belt_Set.add(u1$1, 33); -b("File \"bs_poly_set_test.res\", line 110, characters 4-11", Belt_List.every2(testIterToList(u0$1), Belt_List.makeBy(21, (i => i)), ((x, y) => x === y))); +b("File \"bs_poly_set_test.res\", line 110, characters 4-11", Belt_List.every2(testIterToList(u0$1), Belt_List.makeBy(21, i => i), (x, y) => x === y)); -b("File \"bs_poly_set_test.res\", line 111, characters 4-11", Belt_List.every2(testIterToList2(u0$1), Belt_List.makeBy(21, (i => i)), ((x, y) => x === y))); +b("File \"bs_poly_set_test.res\", line 111, characters 4-11", Belt_List.every2(testIterToList2(u0$1), Belt_List.makeBy(21, i => i), (x, y) => x === y)); -b("File \"bs_poly_set_test.res\", line 112, characters 4-11", Belt_List.every2(testIterToList(u0$1), Belt_SetDict.toList(u0$1.data), ((x, y) => x === y))); +b("File \"bs_poly_set_test.res\", line 112, characters 4-11", Belt_List.every2(testIterToList(u0$1), Belt_SetDict.toList(u0$1.data), (x, y) => x === y)); function f(x) { return x === 17; @@ -250,7 +250,7 @@ function f$2(x) { b("File \"bs_poly_set_test.res\", line 115, characters 4-11", Belt_SetDict.every(u0$1.data, f$2)); -b("File \"bs_poly_set_test.res\", line 116, characters 4-11", Belt_SetDict.every(u0$1.data, (x => x < 24))); +b("File \"bs_poly_set_test.res\", line 116, characters 4-11", Belt_SetDict.every(u0$1.data, x => x < 24)); function f$3(x) { return x < 24; @@ -276,11 +276,11 @@ b("File \"bs_poly_set_test.res\", line 120, characters 4-11", Belt_Set.cmp(u0$1, let a0 = Belt_Set.fromArray(Array_data_util.randomRange(0, 1000), IntCmp); -let a1 = Belt_Set.keep(a0, (x => x % 2 === 0)); +let a1 = Belt_Set.keep(a0, x => x % 2 === 0); -let a2 = Belt_Set.keep(a0, (x => x % 2 !== 0)); +let a2 = Belt_Set.keep(a0, x => x % 2 !== 0); -let match = Belt_Set.partition(a0, (x => x % 2 === 0)); +let match = Belt_Set.partition(a0, x => x % 2 === 0); let a4 = match[1]; @@ -294,13 +294,13 @@ eq("File \"bs_poly_set_test.res\", line 129, characters 5-12", Belt_Set.getExn(a eq("File \"bs_poly_set_test.res\", line 130, characters 5-12", Belt_Set.getExn(a0, 4), 4); -t("File \"bs_poly_set_test.res\", line 131, characters 4-11", (() => { +t("File \"bs_poly_set_test.res\", line 131, characters 4-11", () => { Belt_Set.getExn(a0, 1002); -})); +}); -t("File \"bs_poly_set_test.res\", line 132, characters 4-11", (() => { +t("File \"bs_poly_set_test.res\", line 132, characters 4-11", () => { Belt_Set.getExn(a0, -1); -})); +}); eq("File \"bs_poly_set_test.res\", line 133, characters 5-12", Belt_SetDict.size(a0.data), 1001); @@ -312,9 +312,9 @@ let match$2 = match$1[0]; b("File \"bs_poly_set_test.res\", line 136, characters 4-11", match$1[1]); -eq("File \"bs_poly_set_test.res\", line 137, characters 5-12", Belt_SetDict.toArray(match$2[0].data), Belt_Array.makeBy(200, (i => i))); +eq("File \"bs_poly_set_test.res\", line 137, characters 5-12", Belt_SetDict.toArray(match$2[0].data), Belt_Array.makeBy(200, i => i)); -eq("File \"bs_poly_set_test.res\", line 138, characters 5-12", Belt_SetDict.toList(match$2[1].data), Belt_List.makeBy(800, (i => i + 201 | 0))); +eq("File \"bs_poly_set_test.res\", line 138, characters 5-12", Belt_SetDict.toList(match$2[1].data), Belt_List.makeBy(800, i => i + 201 | 0)); let a7 = Belt_Set.remove(a0, 200); @@ -328,9 +328,9 @@ let a8 = match$4[0]; b("File \"bs_poly_set_test.res\", line 141, characters 4-11", !match$3[1]); -eq("File \"bs_poly_set_test.res\", line 142, characters 5-12", Belt_SetDict.toArray(a8.data), Belt_Array.makeBy(200, (i => i))); +eq("File \"bs_poly_set_test.res\", line 142, characters 5-12", Belt_SetDict.toArray(a8.data), Belt_Array.makeBy(200, i => i)); -eq("File \"bs_poly_set_test.res\", line 143, characters 5-12", Belt_SetDict.toList(a9.data), Belt_List.makeBy(800, (i => i + 201 | 0))); +eq("File \"bs_poly_set_test.res\", line 143, characters 5-12", Belt_SetDict.toList(a9.data), Belt_List.makeBy(800, i => i + 201 | 0)); eq("File \"bs_poly_set_test.res\", line 144, characters 5-12", Belt_SetDict.minimum(a8.data), 0); @@ -351,11 +351,11 @@ Belt_List.forEach({ } } } -}, (x => Belt_SetDict.checkInvariantInternal(x.data))); +}, x => Belt_SetDict.checkInvariantInternal(x.data)); let a = Belt_Set.fromArray([], IntCmp); -let m$1 = Belt_Set.keep(a, (x => x % 2 === 0)); +let m$1 = Belt_Set.keep(a, x => x % 2 === 0); b("File \"bs_poly_set_test.res\", line 151, characters 4-11", Belt_SetDict.isEmpty(m$1.data)); diff --git a/jscomp/test/bs_queue_test.js b/jscomp/test/bs_queue_test.js index d295d4b0a00..23b344361b9 100644 --- a/jscomp/test/bs_queue_test.js +++ b/jscomp/test/bs_queue_test.js @@ -767,7 +767,7 @@ let i$7 = { contents: 1 }; -Belt_MutableQueue.forEach(q$5, (j => { +Belt_MutableQueue.forEach(q$5, j => { if (i$7.contents !== j) { throw new Error("Assert_failure", { cause: { @@ -781,7 +781,7 @@ Belt_MutableQueue.forEach(q$5, (j => { }); } i$7.contents = i$7.contents + 1 | 0; -})); +}); let q1$1 = { length: 0, @@ -1312,7 +1312,7 @@ if (!Caml_obj.equal(Belt_MutableQueue.toArray(q2$4), v)) { }); } -if (Belt_MutableQueue.reduce(q2$4, 0, ((x, y) => x - y | 0)) !== Belt_Array.reduce(v, 0, ((x, y) => x - y | 0))) { +if (Belt_MutableQueue.reduce(q2$4, 0, (x, y) => x - y | 0) !== Belt_Array.reduce(v, 0, (x, y) => x - y | 0)) { throw new Error("Assert_failure", { cause: { RE_EXN_ID: "Assert_failure", @@ -1334,7 +1334,7 @@ let q$6 = Belt_MutableQueue.fromArray([ 4 ]); -let q1$5 = Belt_MutableQueue.map(q$6, (x => x - 1 | 0)); +let q1$5 = Belt_MutableQueue.map(q$6, x => x - 1 | 0); eq("File \"bs_queue_test.res\", line 197, characters 5-12", Belt_MutableQueue.toArray(q1$5), [ 0, @@ -1347,7 +1347,7 @@ let q$7 = Belt_MutableQueue.fromArray([]); b("File \"bs_queue_test.res\", line 198, characters 4-11", q$7.length === 0); -let q$8 = Belt_MutableQueue.map(Belt_MutableQueue.fromArray([]), (x => x + 1 | 0)); +let q$8 = Belt_MutableQueue.map(Belt_MutableQueue.fromArray([]), x => x + 1 | 0); b("File \"bs_queue_test.res\", line 199, characters 4-11", q$8.length === 0); diff --git a/jscomp/test/bs_set_int_test.js b/jscomp/test/bs_set_int_test.js index f9b4c4e954c..7cf08f608fb 100644 --- a/jscomp/test/bs_set_int_test.js +++ b/jscomp/test/bs_set_int_test.js @@ -55,11 +55,11 @@ let u = Belt_SetInt.intersect(Belt_SetInt.fromArray([ b("File \"bs_set_int_test.res\", line 27, characters 11-18", Belt_SetInt.eq(Belt_SetInt.fromArray([3]), u)); function range(i, j) { - return $$Array.init((j - i | 0) + 1 | 0, (k => k + i | 0)); + return $$Array.init((j - i | 0) + 1 | 0, k => k + i | 0); } function revRange(i, j) { - return $$Array.of_list(List.rev($$Array.to_list($$Array.init((j - i | 0) + 1 | 0, (k => k + i | 0))))); + return $$Array.of_list(List.rev($$Array.to_list($$Array.init((j - i | 0) + 1 | 0, k => k + i | 0)))); } let v = Belt_SetInt.fromArray($$Array.append(range(100, 1000), revRange(400, 1500))); @@ -68,7 +68,7 @@ let i = range(100, 1500); b("File \"bs_set_int_test.res\", line 37, characters 4-11", Belt_SetInt.eq(Belt_SetInt.fromArray(i), v)); -let match = Belt_SetInt.partition(v, (x => x % 3 === 0)); +let match = Belt_SetInt.partition(v, x => x % 3 === 0); let l; @@ -156,7 +156,7 @@ function approx(loc, x, y) { b(loc, x === y); } -eq("File \"bs_set_int_test.res\", line 125, characters 5-12", Belt_SetInt.reduce(v$1, 0, ((x, y) => x + y | 0)), Belt_Array.reduce(ss, 0, ((prim0, prim1) => prim0 + prim1 | 0))); +eq("File \"bs_set_int_test.res\", line 125, characters 5-12", Belt_SetInt.reduce(v$1, 0, (x, y) => x + y | 0), Belt_Array.reduce(ss, 0, (prim0, prim1) => prim0 + prim1 | 0)); approx("File \"bs_set_int_test.res\", line 126, characters 9-16", -1, minv); @@ -206,7 +206,7 @@ let v$10 = Belt_SetInt.remove(v$9, 1); b("File \"bs_set_int_test.res\", line 146, characters 4-11", Belt_SetInt.isEmpty(v$10)); -let v$11 = Belt_Array.makeByAndShuffle(1000000, (i => i)); +let v$11 = Belt_Array.makeByAndShuffle(1000000, i => i); let u$1 = Belt_SetInt.fromArray(v$11); @@ -329,15 +329,15 @@ let v3 = Belt_SetInt.removeMany(v2, [ 2001 ]); -let us = Belt_Array.map(Array_data_util.randomRange(1000, 3000), (x => Belt_SetInt.has(v$12, x))); +let us = Belt_Array.map(Array_data_util.randomRange(1000, 3000), x => Belt_SetInt.has(v$12, x)); -let counted = Belt_Array.reduce(us, 0, ((acc, x) => { +let counted = Belt_Array.reduce(us, 0, (acc, x) => { if (x) { return acc + 1 | 0; } else { return acc; } -})); +}); eq("File \"bs_set_int_test.res\", line 235, characters 5-12", counted, 1001); diff --git a/jscomp/test/bs_sort_test.js b/jscomp/test/bs_sort_test.js index 03a7b15cd67..a3c9b0a5f80 100644 --- a/jscomp/test/bs_sort_test.js +++ b/jscomp/test/bs_sort_test.js @@ -92,17 +92,17 @@ eq("File \"bs_sort_test.res\", line 52, characters 5-12", diffs(Array_data_util. 2 ]); -b("File \"bs_sort_test.res\", line 56, characters 4-11", Belt_Range.every(0, 200, (i => { +b("File \"bs_sort_test.res\", line 56, characters 4-11", Belt_Range.every(0, 200, i => { let v = Array_data_util.randomRange(0, i); Belt_SortArray.stableSortInPlaceBy(v, cmp); return Belt_SortArray.isSorted(v, cmp); -}))); +})); -b("File \"bs_sort_test.res\", line 64, characters 4-11", Belt_Range.every(0, 200, (i => { +b("File \"bs_sort_test.res\", line 64, characters 4-11", Belt_Range.every(0, 200, i => { let v = Array_data_util.randomRange(0, i); Belt_SortArray.stableSortInPlaceBy(v, cmp); return Belt_SortArray.isSorted(v, cmp); -}))); +})); b("File \"bs_sort_test.res\", line 71, characters 4-11", Belt_SortArray.isSorted([], cmp)); @@ -151,7 +151,7 @@ let u$1 = [ ] ]; -eq("File \"bs_sort_test.res\", line 95, characters 5-12", Belt_SortArray.stableSortBy(u$1, ((param, param$1) => param[0] - param$1[0] | 0)), [ +eq("File \"bs_sort_test.res\", line 95, characters 5-12", Belt_SortArray.stableSortBy(u$1, (param, param$1) => param[0] - param$1[0] | 0), [ [ 1, "a" @@ -185,7 +185,7 @@ let u$2 = [ ] ]; -eq("File \"bs_sort_test.res\", line 98, characters 4-11", Belt_SortArray.stableSortBy(u$2, ((param, param$1) => param[0] - param$1[0] | 0)), [ +eq("File \"bs_sort_test.res\", line 98, characters 4-11", Belt_SortArray.stableSortBy(u$2, (param, param$1) => param[0] - param$1[0] | 0), [ [ 1, "b" @@ -231,7 +231,7 @@ let u$3 = [ ] ]; -eq("File \"bs_sort_test.res\", line 104, characters 4-11", Belt_SortArray.stableSortBy(u$3, ((param, param$1) => param[0] - param$1[0] | 0)), [ +eq("File \"bs_sort_test.res\", line 104, characters 4-11", Belt_SortArray.stableSortBy(u$3, (param, param$1) => param[0] - param$1[0] | 0), [ [ 1, "c" @@ -317,9 +317,9 @@ eq("File \"bs_sort_test.res\", line 116, characters 5-12", Belt_SortArray.binary let aa = Array_data_util.range(0, 1000); -b("File \"bs_sort_test.res\", line 118, characters 4-11", Belt_Range.every(0, 1000, (i => Belt_SortArray.binarySearchBy(aa, i, cmp) === i))); +b("File \"bs_sort_test.res\", line 118, characters 4-11", Belt_Range.every(0, 1000, i => Belt_SortArray.binarySearchBy(aa, i, cmp) === i)); -let cc = Belt_Array.map(Array_data_util.range(0, 2000), (x => (x << 1))); +let cc = Belt_Array.map(Array_data_util.range(0, 2000), x => (x << 1)); eq("File \"bs_sort_test.res\", line 121, characters 5-12", Belt_SortArray.binarySearchBy(cc, 5000, cmp) ^ -1, 2001); @@ -329,7 +329,7 @@ eq("File \"bs_sort_test.res\", line 123, characters 5-12", Belt_SortArray.binary eq("File \"bs_sort_test.res\", line 125, characters 5-12", Belt_SortArray.binarySearchBy(cc, 1, cmp) ^ -1, 1); -b("File \"bs_sort_test.res\", line 126, characters 6-13", Belt_Range.every(0, 1999, (i => (Belt_SortArray.binarySearchBy(cc, (i << 1) + 1 | 0, cmp) ^ -1) === (i + 1 | 0)))); +b("File \"bs_sort_test.res\", line 126, characters 6-13", Belt_Range.every(0, 1999, i => (Belt_SortArray.binarySearchBy(cc, (i << 1) + 1 | 0, cmp) ^ -1) === (i + 1 | 0))); function lt(x, y) { return x < y; diff --git a/jscomp/test/bs_stack_test.js b/jscomp/test/bs_stack_test.js index c533434e4c1..f30fee5221a 100644 --- a/jscomp/test/bs_stack_test.js +++ b/jscomp/test/bs_stack_test.js @@ -63,7 +63,7 @@ function inOrder3(v) { Belt_MutableStack.push(s, v$1); current = v$1.left; }; - Belt_MutableStack.dynamicPopIter(s, (popped => { + Belt_MutableStack.dynamicPopIter(s, popped => { Belt_MutableQueue.add(q, popped.value); let current = popped.right; while (current !== undefined) { @@ -71,7 +71,7 @@ function inOrder3(v) { Belt_MutableStack.push(s, v); current = v.left; }; - })); + }); return Belt_MutableQueue.toArray(q); } diff --git a/jscomp/test/bs_string_test.js b/jscomp/test/bs_string_test.js index 3a6d4cf1a55..3dc70613f0c 100644 --- a/jscomp/test/bs_string_test.js +++ b/jscomp/test/bs_string_test.js @@ -16,17 +16,17 @@ function eq(loc, x, y) { suites.contents = { hd: [ loc + (" id " + String(test_id.contents)), - (() => ({ + () => ({ TAG: "Eq", _0: x, _1: y - })) + }) ], tl: suites.contents }; } -eq("File \"bs_string_test.res\", line 10, characters 2-9", "ghso ghso g".split(" ").reduce(((x, y) => x + ("-" + y)), ""), "-ghso-ghso-g"); +eq("File \"bs_string_test.res\", line 10, characters 2-9", "ghso ghso g".split(" ").reduce((x, y) => x + ("-" + y), ""), "-ghso-ghso-g"); Mt.from_pair_suites("Bs_string_test", suites.contents); diff --git a/jscomp/test/buffer_test.js b/jscomp/test/buffer_test.js index e6d20605bd0..b67e35703a6 100644 --- a/jscomp/test/buffer_test.js +++ b/jscomp/test/buffer_test.js @@ -11,7 +11,7 @@ let v = "gso"; let suites_0 = [ "equal", - (param => ({ + param => ({ TAG: "Eq", _0: [ Caml_bytes.get(Bytes.make(3, /* 'a' */97), 0), @@ -21,13 +21,13 @@ let suites_0 = [ /* 'a' */97, /* 'a' */97 ] - })) + }) ]; let suites_1 = { hd: [ "equal2", - (param => { + param => { let u = Bytes.make(3, /* 'a' */97); u[0] = /* 'b' */98; return { @@ -41,12 +41,12 @@ let suites_1 = { /* 'g' */103 ] }; - }) + } ], tl: { hd: [ "buffer", - (param => { + param => { let v = Buffer.create(30); for (let i = 0; i <= 10; ++i) { Buffer.add_string(v, String(i)); @@ -56,7 +56,7 @@ let suites_1 = { _0: Buffer.contents(v), _1: "012345678910" }; - }) + } ], tl: /* [] */0 } diff --git a/jscomp/test/bytes_split_gpr_743_test.js b/jscomp/test/bytes_split_gpr_743_test.js index cdcc342a375..7ab680613a8 100644 --- a/jscomp/test/bytes_split_gpr_743_test.js +++ b/jscomp/test/bytes_split_gpr_743_test.js @@ -20,11 +20,11 @@ function eq(loc, param) { suites.contents = { hd: [ loc + (" id " + String(test_id.contents)), - (() => ({ + () => ({ TAG: "Eq", _0: x, _1: y - })) + }) ], tl: suites.contents }; diff --git a/jscomp/test/caml_compare_bigint_test.js b/jscomp/test/caml_compare_bigint_test.js index 43b91c846f7..7d451210b56 100644 --- a/jscomp/test/caml_compare_bigint_test.js +++ b/jscomp/test/caml_compare_bigint_test.js @@ -9,164 +9,164 @@ function isLessThan(title, small, big) { return { hd: [ "compare: " + title, - (param => ({ + param => ({ TAG: "Eq", _0: true, _1: Caml_obj.compare(big, small) > 0 - })) + }) ], tl: { hd: [ "compare: " + title, - (param => ({ + param => ({ TAG: "Eq", _0: true, _1: Caml_obj.compare(small, big) < 0 - })) + }) ], tl: { hd: [ "< operator: " + title, - (param => ({ + param => ({ TAG: "Eq", _0: true, _1: Caml_obj.lessthan(small, big) - })) + }) ], tl: { hd: [ "<= operator: " + title, - (param => ({ + param => ({ TAG: "Eq", _0: true, _1: Caml_obj.lessequal(small, big) - })) + }) ], tl: { hd: [ "> operator: " + title, - (param => ({ + param => ({ TAG: "Eq", _0: true, _1: Caml_obj.greaterthan(big, small) - })) + }) ], tl: { hd: [ ">= operator: " + title, - (param => ({ + param => ({ TAG: "Eq", _0: true, _1: Caml_obj.greaterequal(big, small) - })) + }) ], tl: { hd: [ "min: " + title, - (param => ({ + param => ({ TAG: "Eq", _0: small, _1: Caml_obj.min(big, small) - })) + }) ], tl: { hd: [ "min: " + title, - (param => ({ + param => ({ TAG: "Eq", _0: small, _1: Caml_obj.min(small, big) - })) + }) ], tl: { hd: [ "max: " + title, - (param => ({ + param => ({ TAG: "Eq", _0: big, _1: Caml_obj.max(big, small) - })) + }) ], tl: { hd: [ "max: " + title, - (param => ({ + param => ({ TAG: "Eq", _0: big, _1: Caml_obj.max(small, big) - })) + }) ], tl: { hd: [ "!== operator: " + title, - (param => ({ + param => ({ TAG: "Eq", _0: true, _1: big !== small - })) + }) ], tl: { hd: [ "!== operator: " + title, - (param => ({ + param => ({ TAG: "Eq", _0: true, _1: small !== big - })) + }) ], tl: { hd: [ "!= operator: " + title, - (param => ({ + param => ({ TAG: "Eq", _0: true, _1: Caml_obj.notequal(big, small) - })) + }) ], tl: { hd: [ "!= operator: " + title, - (param => ({ + param => ({ TAG: "Eq", _0: true, _1: Caml_obj.notequal(small, big) - })) + }) ], tl: { hd: [ "== operator: " + title, - (param => ({ + param => ({ TAG: "Eq", _0: false, _1: Caml_obj.equal(big, small) - })) + }) ], tl: { hd: [ "== operator: " + title, - (param => ({ + param => ({ TAG: "Eq", _0: false, _1: Caml_obj.equal(small, big) - })) + }) ], tl: { hd: [ "=== operator: " + title, - (param => ({ + param => ({ TAG: "Eq", _0: false, _1: big === small - })) + }) ], tl: { hd: [ "=== operator: " + title, - (param => ({ + param => ({ TAG: "Eq", _0: false, _1: small === big - })) + }) ], tl: /* [] */0 } @@ -193,146 +193,146 @@ function isEqual(title, num1, num2) { return { hd: [ "< operator: " + title, - (param => ({ + param => ({ TAG: "Eq", _0: false, _1: Caml_obj.lessthan(num2, num1) - })) + }) ], tl: { hd: [ "<= operator: " + title, - (param => ({ + param => ({ TAG: "Eq", _0: true, _1: Caml_obj.lessequal(num2, num1) - })) + }) ], tl: { hd: [ "> operator: " + title, - (param => ({ + param => ({ TAG: "Eq", _0: false, _1: Caml_obj.greaterthan(num1, num2) - })) + }) ], tl: { hd: [ ">= operator: " + title, - (param => ({ + param => ({ TAG: "Eq", _0: true, _1: Caml_obj.greaterequal(num1, num2) - })) + }) ], tl: { hd: [ "min: " + title, - (param => ({ + param => ({ TAG: "Eq", _0: num1, _1: Caml_obj.min(num1, num2) - })) + }) ], tl: { hd: [ "max: " + title, - (param => ({ + param => ({ TAG: "Eq", _0: num1, _1: Caml_obj.max(num1, num2) - })) + }) ], tl: { hd: [ "compare: " + title, - (param => ({ + param => ({ TAG: "Eq", _0: 0, _1: Caml_obj.compare(num1, num2) - })) + }) ], tl: { hd: [ "compare: " + title, - (param => ({ + param => ({ TAG: "Eq", _0: 0, _1: Caml_obj.compare(num2, num1) - })) + }) ], tl: { hd: [ "!= operator: " + title, - (param => ({ + param => ({ TAG: "Eq", _0: false, _1: num1 !== num2 - })) + }) ], tl: { hd: [ "!= operator: " + title, - (param => ({ + param => ({ TAG: "Eq", _0: false, _1: num2 !== num1 - })) + }) ], tl: { hd: [ "!= operator: " + title, - (param => ({ + param => ({ TAG: "Eq", _0: false, _1: Caml_obj.notequal(num1, num2) - })) + }) ], tl: { hd: [ "!= operator: " + title, - (param => ({ + param => ({ TAG: "Eq", _0: false, _1: Caml_obj.notequal(num2, num1) - })) + }) ], tl: { hd: [ "== operator: " + title, - (param => ({ + param => ({ TAG: "Eq", _0: true, _1: Caml_obj.equal(num1, num2) - })) + }) ], tl: { hd: [ "== operator: " + title, - (param => ({ + param => ({ TAG: "Eq", _0: true, _1: Caml_obj.equal(num2, num1) - })) + }) ], tl: { hd: [ "=== operator: " + title, - (param => ({ + param => ({ TAG: "Eq", _0: true, _1: num1 === num2 - })) + }) ], tl: { hd: [ "=== operator: " + title, - (param => ({ + param => ({ TAG: "Eq", _0: true, _1: num2 === num1 - })) + }) ], tl: /* [] */0 } diff --git a/jscomp/test/caml_compare_test.js b/jscomp/test/caml_compare_test.js index 475b5f291f0..2ecd05a679d 100644 --- a/jscomp/test/caml_compare_test.js +++ b/jscomp/test/caml_compare_test.js @@ -8,7 +8,7 @@ let Caml_js_exceptions = require("../../lib/js/caml_js_exceptions.js"); let function_equal_test; try { - function_equal_test = Caml_obj.equal((x => x + 1 | 0), (x => x + 2 | 0)); + function_equal_test = Caml_obj.equal(x => x + 1 | 0, x => x + 2 | 0); } catch (raw_exn) { let exn = Caml_js_exceptions.internalToOCamlException(raw_exn); function_equal_test = exn.RE_EXN_ID === "Invalid_argument" && exn._1 === "equal: functional value" ? true : false; @@ -18,37 +18,37 @@ let suites = { contents: { hd: [ "File \"caml_compare_test.res\", line 12, characters 5-12", - (() => ({ + () => ({ TAG: "Eq", _0: true, _1: Caml_obj.lessthan(undefined, 1) - })) + }) ], tl: { hd: [ "option2", - (() => ({ + () => ({ TAG: "Eq", _0: true, _1: Caml_obj.lessthan(1, 2) - })) + }) ], tl: { hd: [ "File \"caml_compare_test.res\", line 14, characters 5-12", - (() => ({ + () => ({ TAG: "Eq", _0: true, _1: Caml_obj.greaterthan({ hd: 1, tl: /* [] */0 }, /* [] */0) - })) + }) ], tl: { hd: [ "listeq", - (() => ({ + () => ({ TAG: "Eq", _0: true, _1: Caml_obj.equal({ @@ -70,12 +70,12 @@ let suites = { } } }) - })) + }) ], tl: { hd: [ "listneq", - (() => ({ + () => ({ TAG: "Eq", _0: true, _1: Caml_obj.greaterthan({ @@ -97,12 +97,12 @@ let suites = { } } }) - })) + }) ], tl: { hd: [ "custom_u", - (() => ({ + () => ({ TAG: "Eq", _0: true, _1: Caml_obj.greaterthan([ @@ -134,12 +134,12 @@ let suites = { _0: 0 } ]) - })) + }) ], tl: { hd: [ "custom_u2", - (() => ({ + () => ({ TAG: "Eq", _0: true, _1: Caml_obj.equal([ @@ -171,54 +171,54 @@ let suites = { _0: 1 } ]) - })) + }) ], tl: { hd: [ "function", - (() => ({ + () => ({ TAG: "Eq", _0: true, _1: function_equal_test - })) + }) ], tl: { hd: [ "File \"caml_compare_test.res\", line 20, characters 5-12", - (() => ({ + () => ({ TAG: "Eq", _0: true, _1: Caml_obj.lessthan(undefined, 1) - })) + }) ], tl: { hd: [ "File \"caml_compare_test.res\", line 21, characters 5-12", - (() => ({ + () => ({ TAG: "Eq", _0: true, _1: Caml_obj.lessthan(undefined, [ 1, 30 ]) - })) + }) ], tl: { hd: [ "File \"caml_compare_test.res\", line 22, characters 5-12", - (() => ({ + () => ({ TAG: "Eq", _0: true, _1: Caml_obj.greaterthan([ 1, 30 ], undefined) - })) + }) ], tl: { hd: [ "File \"caml_compare_test.res\", line 24, characters 6-13", - (() => ({ + () => ({ TAG: "Eq", _0: true, _1: Caml_obj.lessthan({ @@ -279,12 +279,12 @@ let suites = { } } }) - })) + }) ], tl: { hd: [ "File \"caml_compare_test.res\", line 27, characters 5-12", - (() => ({ + () => ({ TAG: "Eq", _0: true, _1: Caml_obj.lessthan({ @@ -297,24 +297,24 @@ let suites = { tl: /* [] */0 } }) - })) + }) ], tl: { hd: [ "File \"caml_compare_test.res\", line 28, characters 5-12", - (() => ({ + () => ({ TAG: "Eq", _0: true, _1: Caml_obj.lessthan(/* [] */0, { hd: 409, tl: /* [] */0 }) - })) + }) ], tl: { hd: [ "File \"caml_compare_test.res\", line 30, characters 6-13", - (() => ({ + () => ({ TAG: "Eq", _0: true, _1: Caml_obj.greaterthan({ @@ -375,30 +375,30 @@ let suites = { } } }) - })) + }) ], tl: { hd: [ "File \"caml_compare_test.res\", line 33, characters 5-12", - (() => ({ + () => ({ TAG: "Eq", _0: false, _1: false - })) + }) ], tl: { hd: [ "File \"caml_compare_test.res\", line 34, characters 5-12", - (() => ({ + () => ({ TAG: "Eq", _0: false, _1: false - })) + }) ], tl: { hd: [ "File \"caml_compare_test.res\", line 36, characters 6-13", - (() => ({ + () => ({ TAG: "Eq", _0: false, _1: Caml_obj.equal({ @@ -459,12 +459,12 @@ let suites = { } } }) - })) + }) ], tl: { hd: [ "File \"caml_compare_test.res\", line 40, characters 6-13", - (() => ({ + () => ({ TAG: "Eq", _0: false, _1: Caml_obj.equal({ @@ -525,12 +525,12 @@ let suites = { } } }) - })) + }) ], tl: { hd: [ "cmp_id", - (() => ({ + () => ({ TAG: "Eq", _0: Caml_obj.compare({ x: 1, @@ -540,12 +540,12 @@ let suites = { y: 2 }), _1: 0 - })) + }) ], tl: { hd: [ "cmp_val", - (() => ({ + () => ({ TAG: "Eq", _0: Caml_obj.compare({ x: 1 @@ -553,12 +553,12 @@ let suites = { x: 2 }), _1: -1 - })) + }) ], tl: { hd: [ "cmp_val2", - (() => ({ + () => ({ TAG: "Eq", _0: Caml_obj.compare({ x: 2 @@ -566,30 +566,30 @@ let suites = { x: 1 }), _1: 1 - })) + }) ], tl: { hd: [ "cmp_empty", - (() => ({ + () => ({ TAG: "Eq", _0: Caml_obj.compare({}, {}), _1: 0 - })) + }) ], tl: { hd: [ "cmp_empty2", - (() => ({ + () => ({ TAG: "Eq", _0: Caml_obj.compare({}, {x:1}), _1: -1 - })) + }) ], tl: { hd: [ "cmp_swap", - (() => ({ + () => ({ TAG: "Eq", _0: Caml_obj.compare({ x: 1, @@ -599,30 +599,30 @@ let suites = { x: 1 }), _1: 0 - })) + }) ], tl: { hd: [ "cmp_size", - (() => ({ + () => ({ TAG: "Eq", _0: Caml_obj.compare({x:1}, {x:1, y:2}), _1: -1 - })) + }) ], tl: { hd: [ "cmp_size2", - (() => ({ + () => ({ TAG: "Eq", _0: Caml_obj.compare({x:1, y:2}, {x:1}), _1: 1 - })) + }) ], tl: { hd: [ "cmp_order", - (() => ({ + () => ({ TAG: "Eq", _0: Caml_obj.compare({ x: 0, @@ -632,12 +632,12 @@ let suites = { y: 0 }), _1: -1 - })) + }) ], tl: { hd: [ "cmp_order2", - (() => ({ + () => ({ TAG: "Eq", _0: Caml_obj.compare({ x: 1, @@ -647,12 +647,12 @@ let suites = { y: 1 }), _1: 1 - })) + }) ], tl: { hd: [ "cmp_in_list", - (() => ({ + () => ({ TAG: "Eq", _0: Caml_obj.compare({ hd: { @@ -666,12 +666,12 @@ let suites = { tl: /* [] */0 }), _1: -1 - })) + }) ], tl: { hd: [ "cmp_in_list2", - (() => ({ + () => ({ TAG: "Eq", _0: Caml_obj.compare({ hd: { @@ -685,12 +685,12 @@ let suites = { tl: /* [] */0 }), _1: 1 - })) + }) ], tl: { hd: [ "cmp_with_list", - (() => ({ + () => ({ TAG: "Eq", _0: Caml_obj.compare({ x: { @@ -704,12 +704,12 @@ let suites = { } }), _1: -1 - })) + }) ], tl: { hd: [ "cmp_with_list2", - (() => ({ + () => ({ TAG: "Eq", _0: Caml_obj.compare({ x: { @@ -723,12 +723,12 @@ let suites = { } }), _1: 1 - })) + }) ], tl: { hd: [ "eq_id", - (() => ({ + () => ({ TAG: "Ok", _0: Caml_obj.equal({ x: 1, @@ -737,12 +737,12 @@ let suites = { x: 1, y: 2 }) - })) + }) ], tl: { hd: [ "eq_val", - (() => ({ + () => ({ TAG: "Eq", _0: Caml_obj.equal({ x: 1 @@ -750,12 +750,12 @@ let suites = { x: 2 }), _1: false - })) + }) ], tl: { hd: [ "eq_val2", - (() => ({ + () => ({ TAG: "Eq", _0: Caml_obj.equal({ x: 2 @@ -763,30 +763,30 @@ let suites = { x: 1 }), _1: false - })) + }) ], tl: { hd: [ "eq_empty", - (() => ({ + () => ({ TAG: "Eq", _0: Caml_obj.equal({}, {}), _1: true - })) + }) ], tl: { hd: [ "eq_empty2", - (() => ({ + () => ({ TAG: "Eq", _0: Caml_obj.equal({}, {x:1}), _1: false - })) + }) ], tl: { hd: [ "eq_swap", - (() => ({ + () => ({ TAG: "Ok", _0: Caml_obj.equal({ x: 1, @@ -795,30 +795,30 @@ let suites = { y: 2, x: 1 }) - })) + }) ], tl: { hd: [ "eq_size", - (() => ({ + () => ({ TAG: "Eq", _0: Caml_obj.equal({x:1}, {x:1, y:2}), _1: false - })) + }) ], tl: { hd: [ "eq_size2", - (() => ({ + () => ({ TAG: "Eq", _0: Caml_obj.equal({x:1, y:2}, {x:1}), _1: false - })) + }) ], tl: { hd: [ "eq_in_list", - (() => ({ + () => ({ TAG: "Eq", _0: Caml_obj.equal({ hd: { @@ -832,12 +832,12 @@ let suites = { tl: /* [] */0 }), _1: false - })) + }) ], tl: { hd: [ "eq_in_list2", - (() => ({ + () => ({ TAG: "Eq", _0: Caml_obj.equal({ hd: { @@ -851,12 +851,12 @@ let suites = { tl: /* [] */0 }), _1: true - })) + }) ], tl: { hd: [ "eq_with_list", - (() => ({ + () => ({ TAG: "Eq", _0: Caml_obj.equal({ x: { @@ -870,12 +870,12 @@ let suites = { } }), _1: true - })) + }) ], tl: { hd: [ "eq_with_list2", - (() => ({ + () => ({ TAG: "Eq", _0: Caml_obj.equal({ x: { @@ -889,76 +889,76 @@ let suites = { } }), _1: false - })) + }) ], tl: { hd: [ "eq_no_prototype", - (() => ({ + () => ({ TAG: "Eq", _0: Caml_obj.equal({x:1}, ((function(){let o = Object.create(null);o.x = 1;return o;})())), _1: true - })) + }) ], tl: { hd: [ "File \"caml_compare_test.res\", line 76, characters 5-12", - (() => ({ + () => ({ TAG: "Eq", _0: Caml_obj.compare(null, { hd: 3, tl: /* [] */0 }), _1: -1 - })) + }) ], tl: { hd: [ "File \"caml_compare_test.res\", line 77, characters 5-12", - (() => ({ + () => ({ TAG: "Eq", _0: Caml_obj.compare({ hd: 3, tl: /* [] */0 }, null), _1: 1 - })) + }) ], tl: { hd: [ "File \"caml_compare_test.res\", line 78, characters 5-12", - (() => ({ + () => ({ TAG: "Eq", _0: Caml_obj.compare(null, 0), _1: -1 - })) + }) ], tl: { hd: [ "File \"caml_compare_test.res\", line 79, characters 5-12", - (() => ({ + () => ({ TAG: "Eq", _0: Caml_obj.compare(0, null), _1: 1 - })) + }) ], tl: { hd: [ "File \"caml_compare_test.res\", line 80, characters 5-12", - (() => ({ + () => ({ TAG: "Eq", _0: Caml_obj.compare(undefined, 0), _1: -1 - })) + }) ], tl: { hd: [ "File \"caml_compare_test.res\", line 81, characters 5-12", - (() => ({ + () => ({ TAG: "Eq", _0: Caml_obj.compare(0, undefined), _1: 1 - })) + }) ], tl: /* [] */0 } diff --git a/jscomp/test/caml_format_test.js b/jscomp/test/caml_format_test.js index d112a8fc4e9..cd25cfec4b5 100644 --- a/jscomp/test/caml_format_test.js +++ b/jscomp/test/caml_format_test.js @@ -79,22 +79,22 @@ let of_string = [ ]; function from_float_of_string(xs) { - return $$Array.mapi(((i, param) => Pervasives.string_of_float), xs); + return $$Array.mapi((i, param) => Pervasives.string_of_float, xs); } function from_of_string(xs) { - return $$Array.to_list($$Array.mapi(((i, param) => { + return $$Array.to_list($$Array.mapi((i, param) => { let b = param[1]; let a = param[0]; return [ "of_string " + String(i), - (param => ({ + param => ({ TAG: "Eq", _0: Caml_format.int_of_string(b), _1: a - })) + }) ]; - }), of_string)); + }, of_string)); } let to_str = Caml_format.int_of_string; @@ -140,57 +140,57 @@ let pairs$1 = [ let suites = Pervasives.$at(from_of_string(of_string), Pervasives.$at({ hd: [ "isnan_of_string", - (() => ({ + () => ({ TAG: "Eq", _0: true, _1: Pervasives.classify_float(Caml_format.float_of_string("nan")) === "FP_nan" - })) + }) ], tl: /* [] */0 -}, Pervasives.$at($$Array.to_list($$Array.mapi(((i, param) => { +}, Pervasives.$at($$Array.to_list($$Array.mapi((i, param) => { let b = param[1]; let a = param[0]; return [ "infinity_of_string " + String(i), - (() => ({ + () => ({ TAG: "Eq", _0: a, _1: Pervasives.classify_float(Caml_format.float_of_string(b)) - })) + }) ]; -}), pairs)), Pervasives.$at({ +}, pairs)), Pervasives.$at({ hd: [ "throw", - (() => ({ + () => ({ TAG: "ThrowAny", - _0: (() => { + _0: () => { Caml_format.float_of_string(""); - }) - })) + } + }) ], tl: { hd: [ "format_int", - (() => ({ + () => ({ TAG: "Eq", _0: " 33", _1: Caml_format.format_int("%32d", 33) - })) + }) ], tl: /* [] */0 } -}, $$Array.to_list($$Array.mapi(((i, param) => { +}, $$Array.to_list($$Array.mapi((i, param) => { let b = param[1]; let a = param[0]; return [ "normal_float_of_string " + String(i), - (() => ({ + () => ({ TAG: "Eq", _0: a, _1: Caml_format.float_of_string(b) - })) + }) ]; -}), pairs$1)))))); +}, pairs$1)))))); function ff(extra) { return Caml_format.format_int("%32d", extra); @@ -306,36 +306,36 @@ let float_data = [ let int64_suites_0 = [ "i64_simple7", - (param => ({ + param => ({ TAG: "Eq", _0: Caml_int64.to_string([ 0, 3333 ]), _1: "3333" - })) + }) ]; let int64_suites_1 = { hd: [ "i64_simple15", - (param => ({ + param => ({ TAG: "Eq", _0: Caml_int64.to_string(Caml_int64.neg_one), _1: "-1" - })) + }) ], tl: { hd: [ "i64_simple16", - (param => ({ + param => ({ TAG: "Eq", _0: Caml_int64.to_string([ -1, 4294956185 ]), _1: "-11111" - })) + }) ], tl: /* [] */0 } @@ -403,30 +403,30 @@ let of_string_data = [ ] ]; -Mt.from_pair_suites("Caml_format_test", Pervasives.$at(suites, Pervasives.$at($$Array.to_list($$Array.mapi(((i, param) => { +Mt.from_pair_suites("Caml_format_test", Pervasives.$at(suites, Pervasives.$at($$Array.to_list($$Array.mapi((i, param) => { let str_result = param[2]; let f = param[1]; let fmt = param[0]; return [ "loat_format " + String(i), - (() => ({ + () => ({ TAG: "Eq", _0: Caml_format.format_float(fmt, f), _1: str_result - })) + }) ]; -}), float_data)), Pervasives.$at(int64_suites, $$Array.to_list($$Array.mapi(((i, param) => { +}, float_data)), Pervasives.$at(int64_suites, $$Array.to_list($$Array.mapi((i, param) => { let b = param[1]; let a = param[0]; return [ "int64_of_string " + String(i) + " ", - (() => ({ + () => ({ TAG: "Eq", _0: Caml_format.int64_of_string(b), _1: a - })) + }) ]; -}), of_string_data)))))); +}, of_string_data)))))); let float_suites = { hd: "float_nan", diff --git a/jscomp/test/chain_code_test.js b/jscomp/test/chain_code_test.js index 461d59ba4b0..74d651ce605 100644 --- a/jscomp/test/chain_code_test.js +++ b/jscomp/test/chain_code_test.js @@ -16,11 +16,11 @@ function eq(loc, x, y) { suites.contents = { hd: [ loc + (" id " + String(test_id.contents)), - (() => ({ + () => ({ TAG: "Eq", _0: x, _1: y - })) + }) ], tl: suites.contents }; diff --git a/jscomp/test/chn_test.js b/jscomp/test/chn_test.js index 262a90dcdfc..306622fec72 100644 --- a/jscomp/test/chn_test.js +++ b/jscomp/test/chn_test.js @@ -18,11 +18,11 @@ function eq(loc, x, y) { suites.contents = { hd: [ loc + (" id " + String(test_id.contents)), - (() => ({ + () => ({ TAG: "Eq", _0: x, _1: y - })) + }) ], tl: suites.contents }; @@ -33,7 +33,7 @@ console.log("你好,\n世界"); console.log("\x3f\u003f\b\t\n\v\f\r\0\"'"); function convert(s) { - return $$Array.to_list(Array.from(s, (x => { + return $$Array.to_list(Array.from(s, x => { let x$1 = x.codePointAt(0); if (x$1 !== undefined) { return x$1; @@ -48,7 +48,7 @@ function convert(s) { ] } }); - }))); + })); } eq("File \"chn_test.res\", line 24, characters 4-11", "你好,\n世界", "你好,\n世界"); diff --git a/jscomp/test/coercion_module_alias_test.js b/jscomp/test/coercion_module_alias_test.js index eeb1cbc20e4..5d8e7c46128 100644 --- a/jscomp/test/coercion_module_alias_test.js +++ b/jscomp/test/coercion_module_alias_test.js @@ -27,7 +27,7 @@ console.log(prim$2); let f = List.length; function g(x) { - return List.length(List.map((prim => prim + 1 | 0), x)); + return List.length(List.map(prim => prim + 1 | 0, x)); } function F(X) { diff --git a/jscomp/test/complex_if_test.js b/jscomp/test/complex_if_test.js index 59a7fd3a100..15a13ed2bce 100644 --- a/jscomp/test/complex_if_test.js +++ b/jscomp/test/complex_if_test.js @@ -122,11 +122,11 @@ function string_escaped(s) { let suites_0 = [ "complete_escape", - (param => ({ + param => ({ TAG: "Eq", _0: Bytes.to_string(escaped(Bytes.of_string("\x00\x01\x02\x03\x04\x05\x06\x07\b\t\n\x0b\x0c\r\x0e\x0f\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\x7f\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xaa\xab\xac\xad\xae\xaf\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff"))), _1: "\\000\\001\\002\\003\\004\\005\\006\\007\\b\\t\\n\\011\\012\\r\\014\\015\\016\\017\\018\\019\\020\\021\\022\\023\\024\\025\\026\\027\\028\\029\\030\\031 !\\\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\\127\\128\\129\\130\\131\\132\\133\\134\\135\\136\\137\\138\\139\\140\\141\\142\\143\\144\\145\\146\\147\\148\\149\\150\\151\\152\\153\\154\\155\\156\\157\\158\\159\\160\\161\\162\\163\\164\\165\\166\\167\\168\\169\\170\\171\\172\\173\\174\\175\\176\\177\\178\\179\\180\\181\\182\\183\\184\\185\\186\\187\\188\\189\\190\\191\\192\\193\\194\\195\\196\\197\\198\\199\\200\\201\\202\\203\\204\\205\\206\\207\\208\\209\\210\\211\\212\\213\\214\\215\\216\\217\\218\\219\\220\\221\\222\\223\\224\\225\\226\\227\\228\\229\\230\\231\\232\\233\\234\\235\\236\\237\\238\\239\\240\\241\\242\\243\\244\\245\\246\\247\\248\\249\\250\\251\\252\\253\\254\\255" - })) + }) ]; let suites = { diff --git a/jscomp/test/complex_test.js b/jscomp/test/complex_test.js index 3d18a006e46..e8220542606 100644 --- a/jscomp/test/complex_test.js +++ b/jscomp/test/complex_test.js @@ -6,14 +6,14 @@ let Complex = require("../../lib/js/complex.js"); let suites_0 = [ "basic_add", - (param => ({ + param => ({ TAG: "Eq", _0: { re: 2, im: 2 }, _1: Complex.add(Complex.add(Complex.add(Complex.one, Complex.one), Complex.i), Complex.i) - })) + }) ]; let suites = { diff --git a/jscomp/test/complex_while_loop.js b/jscomp/test/complex_while_loop.js index 74fe66fea80..b927bd5dfe7 100644 --- a/jscomp/test/complex_while_loop.js +++ b/jscomp/test/complex_while_loop.js @@ -4,7 +4,7 @@ function f() { let n = 0; - while ((() => { + while (((() => { let fib = x => { if (x === 0 || x === 1) { return 1; @@ -13,17 +13,17 @@ function f() { } }; return fib(n) > 10; - })()) { + }))()) { console.log(String(n)); n = n + 1 | 0; }; } function ff() { - while ((() => { + while (((() => { let b = 9; return (3 + b | 0) > 10; - })()) { + }))()) { }; } diff --git a/jscomp/test/condition_compilation_test.js b/jscomp/test/condition_compilation_test.js index b5898d6574f..da2f401b42d 100644 --- a/jscomp/test/condition_compilation_test.js +++ b/jscomp/test/condition_compilation_test.js @@ -24,11 +24,11 @@ function eq(loc, x, y) { suites.contents = { hd: [ loc + (" id " + String(test_id.contents)), - (() => ({ + () => ({ TAG: "Eq", _0: x, _1: y - })) + }) ], tl: suites.contents }; diff --git a/jscomp/test/const_block_test.js b/jscomp/test/const_block_test.js index 8dcbd22ee97..bbe5d66ae15 100644 --- a/jscomp/test/const_block_test.js +++ b/jscomp/test/const_block_test.js @@ -57,7 +57,7 @@ let suites_0 = [ let suites_1 = { hd: [ "avoid_mutable_inline_test", - (() => { + () => { Caml_array.set(c, 0, 3); Caml_array.set(c, 1, 4); return { @@ -72,7 +72,7 @@ let suites_1 = { ], _1: c }; - }) + } ], tl: /* [] */0 }; diff --git a/jscomp/test/cps_test.js b/jscomp/test/cps_test.js index 959b4371773..89b9d6eb947 100644 --- a/jscomp/test/cps_test.js +++ b/jscomp/test/cps_test.js @@ -16,15 +16,15 @@ function test() { if (n === 0) { return acc(); } - _acc = (() => { + _acc = () => { v.contents = v.contents + n | 0; return acc(); - }); + }; _n = n - 1 | 0; continue; }; }; - f(10, (() => {})); + f(10, () => {}); return v.contents; } @@ -32,13 +32,13 @@ function test_closure() { let v = { contents: 0 }; - let arr = Caml_array.make(6, (x => x)); + let arr = Caml_array.make(6, x => x); for (let i = 0; i <= 5; ++i) { - Caml_array.set(arr, i, (param => i)); + Caml_array.set(arr, i, param => i); } - $$Array.iter((i => { + $$Array.iter(i => { v.contents = v.contents + i(0) | 0; - }), arr); + }, arr); return v.contents; } @@ -46,43 +46,43 @@ function test_closure2() { let v = { contents: 0 }; - let arr = Caml_array.make(6, (x => x)); + let arr = Caml_array.make(6, x => x); for (let i = 0; i <= 5; ++i) { let j = i + i | 0; - Caml_array.set(arr, i, (param => j)); + Caml_array.set(arr, i, param => j); } - $$Array.iter((i => { + $$Array.iter(i => { v.contents = v.contents + i(0) | 0; - }), arr); + }, arr); return v.contents; } Mt.from_pair_suites("Cps_test", { hd: [ "cps_test_sum", - (() => ({ + () => ({ TAG: "Eq", _0: 55, _1: test() - })) + }) ], tl: { hd: [ "cps_test_closure", - (() => ({ + () => ({ TAG: "Eq", _0: 15, _1: test_closure() - })) + }) ], tl: { hd: [ "cps_test_closure2", - (() => ({ + () => ({ TAG: "Eq", _0: 30, _1: test_closure2() - })) + }) ], tl: /* [] */0 } diff --git a/jscomp/test/demo_page.js b/jscomp/test/demo_page.js index 09eeb60a783..f5061333430 100644 --- a/jscomp/test/demo_page.js +++ b/jscomp/test/demo_page.js @@ -41,9 +41,9 @@ function f(extra) { } ReactDom.render(React.createClass({ - render: (() => React.DOM.div({ + render: () => React.DOM.div({ alt: "pic" - }, React.DOM.h1(undefined, "hello react"), React.DOM.h2(undefined, "type safe!"))) + }, React.DOM.h1(undefined, "hello react"), React.DOM.h2(undefined, "type safe!")) }), document.getElementById("hi")); exports.fib = fib; diff --git a/jscomp/test/demo_pipe.js b/jscomp/test/demo_pipe.js index 51570c3f84d..ade4eaf5bef 100644 --- a/jscomp/test/demo_pipe.js +++ b/jscomp/test/demo_pipe.js @@ -3,11 +3,11 @@ function register(rl) { - return rl.on("line", (x => { + return rl.on("line", x => { console.log(x); - })).on("close", (() => { + }).on("close", () => { console.log("finished"); - })); + }); } exports.register = register; diff --git a/jscomp/test/digest_test.js b/jscomp/test/digest_test.js index 6820085cd45..732af43acb8 100644 --- a/jscomp/test/digest_test.js +++ b/jscomp/test/digest_test.js @@ -148,56 +148,56 @@ let ref = [ Mt.from_pair_suites("Digest_test", Pervasives.$at({ hd: [ "File \"digest_test.res\", line 9, characters 9-16", - (() => ({ + () => ({ TAG: "Eq", _0: Digest.to_hex(Digest.string("value")), _1: "2063c1608d6e0baf80249c42e2be5804" - })) + }) ], tl: { hd: [ "File \"digest_test.res\", line 11, characters 10-17", - (() => ({ + () => ({ TAG: "Eq", _0: Digest.to_hex(Digest.string("The quick brown fox jumps over the lazy dog")), _1: "9e107d9d372bb6826bd81d3542a419d6" - })) + }) ], tl: { hd: [ "File \"digest_test.res\", line 18, characters 10-17", - (() => ({ + () => ({ TAG: "Eq", _0: Digest.to_hex(Digest.string("The quick brown fox jumps over the lazy dog.")), _1: "e4d909c290d0fb1ca068ffaddf22cbd0" - })) + }) ], tl: { hd: [ "File \"digest_test.res\", line 24, characters 9-16", - (() => ({ + () => ({ TAG: "Eq", _0: Digest.to_hex(Digest.string("")), _1: "d41d8cd98f00b204e9800998ecf8427e" - })) + }) ], tl: { hd: [ "File \"digest_test.res\", line 26, characters 10-17", - (() => ({ + () => ({ TAG: "Eq", _0: Digest.to_hex(Digest.string("The quick brown fox jumps over the lazy dog.The quick brown fox jumps over the lazy dog.The quick brown fox jumps over the lazy dog.The quick brown fox jumps over the lazy dog.The quick brown fox jumps over the lazy dog.The quick brown fox jumps over the lazy dog.The quick brown fox jumps over the lazy dog.The quick brown fox jumps over the lazy dog.The quick brown fox jumps over the lazy dog.The quick brown fox jumps over the lazy dog.The quick brown fox jumps over the lazy dog.The quick brown fox jumps over the lazy dog.")), _1: "7065cc36bba1d155fb09f9d02f22e8bf" - })) + }) ], tl: { hd: [ "File \"digest_test.res\", line 45, characters 10-17", - (() => ({ + () => ({ TAG: "Eq", _0: Digest.to_hex(Digest.string("The quick brown fox jumps over the lazy dog.The quick brown fox jumps over the lazy dog.The quick brown fox jumps over the lazy dog.")), _1: "b9193d1df4b7a8f0a25ffdd1005c5b2b" - })) + }) ], tl: /* [] */0 } @@ -205,14 +205,14 @@ Mt.from_pair_suites("Digest_test", Pervasives.$at({ } } } -}, $$Array.to_list($$Array.map((i => [ +}, $$Array.to_list($$Array.map(i => [ String(i), - (() => ({ + () => ({ TAG: "Eq", _0: Digest.to_hex(Digest.string("a".repeat(i))), _1: Caml_array.get(ref, i) - })) -]), Ext_array_test.range(0, 129))))); + }) +], Ext_array_test.range(0, 129))))); exports.f = f; /* Not a pure module */ diff --git a/jscomp/test/div_by_zero_test.js b/jscomp/test/div_by_zero_test.js index 4eb69bbc30b..3ef3a489e59 100644 --- a/jscomp/test/div_by_zero_test.js +++ b/jscomp/test/div_by_zero_test.js @@ -18,11 +18,11 @@ function eq(loc, x, y) { suites.contents = { hd: [ loc + (" id " + String(test_id.contents)), - (() => ({ + () => ({ TAG: "Eq", _0: x, _1: y - })) + }) ], tl: suites.contents }; @@ -37,68 +37,68 @@ function add(suite) { add([ "File \"div_by_zero_test.res\", line 11, characters 7-14", - (() => ({ + () => ({ TAG: "ThrowAny", - _0: (() => { + _0: () => { Caml_int32.div(3, 0); - }) - })) + } + }) ]); add([ "File \"div_by_zero_test.res\", line 12, characters 7-14", - (() => ({ + () => ({ TAG: "ThrowAny", - _0: (() => { + _0: () => { Caml_int32.mod_(3, 0); - }) - })) + } + }) ]); add([ "File \"div_by_zero_test.res\", line 13, characters 7-14", - (() => ({ + () => ({ TAG: "ThrowAny", - _0: (() => { + _0: () => { Caml_int32.div(3, 0); - }) - })) + } + }) ]); add([ "File \"div_by_zero_test.res\", line 14, characters 7-14", - (() => ({ + () => ({ TAG: "ThrowAny", - _0: (() => { + _0: () => { Caml_int32.mod_(3, 0); - }) - })) + } + }) ]); add([ "File \"div_by_zero_test.res\", line 15, characters 7-14", - (() => ({ + () => ({ TAG: "ThrowAny", - _0: (() => { + _0: () => { Caml_int64.div([ 0, 3 ], Caml_int64.zero); - }) - })) + } + }) ]); add([ "File \"div_by_zero_test.res\", line 16, characters 7-14", - (() => ({ + () => ({ TAG: "ThrowAny", - _0: (() => { + _0: () => { Caml_int64.mod_([ 0, 3 ], Caml_int64.zero); - }) - })) + } + }) ]); function div(x, y) { diff --git a/jscomp/test/dollar_escape_test.js b/jscomp/test/dollar_escape_test.js index 3d9ae3fde4b..4e8146f9414 100644 --- a/jscomp/test/dollar_escape_test.js +++ b/jscomp/test/dollar_escape_test.js @@ -16,11 +16,11 @@ function eq(loc, x, y) { suites.contents = { hd: [ loc + (" id " + String(test_id.contents)), - (() => ({ + () => ({ TAG: "Eq", _0: x, _1: y - })) + }) ], tl: suites.contents }; diff --git a/jscomp/test/earger_curry_test.js b/jscomp/test/earger_curry_test.js index c830edf9afa..8e6d741bff9 100644 --- a/jscomp/test/earger_curry_test.js +++ b/jscomp/test/earger_curry_test.js @@ -48,9 +48,9 @@ function fold_left(f, x, a) { } function f2() { - let arr = init(30000000, (i => i)); - let b = map((i => i + i - 1), arr); - let v = fold_left(((prim0, prim1) => prim0 + prim1), 0, b); + let arr = init(30000000, i => i); + let b = map(i => i + i - 1, arr); + let v = fold_left((prim0, prim1) => prim0 + prim1, 0, b); console.log(Pervasives.string_of_float(v)); } @@ -69,11 +69,11 @@ function eq(loc, x, y) { suites.contents = { hd: [ loc + (" id " + String(test_id.contents)), - (() => ({ + () => ({ TAG: "Eq", _0: x, _1: y - })) + }) ], tl: suites.contents }; diff --git a/jscomp/test/epsilon_test.js b/jscomp/test/epsilon_test.js index a524211b937..58cfd7092c9 100644 --- a/jscomp/test/epsilon_test.js +++ b/jscomp/test/epsilon_test.js @@ -8,21 +8,21 @@ let v = (Number.EPSILON?Number.EPSILON:2.220446049250313e-16); let suites_0 = [ "epsilon", - (param => ({ + param => ({ TAG: "Eq", _0: Pervasives.epsilon_float, _1: v - })) + }) ]; let suites_1 = { hd: [ "raw_epsilon", - (param => ({ + param => ({ TAG: "Eq", _0: 2.220446049250313e-16, _1: v - })) + }) ], tl: /* [] */0 }; diff --git a/jscomp/test/es6_module_test.js b/jscomp/test/es6_module_test.js index 7d53747f7be..63507f89172 100644 --- a/jscomp/test/es6_module_test.js +++ b/jscomp/test/es6_module_test.js @@ -11,7 +11,7 @@ function length(param) { Mt.from_pair_suites("Es6_module_test", { hd: [ "list_length", - (() => ({ + () => ({ TAG: "Eq", _0: List.length({ hd: 1, @@ -21,16 +21,16 @@ Mt.from_pair_suites("Es6_module_test", { } }), _1: 2 - })) + }) ], tl: { hd: [ "length", - (() => ({ + () => ({ TAG: "Eq", _0: 3, _1: 3 - })) + }) ], tl: /* [] */0 } diff --git a/jscomp/test/exception_raise_test.js b/jscomp/test/exception_raise_test.js index 01ccdad8b6f..e847b09f399 100644 --- a/jscomp/test/exception_raise_test.js +++ b/jscomp/test/exception_raise_test.js @@ -127,7 +127,7 @@ let suites = { contents: { hd: [ "File \"exception_raise_test.res\", line 120, characters 5-12", - (() => ({ + () => ({ TAG: "Eq", _0: [ f, @@ -141,12 +141,12 @@ let suites = { 2, 2 ] - })) + }) ], tl: { hd: [ "File \"exception_raise_test.res\", line 123, characters 6-13", - (() => { + () => { if (a1.RE_EXN_ID === Js_exn.$$Error) { return { TAG: "Eq", @@ -164,7 +164,7 @@ let suites = { ] } }); - }) + } ], tl: /* [] */0 } diff --git a/jscomp/test/exception_rebound_err_test.js b/jscomp/test/exception_rebound_err_test.js index cbf37fae66b..e795fde6244 100644 --- a/jscomp/test/exception_rebound_err_test.js +++ b/jscomp/test/exception_rebound_err_test.js @@ -18,11 +18,11 @@ function eq(loc, x, y) { suites.contents = { hd: [ loc + (" id " + String(test_id.contents)), - (() => ({ + () => ({ TAG: "Eq", _0: x, _1: y - })) + }) ], tl: suites.contents }; diff --git a/jscomp/test/ext_array_test.js b/jscomp/test/ext_array_test.js index 154cca7dc64..7c824a62e79 100644 --- a/jscomp/test/ext_array_test.js +++ b/jscomp/test/ext_array_test.js @@ -112,7 +112,7 @@ function range(from, to_) { } }); } - return $$Array.init((to_ - from | 0) + 1 | 0, (i => i + from | 0)); + return $$Array.init((to_ - from | 0) + 1 | 0, i => i + from | 0); } function map2i(f, a, b) { @@ -125,7 +125,7 @@ function map2i(f, a, b) { } }); } - return $$Array.mapi(((i, a) => f(i, a, b[i])), a); + return $$Array.mapi((i, a) => f(i, a, b[i]), a); } function tolist_aux(a, f, _i, _res) { diff --git a/jscomp/test/ext_bytes_test.js b/jscomp/test/ext_bytes_test.js index d7a2f849154..3a7ad98c917 100644 --- a/jscomp/test/ext_bytes_test.js +++ b/jscomp/test/ext_bytes_test.js @@ -170,13 +170,13 @@ let f = Char.chr; let a$2 = Bytes.unsafe_to_string(Bytes.init(100, f)); -let b = Bytes.init(100, (i => /* '\000' */0)); +let b = Bytes.init(100, i => /* '\000' */0); Bytes.blit_string(a$2, 10, b, 5, 10); eq("File \"ext_bytes_test.res\", line 141, characters 4-11", b, Bytes.of_string("\x00\x00\x00\x00\x00\n\x0b\x0c\r\x0e\x0f\x10\x11\x12\x13\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00")); -let s = Bytes.init(50000, (i => Char.chr(i % 137))); +let s = Bytes.init(50000, i => Char.chr(i % 137)); let s1 = Bytes.to_string(s); diff --git a/jscomp/test/ext_filename_test.js b/jscomp/test/ext_filename_test.js index 997953fb770..7628c95abea 100644 --- a/jscomp/test/ext_filename_test.js +++ b/jscomp/test/ext_filename_test.js @@ -104,7 +104,7 @@ function relative_path(file_or_dir_1, file_or_dir_2) { _dir1 = dir1.tl; continue; } - return Pervasives.$at(List.map((param => node_parent), dir2), dir1); + return Pervasives.$at(List.map(param => node_parent, dir2), dir1); }; }; let ys = go(dir1, dir2); @@ -260,14 +260,14 @@ function rel_normalized_absolute_path(from, to_) { } let xs = xss.tl; if (!yss) { - return List.fold_left(((acc, param) => Filename.concat(acc, Ext_string_test.parent_dir_lit)), Ext_string_test.parent_dir_lit, xs); + return List.fold_left((acc, param) => Filename.concat(acc, Ext_string_test.parent_dir_lit), Ext_string_test.parent_dir_lit, xs); } if (xss.hd === yss.hd) { _yss = yss.tl; _xss = xs; continue; } - let start = List.fold_left(((acc, param) => Filename.concat(acc, Ext_string_test.parent_dir_lit)), Ext_string_test.parent_dir_lit, xs); + let start = List.fold_left((acc, param) => Filename.concat(acc, Ext_string_test.parent_dir_lit), Ext_string_test.parent_dir_lit, xs); return List.fold_left(Filename.concat, start, yss); }; } @@ -339,7 +339,7 @@ function get_extension(x) { let simple_convert_node_path_to_os_path; if (Sys.unix) { - simple_convert_node_path_to_os_path = (x => x); + simple_convert_node_path_to_os_path = x => x; } else if (Sys.win32 || false) { simple_convert_node_path_to_os_path = Ext_string_test.replace_slash_backward; } else { diff --git a/jscomp/test/ext_list_test.js b/jscomp/test/ext_list_test.js index 92d855a990f..5c17bb62a0d 100644 --- a/jscomp/test/ext_list_test.js +++ b/jscomp/test/ext_list_test.js @@ -648,7 +648,7 @@ function for_all_opt(p, _x) { } function fold(f, l, init) { - return List.fold_left(((acc, i) => f(i, init)), init, l); + return List.fold_left((acc, i) => f(i, init), init, l); } function rev_map_acc(acc, f, l) { @@ -772,7 +772,7 @@ function split_map(f, xs) { function reduce_from_right(fn, lst) { let match = List.rev(lst); if (match) { - return List.fold_left(((x, y) => fn(y, x)), match.hd, match.tl); + return List.fold_left((x, y) => fn(y, x), match.hd, match.tl); } throw new Error("Invalid_argument", { cause: { diff --git a/jscomp/test/ext_string_test.js b/jscomp/test/ext_string_test.js index 43d475e72d7..b7cada73096 100644 --- a/jscomp/test/ext_string_test.js +++ b/jscomp/test/ext_string_test.js @@ -54,25 +54,25 @@ function split_by(keep_emptyOpt, is_delim, str) { function trim(s) { let i = 0; let j = s.length; - while ((() => { + while (((() => { let tmp = false; if (i < j) { let u = s.codePointAt(i); tmp = u === /* '\t' */9 || u === /* '\n' */10 || u === /* ' ' */32; } return tmp; - })()) { + }))()) { i = i + 1 | 0; }; let k = j - 1 | 0; - while ((() => { + while (((() => { let tmp = false; if (k >= i) { let u = s.codePointAt(k); tmp = u === /* '\t' */9 || u === /* '\n' */10 || u === /* ' ' */32; } return tmp; - })()) { + }))()) { k = k - 1 | 0; }; return $$String.sub(s, i, (k - i | 0) + 1 | 0); @@ -82,18 +82,18 @@ function split(keep_empty, str, on) { if (str === "") { return /* [] */0; } else { - return split_by(keep_empty, (x => x === on), str); + return split_by(keep_empty, x => x === on, str); } } function quick_split_by_ws(str) { - return split_by(false, (x => { + return split_by(false, x => { if (x === /* '\t' */9 || x === /* '\n' */10) { return true; } else { return x === /* ' ' */32; } - }), str); + }, str); } function starts_with(s, beg) { @@ -145,7 +145,7 @@ function ends_with_then_chop(s, beg) { } function check_any_suffix_case(s, suffixes) { - return List.exists((x => ends_with(s, x)), suffixes); + return List.exists(x => ends_with(s, x), suffixes); } function check_any_suffix_case_then_chop(s, suffixes) { @@ -445,7 +445,7 @@ function is_valid_module_file(s) { } else if (match < 65) { return false; } - return unsafe_for_all_range(s, 1, len - 1 | 0, (x => { + return unsafe_for_all_range(s, 1, len - 1 | 0, x => { if (x >= 65) { if (x > 96 || x < 91) { return x < 123; @@ -457,7 +457,7 @@ function is_valid_module_file(s) { } else { return x === 39; } - })); + }); } function is_valid_npm_package_name(s) { @@ -477,7 +477,7 @@ function is_valid_npm_package_name(s) { } else if (match !== 64) { return false; } - return unsafe_for_all_range(s, 1, len - 1 | 0, (x => { + return unsafe_for_all_range(s, 1, len - 1 | 0, x => { if (x >= 58) { if (x >= 97) { return x < 123; @@ -489,7 +489,7 @@ function is_valid_npm_package_name(s) { } else { return true; } - })); + }); } function is_valid_source_name(name) { @@ -571,13 +571,13 @@ function replace_slash_backward(x) { if (unsafe_no_char(x, /* '/' */47, 0, len - 1 | 0)) { return x; } else { - return $$String.map((x => { + return $$String.map(x => { if (x !== 47) { return x; } else { return /* '\\' */92; } - }), x); + }, x); } } @@ -586,13 +586,13 @@ function replace_backward_slash(x) { if (unsafe_no_char(x, /* '\\' */92, 0, len - 1 | 0)) { return x; } else { - return $$String.map((x => { + return $$String.map(x => { if (x !== 92) { return x; } else { return /* '/' */47; } - }), x); + }, x); } } diff --git a/jscomp/test/extensible_variant_test.js b/jscomp/test/extensible_variant_test.js index 5c5d571d311..cfadcd2ddef 100644 --- a/jscomp/test/extensible_variant_test.js +++ b/jscomp/test/extensible_variant_test.js @@ -38,7 +38,7 @@ function to_int(x) { let suites_0 = [ "test_int", - (param => ({ + param => ({ TAG: "Eq", _0: 3, _1: to_int({ @@ -46,13 +46,13 @@ let suites_0 = [ _1: 3, _2: 0 }) - })) + }) ]; let suites_1 = { hd: [ "test_int2", - (param => ({ + param => ({ TAG: "Eq", _0: 0, _1: to_int({ @@ -60,19 +60,19 @@ let suites_1 = { _1: 3, _2: 0 }) - })) + }) ], tl: { hd: [ "test_string", - (param => ({ + param => ({ TAG: "Eq", _0: -1, _1: to_int({ RE_EXN_ID: Str, _1: "x" }) - })) + }) ], tl: /* [] */0 } diff --git a/jscomp/test/ffi_arity_test.js b/jscomp/test/ffi_arity_test.js index b22cee3c8bf..ad382cb1b09 100644 --- a/jscomp/test/ffi_arity_test.js +++ b/jscomp/test/ffi_arity_test.js @@ -60,7 +60,7 @@ fff(); Mt.from_pair_suites("Ffi_arity_test", { hd: [ "File \"ffi_arity_test.res\", line 51, characters 7-14", - (() => ({ + () => ({ TAG: "Eq", _0: v, _1: [ @@ -68,12 +68,12 @@ Mt.from_pair_suites("Ffi_arity_test", { 1, 4 ] - })) + }) ], tl: { hd: [ "File \"ffi_arity_test.res\", line 52, characters 7-14", - (() => ({ + () => ({ TAG: "Eq", _0: vv, _1: [ @@ -81,12 +81,12 @@ Mt.from_pair_suites("Ffi_arity_test", { 3, 5 ] - })) + }) ], tl: { hd: [ "File \"ffi_arity_test.res\", line 53, characters 7-14", - (() => ({ + () => ({ TAG: "Eq", _0: hh, _1: [ @@ -94,7 +94,7 @@ Mt.from_pair_suites("Ffi_arity_test", { 2, 3 ] - })) + }) ], tl: /* [] */0 } diff --git a/jscomp/test/ffi_array_test.js b/jscomp/test/ffi_array_test.js index 3c67221ad07..ea510b33cf7 100644 --- a/jscomp/test/ffi_array_test.js +++ b/jscomp/test/ffi_array_test.js @@ -16,11 +16,11 @@ function eq(loc, x, y) { suites.contents = { hd: [ loc + (" id " + String(test_id.contents)), - (() => ({ + () => ({ TAG: "Eq", _0: x, _1: y - })) + }) ], tl: suites.contents }; diff --git a/jscomp/test/ffi_js_test.js b/jscomp/test/ffi_js_test.js index c70965c6f0d..6fd4eb63991 100644 --- a/jscomp/test/ffi_js_test.js +++ b/jscomp/test/ffi_js_test.js @@ -27,11 +27,11 @@ function eq(loc, param) { suites.contents = { hd: [ loc + (" id " + String(test_id.contents)), - (() => ({ + () => ({ TAG: "Eq", _0: x, _1: y - })) + }) ], tl: suites.contents }; diff --git a/jscomp/test/ffi_splice_test.js b/jscomp/test/ffi_splice_test.js index d42e7cd1d04..1885b6ec2eb 100644 --- a/jscomp/test/ffi_splice_test.js +++ b/jscomp/test/ffi_splice_test.js @@ -16,11 +16,11 @@ function eq(loc, x, y) { suites.contents = { hd: [ loc + (" id " + String(test_id.contents)), - (() => ({ + () => ({ TAG: "Eq", _0: x, _1: y - })) + }) ], tl: suites.contents }; diff --git a/jscomp/test/flexible_array_test.js b/jscomp/test/flexible_array_test.js index ddb7f45a572..7e932c4ae93 100644 --- a/jscomp/test/flexible_array_test.js +++ b/jscomp/test/flexible_array_test.js @@ -269,8 +269,8 @@ function sort(s) { return s; } let head = get(s, 0); - let larger = sort(filter_from(1, (x => Caml_obj.greaterthan(x, head)), s)); - let smaller = sort(filter_from(1, (x => Caml_obj.lessequal(x, head)), s)); + let larger = sort(filter_from(1, x => Caml_obj.greaterthan(x, head), s)); + let smaller = sort(filter_from(1, x => Caml_obj.lessequal(x, head), s)); return append(smaller, push_front(larger, head)); } @@ -331,9 +331,9 @@ if (!$eq$tilde(sort(u), [ }); } -let v = $$Array.init(500, (i => 500 - i | 0)); +let v = $$Array.init(500, i => 500 - i | 0); -$eq$tilde(sort(of_array(v)), $$Array.init(500, (i => i + 1 | 0))); +$eq$tilde(sort(of_array(v)), $$Array.init(500, i => i + 1 | 0)); exports.sub = sub; exports.update = update; diff --git a/jscomp/test/float_of_bits_test.js b/jscomp/test/float_of_bits_test.js index 4d8f89d3ce5..d4f450973a5 100644 --- a/jscomp/test/float_of_bits_test.js +++ b/jscomp/test/float_of_bits_test.js @@ -25,50 +25,50 @@ let int32_pairs = [ ]; function from_pairs(pair) { - return List.concat($$Array.to_list($$Array.mapi(((i, param) => { + return List.concat($$Array.to_list($$Array.mapi((i, param) => { let f = param[1]; let i32 = param[0]; return { hd: [ "int32_float_of_bits " + i, - (param => ({ + param => ({ TAG: "Eq", _0: Caml_float.int_float_of_bits(i32), _1: f - })) + }) ], tl: { hd: [ "int32_bits_of_float " + i, - (param => ({ + param => ({ TAG: "Eq", _0: Caml_float.int_bits_of_float(f), _1: i32 - })) + }) ], tl: /* [] */0 } }; - }), int32_pairs))); + }, int32_pairs))); } let suites = Pervasives.$at({ hd: [ "one", - (() => ({ + () => ({ TAG: "Eq", _0: Caml_int64.bits_of_float(1.0), _1: one_float - })) + }) ], tl: { hd: [ "two", - (() => ({ + () => ({ TAG: "Eq", _0: Caml_int64.float_of_bits(one_float), _1: 1.0 - })) + }) ], tl: /* [] */0 } diff --git a/jscomp/test/float_test.js b/jscomp/test/float_test.js index 87516dde675..e463d77f83b 100644 --- a/jscomp/test/float_test.js +++ b/jscomp/test/float_test.js @@ -118,18 +118,18 @@ let results = $$Array.append([ ]); function from_pairs(ps) { - return $$Array.to_list($$Array.mapi(((i, param) => { + return $$Array.to_list($$Array.mapi((i, param) => { let b = param[1]; let a = param[0]; return [ "pair " + i, - (param => ({ + param => ({ TAG: "Approx", _0: a, _1: b - })) + }) ]; - }), ps)); + }, ps)); } let float_compare = Caml.float_compare; @@ -189,7 +189,7 @@ eq("File \"float_test.res\", line 62, characters 4-11", [ true ]); -eq("File \"float_test.res\", line 71, characters 4-11", $$Array.map((x => { +eq("File \"float_test.res\", line 71, characters 4-11", $$Array.map(x => { if (x > 0) { return 1; } else if (x < 0) { @@ -197,7 +197,7 @@ eq("File \"float_test.res\", line 71, characters 4-11", $$Array.map((x => { } else { return 0; } -}), $$Array.map((param => Caml.float_compare(param[0], param[1])), [ +}, $$Array.map(param => Caml.float_compare(param[0], param[1]), [ [ 1, 3 @@ -321,38 +321,38 @@ let a = match$4[0]; Mt.from_pair_suites("Float_test", Pervasives.$at({ hd: [ "mod_float", - (() => ({ + () => ({ TAG: "Approx", _0: 3.2 % 0.5, _1: 0.200000000000000178 - })) + }) ], tl: { hd: [ "modf_float1", - (() => ({ + () => ({ TAG: "Approx", _0: a, _1: 0.299999999999997158 - })) + }) ], tl: { hd: [ "modf_float2", - (() => ({ + () => ({ TAG: "Approx", _0: b, _1: 32 - })) + }) ], tl: { hd: [ "int_of_float", - (() => ({ + () => ({ TAG: "Eq", _0: 3, _1: 3 - })) + }) ], tl: /* [] */0 } diff --git a/jscomp/test/for_loop_test.js b/jscomp/test/for_loop_test.js index 541d27444ed..11a546508ae 100644 --- a/jscomp/test/for_loop_test.js +++ b/jscomp/test/for_loop_test.js @@ -9,14 +9,14 @@ function for_3(x) { let v = { contents: 0 }; - let arr = $$Array.map((param => ((() => {}))), x); + let arr = $$Array.map(param => (() => {}), x); for (let i = 0, i_finish = x.length; i < i_finish; ++i) { let j = (i << 1); - Caml_array.set(arr, i, (() => { + Caml_array.set(arr, i, () => { v.contents = v.contents + j | 0; - })); + }); } - $$Array.iter((x => x()), arr); + $$Array.iter(x => x(), arr); return v.contents; } @@ -24,15 +24,15 @@ function for_4(x) { let v = { contents: 0 }; - let arr = $$Array.map((param => ((() => {}))), x); + let arr = $$Array.map(param => (() => {}), x); for (let i = 0, i_finish = x.length; i < i_finish; ++i) { let j = (i << 1); let k = (j << 1); - Caml_array.set(arr, i, (() => { + Caml_array.set(arr, i, () => { v.contents = v.contents + k | 0; - })); + }); } - $$Array.iter((x => x()), arr); + $$Array.iter(x => x(), arr); return v.contents; } @@ -40,14 +40,14 @@ function for_5(x, u) { let v = { contents: 0 }; - let arr = $$Array.map((param => ((() => {}))), x); + let arr = $$Array.map(param => (() => {}), x); for (let i = 0, i_finish = x.length; i < i_finish; ++i) { let k = Math.imul((u << 1), u); - Caml_array.set(arr, i, (() => { + Caml_array.set(arr, i, () => { v.contents = v.contents + k | 0; - })); + }); } - $$Array.iter((x => x()), arr); + $$Array.iter(x => x(), arr); return v.contents; } @@ -55,7 +55,7 @@ function for_6(x, u) { let v = { contents: 0 }; - let arr = $$Array.map((param => ((() => {}))), x); + let arr = $$Array.map(param => (() => {}), x); let v4 = { contents: 0 }; @@ -73,13 +73,13 @@ function for_6(x, u) { let k = Math.imul((u << 1), u); let h = (v5.contents << 1); v2.contents = v2.contents + 1 | 0; - Caml_array.set(arr, i, (() => { + Caml_array.set(arr, i, () => { v.contents = (((((v.contents + k | 0) + v2.contents | 0) + v4.contents | 0) + v5.contents | 0) + h | 0) + u | 0; - })); + }); } inspect_3 = v2.contents; } - $$Array.iter((x => x()), arr); + $$Array.iter(x => x(), arr); return [ v.contents, v4.contents, @@ -92,15 +92,15 @@ function for_7() { let v = { contents: 0 }; - let arr = Caml_array.make(21, (() => {})); + let arr = Caml_array.make(21, () => {}); for (let i = 0; i <= 6; ++i) { for (let j = 0; j <= 2; ++j) { - Caml_array.set(arr, Math.imul(i, 3) + j | 0, (() => { + Caml_array.set(arr, Math.imul(i, 3) + j | 0, () => { v.contents = (v.contents + i | 0) + j | 0; - })); + }); } } - $$Array.iter((f => f()), arr); + $$Array.iter(f => f(), arr); return v.contents; } @@ -108,17 +108,17 @@ function for_8() { let v = { contents: 0 }; - let arr = Caml_array.make(21, (() => {})); + let arr = Caml_array.make(21, () => {}); for (let i = 0; i <= 6; ++i) { let k = (i << 1); for (let j = 0; j <= 2; ++j) { let h = i + j | 0; - Caml_array.set(arr, Math.imul(i, 3) + j | 0, (() => { + Caml_array.set(arr, Math.imul(i, 3) + j | 0, () => { v.contents = (((v.contents + i | 0) + j | 0) + h | 0) + k | 0; - })); + }); } } - $$Array.iter((f => f()), arr); + $$Array.iter(f => f(), arr); return v.contents; } @@ -138,8 +138,8 @@ function for_9() { let vv2 = { contents: 0 }; - let arr = Caml_array.make(4, (() => {})); - let arr2 = Caml_array.make(2, (() => {})); + let arr = Caml_array.make(4, () => {}); + let arr2 = Caml_array.make(2, () => {}); for (let i = 0; i <= 1; ++i) { let v$1 = { contents: 0 @@ -148,16 +148,16 @@ function for_9() { for (let j = 0; j <= 1; ++j) { v$1.contents = v$1.contents + 1 | 0; collect(v$1.contents); - Caml_array.set(arr, (i << 1) + j | 0, (() => { + Caml_array.set(arr, (i << 1) + j | 0, () => { vv.contents = vv.contents + v$1.contents | 0; - })); + }); } - Caml_array.set(arr2, i, (() => { + Caml_array.set(arr2, i, () => { vv2.contents = vv2.contents + v$1.contents | 0; - })); + }); } - $$Array.iter((f => f()), arr); - $$Array.iter((f => f()), arr2); + $$Array.iter(f => f(), arr); + $$Array.iter(f => f(), arr2); return [[ vv.contents, $$Array.of_list(List.rev(v.contents)), @@ -167,35 +167,35 @@ function for_9() { let suites_0 = [ "for_loop_test_3", - (param => ({ + param => ({ TAG: "Eq", _0: 90, _1: for_3(Caml_array.make(10, 2)) - })) + }) ]; let suites_1 = { hd: [ "for_loop_test_4", - (param => ({ + param => ({ TAG: "Eq", _0: 180, _1: for_4(Caml_array.make(10, 2)) - })) + }) ], tl: { hd: [ "for_loop_test_5", - (param => ({ + param => ({ TAG: "Eq", _0: 2420, _1: for_5(Caml_array.make(10, 2), 11) - })) + }) ], tl: { hd: [ "for_loop_test_6", - (param => ({ + param => ({ TAG: "Eq", _0: [ 30, @@ -204,30 +204,30 @@ let suites_1 = { 3 ], _1: for_6(Caml_array.make(3, 0), 0) - })) + }) ], tl: { hd: [ "for_loop_test_7", - (param => ({ + param => ({ TAG: "Eq", _0: 84, _1: for_7() - })) + }) ], tl: { hd: [ "for_loop_test_8", - (param => ({ + param => ({ TAG: "Eq", _0: 294, _1: for_8() - })) + }) ], tl: { hd: [ "for_loop_test_9", - (param => ({ + param => ({ TAG: "Eq", _0: [[ 10, @@ -240,7 +240,7 @@ let suites_1 = { 5 ]], _1: for_9() - })) + }) ], tl: /* [] */0 } diff --git a/jscomp/test/for_side_effect_test.js b/jscomp/test/for_side_effect_test.js index 9eefaf994c9..5ad59cf45da 100644 --- a/jscomp/test/for_side_effect_test.js +++ b/jscomp/test/for_side_effect_test.js @@ -21,11 +21,11 @@ function test2() { let suites_0 = [ "for_order", - (param => ({ + param => ({ TAG: "Eq", _0: 10, _1: test2() - })) + }) ]; let suites = { diff --git a/jscomp/test/format_test.js b/jscomp/test/format_test.js index 60194b196c0..126980a7021 100644 --- a/jscomp/test/format_test.js +++ b/jscomp/test/format_test.js @@ -20,11 +20,11 @@ function eq(loc, x, y) { suites.contents = { hd: [ loc + (" id " + String(test_id.contents)), - (() => ({ + () => ({ TAG: "Eq", _0: x, _1: y - })) + }) ], tl: suites.contents }; @@ -75,7 +75,7 @@ eq("File \"format_test.res\", line 45, characters 5-12", (1 + 4095 / 4096) * 8, eq("File \"format_test.res\", line 46, characters 5-12", (1 + 65535 / 65536) * 8, 15.9998779296875); function f(loc, ls) { - List.iter((param => eq(loc, Caml_format.float_of_string(param[0]), param[1])), ls); + List.iter(param => eq(loc, Caml_format.float_of_string(param[0]), param[1]), ls); } f("File \"format_test.res\", line 53, characters 11-18", { @@ -103,7 +103,7 @@ function sl(f) { } function aux_list(loc, ls) { - List.iter((param => eq(loc, Caml_format.hexstring_of_float(param[0], -1, /* '-' */45), param[1])), ls); + List.iter(param => eq(loc, Caml_format.hexstring_of_float(param[0], -1, /* '-' */45), param[1]), ls); } let literals_0 = [ @@ -180,7 +180,7 @@ scan_float("File \"format_test.res\", line 80, characters 13-20", "0x3f.p1", 126 scan_float("File \"format_test.res\", line 81, characters 13-20", "0x1.3333333333333p-2", 0.3); -List.iter((param => scan_float("File \"format_test.res\", line 82, characters 35-42", param[1], param[0])), literals); +List.iter(param => scan_float("File \"format_test.res\", line 82, characters 35-42", param[1], param[0]), literals); let f1 = - -9.9; diff --git a/jscomp/test/functor_app_test.js b/jscomp/test/functor_app_test.js index dfe9b6b287f..0bbeb2abfcc 100644 --- a/jscomp/test/functor_app_test.js +++ b/jscomp/test/functor_app_test.js @@ -18,11 +18,11 @@ function eq(loc, x, y) { suites.contents = { hd: [ loc + (" id " + String(test_id.contents)), - (() => ({ + () => ({ TAG: "Eq", _0: x, _1: y - })) + }) ], tl: suites.contents }; diff --git a/jscomp/test/functors.js b/jscomp/test/functors.js index 8356fd371ee..44b8b1ef0a8 100644 --- a/jscomp/test/functors.js +++ b/jscomp/test/functors.js @@ -35,12 +35,12 @@ function F2(X, Y) { } let M = { - F: ((funarg, funarg$1) => { + F: (funarg, funarg$1) => { let sheep = x => 1 + funarg$1.foo(funarg.foo(x)) | 0; return { sheep: sheep }; - }) + } }; exports.O = O; diff --git a/jscomp/test/genlex_test.js b/jscomp/test/genlex_test.js index ffd25cdc8a7..7aa4e74b155 100644 --- a/jscomp/test/genlex_test.js +++ b/jscomp/test/genlex_test.js @@ -59,7 +59,7 @@ function to_list(s) { let suites_0 = [ "lexer_stream_genlex", - (param => ({ + param => ({ TAG: "Eq", _0: { hd: { @@ -105,7 +105,7 @@ let suites_0 = [ } }, _1: to_list(lexer(Stream.of_string("3(3 + 2 -1)"))) - })) + }) ]; let suites = { diff --git a/jscomp/test/global_exception_regression_test.js b/jscomp/test/global_exception_regression_test.js index cb861d4208c..a659c2d3fbd 100644 --- a/jscomp/test/global_exception_regression_test.js +++ b/jscomp/test/global_exception_regression_test.js @@ -17,21 +17,21 @@ let s = { let suites_0 = [ "not_found_equal", - (param => ({ + param => ({ TAG: "Eq", _0: u, _1: v - })) + }) ]; let suites_1 = { hd: [ "not_found_not_equal_end_of_file", - (param => ({ + param => ({ TAG: "Neq", _0: u, _1: s - })) + }) ], tl: /* [] */0 }; diff --git a/jscomp/test/global_module_alias_test.js b/jscomp/test/global_module_alias_test.js index 231d06129dd..7752010026a 100644 --- a/jscomp/test/global_module_alias_test.js +++ b/jscomp/test/global_module_alias_test.js @@ -17,11 +17,11 @@ function eq(loc, x, y) { suites.contents = { hd: [ loc + (" id " + String(test_id.contents)), - (() => ({ + () => ({ TAG: "Eq", _0: x, _1: y - })) + }) ], tl: suites.contents }; diff --git a/jscomp/test/google_closure_test.js b/jscomp/test/google_closure_test.js index 86f0461e0fb..2e9cbe212d0 100644 --- a/jscomp/test/google_closure_test.js +++ b/jscomp/test/google_closure_test.js @@ -7,7 +7,7 @@ let Test_google_closure = require("./test_google_closure.js"); Mt.from_pair_suites("Closure", { hd: [ "partial", - (() => ({ + () => ({ TAG: "Eq", _0: [ Test_google_closure.a, @@ -22,7 +22,7 @@ Mt.from_pair_suites("Closure", { 2 ] ] - })) + }) ], tl: /* [] */0 }); diff --git a/jscomp/test/gpr496_test.js b/jscomp/test/gpr496_test.js index 390b2db6eee..b7c42a58bc4 100644 --- a/jscomp/test/gpr496_test.js +++ b/jscomp/test/gpr496_test.js @@ -17,11 +17,11 @@ function eq(loc, x, y) { suites.contents = { hd: [ loc + (" id " + String(test_id.contents)), - (() => ({ + () => ({ TAG: "Eq", _0: x, _1: y - })) + }) ], tl: suites.contents }; diff --git a/jscomp/test/gpr_1154_test.js b/jscomp/test/gpr_1154_test.js index 12c93aa5549..409b24e7faa 100644 --- a/jscomp/test/gpr_1154_test.js +++ b/jscomp/test/gpr_1154_test.js @@ -18,11 +18,11 @@ function eq(loc, x, y) { suites.contents = { hd: [ loc + (" id " + String(test_id.contents)), - (() => ({ + () => ({ TAG: "Eq", _0: x, _1: y - })) + }) ], tl: suites.contents }; diff --git a/jscomp/test/gpr_1409_test.js b/jscomp/test/gpr_1409_test.js index adfd00605bb..0fd2d32db45 100644 --- a/jscomp/test/gpr_1409_test.js +++ b/jscomp/test/gpr_1409_test.js @@ -19,11 +19,11 @@ function eq(loc, x, y) { suites.contents = { hd: [ loc + (" id " + String(test_id.contents)), - (() => ({ + () => ({ TAG: "Eq", _0: x, _1: y - })) + }) ], tl: suites.contents }; @@ -44,7 +44,7 @@ function map(f, x) { function make(foo, param) { let tmp = {}; - let tmp$1 = map((prim => String(prim)), foo); + let tmp$1 = map(prim => String(prim), foo); if (tmp$1 !== undefined) { tmp.foo = tmp$1; } diff --git a/jscomp/test/gpr_1423_app_test.js b/jscomp/test/gpr_1423_app_test.js index bdf146e109c..e87c3e1fc18 100644 --- a/jscomp/test/gpr_1423_app_test.js +++ b/jscomp/test/gpr_1423_app_test.js @@ -16,11 +16,11 @@ function eq(loc, x, y) { suites.contents = { hd: [ loc + (" id " + String(test_id.contents)), - (() => ({ + () => ({ TAG: "Eq", _0: x, _1: y - })) + }) ], tl: suites.contents }; diff --git a/jscomp/test/gpr_1503_test.js b/jscomp/test/gpr_1503_test.js index 0fbfae3775b..c5bd31f0c67 100644 --- a/jscomp/test/gpr_1503_test.js +++ b/jscomp/test/gpr_1503_test.js @@ -19,11 +19,11 @@ function eq(loc, x, y) { suites.contents = { hd: [ loc + (" id " + String(test_id.contents)), - (() => ({ + () => ({ TAG: "Eq", _0: x, _1: y - })) + }) ], tl: suites.contents }; diff --git a/jscomp/test/gpr_1539_test.js b/jscomp/test/gpr_1539_test.js index 11f8a5ea571..e8b2d507a82 100644 --- a/jscomp/test/gpr_1539_test.js +++ b/jscomp/test/gpr_1539_test.js @@ -22,7 +22,7 @@ Caml_module.update_mod({ "add" ]] }, Point, { - add: ((prim0, prim1) => prim0.add(prim1)) + add: (prim0, prim1) => prim0.add(prim1) }); let CRS; diff --git a/jscomp/test/gpr_1658_test.js b/jscomp/test/gpr_1658_test.js index 2b0408c80f8..f0b9e8752e5 100644 --- a/jscomp/test/gpr_1658_test.js +++ b/jscomp/test/gpr_1658_test.js @@ -17,11 +17,11 @@ function eq(loc, x, y) { suites.contents = { hd: [ loc + (" id " + String(test_id.contents)), - (() => ({ + () => ({ TAG: "Eq", _0: x, _1: y - })) + }) ], tl: suites.contents }; diff --git a/jscomp/test/gpr_1667_test.js b/jscomp/test/gpr_1667_test.js index 99317330bc0..9da1661ecb9 100644 --- a/jscomp/test/gpr_1667_test.js +++ b/jscomp/test/gpr_1667_test.js @@ -16,11 +16,11 @@ function eq(loc, x, y) { suites.contents = { hd: [ loc + (" id " + String(test_id.contents)), - (() => ({ + () => ({ TAG: "Eq", _0: x, _1: y - })) + }) ], tl: suites.contents }; diff --git a/jscomp/test/gpr_1716_test.js b/jscomp/test/gpr_1716_test.js index b1016951d5b..63584127f32 100644 --- a/jscomp/test/gpr_1716_test.js +++ b/jscomp/test/gpr_1716_test.js @@ -17,11 +17,11 @@ function eq(loc, x, y) { suites.contents = { hd: [ loc + (" id " + String(test_id.contents)), - (() => ({ + () => ({ TAG: "Eq", _0: x, _1: y - })) + }) ], tl: suites.contents }; diff --git a/jscomp/test/gpr_1728_test.js b/jscomp/test/gpr_1728_test.js index 4c1002b1aee..a593c54a84a 100644 --- a/jscomp/test/gpr_1728_test.js +++ b/jscomp/test/gpr_1728_test.js @@ -17,11 +17,11 @@ function eq(loc, x, y) { suites.contents = { hd: [ loc + (" id " + String(test_id.contents)), - (() => ({ + () => ({ TAG: "Eq", _0: x, _1: y - })) + }) ], tl: suites.contents }; diff --git a/jscomp/test/gpr_1749_test.js b/jscomp/test/gpr_1749_test.js index 989a80fc277..a253398ae64 100644 --- a/jscomp/test/gpr_1749_test.js +++ b/jscomp/test/gpr_1749_test.js @@ -16,11 +16,11 @@ function eq(loc, x, y) { suites.contents = { hd: [ loc + (" id " + String(test_id.contents)), - (() => ({ + () => ({ TAG: "Eq", _0: x, _1: y - })) + }) ], tl: suites.contents }; diff --git a/jscomp/test/gpr_1760_test.js b/jscomp/test/gpr_1760_test.js index e79a4f6eb4b..a1a7811211b 100644 --- a/jscomp/test/gpr_1760_test.js +++ b/jscomp/test/gpr_1760_test.js @@ -18,11 +18,11 @@ function eq(loc, x, y) { suites.contents = { hd: [ loc + (" id " + String(test_id.contents)), - (() => ({ + () => ({ TAG: "Eq", _0: x, _1: y - })) + }) ], tl: suites.contents }; diff --git a/jscomp/test/gpr_1762_test.js b/jscomp/test/gpr_1762_test.js index cf40b53c356..5624f6b6c70 100644 --- a/jscomp/test/gpr_1762_test.js +++ b/jscomp/test/gpr_1762_test.js @@ -16,11 +16,11 @@ function eq(loc, x, y) { suites.contents = { hd: [ loc + (" id " + String(test_id.contents)), - (() => ({ + () => ({ TAG: "Eq", _0: x, _1: y - })) + }) ], tl: suites.contents }; diff --git a/jscomp/test/gpr_1817_test.js b/jscomp/test/gpr_1817_test.js index 2ef62be1b6c..a8e9c48e838 100644 --- a/jscomp/test/gpr_1817_test.js +++ b/jscomp/test/gpr_1817_test.js @@ -17,11 +17,11 @@ function eq(loc, x, y) { suites.contents = { hd: [ loc + (" id " + String(test_id.contents)), - (() => ({ + () => ({ TAG: "Eq", _0: x, _1: y - })) + }) ], tl: suites.contents }; diff --git a/jscomp/test/gpr_1822_test.js b/jscomp/test/gpr_1822_test.js index 2c5fd0e3ad9..bbabae4d9f6 100644 --- a/jscomp/test/gpr_1822_test.js +++ b/jscomp/test/gpr_1822_test.js @@ -16,11 +16,11 @@ function eq(loc, x, y) { suites.contents = { hd: [ loc + (" id " + String(test_id.contents)), - (() => ({ + () => ({ TAG: "Eq", _0: x, _1: y - })) + }) ], tl: suites.contents }; diff --git a/jscomp/test/gpr_1943_test.js b/jscomp/test/gpr_1943_test.js index f5cd2292894..0231c905ae0 100644 --- a/jscomp/test/gpr_1943_test.js +++ b/jscomp/test/gpr_1943_test.js @@ -16,11 +16,11 @@ function eq(loc, x, y) { suites.contents = { hd: [ loc + (" id " + String(test_id.contents)), - (() => ({ + () => ({ TAG: "Eq", _0: x, _1: y - })) + }) ], tl: suites.contents }; diff --git a/jscomp/test/gpr_2316_test.js b/jscomp/test/gpr_2316_test.js index ff97acef5f3..aa33122ecb5 100644 --- a/jscomp/test/gpr_2316_test.js +++ b/jscomp/test/gpr_2316_test.js @@ -17,11 +17,11 @@ function eq(loc, x, y) { suites.contents = { hd: [ loc + (" id " + String(test_id.contents)), - (() => ({ + () => ({ TAG: "Eq", _0: x, _1: y - })) + }) ], tl: suites.contents }; diff --git a/jscomp/test/gpr_2487.js b/jscomp/test/gpr_2487.js index feb3ae3c83d..517bf784b3a 100644 --- a/jscomp/test/gpr_2487.js +++ b/jscomp/test/gpr_2487.js @@ -11,7 +11,7 @@ let b = Belt_Array.eq([ 1, 2, 3 -], ((prim0, prim1) => prim0 === prim1)); +], (prim0, prim1) => prim0 === prim1); let A; diff --git a/jscomp/test/gpr_2608_test.js b/jscomp/test/gpr_2608_test.js index eb2726fd80d..f3a4853f53e 100644 --- a/jscomp/test/gpr_2608_test.js +++ b/jscomp/test/gpr_2608_test.js @@ -24,14 +24,14 @@ let oppHeroes = { let huntGrootCondition = false; if (List.length(/* [] */0) > 0) { - let x = List.filter((h => List.hd(/* [] */0) <= 1000), oppHeroes); + let x = List.filter(h => List.hd(/* [] */0) <= 1000, oppHeroes); huntGrootCondition = List.length(x) === 0; } let huntGrootCondition2 = true; if (List.length(/* [] */0) < 0) { - let x$1 = List.filter((h => List.hd(/* [] */0) <= 1000), oppHeroes); + let x$1 = List.filter(h => List.hd(/* [] */0) <= 1000, oppHeroes); huntGrootCondition2 = List.length(x$1) === 0; } diff --git a/jscomp/test/gpr_2682_test.js b/jscomp/test/gpr_2682_test.js index 81c929cc5ee..4b85655c95d 100644 --- a/jscomp/test/gpr_2682_test.js +++ b/jscomp/test/gpr_2682_test.js @@ -30,16 +30,16 @@ let N = { forIn({ x: 3 -}, (x => { +}, x => { console.log(x); -})); +}); forIn({ x: 3, y: 3 -}, (x => { +}, x => { console.log(x); -})); +}); let f3 = (()=>true); diff --git a/jscomp/test/gpr_3536_test.js b/jscomp/test/gpr_3536_test.js index f9972027244..4f40fea9979 100644 --- a/jscomp/test/gpr_3536_test.js +++ b/jscomp/test/gpr_3536_test.js @@ -23,7 +23,7 @@ function xx(obj, a0, a1, a2, a3, a4, a5) { eq("File \"gpr_3536_test.res\", line 18, characters 12-19", 5, 5); -eq("File \"gpr_3536_test.res\", line 20, characters 12-19", xx(3, ((prim0, prim1) => prim0 - prim1 | 0), 2, ((prim0, prim1) => prim0 + prim1 | 0), 4, ((prim0, prim1) => Math.imul(prim0, prim1)), 3), 11); +eq("File \"gpr_3536_test.res\", line 20, characters 12-19", xx(3, (prim0, prim1) => prim0 - prim1 | 0, 2, (prim0, prim1) => prim0 + prim1 | 0, 4, (prim0, prim1) => Math.imul(prim0, prim1), 3), 11); Mt.from_pair_suites("Gpr_3536_test", suites.contents); diff --git a/jscomp/test/gpr_3875_test.js b/jscomp/test/gpr_3875_test.js index 886d383a303..6dcd01cc610 100644 --- a/jscomp/test/gpr_3875_test.js +++ b/jscomp/test/gpr_3875_test.js @@ -58,7 +58,7 @@ function eq(loc, x, y) { Mt.eq_suites(test_id, suites, loc, x, y); } -compilerBug("x", undefined, true, (() => true)); +compilerBug("x", undefined, true, () => true); eq("File \"gpr_3875_test.res\", line 35, characters 5-12", result.contents, "Some x, f returns true"); diff --git a/jscomp/test/gpr_4274_test.js b/jscomp/test/gpr_4274_test.js index 7c8aed2ae68..c32273387d7 100644 --- a/jscomp/test/gpr_4274_test.js +++ b/jscomp/test/gpr_4274_test.js @@ -8,9 +8,9 @@ let N = {}; function f(X, xs) { X.forEach(xs, { - i: (x => { + i: x => { console.log(x.x); - }) + } }); } @@ -19,9 +19,9 @@ Belt_List.forEach({ x: 3 }, tl: /* [] */0 -}, (x => { +}, x => { console.log(x.x); -})); +}); let Foo = {}; @@ -29,7 +29,7 @@ let bar = [{ foo: "bar" }]; -Belt_Array.map(bar, (b => b.foo)); +Belt_Array.map(bar, b => b.foo); exports.N = N; exports.f = f; diff --git a/jscomp/test/gpr_459_test.js b/jscomp/test/gpr_459_test.js index 8a515314ee8..c43d1267f6b 100644 --- a/jscomp/test/gpr_459_test.js +++ b/jscomp/test/gpr_459_test.js @@ -16,11 +16,11 @@ function eq(loc, x, y) { suites.contents = { hd: [ loc + (" id " + String(test_id.contents)), - (() => ({ + () => ({ TAG: "Eq", _0: x, _1: y - })) + }) ], tl: suites.contents }; diff --git a/jscomp/test/gpr_858_unit2_test.js b/jscomp/test/gpr_858_unit2_test.js index ed0f9cfb439..8485cff5a85 100644 --- a/jscomp/test/gpr_858_unit2_test.js +++ b/jscomp/test/gpr_858_unit2_test.js @@ -3,17 +3,17 @@ let delayed = { - contents: (() => {}) + contents: () => {} }; for (let i = 1; i <= 2; ++i) { let f = (n, x) => { if (x !== 0) { let prev = delayed.contents; - delayed.contents = (() => { + delayed.contents = () => { prev(); f(((n + 1 | 0) + i | 0) - i | 0, x - 1 | 0); - }); + }; return; } if (i === n) { diff --git a/jscomp/test/gpr_904_test.js b/jscomp/test/gpr_904_test.js index 7fd086142d1..7f1380b73fa 100644 --- a/jscomp/test/gpr_904_test.js +++ b/jscomp/test/gpr_904_test.js @@ -16,11 +16,11 @@ function eq(loc, x, y) { suites.contents = { hd: [ loc + (" id " + String(test_id.contents)), - (() => ({ + () => ({ TAG: "Eq", _0: x, _1: y - })) + }) ], tl: suites.contents }; diff --git a/jscomp/test/gpr_977_test.js b/jscomp/test/gpr_977_test.js index 69a06171e39..aa765405f2c 100644 --- a/jscomp/test/gpr_977_test.js +++ b/jscomp/test/gpr_977_test.js @@ -17,11 +17,11 @@ function eq(loc, x, y) { suites.contents = { hd: [ loc + (" id " + String(test_id.contents)), - (() => ({ + () => ({ TAG: "Eq", _0: x, _1: y - })) + }) ], tl: suites.contents }; diff --git a/jscomp/test/hash_test.js b/jscomp/test/hash_test.js index 7463e6f6499..aebfabff040 100644 --- a/jscomp/test/hash_test.js +++ b/jscomp/test/hash_test.js @@ -20,7 +20,7 @@ function eq(f, x, y) { Mt_global.collect_eq(test_id, suites, f, x, y); } -let test_strings = $$Array.init(32, (i => Caml_string.make(i, Char.chr(i)))); +let test_strings = $$Array.init(32, i => Caml_string.make(i, Char.chr(i))); let test_strings_hash_results = [ 0, diff --git a/jscomp/test/hashtbl_test.js b/jscomp/test/hashtbl_test.js index 3393ea8c665..a4b95c66f8d 100644 --- a/jscomp/test/hashtbl_test.js +++ b/jscomp/test/hashtbl_test.js @@ -9,13 +9,13 @@ let Hashtbl = require("../../lib/js/hashtbl.js"); let MoreLabels = require("../../lib/js/moreLabels.js"); function to_list(tbl) { - return Hashtbl.fold(((k, v, acc) => ({ + return Hashtbl.fold((k, v, acc) => ({ hd: [ k, v ], tl: acc - })), tbl, /* [] */0); + }), tbl, /* [] */0); } function f() { @@ -23,7 +23,7 @@ function f() { Hashtbl.add(tbl, 1, /* '1' */49); Hashtbl.add(tbl, 2, /* '2' */50); let extra = to_list(tbl); - return List.sort(((param, param$1) => Caml.int_compare(param[0], param$1[0])), extra); + return List.sort((param, param$1) => Caml.int_compare(param[0], param$1[0]), extra); } function g(count) { @@ -35,12 +35,12 @@ function g(count) { Hashtbl.replace(tbl, (i$1 << 1), String(i$1)); } let v = to_list(tbl); - return $$Array.of_list(List.sort(((param, param$1) => Caml.int_compare(param[0], param$1[0])), v)); + return $$Array.of_list(List.sort((param, param$1) => Caml.int_compare(param[0], param$1[0]), v)); } let suites_0 = [ "simple", - (param => ({ + param => ({ TAG: "Eq", _0: { hd: [ @@ -56,25 +56,25 @@ let suites_0 = [ } }, _1: f() - })) + }) ]; let suites_1 = { hd: [ "more_iterations", - (param => ({ + param => ({ TAG: "Eq", - _0: $$Array.init(1001, (i => [ + _0: $$Array.init(1001, i => [ (i << 1), String(i) - ])), + ]), _1: g(1000) - })) + }) ], tl: { hd: [ "More_labels_regressionfix_374", - (param => { + param => { let tbl = MoreLabels.Hashtbl.create(undefined, 30); Hashtbl.add(tbl, 3, 3); return { @@ -82,7 +82,7 @@ let suites_1 = { _0: tbl.size, _1: 1 }; - }) + } ], tl: /* [] */0 } diff --git a/jscomp/test/ignore_test.js b/jscomp/test/ignore_test.js index 3763253f6d9..dc2915a59f6 100644 --- a/jscomp/test/ignore_test.js +++ b/jscomp/test/ignore_test.js @@ -16,11 +16,11 @@ function eq(loc, x, y) { suites.contents = { hd: [ loc + (" id " + String(test_id.contents)), - (() => ({ + () => ({ TAG: "Eq", _0: x, _1: y - })) + }) ], tl: suites.contents }; diff --git a/jscomp/test/inline_map2_test.js b/jscomp/test/inline_map2_test.js index 6fda5e08271..f9d8d4da7ca 100644 --- a/jscomp/test/inline_map2_test.js +++ b/jscomp/test/inline_map2_test.js @@ -1301,7 +1301,7 @@ let IntMap = { choose: min_binding }; -let m = List.fold_left(((acc, param) => add(param[0], param[1], acc)), "Empty", { +let m = List.fold_left((acc, param) => add(param[0], param[1], acc), "Empty", { hd: [ 10, /* 'a' */97 @@ -1992,7 +1992,7 @@ let SMap = { choose: min_binding$1 }; -let s = List.fold_left(((acc, param) => add$1(param[0], param[1], acc)), "Empty", { +let s = List.fold_left((acc, param) => add$1(param[0], param[1], acc), "Empty", { hd: [ "10", /* 'a' */97 @@ -2021,20 +2021,20 @@ let s = List.fold_left(((acc, param) => add$1(param[0], param[1], acc)), "Empty" Mt.from_pair_suites("Inline_map2_test", { hd: [ "assertion1", - (() => ({ + () => ({ TAG: "Eq", _0: find(10, m), _1: /* 'a' */97 - })) + }) ], tl: { hd: [ "assertion2", - (() => ({ + () => ({ TAG: "Eq", _0: find$1("10", s), _1: /* 'a' */97 - })) + }) ], tl: /* [] */0 } diff --git a/jscomp/test/inline_map_demo.js b/jscomp/test/inline_map_demo.js index 91ebbb06ba4..10ebfd54943 100644 --- a/jscomp/test/inline_map_demo.js +++ b/jscomp/test/inline_map_demo.js @@ -141,7 +141,7 @@ function add(x, data, tree) { } } -let m = List.fold_left(((acc, param) => add(param[0], param[1], acc)), "Empty", { +let m = List.fold_left((acc, param) => add(param[0], param[1], acc), "Empty", { hd: [ 10, /* 'a' */97 @@ -189,11 +189,11 @@ function find(px, _x) { Mt.from_pair_suites("Inline_map_demo", { hd: [ "find", - (() => ({ + () => ({ TAG: "Eq", _0: find(10, m), _1: /* 'a' */97 - })) + }) ], tl: /* [] */0 }); diff --git a/jscomp/test/inline_map_test.js b/jscomp/test/inline_map_test.js index 4479b97a96f..343b9ec72f3 100644 --- a/jscomp/test/inline_map_test.js +++ b/jscomp/test/inline_map_test.js @@ -144,7 +144,7 @@ function find(x, _x_) { }; } -let m = List.fold_left(((acc, param) => add(param[0], param[1], acc)), "Empty", { +let m = List.fold_left((acc, param) => add(param[0], param[1], acc), "Empty", { hd: [ 10, /* 'a' */97 @@ -173,11 +173,11 @@ let m = List.fold_left(((acc, param) => add(param[0], param[1], acc)), "Empty", Mt.from_pair_suites("Inline_map_test", { hd: [ "find", - (() => ({ + () => ({ TAG: "Eq", _0: find(10, m), _1: /* 'a' */97 - })) + }) ], tl: /* [] */0 }); diff --git a/jscomp/test/inline_record_test.js b/jscomp/test/inline_record_test.js index d519c996b18..b6e71324b14 100644 --- a/jscomp/test/inline_record_test.js +++ b/jscomp/test/inline_record_test.js @@ -36,9 +36,9 @@ let v1 = { function f(x) { if (x.TAG === "A0") { - return List.fold_left(((prim0, prim1) => prim0 + prim1 | 0), x.lbl, x.more); + return List.fold_left((prim0, prim1) => prim0 + prim1 | 0, x.lbl, x.more); } else { - return List.fold_left(((prim0, prim1) => prim0 + prim1 | 0), 0, x.more); + return List.fold_left((prim0, prim1) => prim0 + prim1 | 0, 0, x.more); } } diff --git a/jscomp/test/inline_regression_test.js b/jscomp/test/inline_regression_test.js index 0ec534d9483..a1ca7bdd552 100644 --- a/jscomp/test/inline_regression_test.js +++ b/jscomp/test/inline_regression_test.js @@ -38,16 +38,16 @@ function generic_basename(is_dir_sep, current_dir_name, name) { } function basename(extra) { - return generic_basename(((s, i) => Caml_string.get(s, i) === /* '/' */47), Filename.current_dir_name, extra); + return generic_basename((s, i) => Caml_string.get(s, i) === /* '/' */47, Filename.current_dir_name, extra); } let suites_0 = [ "basename", - (param => ({ + param => ({ TAG: "Eq", _0: basename("b/c/a.b"), _1: "a.b" - })) + }) ]; let suites = { diff --git a/jscomp/test/installation_test.js b/jscomp/test/installation_test.js index 7147c617f8f..0c84e4c34b1 100644 --- a/jscomp/test/installation_test.js +++ b/jscomp/test/installation_test.js @@ -16,11 +16,11 @@ function eq(loc, x, y) { suites.contents = { hd: [ loc + (" id " + String(test_id.contents)), - (() => ({ + () => ({ TAG: "Eq", _0: x, _1: y - })) + }) ], tl: suites.contents }; diff --git a/jscomp/test/int32_test.js b/jscomp/test/int32_test.js index 7786026c21b..de01fef6042 100644 --- a/jscomp/test/int32_test.js +++ b/jscomp/test/int32_test.js @@ -16,7 +16,7 @@ function f(x) { ]; } -let shift_right_logical_tests_0 = $$Array.map((x => (-1 >>> x) | 0), Ext_array_test.range(0, 31)); +let shift_right_logical_tests_0 = $$Array.map(x => (-1 >>> x) | 0, Ext_array_test.range(0, 31)); let shift_right_logical_tests_1 = [ -1, @@ -58,7 +58,7 @@ let shift_right_logical_tests = [ shift_right_logical_tests_1 ]; -let shift_right_tests_0 = $$Array.map((x => (Int32.min_int >> x)), Ext_array_test.range(0, 31)); +let shift_right_tests_0 = $$Array.map(x => (Int32.min_int >> x), Ext_array_test.range(0, 31)); let shift_right_tests_1 = [ -2147483648, @@ -100,7 +100,7 @@ let shift_right_tests = [ shift_right_tests_1 ]; -let shift_left_tests_0 = $$Array.map((x => (1 << x)), Ext_array_test.range(0, 31)); +let shift_left_tests_0 = $$Array.map(x => (1 << x), Ext_array_test.range(0, 31)); let shift_left_tests_1 = [ 1, @@ -150,45 +150,45 @@ let suites = { contents: Pervasives.$at({ hd: [ "File \"int32_test.res\", line 131, characters 9-16", - (() => ({ + () => ({ TAG: "Eq", _0: 1, _1: 1 - })) + }) ], tl: { hd: [ "File \"int32_test.res\", line 132, characters 9-16", - (() => ({ + () => ({ TAG: "Eq", _0: -2147483647, _1: -2147483647 - })) + }) ], tl: /* [] */0 } - }, Pervasives.$at($$Array.to_list(Ext_array_test.map2i(((i, a, b) => [ + }, Pervasives.$at($$Array.to_list(Ext_array_test.map2i((i, a, b) => [ "shift_right_logical_cases " + i, - (() => ({ + () => ({ TAG: "Eq", _0: a, _1: b - })) - ]), shift_right_logical_tests_0, shift_right_logical_tests_1)), Pervasives.$at($$Array.to_list(Ext_array_test.map2i(((i, a, b) => [ + }) + ], shift_right_logical_tests_0, shift_right_logical_tests_1)), Pervasives.$at($$Array.to_list(Ext_array_test.map2i((i, a, b) => [ "shift_right_cases " + i, - (() => ({ + () => ({ TAG: "Eq", _0: a, _1: b - })) - ]), shift_right_tests_0, shift_right_tests_1)), $$Array.to_list(Ext_array_test.map2i(((i, a, b) => [ + }) + ], shift_right_tests_0, shift_right_tests_1)), $$Array.to_list(Ext_array_test.map2i((i, a, b) => [ "shift_left_cases " + i, - (() => ({ + () => ({ TAG: "Eq", _0: a, _1: b - })) - ]), shift_left_tests_0, shift_left_tests_1))))) + }) + ], shift_left_tests_0, shift_left_tests_1))))) }; let test_id = { diff --git a/jscomp/test/int64_mul_div_test.js b/jscomp/test/int64_mul_div_test.js index a96ae4ff0e0..e2c3036e632 100644 --- a/jscomp/test/int64_mul_div_test.js +++ b/jscomp/test/int64_mul_div_test.js @@ -306,15 +306,15 @@ let pairs = [ ]; function from_pairs(prefix, pairs) { - return $$Array.to_list($$Array.mapi(((i, param) => { + return $$Array.to_list($$Array.mapi((i, param) => { let b = param[2]; let a = param[1]; let result = param[0]; return [ prefix + "_" + i, - (param => commutative_mul(result, a, b)) + param => commutative_mul(result, a, b) ]; - }), pairs)); + }, pairs)); } let small_pairs = [ @@ -1507,14 +1507,14 @@ let simple_divs = [ ]; function from(xs) { - return List.mapi(((i, param) => { + return List.mapi((i, param) => { let d = param[3]; let c = param[2]; let b = param[1]; let a = param[0]; return [ "small_divs " + i, - (param => ({ + param => ({ TAG: "Eq", _0: [ c, @@ -1524,9 +1524,9 @@ function from(xs) { Caml_int64.div(a, b), Caml_int64.mod_(a, b) ] - })) + }) ]; - }), $$Array.to_list(xs)); + }, $$Array.to_list(xs)); } let to_string = [[ @@ -1562,94 +1562,94 @@ let int64_compare_tests = [ ]; function from_compare(xs) { - return List.mapi(((i, param) => { + return List.mapi((i, param) => { let c = param[2]; let b = param[1]; let a = param[0]; return [ "int64_compare " + i, - (param => ({ + param => ({ TAG: "Eq", _0: c, _1: Caml_int64.compare(a, b) - })) + }) ]; - }), $$Array.to_list(xs)); + }, $$Array.to_list(xs)); } function from_to_string(xs) { - return List.mapi(((i, param) => { + return List.mapi((i, param) => { let str_a = param[1]; let a = param[0]; return [ "to_string " + i, - (param => ({ + param => ({ TAG: "Eq", _0: str_a, _1: Caml_int64.to_string(a) - })) + }) ]; - }), $$Array.to_list(xs)); + }, $$Array.to_list(xs)); } -Mt.from_pair_suites("Int64_mul_div_test", Pervasives.$at(from_pairs("random", pairs), Pervasives.$at(from_pairs("small", small_pairs), Pervasives.$at(List.mapi(((i, param) => { +Mt.from_pair_suites("Int64_mul_div_test", Pervasives.$at(from_pairs("random", pairs), Pervasives.$at(from_pairs("small", small_pairs), Pervasives.$at(List.mapi((i, param) => { let f = param[1]; let i64 = param[0]; return [ "to_float_" + i, - (() => ({ + () => ({ TAG: "Eq", _0: Caml_int64.to_float(i64), _1: f - })) + }) ]; -}), $$Array.to_list(to_floats)), Pervasives.$at(List.mapi(((i, param) => { +}, $$Array.to_list(to_floats)), Pervasives.$at(List.mapi((i, param) => { let i64 = param[1]; let f = param[0]; return [ "of_float_" + i, - (() => ({ + () => ({ TAG: "Eq", _0: Caml_int64.of_float(f), _1: i64 - })) + }) ]; -}), $$Array.to_list(of_float_pairs)), Pervasives.$at({ +}, $$Array.to_list(of_float_pairs)), Pervasives.$at({ hd: [ "compare_check_complete", - (() => ({ + () => ({ TAG: "Eq", - _0: $$Array.map((param => true), check_complete_compare), + _0: $$Array.map(param => true, check_complete_compare), _1: check_complete_compare - })) + }) ], tl: /* [] */0 }, Pervasives.$at(from(simple_divs), Pervasives.$at(from_compare(int64_compare_tests), { hd: [ "div_rem_0", - (() => ({ + () => ({ TAG: "Eq", _0: Caml_int64.zero, _1: Caml_int64.zero - })) + }) ], tl: { hd: [ "div_rem_1", - (() => ({ + () => ({ TAG: "Eq", _0: Caml_int64.neg_one, _1: Caml_int64.neg_one - })) + }) ], tl: { hd: [ "File \"int64_mul_div_test.res\", line 263, characters 19-26", - (() => ({ + () => ({ TAG: "Eq", _0: Caml_int64.to_float(Int64.max_int), _1: 9.22337203685477581e+18 - })) + }) ], tl: /* [] */0 } diff --git a/jscomp/test/int64_string_test.js b/jscomp/test/int64_string_test.js index 07dfa89c3e1..c1ce0329b6d 100644 --- a/jscomp/test/int64_string_test.js +++ b/jscomp/test/int64_string_test.js @@ -1304,7 +1304,7 @@ let random_data = { } }; -Belt_List.forEach(random_data, (u => { +Belt_List.forEach(random_data, u => { if (u) { if (u.tl) { throw new Error("Assert_failure", { @@ -1331,7 +1331,7 @@ Belt_List.forEach(random_data, (u => { ] } }); -})); +}); eq("File \"int64_string_test.res\", line 195, characters 3-10", Caml_int64.to_string([ -2097152, diff --git a/jscomp/test/int64_test.js b/jscomp/test/int64_test.js index 3468ff6ffd6..fa1dbbd7453 100644 --- a/jscomp/test/int64_test.js +++ b/jscomp/test/int64_test.js @@ -35,7 +35,7 @@ function commutative_add(result, a, b) { let generic_compare = Caml_obj.compare; -let shift_left_tests_0 = $$Array.map((i => Caml_int64.lsl_(Caml_int64.one, i)), Ext_array_test.range(0, 63)); +let shift_left_tests_0 = $$Array.map(i => Caml_int64.lsl_(Caml_int64.one, i), Ext_array_test.range(0, 63)); let shift_left_tests_1 = [ Caml_int64.one, @@ -295,7 +295,7 @@ let shift_left_tests = [ shift_left_tests_1 ]; -let shift_right_tests_0 = $$Array.map((i => Caml_int64.asr_(Caml_int64.min_int, i)), Ext_array_test.range(0, 63)); +let shift_right_tests_0 = $$Array.map(i => Caml_int64.asr_(Caml_int64.min_int, i), Ext_array_test.range(0, 63)); let shift_right_tests_1 = [ Caml_int64.min_int, @@ -555,7 +555,7 @@ let shift_right_tests = [ shift_right_tests_1 ]; -let shift_right_logical_suites_0 = $$Array.map((i => Caml_int64.lsr_(Caml_int64.min_int, i)), Ext_array_test.range(0, 63)); +let shift_right_logical_suites_0 = $$Array.map(i => Caml_int64.lsr_(Caml_int64.min_int, i), Ext_array_test.range(0, 63)); let shift_right_logical_suites_1 = [ Caml_int64.min_int, @@ -846,62 +846,62 @@ function fac(_n, _acc) { let suites = Pervasives.$at({ hd: [ "add_one", - (() => ({ + () => ({ TAG: "Eq", _0: v, _1: [ 0, 2147483648 ] - })) + }) ], tl: { hd: [ "add_2", - (() => ({ + () => ({ TAG: "Eq", _0: [ 0, 4294967294 ], _1: Caml_int64.add(a, a) - })) + }) ], tl: { hd: [ "add_3", - (() => ({ + () => ({ TAG: "Eq", _0: Caml_int64.zero, _1: Caml_int64.zero - })) + }) ], tl: { hd: [ "add_4", - (() => commutative_add([ + () => commutative_add([ -1, 4294967294 ], [ -1, 4294967293 - ], Caml_int64.one)) + ], Caml_int64.one) ], tl: { hd: [ "add_5", - (() => commutative_add([ + () => commutative_add([ -1, 4294967293 ], [ -1, 4294967293 - ], Caml_int64.zero)) + ], Caml_int64.zero) ], tl: { hd: [ "add_6", - (() => commutative_add([ + () => commutative_add([ 0, 4 ], [ @@ -910,12 +910,12 @@ let suites = Pervasives.$at({ ], [ 0, 7 - ])) + ]) ], tl: { hd: [ "add_7", - (() => commutative_add([ + () => commutative_add([ 1, 0 ], [ @@ -924,23 +924,23 @@ let suites = Pervasives.$at({ ], [ 0, 2147483648 - ])) + ]) ], tl: { hd: [ "add_8", - (() => commutative_add([ + () => commutative_add([ 1, 0 ], [ 0, 4294967295 - ], Caml_int64.one)) + ], Caml_int64.one) ], tl: { hd: [ "add_9", - (() => commutative_add([ + () => commutative_add([ 0, 4294967295 ], [ @@ -949,58 +949,58 @@ let suites = Pervasives.$at({ ], [ 0, 2147483647 - ])) + ]) ], tl: { hd: [ "add_10", - (() => commutative_add([ + () => commutative_add([ 0, 2147483648 ], [ 0, 2147483648 - ], Caml_int64.zero)) + ], Caml_int64.zero) ], tl: { hd: [ "add_11", - (() => commutative_add([ + () => commutative_add([ 0, 4294967295 ], [ 0, 4294967295 - ], Caml_int64.zero)) + ], Caml_int64.zero) ], tl: { hd: [ "to_int32", - (() => ({ + () => ({ TAG: "Eq", _0: 3, _1: Caml_int64.to_int32([ 0, 3 ]) - })) + }) ], tl: { hd: [ "to_int", - (() => ({ + () => ({ TAG: "Eq", _0: 3, _1: Caml_int64.to_int32([ 0, 3 ]) - })) + }) ], tl: { hd: [ "of_int", - (() => ({ + () => ({ TAG: "Eq", _0: [ 0, @@ -1010,12 +1010,12 @@ let suites = Pervasives.$at({ 0, 3 ] - })) + }) ], tl: { hd: [ "lognot", - (() => ({ + () => ({ TAG: "Eq", _0: [ -1, @@ -1025,12 +1025,12 @@ let suites = Pervasives.$at({ -1, 4294967293 ] - })) + }) ], tl: { hd: [ "neg", - (() => ({ + () => ({ TAG: "Eq", _0: [ -1, @@ -1040,30 +1040,30 @@ let suites = Pervasives.$at({ -1, 4294967294 ] - })) + }) ], tl: { hd: [ "File \"int64_test.res\", line 277, characters 7-14", - (() => ({ + () => ({ TAG: "Eq", _0: Int64.min_int, _1: Caml_int64.neg(Int64.min_int) - })) + }) ], tl: { hd: [ "File \"int64_test.res\", line 279, characters 8-15", - (() => ({ + () => ({ TAG: "Eq", _0: Int64.max_int, _1: Caml_int64.neg(Caml_int64.add(Int64.min_int, Caml_int64.one)) - })) + }) ], tl: { hd: [ "sub1", - (() => ({ + () => ({ TAG: "Eq", _0: [ 0, @@ -1073,12 +1073,12 @@ let suites = Pervasives.$at({ 0, 2 ] - })) + }) ], tl: { hd: [ "xor1", - (() => ({ + () => ({ TAG: "Eq", _0: [ [ @@ -1100,12 +1100,12 @@ let suites = Pervasives.$at({ 2432700672 ] ] - })) + }) ], tl: { hd: [ "or", - (() => ({ + () => ({ TAG: "Eq", _0: [ 0, @@ -1115,12 +1115,12 @@ let suites = Pervasives.$at({ 0, 4294967295 ] - })) + }) ], tl: { hd: [ "and", - (() => ({ + () => ({ TAG: "Eq", _0: [ 0, @@ -1130,14 +1130,14 @@ let suites = Pervasives.$at({ 0, 4008636142 ] - })) + }) ], tl: { hd: [ "lsl", - (() => ({ + () => ({ TAG: "Eq", - _0: $$Array.map((x => Caml_int64.lsl_(Caml_int64.one, x)), $$Array.init(64, (i => i))), + _0: $$Array.map(x => Caml_int64.lsl_(Caml_int64.one, x), $$Array.init(64, i => i)), _1: [ Caml_int64.one, [ @@ -1390,14 +1390,14 @@ let suites = Pervasives.$at({ ], Caml_int64.min_int ] - })) + }) ], tl: { hd: [ "lsr", - (() => ({ + () => ({ TAG: "Eq", - _0: $$Array.map((x => Caml_int64.lsr_(Caml_int64.neg_one, x)), $$Array.init(64, (i => i))), + _0: $$Array.map(x => Caml_int64.lsr_(Caml_int64.neg_one, x), $$Array.init(64, i => i)), _1: [ Caml_int64.neg_one, Caml_int64.max_int, @@ -1647,14 +1647,14 @@ let suites = Pervasives.$at({ ], Caml_int64.one ] - })) + }) ], tl: { hd: [ "asr", - (() => ({ + () => ({ TAG: "Eq", - _0: $$Array.map((x => Caml_int64.asr_(Caml_int64.neg_one, x)), $$Array.init(64, (i => i))), + _0: $$Array.map(x => Caml_int64.asr_(Caml_int64.neg_one, x), $$Array.init(64, i => i)), _1: [ Caml_int64.neg_one, Caml_int64.neg_one, @@ -1721,12 +1721,12 @@ let suites = Pervasives.$at({ Caml_int64.neg_one, Caml_int64.neg_one ] - })) + }) ], tl: { hd: [ "mul simple", - (() => ({ + () => ({ TAG: "Eq", _0: [ 0, @@ -1736,12 +1736,12 @@ let suites = Pervasives.$at({ 0, 6 ] - })) + }) ], tl: { hd: [ "of_int32", - (() => ({ + () => ({ TAG: "Eq", _0: $$Array.map(Caml_int64.of_int32, [ 0, @@ -1754,12 +1754,12 @@ let suites = Pervasives.$at({ 2147483648 ] ] - })) + }) ], tl: { hd: [ "of_int32_singleton", - (() => ({ + () => ({ TAG: "Eq", _0: [ -1, @@ -1769,12 +1769,12 @@ let suites = Pervasives.$at({ -1, 4294967293 ] - })) + }) ], tl: { hd: [ "File \"int64_test.res\", line 526, characters 7-14", - (() => ({ + () => ({ TAG: "Eq", _0: [ 0, @@ -1784,12 +1784,12 @@ let suites = Pervasives.$at({ 0, 3 ] - })) + }) ], tl: { hd: [ "to_int32", - (() => ({ + () => ({ TAG: "Eq", _0: $$Array.map(Caml_int64.to_int32, [ Caml_int64.zero, @@ -1802,21 +1802,21 @@ let suites = Pervasives.$at({ 0, -2147483648 ] - })) + }) ], tl: { hd: [ "discard_sign", - (() => ({ + () => ({ TAG: "Eq", _0: Caml_int64.discard_sign(Caml_int64.neg_one), _1: Caml_int64.max_int - })) + }) ], tl: { hd: [ "div_mod", - (() => ({ + () => ({ TAG: "Eq", _0: Caml_int64.div_mod([ 0, @@ -1832,33 +1832,33 @@ let suites = Pervasives.$at({ ], Caml_int64.one ] - })) + }) ], tl: { hd: [ "to_hex", - (() => ({ + () => ({ TAG: "Eq", _0: Caml_int64.to_hex(Caml_int64.neg_one), _1: "ffffffffffffffff" - })) + }) ], tl: { hd: [ "generic_compare", - (() => ({ + () => ({ TAG: "Eq", _0: Caml_obj.compare([ 1, 0 ], Caml_int64.one) > 0, _1: true - })) + }) ], tl: { hd: [ "test_compier_literal", - (() => ({ + () => ({ TAG: "Eq", _0: [ 0, @@ -1868,24 +1868,24 @@ let suites = Pervasives.$at({ 0, 4294967295 ] - })) + }) ], tl: { hd: [ "generic_compare2", - (() => ({ + () => ({ TAG: "Eq", _0: Caml_obj.compare([ 0, 2147483648 ], Caml_int64.one) > 0, _1: true - })) + }) ], tl: { hd: [ "shift_left", - (() => ({ + () => ({ TAG: "Eq", _0: [ 0, @@ -1895,12 +1895,12 @@ let suites = Pervasives.$at({ 0, 4294967040 ] - })) + }) ], tl: { hd: [ "fib_int64", - (() => ({ + () => ({ TAG: "Eq", _0: fib(1000, Caml_int64.one, [ 0, @@ -1910,49 +1910,49 @@ let suites = Pervasives.$at({ -1990564327, 2874523960 ] - })) + }) ], tl: { hd: [ "fac_int64", - (() => ({ + () => ({ TAG: "Eq", _0: fac(30, Caml_int64.one), _1: [ -2040662563, 1409286144 ] - })) + }) ], tl: { hd: [ "File \"int64_test.res\", line 553, characters 8-15", - (() => ({ + () => ({ TAG: "Eq", _0: Caml_int64.add(Int64.max_int, Int64.max_int), _1: [ -1, 4294967294 ] - })) + }) ], tl: { hd: [ "File \"int64_test.res\", line 563, characters 8-15", - (() => ({ + () => ({ TAG: "Eq", _0: Caml_int64.add(Int64.min_int, Int64.min_int), _1: Caml_int64.zero - })) + }) ], tl: { hd: [ "File \"int64_test.res\", line 573, characters 8-15", - (() => ({ + () => ({ TAG: "Eq", _0: Caml_int64.neg_one, _1: Caml_int64.neg_one - })) + }) ], tl: /* [] */0 } @@ -1996,28 +1996,28 @@ let suites = Pervasives.$at({ } } } -}, Pervasives.$at($$Array.to_list(Ext_array_test.map2i(((i, a, b) => [ +}, Pervasives.$at($$Array.to_list(Ext_array_test.map2i((i, a, b) => [ "shift_left_cases " + i, - (() => ({ + () => ({ TAG: "Eq", _0: a, _1: b - })) -]), shift_left_tests_0, shift_left_tests_1)), Pervasives.$at($$Array.to_list(Ext_array_test.map2i(((i, a, b) => [ + }) +], shift_left_tests_0, shift_left_tests_1)), Pervasives.$at($$Array.to_list(Ext_array_test.map2i((i, a, b) => [ "shift_right_cases " + i, - (() => ({ + () => ({ TAG: "Eq", _0: a, _1: b - })) -]), shift_right_tests_0, shift_right_tests_1)), $$Array.to_list(Ext_array_test.map2i(((i, a, b) => [ + }) +], shift_right_tests_0, shift_right_tests_1)), $$Array.to_list(Ext_array_test.map2i((i, a, b) => [ "shift_right_logical_cases " + i, - (() => ({ + () => ({ TAG: "Eq", _0: a, _1: b - })) -]), shift_right_logical_suites_0, shift_right_logical_suites_1))))); + }) +], shift_right_logical_suites_0, shift_right_logical_suites_1))))); let suites$1 = { contents: suites diff --git a/jscomp/test/int_hashtbl_test.js b/jscomp/test/int_hashtbl_test.js index 1fdcfb1d7fa..27976bf1864 100644 --- a/jscomp/test/int_hashtbl_test.js +++ b/jscomp/test/int_hashtbl_test.js @@ -11,14 +11,14 @@ function f(H) { let tbl = H.create(17); H.add(tbl, 1, /* '1' */49); H.add(tbl, 2, /* '2' */50); - let extra = H.fold(((k, v, acc) => ({ + let extra = H.fold((k, v, acc) => ({ hd: [ k, v ], tl: acc - })), tbl, /* [] */0); - return List.sort(((param, param$1) => Caml.int_compare(param[0], param$1[0])), extra); + }), tbl, /* [] */0); + return List.sort((param, param$1) => Caml.int_compare(param[0], param$1[0]), extra); } function g(H, count) { @@ -29,14 +29,14 @@ function g(H, count) { for (let i$1 = 0; i$1 <= count; ++i$1) { H.replace(tbl, (i$1 << 1), String(i$1)); } - let v = H.fold(((k, v, acc) => ({ + let v = H.fold((k, v, acc) => ({ hd: [ k, v ], tl: acc - })), tbl, /* [] */0); - return $$Array.of_list(List.sort(((param, param$1) => Caml.int_compare(param[0], param$1[0])), v)); + }), tbl, /* [] */0); + return $$Array.of_list(List.sort((param, param$1) => Caml.int_compare(param[0], param$1[0]), v)); } let hash = Hashtbl.hash; @@ -52,7 +52,7 @@ let Int_hash = Hashtbl.Make({ let suites_0 = [ "simple", - (param => ({ + param => ({ TAG: "Eq", _0: { hd: [ @@ -68,20 +68,20 @@ let suites_0 = [ } }, _1: f(Int_hash) - })) + }) ]; let suites_1 = { hd: [ "more_iterations", - (param => ({ + param => ({ TAG: "Eq", - _0: $$Array.init(1001, (i => [ + _0: $$Array.init(1001, i => [ (i << 1), String(i) - ])), + ]), _1: g(Int_hash, 1000) - })) + }) ], tl: /* [] */0 }; diff --git a/jscomp/test/int_overflow_test.js b/jscomp/test/int_overflow_test.js index a60f6687a12..5b5bd932d08 100644 --- a/jscomp/test/int_overflow_test.js +++ b/jscomp/test/int_overflow_test.js @@ -41,128 +41,128 @@ function fib(x) { Mt.from_pair_suites("Int_overflow_test", { hd: [ "plus_overflow", - (() => ({ + () => ({ TAG: "Eq", _0: true, _1: (Int32.max_int + 1 | 0) === Int32.min_int - })) + }) ], tl: { hd: [ "minus_overflow", - (() => ({ + () => ({ TAG: "Eq", _0: true, _1: (Int32.min_int - Int32.one | 0) === Int32.max_int - })) + }) ], tl: { hd: [ "flow_again", - (() => ({ + () => ({ TAG: "Eq", _0: 2147483646, _1: (Int32.max_int + Int32.max_int | 0) + Int32.min_int | 0 - })) + }) ], tl: { hd: [ "flow_again", - (() => ({ + () => ({ TAG: "Eq", _0: -2, _1: Int32.max_int + Int32.max_int | 0 - })) + }) ], tl: { hd: [ "hash_test", - (() => ({ + () => ({ TAG: "Eq", _0: hash_variant("xxyyzzuuxxzzyy00112233"), _1: 544087776 - })) + }) ], tl: { hd: [ "hash_test2", - (() => ({ + () => ({ TAG: "Eq", _0: hash_variant("xxyyzxzzyy"), _1: -449896130 - })) + }) ], tl: { hd: [ "File \"int_overflow_test.res\", line 88, characters 5-12", - (() => ({ + () => ({ TAG: "Eq", _0: hash_variant2("xxyyzzuuxxzzyy00112233"), _1: 544087776 - })) + }) ], tl: { hd: [ "File \"int_overflow_test.res\", line 89, characters 5-12", - (() => ({ + () => ({ TAG: "Eq", _0: hash_variant2("xxyyzxzzyy"), _1: -449896130 - })) + }) ], tl: { hd: [ "int_literal_flow", - (() => ({ + () => ({ TAG: "Eq", _0: -1, _1: -1 - })) + }) ], tl: { hd: [ "int_literal_flow2", - (() => ({ + () => ({ TAG: "Eq", _0: -1, _1: -1 - })) + }) ], tl: { hd: [ "int_literal_flow3", - (() => ({ + () => ({ TAG: "Eq", _0: -1, _1: -1 - })) + }) ], tl: { hd: [ "int32_mul", - (() => ({ + () => ({ TAG: "Eq", _0: -33554431, _1: -33554431 - })) + }) ], tl: { hd: [ "File \"int_overflow_test.res\", line 94, characters 5-12", - (() => ({ + () => ({ TAG: "Eq", _0: Number("3") | 0, _1: 3 - })) + }) ], tl: { hd: [ "File \"int_overflow_test.res\", line 96, characters 5-12", - (() => ({ + () => ({ TAG: "Eq", _0: Number("3.2") | 0, _1: 3 - })) + }) ], tl: /* [] */0 } diff --git a/jscomp/test/js_array_test.js b/jscomp/test/js_array_test.js index fd1b6077847..fa7a168a300 100644 --- a/jscomp/test/js_array_test.js +++ b/jscomp/test/js_array_test.js @@ -6,26 +6,26 @@ let Caml_option = require("../../lib/js/caml_option.js"); let suites_0 = [ "isArray_array", - (param => ({ + param => ({ TAG: "Eq", _0: true, _1: Array.isArray([]) - })) + }) ]; let suites_1 = { hd: [ "isArray_int", - (param => ({ + param => ({ TAG: "Eq", _0: false, _1: Array.isArray(34) - })) + }) ], tl: { hd: [ "length", - (param => ({ + param => ({ TAG: "Eq", _0: 3, _1: [ @@ -33,12 +33,12 @@ let suites_1 = { 2, 3 ].length - })) + }) ], tl: { hd: [ "copyWithin", - (param => ({ + param => ({ TAG: "Eq", _0: [ 1, @@ -54,12 +54,12 @@ let suites_1 = { 4, 5 ].copyWithin(-2) - })) + }) ], tl: { hd: [ "copyWithinFrom", - (param => ({ + param => ({ TAG: "Eq", _0: [ 4, @@ -75,12 +75,12 @@ let suites_1 = { 4, 5 ].copyWithin(0, 3) - })) + }) ], tl: { hd: [ "copyWithinFromRange", - (param => ({ + param => ({ TAG: "Eq", _0: [ 4, @@ -96,12 +96,12 @@ let suites_1 = { 4, 5 ].copyWithin(0, 3, 4) - })) + }) ], tl: { hd: [ "fillInPlace", - (param => ({ + param => ({ TAG: "Eq", _0: [ 4, @@ -113,12 +113,12 @@ let suites_1 = { 2, 3 ].fill(4) - })) + }) ], tl: { hd: [ "fillFromInPlace", - (param => ({ + param => ({ TAG: "Eq", _0: [ 1, @@ -130,12 +130,12 @@ let suites_1 = { 2, 3 ].fill(4, 1) - })) + }) ], tl: { hd: [ "fillRangeInPlace", - (param => ({ + param => ({ TAG: "Eq", _0: [ 1, @@ -147,12 +147,12 @@ let suites_1 = { 2, 3 ].fill(4, 1, 2) - })) + }) ], tl: { hd: [ "pop", - (param => ({ + param => ({ TAG: "Eq", _0: 3, _1: Caml_option.undefined_to_opt([ @@ -160,21 +160,21 @@ let suites_1 = { 2, 3 ].pop()) - })) + }) ], tl: { hd: [ "pop - empty array", - (param => ({ + param => ({ TAG: "Eq", _0: undefined, _1: Caml_option.undefined_to_opt([].pop()) - })) + }) ], tl: { hd: [ "push", - (param => ({ + param => ({ TAG: "Eq", _0: 4, _1: [ @@ -182,12 +182,12 @@ let suites_1 = { 2, 3 ].push(4) - })) + }) ], tl: { hd: [ "pushMany", - (param => ({ + param => ({ TAG: "Eq", _0: 5, _1: [ @@ -195,12 +195,12 @@ let suites_1 = { 2, 3 ].push(4, 5) - })) + }) ], tl: { hd: [ "reverseInPlace", - (param => ({ + param => ({ TAG: "Eq", _0: [ 3, @@ -212,12 +212,12 @@ let suites_1 = { 2, 3 ].reverse() - })) + }) ], tl: { hd: [ "shift", - (param => ({ + param => ({ TAG: "Eq", _0: 1, _1: Caml_option.undefined_to_opt([ @@ -225,21 +225,21 @@ let suites_1 = { 2, 3 ].shift()) - })) + }) ], tl: { hd: [ "shift - empty array", - (param => ({ + param => ({ TAG: "Eq", _0: undefined, _1: Caml_option.undefined_to_opt([].shift()) - })) + }) ], tl: { hd: [ "sortInPlace", - (param => ({ + param => ({ TAG: "Eq", _0: [ 1, @@ -251,12 +251,12 @@ let suites_1 = { 1, 2 ].sort() - })) + }) ], tl: { hd: [ "sortInPlaceWith", - (param => ({ + param => ({ TAG: "Eq", _0: [ 3, @@ -268,12 +268,12 @@ let suites_1 = { 1, 2 ].sort((a, b) => b - a | 0) - })) + }) ], tl: { hd: [ "spliceInPlace", - (param => { + param => { let arr = [ 1, 2, @@ -298,12 +298,12 @@ let suites_1 = { removed ] }; - }) + } ], tl: { hd: [ "removeFromInPlace", - (param => { + param => { let arr = [ 1, 2, @@ -328,12 +328,12 @@ let suites_1 = { removed ] }; - }) + } ], tl: { hd: [ "removeCountInPlace", - (param => { + param => { let arr = [ 1, 2, @@ -356,12 +356,12 @@ let suites_1 = { removed ] }; - }) + } ], tl: { hd: [ "unshift", - (param => ({ + param => ({ TAG: "Eq", _0: 4, _1: [ @@ -369,12 +369,12 @@ let suites_1 = { 2, 3 ].unshift(4) - })) + }) ], tl: { hd: [ "unshiftMany", - (param => ({ + param => ({ TAG: "Eq", _0: 5, _1: [ @@ -382,12 +382,12 @@ let suites_1 = { 2, 3 ].unshift(4, 5) - })) + }) ], tl: { hd: [ "append", - (param => ({ + param => ({ TAG: "Eq", _0: [ 1, @@ -400,12 +400,12 @@ let suites_1 = { 2, 3 ].concat([4]) - })) + }) ], tl: { hd: [ "concat", - (param => ({ + param => ({ TAG: "Eq", _0: [ 1, @@ -422,12 +422,12 @@ let suites_1 = { 4, 5 ]) - })) + }) ], tl: { hd: [ "concatMany", - (param => ({ + param => ({ TAG: "Eq", _0: [ 1, @@ -449,12 +449,12 @@ let suites_1 = { 6, 7 ]) - })) + }) ], tl: { hd: [ "includes", - (param => ({ + param => ({ TAG: "Eq", _0: true, _1: [ @@ -462,12 +462,12 @@ let suites_1 = { 2, 3 ].includes(3) - })) + }) ], tl: { hd: [ "indexOf", - (param => ({ + param => ({ TAG: "Eq", _0: 1, _1: [ @@ -475,12 +475,12 @@ let suites_1 = { 2, 3 ].indexOf(2) - })) + }) ], tl: { hd: [ "indexOfFrom", - (param => ({ + param => ({ TAG: "Eq", _0: 3, _1: [ @@ -489,12 +489,12 @@ let suites_1 = { 3, 2 ].indexOf(2, 2) - })) + }) ], tl: { hd: [ "join", - (param => ({ + param => ({ TAG: "Eq", _0: "1,2,3", _1: [ @@ -502,12 +502,12 @@ let suites_1 = { 2, 3 ].join() - })) + }) ], tl: { hd: [ "joinWith", - (param => ({ + param => ({ TAG: "Eq", _0: "1;2;3", _1: [ @@ -515,12 +515,12 @@ let suites_1 = { 2, 3 ].join(";") - })) + }) ], tl: { hd: [ "lastIndexOf", - (param => ({ + param => ({ TAG: "Eq", _0: 1, _1: [ @@ -528,12 +528,12 @@ let suites_1 = { 2, 3 ].lastIndexOf(2) - })) + }) ], tl: { hd: [ "lastIndexOfFrom", - (param => ({ + param => ({ TAG: "Eq", _0: 1, _1: [ @@ -542,12 +542,12 @@ let suites_1 = { 3, 2 ].lastIndexOf(2, 2) - })) + }) ], tl: { hd: [ "slice", - (param => ({ + param => ({ TAG: "Eq", _0: [ 2, @@ -560,12 +560,12 @@ let suites_1 = { 4, 5 ].slice(1, 3) - })) + }) ], tl: { hd: [ "copy", - (param => ({ + param => ({ TAG: "Eq", _0: [ 1, @@ -581,12 +581,12 @@ let suites_1 = { 4, 5 ].slice() - })) + }) ], tl: { hd: [ "sliceFrom", - (param => ({ + param => ({ TAG: "Eq", _0: [ 3, @@ -600,12 +600,12 @@ let suites_1 = { 4, 5 ].slice(2) - })) + }) ], tl: { hd: [ "toString", - (param => ({ + param => ({ TAG: "Eq", _0: "1,2,3", _1: [ @@ -613,12 +613,12 @@ let suites_1 = { 2, 3 ].toString() - })) + }) ], tl: { hd: [ "toLocaleString", - (param => ({ + param => ({ TAG: "Eq", _0: "1,2,3", _1: [ @@ -626,12 +626,12 @@ let suites_1 = { 2, 3 ].toLocaleString() - })) + }) ], tl: { hd: [ "every", - (param => ({ + param => ({ TAG: "Eq", _0: true, _1: [ @@ -639,12 +639,12 @@ let suites_1 = { 2, 3 ].every(n => n > 0) - })) + }) ], tl: { hd: [ "everyi", - (param => ({ + param => ({ TAG: "Eq", _0: false, _1: [ @@ -652,12 +652,12 @@ let suites_1 = { 2, 3 ].every((param, i) => i > 0) - })) + }) ], tl: { hd: [ "filter", - (param => ({ + param => ({ TAG: "Eq", _0: [ 2, @@ -669,12 +669,12 @@ let suites_1 = { 3, 4 ].filter(n => n % 2 === 0) - })) + }) ], tl: { hd: [ "filteri", - (param => ({ + param => ({ TAG: "Eq", _0: [ 1, @@ -686,12 +686,12 @@ let suites_1 = { 3, 4 ].filter((param, i) => i % 2 === 0) - })) + }) ], tl: { hd: [ "find", - (param => ({ + param => ({ TAG: "Eq", _0: 2, _1: Caml_option.undefined_to_opt([ @@ -700,12 +700,12 @@ let suites_1 = { 3, 4 ].find(n => n % 2 === 0)) - })) + }) ], tl: { hd: [ "find - no match", - (param => ({ + param => ({ TAG: "Eq", _0: undefined, _1: Caml_option.undefined_to_opt([ @@ -714,12 +714,12 @@ let suites_1 = { 3, 4 ].find(n => n % 2 === 5)) - })) + }) ], tl: { hd: [ "findi", - (param => ({ + param => ({ TAG: "Eq", _0: 1, _1: Caml_option.undefined_to_opt([ @@ -728,12 +728,12 @@ let suites_1 = { 3, 4 ].find((param, i) => i % 2 === 0)) - })) + }) ], tl: { hd: [ "findi - no match", - (param => ({ + param => ({ TAG: "Eq", _0: undefined, _1: Caml_option.undefined_to_opt([ @@ -742,12 +742,12 @@ let suites_1 = { 3, 4 ].find((param, i) => i % 2 === 5)) - })) + }) ], tl: { hd: [ "findIndex", - (param => ({ + param => ({ TAG: "Eq", _0: 1, _1: [ @@ -756,12 +756,12 @@ let suites_1 = { 3, 4 ].findIndex(n => n % 2 === 0) - })) + }) ], tl: { hd: [ "findIndexi", - (param => ({ + param => ({ TAG: "Eq", _0: 0, _1: [ @@ -770,12 +770,12 @@ let suites_1 = { 3, 4 ].findIndex((param, i) => i % 2 === 0) - })) + }) ], tl: { hd: [ "forEach", - (param => { + param => { let sum = { contents: 0 }; @@ -791,12 +791,12 @@ let suites_1 = { _0: 6, _1: sum.contents }; - }) + } ], tl: { hd: [ "forEachi", - (param => { + param => { let sum = { contents: 0 }; @@ -812,12 +812,12 @@ let suites_1 = { _0: 3, _1: sum.contents }; - }) + } ], tl: { hd: [ "map", - (param => ({ + param => ({ TAG: "Eq", _0: [ 2, @@ -831,12 +831,12 @@ let suites_1 = { 3, 4 ].map(n => (n << 1)) - })) + }) ], tl: { hd: [ "map", - (param => ({ + param => ({ TAG: "Eq", _0: [ 0, @@ -850,12 +850,12 @@ let suites_1 = { 3, 4 ].map((param, i) => (i << 1)) - })) + }) ], tl: { hd: [ "reduce", - (param => ({ + param => ({ TAG: "Eq", _0: -10, _1: [ @@ -863,13 +863,13 @@ let suites_1 = { 2, 3, 4 - ].reduce(((acc, n) => acc - n | 0), 0) - })) + ].reduce((acc, n) => acc - n | 0, 0) + }) ], tl: { hd: [ "reducei", - (param => ({ + param => ({ TAG: "Eq", _0: -6, _1: [ @@ -877,13 +877,13 @@ let suites_1 = { 2, 3, 4 - ].reduce(((acc, param, i) => acc - i | 0), 0) - })) + ].reduce((acc, param, i) => acc - i | 0, 0) + }) ], tl: { hd: [ "reduceRight", - (param => ({ + param => ({ TAG: "Eq", _0: -10, _1: [ @@ -891,13 +891,13 @@ let suites_1 = { 2, 3, 4 - ].reduceRight(((acc, n) => acc - n | 0), 0) - })) + ].reduceRight((acc, n) => acc - n | 0, 0) + }) ], tl: { hd: [ "reduceRighti", - (param => ({ + param => ({ TAG: "Eq", _0: -6, _1: [ @@ -905,13 +905,13 @@ let suites_1 = { 2, 3, 4 - ].reduceRight(((acc, param, i) => acc - i | 0), 0) - })) + ].reduceRight((acc, param, i) => acc - i | 0, 0) + }) ], tl: { hd: [ "some", - (param => ({ + param => ({ TAG: "Eq", _0: false, _1: [ @@ -920,12 +920,12 @@ let suites_1 = { 3, 4 ].some(n => n <= 0) - })) + }) ], tl: { hd: [ "somei", - (param => ({ + param => ({ TAG: "Eq", _0: true, _1: [ @@ -934,7 +934,7 @@ let suites_1 = { 3, 4 ].some((param, i) => i <= 0) - })) + }) ], tl: /* [] */0 } diff --git a/jscomp/test/js_bool_test.js b/jscomp/test/js_bool_test.js index b27705f5d55..50bd8edab0d 100644 --- a/jscomp/test/js_bool_test.js +++ b/jscomp/test/js_bool_test.js @@ -33,30 +33,30 @@ let v = true; let suites_0 = [ "?bool_eq_caml_bool", - (param => ({ + param => ({ TAG: "Eq", _0: u, _1: true - })) + }) ]; let suites_1 = { hd: [ "js_bool_eq_js_bool", - (param => ({ + param => ({ TAG: "Eq", _0: v, _1: true - })) + }) ], tl: { hd: [ "js_bool_neq_acml_bool", - (param => ({ + param => ({ TAG: "Eq", _0: true, _1: true === true - })) + }) ], tl: /* [] */0 } diff --git a/jscomp/test/js_cast_test.js b/jscomp/test/js_cast_test.js index 5406f47ecab..c392fd4587b 100644 --- a/jscomp/test/js_cast_test.js +++ b/jscomp/test/js_cast_test.js @@ -24,11 +24,11 @@ function add_test(loc, test) { } function eq(loc, x, y) { - add_test(loc, (() => ({ + add_test(loc, () => ({ TAG: "Eq", _0: x, _1: y - }))); + })); } eq("File \"js_cast_test.res\", line 14, characters 12-19", true, 1); diff --git a/jscomp/test/js_date_test.js b/jscomp/test/js_date_test.js index 8b614ad2107..eb79311a2c2 100644 --- a/jscomp/test/js_date_test.js +++ b/jscomp/test/js_date_test.js @@ -10,68 +10,68 @@ function date() { let suites_0 = [ "valueOf", - (param => ({ + param => ({ TAG: "Eq", _0: 195131516789, _1: new Date("1976-03-08T12:34:56.789+01:23").valueOf() - })) + }) ]; let suites_1 = { hd: [ "make", - (param => ({ + param => ({ TAG: "Ok", _0: new Date().getTime() > 1487223505382 - })) + }) ], tl: { hd: [ "parseAsFloat", - (param => ({ + param => ({ TAG: "Eq", _0: Date.parse("1976-03-08T12:34:56.789+01:23"), _1: 195131516789 - })) + }) ], tl: { hd: [ "parseAsFloat_invalid", - (param => ({ + param => ({ TAG: "Ok", _0: Number.isNaN(Date.parse("gibberish")) - })) + }) ], tl: { hd: [ "fromFloat", - (param => ({ + param => ({ TAG: "Eq", _0: "1976-03-08T11:11:56.789Z", _1: new Date(195131516789).toISOString() - })) + }) ], tl: { hd: [ "fromString_valid", - (param => ({ + param => ({ TAG: "Eq", _0: 195131516789, _1: new Date("1976-03-08T12:34:56.789+01:23").getTime() - })) + }) ], tl: { hd: [ "fromString_invalid", - (param => ({ + param => ({ TAG: "Ok", _0: Number.isNaN(new Date("gibberish").getTime()) - })) + }) ], tl: { hd: [ "makeWithYM", - (param => { + param => { let d = new Date(1984, 4); return { TAG: "Eq", @@ -84,12 +84,12 @@ let suites_1 = { d.getMonth() ] }; - }) + } ], tl: { hd: [ "makeWithYMD", - (param => { + param => { let d = new Date(1984, 4, 6); return { TAG: "Eq", @@ -104,12 +104,12 @@ let suites_1 = { d.getDate() ] }; - }) + } ], tl: { hd: [ "makeWithYMDH", - (param => { + param => { let d = new Date(1984, 4, 6, 3); return { TAG: "Eq", @@ -126,12 +126,12 @@ let suites_1 = { d.getHours() ] }; - }) + } ], tl: { hd: [ "makeWithYMDHM", - (param => { + param => { let d = new Date(1984, 4, 6, 3, 59); return { TAG: "Eq", @@ -150,12 +150,12 @@ let suites_1 = { d.getMinutes() ] }; - }) + } ], tl: { hd: [ "makeWithYMDHMS", - (param => { + param => { let d = new Date(1984, 4, 6, 3, 59, 27); return { TAG: "Eq", @@ -176,12 +176,12 @@ let suites_1 = { d.getSeconds() ] }; - }) + } ], tl: { hd: [ "utcWithYM", - (param => { + param => { let d = Date.UTC(1984, 4); let d$1 = new Date(d); return { @@ -195,12 +195,12 @@ let suites_1 = { d$1.getUTCMonth() ] }; - }) + } ], tl: { hd: [ "utcWithYMD", - (param => { + param => { let d = Date.UTC(1984, 4, 6); let d$1 = new Date(d); return { @@ -216,12 +216,12 @@ let suites_1 = { d$1.getUTCDate() ] }; - }) + } ], tl: { hd: [ "utcWithYMDH", - (param => { + param => { let d = Date.UTC(1984, 4, 6, 3); let d$1 = new Date(d); return { @@ -239,12 +239,12 @@ let suites_1 = { d$1.getUTCHours() ] }; - }) + } ], tl: { hd: [ "utcWithYMDHM", - (param => { + param => { let d = Date.UTC(1984, 4, 6, 3, 59); let d$1 = new Date(d); return { @@ -264,12 +264,12 @@ let suites_1 = { d$1.getUTCMinutes() ] }; - }) + } ], tl: { hd: [ "utcWithYMDHMS", - (param => { + param => { let d = Date.UTC(1984, 4, 6, 3, 59, 27); let d$1 = new Date(d); return { @@ -291,129 +291,129 @@ let suites_1 = { d$1.getUTCSeconds() ] }; - }) + } ], tl: { hd: [ "getFullYear", - (param => ({ + param => ({ TAG: "Eq", _0: 1976, _1: new Date("1976-03-08T12:34:56.789+01:23").getFullYear() - })) + }) ], tl: { hd: [ "getMilliseconds", - (param => ({ + param => ({ TAG: "Eq", _0: 789, _1: new Date("1976-03-08T12:34:56.789+01:23").getMilliseconds() - })) + }) ], tl: { hd: [ "getSeconds", - (param => ({ + param => ({ TAG: "Eq", _0: 56, _1: new Date("1976-03-08T12:34:56.789+01:23").getSeconds() - })) + }) ], tl: { hd: [ "getTime", - (param => ({ + param => ({ TAG: "Eq", _0: 195131516789, _1: new Date("1976-03-08T12:34:56.789+01:23").getTime() - })) + }) ], tl: { hd: [ "getUTCDate", - (param => ({ + param => ({ TAG: "Eq", _0: 8, _1: new Date("1976-03-08T12:34:56.789+01:23").getUTCDate() - })) + }) ], tl: { hd: [ "getUTCDay", - (param => ({ + param => ({ TAG: "Eq", _0: 1, _1: new Date("1976-03-08T12:34:56.789+01:23").getUTCDay() - })) + }) ], tl: { hd: [ "getUTCFUllYear", - (param => ({ + param => ({ TAG: "Eq", _0: 1976, _1: new Date("1976-03-08T12:34:56.789+01:23").getUTCFullYear() - })) + }) ], tl: { hd: [ "getUTCHours", - (param => ({ + param => ({ TAG: "Eq", _0: 11, _1: new Date("1976-03-08T12:34:56.789+01:23").getUTCHours() - })) + }) ], tl: { hd: [ "getUTCMilliseconds", - (param => ({ + param => ({ TAG: "Eq", _0: 789, _1: new Date("1976-03-08T12:34:56.789+01:23").getUTCMilliseconds() - })) + }) ], tl: { hd: [ "getUTCMinutes", - (param => ({ + param => ({ TAG: "Eq", _0: 11, _1: new Date("1976-03-08T12:34:56.789+01:23").getUTCMinutes() - })) + }) ], tl: { hd: [ "getUTCMonth", - (param => ({ + param => ({ TAG: "Eq", _0: 2, _1: new Date("1976-03-08T12:34:56.789+01:23").getUTCMonth() - })) + }) ], tl: { hd: [ "getUTCSeconds", - (param => ({ + param => ({ TAG: "Eq", _0: 56, _1: new Date("1976-03-08T12:34:56.789+01:23").getUTCSeconds() - })) + }) ], tl: { hd: [ "getYear", - (param => ({ + param => ({ TAG: "Eq", _0: 1976, _1: new Date("1976-03-08T12:34:56.789+01:23").getFullYear() - })) + }) ], tl: { hd: [ "setDate", - (param => { + param => { let d = new Date("1976-03-08T12:34:56.789+01:23"); d.setDate(12); return { @@ -421,12 +421,12 @@ let suites_1 = { _0: 12, _1: d.getDate() }; - }) + } ], tl: { hd: [ "setFullYear", - (param => { + param => { let d = new Date("1976-03-08T12:34:56.789+01:23"); d.setFullYear(1986); return { @@ -434,12 +434,12 @@ let suites_1 = { _0: 1986, _1: d.getFullYear() }; - }) + } ], tl: { hd: [ "setFullYearM", - (param => { + param => { let d = new Date("1976-03-08T12:34:56.789+01:23"); d.setFullYear(1986, 7); return { @@ -453,12 +453,12 @@ let suites_1 = { d.getMonth() ] }; - }) + } ], tl: { hd: [ "setFullYearMD", - (param => { + param => { let d = new Date("1976-03-08T12:34:56.789+01:23"); d.setFullYear(1986, 7, 23); return { @@ -474,12 +474,12 @@ let suites_1 = { d.getDate() ] }; - }) + } ], tl: { hd: [ "setHours", - (param => { + param => { let d = new Date("1976-03-08T12:34:56.789+01:23"); d.setHours(22); return { @@ -487,12 +487,12 @@ let suites_1 = { _0: 22, _1: d.getHours() }; - }) + } ], tl: { hd: [ "setHoursM", - (param => { + param => { let d = new Date("1976-03-08T12:34:56.789+01:23"); d.setHours(22, 48); return { @@ -506,12 +506,12 @@ let suites_1 = { d.getMinutes() ] }; - }) + } ], tl: { hd: [ "setHoursMS", - (param => { + param => { let d = new Date("1976-03-08T12:34:56.789+01:23"); d.setHours(22, 48, 54); return { @@ -527,12 +527,12 @@ let suites_1 = { d.getSeconds() ] }; - }) + } ], tl: { hd: [ "setMilliseconds", - (param => { + param => { let d = new Date("1976-03-08T12:34:56.789+01:23"); d.setMilliseconds(543); return { @@ -540,12 +540,12 @@ let suites_1 = { _0: 543, _1: d.getMilliseconds() }; - }) + } ], tl: { hd: [ "setMinutes", - (param => { + param => { let d = new Date("1976-03-08T12:34:56.789+01:23"); d.setMinutes(18); return { @@ -553,12 +553,12 @@ let suites_1 = { _0: 18, _1: d.getMinutes() }; - }) + } ], tl: { hd: [ "setMinutesS", - (param => { + param => { let d = new Date("1976-03-08T12:34:56.789+01:23"); d.setMinutes(18, 42); return { @@ -572,12 +572,12 @@ let suites_1 = { d.getSeconds() ] }; - }) + } ], tl: { hd: [ "setMinutesSMs", - (param => { + param => { let d = new Date("1976-03-08T12:34:56.789+01:23"); d.setMinutes(18, 42, 311); return { @@ -593,12 +593,12 @@ let suites_1 = { d.getMilliseconds() ] }; - }) + } ], tl: { hd: [ "setMonth", - (param => { + param => { let d = new Date("1976-03-08T12:34:56.789+01:23"); d.setMonth(10); return { @@ -606,12 +606,12 @@ let suites_1 = { _0: 10, _1: d.getMonth() }; - }) + } ], tl: { hd: [ "setMonthD", - (param => { + param => { let d = new Date("1976-03-08T12:34:56.789+01:23"); d.setMonth(10, 14); return { @@ -625,12 +625,12 @@ let suites_1 = { d.getDate() ] }; - }) + } ], tl: { hd: [ "setSeconds", - (param => { + param => { let d = new Date("1976-03-08T12:34:56.789+01:23"); d.setSeconds(36); return { @@ -638,12 +638,12 @@ let suites_1 = { _0: 36, _1: d.getSeconds() }; - }) + } ], tl: { hd: [ "setSecondsMs", - (param => { + param => { let d = new Date("1976-03-08T12:34:56.789+01:23"); d.setSeconds(36, 420); return { @@ -657,12 +657,12 @@ let suites_1 = { d.getMilliseconds() ] }; - }) + } ], tl: { hd: [ "setUTCDate", - (param => { + param => { let d = new Date("1976-03-08T12:34:56.789+01:23"); d.setUTCDate(12); return { @@ -670,12 +670,12 @@ let suites_1 = { _0: 12, _1: d.getUTCDate() }; - }) + } ], tl: { hd: [ "setUTCFullYear", - (param => { + param => { let d = new Date("1976-03-08T12:34:56.789+01:23"); d.setUTCFullYear(1986); return { @@ -683,12 +683,12 @@ let suites_1 = { _0: 1986, _1: d.getUTCFullYear() }; - }) + } ], tl: { hd: [ "setUTCFullYearM", - (param => { + param => { let d = new Date("1976-03-08T12:34:56.789+01:23"); d.setUTCFullYear(1986, 7); return { @@ -702,12 +702,12 @@ let suites_1 = { d.getUTCMonth() ] }; - }) + } ], tl: { hd: [ "setUTCFullYearMD", - (param => { + param => { let d = new Date("1976-03-08T12:34:56.789+01:23"); d.setUTCFullYear(1986, 7, 23); return { @@ -723,12 +723,12 @@ let suites_1 = { d.getUTCDate() ] }; - }) + } ], tl: { hd: [ "setUTCHours", - (param => { + param => { let d = new Date("1976-03-08T12:34:56.789+01:23"); d.setUTCHours(22); return { @@ -736,12 +736,12 @@ let suites_1 = { _0: 22, _1: d.getUTCHours() }; - }) + } ], tl: { hd: [ "setUTCHoursM", - (param => { + param => { let d = new Date("1976-03-08T12:34:56.789+01:23"); d.setUTCHours(22, 48); return { @@ -755,12 +755,12 @@ let suites_1 = { d.getUTCMinutes() ] }; - }) + } ], tl: { hd: [ "setUTCHoursMS", - (param => { + param => { let d = new Date("1976-03-08T12:34:56.789+01:23"); d.setUTCHours(22, 48, 54); return { @@ -776,12 +776,12 @@ let suites_1 = { d.getUTCSeconds() ] }; - }) + } ], tl: { hd: [ "setUTCMilliseconds", - (param => { + param => { let d = new Date("1976-03-08T12:34:56.789+01:23"); d.setUTCMilliseconds(543); return { @@ -789,12 +789,12 @@ let suites_1 = { _0: 543, _1: d.getUTCMilliseconds() }; - }) + } ], tl: { hd: [ "setUTCMinutes", - (param => { + param => { let d = new Date("1976-03-08T12:34:56.789+01:23"); d.setUTCMinutes(18); return { @@ -802,12 +802,12 @@ let suites_1 = { _0: 18, _1: d.getUTCMinutes() }; - }) + } ], tl: { hd: [ "setUTCMinutesS", - (param => { + param => { let d = new Date("1976-03-08T12:34:56.789+01:23"); d.setUTCMinutes(18, 42); return { @@ -821,12 +821,12 @@ let suites_1 = { d.getUTCSeconds() ] }; - }) + } ], tl: { hd: [ "setUTCMinutesSMs", - (param => { + param => { let d = new Date("1976-03-08T12:34:56.789+01:23"); d.setUTCMinutes(18, 42, 311); return { @@ -842,12 +842,12 @@ let suites_1 = { d.getUTCMilliseconds() ] }; - }) + } ], tl: { hd: [ "setUTCMonth", - (param => { + param => { let d = new Date("1976-03-08T12:34:56.789+01:23"); d.setUTCMonth(10); return { @@ -855,12 +855,12 @@ let suites_1 = { _0: 10, _1: d.getUTCMonth() }; - }) + } ], tl: { hd: [ "setUTCMonthD", - (param => { + param => { let d = new Date("1976-03-08T12:34:56.789+01:23"); d.setUTCMonth(10, 14); return { @@ -874,12 +874,12 @@ let suites_1 = { d.getUTCDate() ] }; - }) + } ], tl: { hd: [ "setUTCSeconds", - (param => { + param => { let d = new Date("1976-03-08T12:34:56.789+01:23"); d.setUTCSeconds(36); return { @@ -887,12 +887,12 @@ let suites_1 = { _0: 36, _1: d.getUTCSeconds() }; - }) + } ], tl: { hd: [ "setUTCSecondsMs", - (param => { + param => { let d = new Date("1976-03-08T12:34:56.789+01:23"); d.setUTCSeconds(36, 420); return { @@ -906,66 +906,66 @@ let suites_1 = { d.getUTCMilliseconds() ] }; - }) + } ], tl: { hd: [ "toDateString", - (param => ({ + param => ({ TAG: "Eq", _0: "Mon Mar 08 1976", _1: new Date("1976-03-08T12:34:56.789+01:23").toDateString() - })) + }) ], tl: { hd: [ "toGMTString", - (param => ({ + param => ({ TAG: "Eq", _0: "Mon, 08 Mar 1976 11:11:56 GMT", _1: new Date("1976-03-08T12:34:56.789+01:23").toUTCString() - })) + }) ], tl: { hd: [ "toISOString", - (param => ({ + param => ({ TAG: "Eq", _0: "1976-03-08T11:11:56.789Z", _1: new Date("1976-03-08T12:34:56.789+01:23").toISOString() - })) + }) ], tl: { hd: [ "toJSON", - (param => ({ + param => ({ TAG: "Eq", _0: "1976-03-08T11:11:56.789Z", _1: new Date("1976-03-08T12:34:56.789+01:23").toJSON() - })) + }) ], tl: { hd: [ "toJSONUnsafe", - (param => ({ + param => ({ TAG: "Eq", _0: "1976-03-08T11:11:56.789Z", _1: new Date("1976-03-08T12:34:56.789+01:23").toJSON() - })) + }) ], tl: { hd: [ "toUTCString", - (param => ({ + param => ({ TAG: "Eq", _0: "Mon, 08 Mar 1976 11:11:56 GMT", _1: new Date("1976-03-08T12:34:56.789+01:23").toUTCString() - })) + }) ], tl: { hd: [ "eq", - (param => { + param => { let a = new Date("2013-03-01T01:10:00"); let b = new Date("2013-03-01T01:10:00"); let c = new Date("2013-03-01T01:10:01"); @@ -973,7 +973,7 @@ let suites_1 = { TAG: "Ok", _0: Caml_obj.equal(a, b) && Caml_obj.notequal(b, c) && Caml_obj.greaterthan(c, b) }; - }) + } ], tl: /* [] */0 } diff --git a/jscomp/test/js_dict_test.js b/jscomp/test/js_dict_test.js index f32b9f42294..231646783ad 100644 --- a/jscomp/test/js_dict_test.js +++ b/jscomp/test/js_dict_test.js @@ -13,53 +13,53 @@ function obj() { let suites_0 = [ "empty", - (param => ({ + param => ({ TAG: "Eq", _0: [], _1: Object.keys({}) - })) + }) ]; let suites_1 = { hd: [ "get", - (param => ({ + param => ({ TAG: "Eq", _0: 43, _1: Js_dict.get({ foo: 43, bar: 86 }, "foo") - })) + }) ], tl: { hd: [ "get - property not in object", - (param => ({ + param => ({ TAG: "Eq", _0: undefined, _1: Js_dict.get({ foo: 43, bar: 86 }, "baz") - })) + }) ], tl: { hd: [ "unsafe_get", - (param => ({ + param => ({ TAG: "Eq", _0: 43, _1: ({ foo: 43, bar: 86 })["foo"] - })) + }) ], tl: { hd: [ "set", - (param => { + param => { let o = { foo: 43, bar: 86 @@ -70,12 +70,12 @@ let suites_1 = { _0: 36, _1: Js_dict.get(o, "foo") }; - }) + } ], tl: { hd: [ "keys", - (param => ({ + param => ({ TAG: "Eq", _0: [ "foo", @@ -85,12 +85,12 @@ let suites_1 = { foo: 43, bar: 86 }) - })) + }) ], tl: { hd: [ "entries", - (param => ({ + param => ({ TAG: "Eq", _0: [ [ @@ -106,12 +106,12 @@ let suites_1 = { foo: 43, bar: 86 }) - })) + }) ], tl: { hd: [ "values", - (param => ({ + param => ({ TAG: "Eq", _0: [ 43, @@ -121,21 +121,21 @@ let suites_1 = { foo: 43, bar: 86 }) - })) + }) ], tl: { hd: [ "fromList - []", - (param => ({ + param => ({ TAG: "Eq", _0: {}, _1: Js_dict.fromList(/* [] */0) - })) + }) ], tl: { hd: [ "fromList", - (param => ({ + param => ({ TAG: "Eq", _0: [ [ @@ -160,21 +160,21 @@ let suites_1 = { tl: /* [] */0 } })) - })) + }) ], tl: { hd: [ "fromArray - []", - (param => ({ + param => ({ TAG: "Eq", _0: {}, _1: Js_dict.fromArray([]) - })) + }) ], tl: { hd: [ "fromArray", - (param => ({ + param => ({ TAG: "Eq", _0: [ [ @@ -196,22 +196,22 @@ let suites_1 = { 46 ] ])) - })) + }) ], tl: { hd: [ "map", - (param => ({ + param => ({ TAG: "Eq", _0: { foo: "43", bar: "86" }, - _1: Js_dict.map((i => String(i)), { + _1: Js_dict.map(i => String(i), { foo: 43, bar: 86 }) - })) + }) ], tl: /* [] */0 } diff --git a/jscomp/test/js_exception_catch_test.js b/jscomp/test/js_exception_catch_test.js index a35d45a033f..f4580b614a8 100644 --- a/jscomp/test/js_exception_catch_test.js +++ b/jscomp/test/js_exception_catch_test.js @@ -27,25 +27,25 @@ function add_test(loc, test) { } function eq(loc, x, y) { - add_test(loc, (() => ({ + add_test(loc, () => ({ TAG: "Eq", _0: x, _1: y - }))); + })); } function false_(loc) { - add_test(loc, (() => ({ + add_test(loc, () => ({ TAG: "Ok", _0: false - }))); + })); } function true_(loc) { - add_test(loc, (() => ({ + add_test(loc, () => ({ TAG: "Ok", _0: true - }))); + })); } let exit = 0; @@ -58,10 +58,10 @@ try { } catch (raw_x) { let x = Caml_js_exceptions.internalToOCamlException(raw_x); if (x.RE_EXN_ID === Js_exn.$$Error) { - add_test("File \"js_exception_catch_test.res\", line 18, characters 37-44", (() => ({ + add_test("File \"js_exception_catch_test.res\", line 18, characters 37-44", () => ({ TAG: "Ok", _0: true - }))); + })); } else { throw new Error(x.RE_EXN_ID, { cause: x @@ -70,10 +70,10 @@ try { } if (exit === 1) { - add_test("File \"js_exception_catch_test.res\", line 19, characters 14-21", (() => ({ + add_test("File \"js_exception_catch_test.res\", line 19, characters 14-21", () => ({ TAG: "Ok", _0: false - }))); + })); } let A = /* @__PURE__ */Caml_exceptions.create("Js_exception_catch_test.A"); diff --git a/jscomp/test/js_float_test.js b/jscomp/test/js_float_test.js index bdc5d72dc14..9c7bd025d5d 100644 --- a/jscomp/test/js_float_test.js +++ b/jscomp/test/js_float_test.js @@ -6,399 +6,399 @@ let Pervasives = require("../../lib/js/pervasives.js"); let suites_0 = [ "_NaN <> _NaN", - (param => ({ + param => ({ TAG: "Eq", _0: false, _1: NaN === NaN - })) + }) ]; let suites_1 = { hd: [ "isNaN - _NaN", - (param => ({ + param => ({ TAG: "Eq", _0: true, _1: Number.isNaN(NaN) - })) + }) ], tl: { hd: [ "isNaN - 0.", - (param => ({ + param => ({ TAG: "Eq", _0: false, _1: Number.isNaN(0) - })) + }) ], tl: { hd: [ "isFinite - infinity", - (param => ({ + param => ({ TAG: "Eq", _0: false, _1: Number.isFinite(Pervasives.infinity) - })) + }) ], tl: { hd: [ "isFinite - neg_infinity", - (param => ({ + param => ({ TAG: "Eq", _0: false, _1: Number.isFinite(Pervasives.neg_infinity) - })) + }) ], tl: { hd: [ "isFinite - _NaN", - (param => ({ + param => ({ TAG: "Eq", _0: false, _1: Number.isFinite(NaN) - })) + }) ], tl: { hd: [ "isFinite - 0.", - (param => ({ + param => ({ TAG: "Eq", _0: true, _1: Number.isFinite(0) - })) + }) ], tl: { hd: [ "toExponential", - (param => ({ + param => ({ TAG: "Eq", _0: "1.23456e+2", _1: (123.456).toExponential() - })) + }) ], tl: { hd: [ "toExponential - large number", - (param => ({ + param => ({ TAG: "Eq", _0: "1.2e+21", _1: (1.2e21).toExponential() - })) + }) ], tl: { hd: [ "toExponentialWithPrecision - digits:2", - (param => ({ + param => ({ TAG: "Eq", _0: "1.23e+2", _1: (123.456).toExponential(2) - })) + }) ], tl: { hd: [ "toExponentialWithPrecision - digits:4", - (param => ({ + param => ({ TAG: "Eq", _0: "1.2346e+2", _1: (123.456).toExponential(4) - })) + }) ], tl: { hd: [ "toExponentialWithPrecision - digits:20", - (param => ({ + param => ({ TAG: "Eq", _0: "0.00000000000000000000e+0", _1: (0).toExponential(20) - })) + }) ], tl: { hd: [ "File \"js_float_test.res\", line 27, characters 5-12", - (param => ({ + param => ({ TAG: "ThrowAny", - _0: (() => { + _0: () => { (0).toExponential(101); - }) - })) + } + }) ], tl: { hd: [ "toExponentialWithPrecision - digits:-1", - (param => ({ + param => ({ TAG: "ThrowAny", - _0: (() => { + _0: () => { (0).toExponential(-1); - }) - })) + } + }) ], tl: { hd: [ "toFixed", - (param => ({ + param => ({ TAG: "Eq", _0: "123", _1: (123.456).toFixed() - })) + }) ], tl: { hd: [ "toFixed - large number", - (param => ({ + param => ({ TAG: "Eq", _0: "1.2e+21", _1: (1.2e21).toFixed() - })) + }) ], tl: { hd: [ "toFixedWithPrecision - digits:2", - (param => ({ + param => ({ TAG: "Eq", _0: "123.46", _1: (123.456).toFixed(2) - })) + }) ], tl: { hd: [ "toFixedWithPrecision - digits:4", - (param => ({ + param => ({ TAG: "Eq", _0: "123.4560", _1: (123.456).toFixed(4) - })) + }) ], tl: { hd: [ "toFixedWithPrecision - digits:20", - (param => ({ + param => ({ TAG: "Eq", _0: "0.00000000000000000000", _1: (0).toFixed(20) - })) + }) ], tl: { hd: [ "toFixedWithPrecision - digits:101", - (param => ({ + param => ({ TAG: "ThrowAny", - _0: (() => { + _0: () => { (0).toFixed(101); - }) - })) + } + }) ], tl: { hd: [ "toFixedWithPrecision - digits:-1", - (param => ({ + param => ({ TAG: "ThrowAny", - _0: (() => { + _0: () => { (0).toFixed(-1); - }) - })) + } + }) ], tl: { hd: [ "toPrecision", - (param => ({ + param => ({ TAG: "Eq", _0: "123.456", _1: (123.456).toPrecision() - })) + }) ], tl: { hd: [ "toPrecision - large number", - (param => ({ + param => ({ TAG: "Eq", _0: "1.2e+21", _1: (1.2e21).toPrecision() - })) + }) ], tl: { hd: [ "toPrecisionWithPrecision - digits:2", - (param => ({ + param => ({ TAG: "Eq", _0: "1.2e+2", _1: (123.456).toPrecision(2) - })) + }) ], tl: { hd: [ "toPrecisionWithPrecision - digits:4", - (param => ({ + param => ({ TAG: "Eq", _0: "123.5", _1: (123.456).toPrecision(4) - })) + }) ], tl: { hd: [ "toPrecisionWithPrecision - digits:20", - (param => ({ + param => ({ TAG: "Eq", _0: "0.0000000000000000000", _1: (0).toPrecision(20) - })) + }) ], tl: { hd: [ "File \"js_float_test.res\", line 68, characters 5-12", - (param => ({ + param => ({ TAG: "ThrowAny", - _0: (() => { + _0: () => { (0).toPrecision(101); - }) - })) + } + }) ], tl: { hd: [ "toPrecisionWithPrecision - digits:-1", - (param => ({ + param => ({ TAG: "ThrowAny", - _0: (() => { + _0: () => { (0).toPrecision(-1); - }) - })) + } + }) ], tl: { hd: [ "toString", - (param => ({ + param => ({ TAG: "Eq", _0: "1.23", _1: (1.23).toString() - })) + }) ], tl: { hd: [ "toString - large number", - (param => ({ + param => ({ TAG: "Eq", _0: "1.2e+21", _1: (1.2e21).toString() - })) + }) ], tl: { hd: [ "toStringWithRadix - radix:2", - (param => ({ + param => ({ TAG: "Eq", _0: "1111011.0111010010111100011010100111111011111001110111", _1: (123.456).toString(2) - })) + }) ], tl: { hd: [ "toStringWithRadix - radix:16", - (param => ({ + param => ({ TAG: "Eq", _0: "7b.74bc6a7ef9dc", _1: (123.456).toString(16) - })) + }) ], tl: { hd: [ "toStringWithRadix - radix:36", - (param => ({ + param => ({ TAG: "Eq", _0: "3f", _1: (123).toString(36) - })) + }) ], tl: { hd: [ "toStringWithRadix - radix:37", - (param => ({ + param => ({ TAG: "ThrowAny", - _0: (() => { + _0: () => { (0).toString(37); - }) - })) + } + }) ], tl: { hd: [ "toStringWithRadix - radix:1", - (param => ({ + param => ({ TAG: "ThrowAny", - _0: (() => { + _0: () => { (0).toString(1); - }) - })) + } + }) ], tl: { hd: [ "toStringWithRadix - radix:-1", - (param => ({ + param => ({ TAG: "ThrowAny", - _0: (() => { + _0: () => { (0).toString(-1); - }) - })) + } + }) ], tl: { hd: [ "fromString - 123", - (param => ({ + param => ({ TAG: "Eq", _0: 123, _1: Number("123") - })) + }) ], tl: { hd: [ "fromString - 12.3", - (param => ({ + param => ({ TAG: "Eq", _0: 12.3, _1: Number("12.3") - })) + }) ], tl: { hd: [ "fromString - empty string", - (param => ({ + param => ({ TAG: "Eq", _0: 0, _1: Number("") - })) + }) ], tl: { hd: [ "fromString - 0x11", - (param => ({ + param => ({ TAG: "Eq", _0: 17, _1: Number("0x11") - })) + }) ], tl: { hd: [ "fromString - 0b11", - (param => ({ + param => ({ TAG: "Eq", _0: 3, _1: Number("0b11") - })) + }) ], tl: { hd: [ "fromString - 0o11", - (param => ({ + param => ({ TAG: "Eq", _0: 9, _1: Number("0o11") - })) + }) ], tl: { hd: [ "fromString - invalid string", - (param => ({ + param => ({ TAG: "Eq", _0: true, _1: Number.isNaN(Number("foo")) - })) + }) ], tl: /* [] */0 } diff --git a/jscomp/test/js_global_test.js b/jscomp/test/js_global_test.js index 05aa3de7b63..8a77b3aef16 100644 --- a/jscomp/test/js_global_test.js +++ b/jscomp/test/js_global_test.js @@ -5,63 +5,63 @@ let Mt = require("./mt.js"); let suites_0 = [ "setTimeout/clearTimeout sanity check", - (param => { - let handle = setTimeout((() => {}), 0); + param => { + let handle = setTimeout(() => {}, 0); clearTimeout(handle); return { TAG: "Ok", _0: true }; - }) + } ]; let suites_1 = { hd: [ "setInerval/clearInterval sanity check", - (param => { - let handle = setInterval((() => {}), 0); + param => { + let handle = setInterval(() => {}, 0); clearInterval(handle); return { TAG: "Ok", _0: true }; - }) + } ], tl: { hd: [ "encodeURI", - (param => ({ + param => ({ TAG: "Eq", _0: encodeURI("[-=-]"), _1: "%5B-=-%5D" - })) + }) ], tl: { hd: [ "decodeURI", - (param => ({ + param => ({ TAG: "Eq", _0: decodeURI("%5B-=-%5D"), _1: "[-=-]" - })) + }) ], tl: { hd: [ "encodeURIComponent", - (param => ({ + param => ({ TAG: "Eq", _0: encodeURIComponent("[-=-]"), _1: "%5B-%3D-%5D" - })) + }) ], tl: { hd: [ "decodeURIComponent", - (param => ({ + param => ({ TAG: "Eq", _0: decodeURIComponent("%5B-%3D-%5D"), _1: "[-=-]" - })) + }) ], tl: /* [] */0 } diff --git a/jscomp/test/js_int_test.js b/jscomp/test/js_int_test.js index 34deb2ec445..e7a41d3a1fa 100644 --- a/jscomp/test/js_int_test.js +++ b/jscomp/test/js_int_test.js @@ -5,181 +5,181 @@ let Mt = require("./mt.js"); let suites_0 = [ "toExponential", - (param => ({ + param => ({ TAG: "Eq", _0: "1.23456e+5", _1: (123456).toExponential() - })) + }) ]; let suites_1 = { hd: [ "toExponentialWithPrecision - digits:2", - (param => ({ + param => ({ TAG: "Eq", _0: "1.23e+5", _1: (123456).toExponential(2) - })) + }) ], tl: { hd: [ "toExponentialWithPrecision - digits:4", - (param => ({ + param => ({ TAG: "Eq", _0: "1.2346e+5", _1: (123456).toExponential(4) - })) + }) ], tl: { hd: [ "toExponentialWithPrecision - digits:20", - (param => ({ + param => ({ TAG: "Eq", _0: "0.00000000000000000000e+0", _1: (0).toExponential(20) - })) + }) ], tl: { hd: [ "File \"js_int_test.res\", line 19, characters 5-12", - (param => ({ + param => ({ TAG: "ThrowAny", - _0: (() => { + _0: () => { (0).toExponential(101); - }) - })) + } + }) ], tl: { hd: [ "toExponentialWithPrecision - digits:-1", - (param => ({ + param => ({ TAG: "ThrowAny", - _0: (() => { + _0: () => { (0).toExponential(-1); - }) - })) + } + }) ], tl: { hd: [ "toPrecision", - (param => ({ + param => ({ TAG: "Eq", _0: "123456", _1: (123456).toPrecision() - })) + }) ], tl: { hd: [ "toPrecisionWithPrecision - digits:2", - (param => ({ + param => ({ TAG: "Eq", _0: "1.2e+5", _1: (123456).toPrecision(2) - })) + }) ], tl: { hd: [ "toPrecisionWithPrecision - digits:4", - (param => ({ + param => ({ TAG: "Eq", _0: "1.235e+5", _1: (123456).toPrecision(4) - })) + }) ], tl: { hd: [ "toPrecisionWithPrecision - digits:20", - (param => ({ + param => ({ TAG: "Eq", _0: "0.0000000000000000000", _1: (0).toPrecision(20) - })) + }) ], tl: { hd: [ "File \"js_int_test.res\", line 37, characters 5-12", - (param => ({ + param => ({ TAG: "ThrowAny", - _0: (() => { + _0: () => { (0).toPrecision(101); - }) - })) + } + }) ], tl: { hd: [ "toPrecisionWithPrecision - digits:-1", - (param => ({ + param => ({ TAG: "ThrowAny", - _0: (() => { + _0: () => { (0).toPrecision(-1); - }) - })) + } + }) ], tl: { hd: [ "toString", - (param => ({ + param => ({ TAG: "Eq", _0: "123", _1: (123).toString() - })) + }) ], tl: { hd: [ "toStringWithRadix - radix:2", - (param => ({ + param => ({ TAG: "Eq", _0: "11110001001000000", _1: (123456).toString(2) - })) + }) ], tl: { hd: [ "toStringWithRadix - radix:16", - (param => ({ + param => ({ TAG: "Eq", _0: "1e240", _1: (123456).toString(16) - })) + }) ], tl: { hd: [ "toStringWithRadix - radix:36", - (param => ({ + param => ({ TAG: "Eq", _0: "2n9c", _1: (123456).toString(36) - })) + }) ], tl: { hd: [ "toStringWithRadix - radix:37", - (param => ({ + param => ({ TAG: "ThrowAny", - _0: (() => { + _0: () => { (0).toString(37); - }) - })) + } + }) ], tl: { hd: [ "toStringWithRadix - radix:1", - (param => ({ + param => ({ TAG: "ThrowAny", - _0: (() => { + _0: () => { (0).toString(1); - }) - })) + } + }) ], tl: { hd: [ "toStringWithRadix - radix:-1", - (param => ({ + param => ({ TAG: "ThrowAny", - _0: (() => { + _0: () => { (0).toString(-1); - }) - })) + } + }) ], tl: /* [] */0 } diff --git a/jscomp/test/js_json_test.js b/jscomp/test/js_json_test.js index c62d11cdbcd..e9af1d1c3b4 100644 --- a/jscomp/test/js_json_test.js +++ b/jscomp/test/js_json_test.js @@ -31,30 +31,30 @@ function add_test(loc, test) { } function eq(loc, x, y) { - add_test(loc, (() => ({ + add_test(loc, () => ({ TAG: "Eq", _0: x, _1: y - }))); + })); } function false_(loc) { - add_test(loc, (() => ({ + add_test(loc, () => ({ TAG: "Ok", _0: false - }))); + })); } function true_(loc) { - add_test(loc, (() => ({ + add_test(loc, () => ({ TAG: "Ok", _0: true - }))); + })); } let v = JSON.parse(" { \"x\" : [1, 2, 3 ] } "); -add_test("File \"js_json_test.res\", line 22, characters 11-18", (() => { +add_test("File \"js_json_test.res\", line 22, characters 11-18", () => { let ty = Js_json.classify(v); if (typeof ty !== "object") { return { @@ -120,7 +120,7 @@ add_test("File \"js_json_test.res\", line 22, characters 11-18", (() => { TAG: "Ok", _0: true }; -})); +}); eq("File \"js_json_test.res\", line 48, characters 5-12", Js_json.test(v, "Object"), true); @@ -130,23 +130,23 @@ let ty = Js_json.classify(json); if (typeof ty !== "object") { if (ty === "JSONNull") { - add_test("File \"js_json_test.res\", line 55, characters 24-31", (() => ({ + add_test("File \"js_json_test.res\", line 55, characters 24-31", () => ({ TAG: "Ok", _0: true - }))); + })); } else { console.log(ty); - add_test("File \"js_json_test.res\", line 58, characters 11-18", (() => ({ + add_test("File \"js_json_test.res\", line 58, characters 11-18", () => ({ TAG: "Ok", _0: false - }))); + })); } } else { console.log(ty); - add_test("File \"js_json_test.res\", line 58, characters 11-18", (() => ({ + add_test("File \"js_json_test.res\", line 58, characters 11-18", () => ({ TAG: "Ok", _0: false - }))); + })); } let json$1 = JSON.parse(JSON.stringify("test string")); @@ -154,17 +154,17 @@ let json$1 = JSON.parse(JSON.stringify("test string")); let ty$1 = Js_json.classify(json$1); if (typeof ty$1 !== "object") { - add_test("File \"js_json_test.res\", line 68, characters 16-23", (() => ({ + add_test("File \"js_json_test.res\", line 68, characters 16-23", () => ({ TAG: "Ok", _0: false - }))); + })); } else if (ty$1.TAG === "JSONString") { eq("File \"js_json_test.res\", line 67, characters 26-33", ty$1._0, "test string"); } else { - add_test("File \"js_json_test.res\", line 68, characters 16-23", (() => ({ + add_test("File \"js_json_test.res\", line 68, characters 16-23", () => ({ TAG: "Ok", _0: false - }))); + })); } let json$2 = JSON.parse(JSON.stringify(1.23456789)); @@ -180,10 +180,10 @@ if (typeof ty$2 !== "object" || ty$2.TAG !== "JSONNumber") { } if (exit === 1) { - add_test("File \"js_json_test.res\", line 78, characters 18-25", (() => ({ + add_test("File \"js_json_test.res\", line 78, characters 18-25", () => ({ TAG: "Ok", _0: false - }))); + })); } let json$3 = JSON.parse(JSON.stringify(-1347440721)); @@ -199,20 +199,20 @@ if (typeof ty$3 !== "object" || ty$3.TAG !== "JSONNumber") { } if (exit$1 === 1) { - add_test("File \"js_json_test.res\", line 88, characters 18-25", (() => ({ + add_test("File \"js_json_test.res\", line 88, characters 18-25", () => ({ TAG: "Ok", _0: false - }))); + })); } function test(v) { let json = JSON.parse(JSON.stringify(v)); let ty = Js_json.classify(json); if (typeof ty === "object") { - return add_test("File \"js_json_test.res\", line 100, characters 18-25", (() => ({ + return add_test("File \"js_json_test.res\", line 100, characters 18-25", () => ({ TAG: "Ok", _0: false - }))); + })); } switch (ty) { case "JSONFalse" : @@ -220,10 +220,10 @@ function test(v) { case "JSONTrue" : return eq("File \"js_json_test.res\", line 98, characters 23-30", true, v); default: - return add_test("File \"js_json_test.res\", line 100, characters 18-25", (() => ({ + return add_test("File \"js_json_test.res\", line 100, characters 18-25", () => ({ TAG: "Ok", _0: false - }))); + })); } } @@ -258,136 +258,136 @@ let json$4 = JSON.parse(JSON.stringify(dict)); let ty$4 = Js_json.classify(json$4); if (typeof ty$4 !== "object") { - add_test("File \"js_json_test.res\", line 142, characters 16-23", (() => ({ + add_test("File \"js_json_test.res\", line 142, characters 16-23", () => ({ TAG: "Ok", _0: false - }))); + })); } else if (ty$4.TAG === "JSONObject") { let x = ty$4._0; let ta = Js_json.classify(option_get(Js_dict.get(x, "a"))); if (typeof ta !== "object") { - add_test("File \"js_json_test.res\", line 140, characters 18-25", (() => ({ + add_test("File \"js_json_test.res\", line 140, characters 18-25", () => ({ TAG: "Ok", _0: false - }))); + })); } else if (ta.TAG === "JSONString") { if (ta._0 !== "test string") { - add_test("File \"js_json_test.res\", line 131, characters 15-22", (() => ({ + add_test("File \"js_json_test.res\", line 131, characters 15-22", () => ({ TAG: "Ok", _0: false - }))); + })); } else { let ty$5 = Js_json.classify(option_get(Js_dict.get(x, "b"))); if (typeof ty$5 !== "object") { - add_test("File \"js_json_test.res\", line 137, characters 22-29", (() => ({ + add_test("File \"js_json_test.res\", line 137, characters 22-29", () => ({ TAG: "Ok", _0: false - }))); + })); } else if (ty$5.TAG === "JSONNumber") { let b = ty$5._0; - add_test("File \"js_json_test.res\", line 136, characters 38-45", (() => ({ + add_test("File \"js_json_test.res\", line 136, characters 38-45", () => ({ TAG: "Approx", _0: 123.0, _1: b - }))); + })); } else { - add_test("File \"js_json_test.res\", line 137, characters 22-29", (() => ({ + add_test("File \"js_json_test.res\", line 137, characters 22-29", () => ({ TAG: "Ok", _0: false - }))); + })); } } } else { - add_test("File \"js_json_test.res\", line 140, characters 18-25", (() => ({ + add_test("File \"js_json_test.res\", line 140, characters 18-25", () => ({ TAG: "Ok", _0: false - }))); + })); } } else { - add_test("File \"js_json_test.res\", line 142, characters 16-23", (() => ({ + add_test("File \"js_json_test.res\", line 142, characters 16-23", () => ({ TAG: "Ok", _0: false - }))); + })); } function eq_at_i(loc, json, i, kind, expected) { let ty = Js_json.classify(json); if (typeof ty !== "object") { - return add_test(loc, (() => ({ + return add_test(loc, () => ({ TAG: "Ok", _0: false - }))); + })); } if (ty.TAG !== "JSONArray") { - return add_test(loc, (() => ({ + return add_test(loc, () => ({ TAG: "Ok", _0: false - }))); + })); } let ty$1 = Js_json.classify(Caml_array.get(ty._0, i)); switch (kind) { case "String" : if (typeof ty$1 !== "object") { - return add_test(loc, (() => ({ + return add_test(loc, () => ({ TAG: "Ok", _0: false - }))); + })); } else if (ty$1.TAG === "JSONString") { return eq(loc, ty$1._0, expected); } else { - return add_test(loc, (() => ({ + return add_test(loc, () => ({ TAG: "Ok", _0: false - }))); + })); } case "Number" : if (typeof ty$1 !== "object") { - return add_test(loc, (() => ({ + return add_test(loc, () => ({ TAG: "Ok", _0: false - }))); + })); } else if (ty$1.TAG === "JSONNumber") { return eq(loc, ty$1._0, expected); } else { - return add_test(loc, (() => ({ + return add_test(loc, () => ({ TAG: "Ok", _0: false - }))); + })); } case "Object" : if (typeof ty$1 !== "object") { - return add_test(loc, (() => ({ + return add_test(loc, () => ({ TAG: "Ok", _0: false - }))); + })); } else if (ty$1.TAG === "JSONObject") { return eq(loc, ty$1._0, expected); } else { - return add_test(loc, (() => ({ + return add_test(loc, () => ({ TAG: "Ok", _0: false - }))); + })); } case "Array" : if (typeof ty$1 !== "object") { - return add_test(loc, (() => ({ + return add_test(loc, () => ({ TAG: "Ok", _0: false - }))); + })); } else if (ty$1.TAG === "JSONArray") { return eq(loc, ty$1._0, expected); } else { - return add_test(loc, (() => ({ + return add_test(loc, () => ({ TAG: "Ok", _0: false - }))); + })); } case "Boolean" : if (typeof ty$1 === "object") { - return add_test(loc, (() => ({ + return add_test(loc, () => ({ TAG: "Ok", _0: false - }))); + })); } switch (ty$1) { case "JSONFalse" : @@ -395,34 +395,34 @@ function eq_at_i(loc, json, i, kind, expected) { case "JSONTrue" : return eq(loc, true, expected); default: - return add_test(loc, (() => ({ + return add_test(loc, () => ({ TAG: "Ok", _0: false - }))); + })); } case "Null" : if (typeof ty$1 !== "object") { if (ty$1 === "JSONNull") { - return add_test(loc, (() => ({ + return add_test(loc, () => ({ TAG: "Ok", _0: true - }))); + })); } else { - return add_test(loc, (() => ({ + return add_test(loc, () => ({ TAG: "Ok", _0: false - }))); + })); } } else { - return add_test(loc, (() => ({ + return add_test(loc, () => ({ TAG: "Ok", _0: false - }))); + })); } } } -let json$5 = JSON.parse(JSON.stringify($$Array.map((prim => prim), [ +let json$5 = JSON.parse(JSON.stringify($$Array.map(prim => prim, [ "string 0", "string 1", "string 2" @@ -466,7 +466,7 @@ let a$1 = [ -268391749 ]; -let json$8 = JSON.parse(JSON.stringify($$Array.map((prim => prim), a$1))); +let json$8 = JSON.parse(JSON.stringify($$Array.map(prim => prim, a$1))); eq_at_i("File \"js_json_test.res\", line 230, characters 10-17", json$8, 0, "Number", Caml_array.get(a$1, 0)); @@ -505,56 +505,56 @@ let json$10 = JSON.parse(JSON.stringify(a$3)); let ty$6 = Js_json.classify(json$10); if (typeof ty$6 !== "object") { - add_test("File \"js_json_test.res\", line 271, characters 16-23", (() => ({ + add_test("File \"js_json_test.res\", line 271, characters 16-23", () => ({ TAG: "Ok", _0: false - }))); + })); } else if (ty$6.TAG === "JSONArray") { let ty$7 = Js_json.classify(Caml_array.get(ty$6._0, 1)); if (typeof ty$7 !== "object") { - add_test("File \"js_json_test.res\", line 269, characters 18-25", (() => ({ + add_test("File \"js_json_test.res\", line 269, characters 18-25", () => ({ TAG: "Ok", _0: false - }))); + })); } else if (ty$7.TAG === "JSONObject") { let ty$8 = Js_json.classify(option_get(Js_dict.get(ty$7._0, "a"))); if (typeof ty$8 !== "object") { - add_test("File \"js_json_test.res\", line 267, characters 20-27", (() => ({ + add_test("File \"js_json_test.res\", line 267, characters 20-27", () => ({ TAG: "Ok", _0: false - }))); + })); } else if (ty$8.TAG === "JSONString") { eq("File \"js_json_test.res\", line 266, characters 35-42", ty$8._0, "bbb"); } else { - add_test("File \"js_json_test.res\", line 267, characters 20-27", (() => ({ + add_test("File \"js_json_test.res\", line 267, characters 20-27", () => ({ TAG: "Ok", _0: false - }))); + })); } } else { - add_test("File \"js_json_test.res\", line 269, characters 18-25", (() => ({ + add_test("File \"js_json_test.res\", line 269, characters 18-25", () => ({ TAG: "Ok", _0: false - }))); + })); } } else { - add_test("File \"js_json_test.res\", line 271, characters 16-23", (() => ({ + add_test("File \"js_json_test.res\", line 271, characters 16-23", () => ({ TAG: "Ok", _0: false - }))); + })); } try { JSON.parse("{{ A}"); - add_test("File \"js_json_test.res\", line 279, characters 11-18", (() => ({ + add_test("File \"js_json_test.res\", line 279, characters 11-18", () => ({ TAG: "Ok", _0: false - }))); + })); } catch (exn) { - add_test("File \"js_json_test.res\", line 281, characters 17-24", (() => ({ + add_test("File \"js_json_test.res\", line 281, characters 17-24", () => ({ TAG: "Ok", _0: true - }))); + })); } eq("File \"js_json_test.res\", line 287, characters 12-19", JSON.stringify([ @@ -666,21 +666,21 @@ idtest({ tl: /* [] */0 }); -idtest(Belt_List.makeBy(500, (i => { +idtest(Belt_List.makeBy(500, i => { if (i % 2 === 0) { return; } else { return 1; } -}))); +})); -idtest(Belt_Array.makeBy(500, (i => { +idtest(Belt_Array.makeBy(500, i => { if (i % 2 === 0) { return; } else { return 1; } -}))); +})); Mt.from_pair_suites("Js_json_test", suites.contents); diff --git a/jscomp/test/js_math_test.js b/jscomp/test/js_math_test.js index 1175177c90f..fc2059ea26d 100644 --- a/jscomp/test/js_math_test.js +++ b/jscomp/test/js_math_test.js @@ -6,559 +6,559 @@ let Js_math = require("../../lib/js/js_math.js"); let suites_0 = [ "_E", - (param => ({ + param => ({ TAG: "ApproxThreshold", _0: 0.001, _1: 2.718, _2: Math.E - })) + }) ]; let suites_1 = { hd: [ "_LN2", - (param => ({ + param => ({ TAG: "ApproxThreshold", _0: 0.001, _1: 0.693, _2: Math.LN2 - })) + }) ], tl: { hd: [ "_LN10", - (param => ({ + param => ({ TAG: "ApproxThreshold", _0: 0.001, _1: 2.303, _2: Math.LN10 - })) + }) ], tl: { hd: [ "_LOG2E", - (param => ({ + param => ({ TAG: "ApproxThreshold", _0: 0.001, _1: 1.443, _2: Math.LOG2E - })) + }) ], tl: { hd: [ "_LOG10E", - (param => ({ + param => ({ TAG: "ApproxThreshold", _0: 0.001, _1: 0.434, _2: Math.LOG10E - })) + }) ], tl: { hd: [ "_PI", - (param => ({ + param => ({ TAG: "ApproxThreshold", _0: 0.00001, _1: 3.14159, _2: Math.PI - })) + }) ], tl: { hd: [ "_SQRT1_2", - (param => ({ + param => ({ TAG: "ApproxThreshold", _0: 0.001, _1: 0.707, _2: Math.SQRT1_2 - })) + }) ], tl: { hd: [ "_SQRT2", - (param => ({ + param => ({ TAG: "ApproxThreshold", _0: 0.001, _1: 1.414, _2: Math.SQRT2 - })) + }) ], tl: { hd: [ "abs_int", - (param => ({ + param => ({ TAG: "Eq", _0: 4, _1: Math.abs(-4) - })) + }) ], tl: { hd: [ "abs_float", - (param => ({ + param => ({ TAG: "Eq", _0: 1.2, _1: Math.abs(-1.2) - })) + }) ], tl: { hd: [ "acos", - (param => ({ + param => ({ TAG: "ApproxThreshold", _0: 0.001, _1: 1.159, _2: Math.acos(0.4) - })) + }) ], tl: { hd: [ "acosh", - (param => ({ + param => ({ TAG: "ApproxThreshold", _0: 0.001, _1: 0.622, _2: Math.acosh(1.2) - })) + }) ], tl: { hd: [ "asin", - (param => ({ + param => ({ TAG: "ApproxThreshold", _0: 0.001, _1: 0.411, _2: Math.asin(0.4) - })) + }) ], tl: { hd: [ "asinh", - (param => ({ + param => ({ TAG: "ApproxThreshold", _0: 0.001, _1: 0.390, _2: Math.asinh(0.4) - })) + }) ], tl: { hd: [ "atan", - (param => ({ + param => ({ TAG: "ApproxThreshold", _0: 0.001, _1: 0.380, _2: Math.atan(0.4) - })) + }) ], tl: { hd: [ "atanh", - (param => ({ + param => ({ TAG: "ApproxThreshold", _0: 0.001, _1: 0.423, _2: Math.atanh(0.4) - })) + }) ], tl: { hd: [ "atan2", - (param => ({ + param => ({ TAG: "ApproxThreshold", _0: 0.001, _1: 0.588, _2: Math.atan2(0.4, 0.6) - })) + }) ], tl: { hd: [ "cbrt", - (param => ({ + param => ({ TAG: "Eq", _0: 2, _1: Math.cbrt(8) - })) + }) ], tl: { hd: [ "unsafe_ceil_int", - (param => ({ + param => ({ TAG: "Eq", _0: 4, _1: Math.ceil(3.2) - })) + }) ], tl: { hd: [ "ceil_int", - (param => ({ + param => ({ TAG: "Eq", _0: 4, _1: Js_math.ceil_int(3.2) - })) + }) ], tl: { hd: [ "ceil_float", - (param => ({ + param => ({ TAG: "Eq", _0: 4, _1: Math.ceil(3.2) - })) + }) ], tl: { hd: [ "cos", - (param => ({ + param => ({ TAG: "ApproxThreshold", _0: 0.001, _1: 0.921, _2: Math.cos(0.4) - })) + }) ], tl: { hd: [ "cosh", - (param => ({ + param => ({ TAG: "ApproxThreshold", _0: 0.001, _1: 1.081, _2: Math.cosh(0.4) - })) + }) ], tl: { hd: [ "exp", - (param => ({ + param => ({ TAG: "ApproxThreshold", _0: 0.001, _1: 1.491, _2: Math.exp(0.4) - })) + }) ], tl: { hd: [ "expm1", - (param => ({ + param => ({ TAG: "ApproxThreshold", _0: 0.001, _1: 0.491, _2: Math.expm1(0.4) - })) + }) ], tl: { hd: [ "unsafe_floor_int", - (param => ({ + param => ({ TAG: "Eq", _0: 3, _1: Math.floor(3.2) - })) + }) ], tl: { hd: [ "floor_int", - (param => ({ + param => ({ TAG: "Eq", _0: 3, _1: Js_math.floor_int(3.2) - })) + }) ], tl: { hd: [ "floor_float", - (param => ({ + param => ({ TAG: "Eq", _0: 3, _1: Math.floor(3.2) - })) + }) ], tl: { hd: [ "fround", - (param => ({ + param => ({ TAG: "Approx", _0: 3.2, _1: Math.fround(3.2) - })) + }) ], tl: { hd: [ "hypot", - (param => ({ + param => ({ TAG: "ApproxThreshold", _0: 0.001, _1: 0.721, _2: Math.hypot(0.4, 0.6) - })) + }) ], tl: { hd: [ "hypotMany", - (param => ({ + param => ({ TAG: "ApproxThreshold", _0: 0.001, _1: 1.077, _2: Math.hypot(0.4, 0.6, 0.8) - })) + }) ], tl: { hd: [ "imul", - (param => ({ + param => ({ TAG: "Eq", _0: 8, _1: Math.imul(4, 2) - })) + }) ], tl: { hd: [ "log", - (param => ({ + param => ({ TAG: "ApproxThreshold", _0: 0.001, _1: -0.916, _2: Math.log(0.4) - })) + }) ], tl: { hd: [ "log1p", - (param => ({ + param => ({ TAG: "ApproxThreshold", _0: 0.001, _1: 0.336, _2: Math.log1p(0.4) - })) + }) ], tl: { hd: [ "log10", - (param => ({ + param => ({ TAG: "ApproxThreshold", _0: 0.001, _1: -0.397, _2: Math.log10(0.4) - })) + }) ], tl: { hd: [ "log2", - (param => ({ + param => ({ TAG: "ApproxThreshold", _0: 0.001, _1: -1.321, _2: Math.log2(0.4) - })) + }) ], tl: { hd: [ "max_int", - (param => ({ + param => ({ TAG: "Eq", _0: 4, _1: Math.max(2, 4) - })) + }) ], tl: { hd: [ "maxMany_int", - (param => ({ + param => ({ TAG: "Eq", _0: 4, _1: Math.max(2, 4, 3) - })) + }) ], tl: { hd: [ "max_float", - (param => ({ + param => ({ TAG: "Eq", _0: 4.2, _1: Math.max(2.7, 4.2) - })) + }) ], tl: { hd: [ "maxMany_float", - (param => ({ + param => ({ TAG: "Eq", _0: 4.2, _1: Math.max(2.7, 4.2, 3.9) - })) + }) ], tl: { hd: [ "min_int", - (param => ({ + param => ({ TAG: "Eq", _0: 2, _1: Math.min(2, 4) - })) + }) ], tl: { hd: [ "minMany_int", - (param => ({ + param => ({ TAG: "Eq", _0: 2, _1: Math.min(2, 4, 3) - })) + }) ], tl: { hd: [ "min_float", - (param => ({ + param => ({ TAG: "Eq", _0: 2.7, _1: Math.min(2.7, 4.2) - })) + }) ], tl: { hd: [ "minMany_float", - (param => ({ + param => ({ TAG: "Eq", _0: 2.7, _1: Math.min(2.7, 4.2, 3.9) - })) + }) ], tl: { hd: [ "random", - (param => { + param => { let a = Math.random(); return { TAG: "Ok", _0: a >= 0 && a < 1 }; - }) + } ], tl: { hd: [ "random_int", - (param => { + param => { let a = Js_math.random_int(1, 3); return { TAG: "Ok", _0: a >= 1 && a < 3 }; - }) + } ], tl: { hd: [ "unsafe_round", - (param => ({ + param => ({ TAG: "Eq", _0: 3, _1: Math.round(3.2) - })) + }) ], tl: { hd: [ "round", - (param => ({ + param => ({ TAG: "Eq", _0: 3, _1: Math.round(3.2) - })) + }) ], tl: { hd: [ "sign_int", - (param => ({ + param => ({ TAG: "Eq", _0: -1, _1: Math.sign(-4) - })) + }) ], tl: { hd: [ "sign_float", - (param => ({ + param => ({ TAG: "Eq", _0: -1, _1: Math.sign(-4.2) - })) + }) ], tl: { hd: [ "sign_float -0", - (param => ({ + param => ({ TAG: "Eq", _0: -0, _1: Math.sign(-0) - })) + }) ], tl: { hd: [ "sin", - (param => ({ + param => ({ TAG: "ApproxThreshold", _0: 0.001, _1: 0.389, _2: Math.sin(0.4) - })) + }) ], tl: { hd: [ "sinh", - (param => ({ + param => ({ TAG: "ApproxThreshold", _0: 0.001, _1: 0.410, _2: Math.sinh(0.4) - })) + }) ], tl: { hd: [ "sqrt", - (param => ({ + param => ({ TAG: "ApproxThreshold", _0: 0.001, _1: 0.632, _2: Math.sqrt(0.4) - })) + }) ], tl: { hd: [ "tan", - (param => ({ + param => ({ TAG: "ApproxThreshold", _0: 0.001, _1: 0.422, _2: Math.tan(0.4) - })) + }) ], tl: { hd: [ "tanh", - (param => ({ + param => ({ TAG: "ApproxThreshold", _0: 0.001, _1: 0.379, _2: Math.tanh(0.4) - })) + }) ], tl: { hd: [ "unsafe_trunc", - (param => ({ + param => ({ TAG: "Eq", _0: 4, _1: Math.trunc(4.2156) - })) + }) ], tl: { hd: [ "trunc", - (param => ({ + param => ({ TAG: "Eq", _0: 4, _1: Math.trunc(4.2156) - })) + }) ], tl: /* [] */0 } diff --git a/jscomp/test/js_null_test.js b/jscomp/test/js_null_test.js index 67c77af53d0..abcceec261c 100644 --- a/jscomp/test/js_null_test.js +++ b/jscomp/test/js_null_test.js @@ -7,118 +7,118 @@ let Caml_option = require("../../lib/js/caml_option.js"); let suites_0 = [ "toOption - empty", - (param => ({ + param => ({ TAG: "Eq", _0: undefined, _1: undefined - })) + }) ]; let suites_1 = { hd: [ "toOption - 'a", - (param => ({ + param => ({ TAG: "Eq", _0: Caml_option.some(undefined), _1: Caml_option.some() - })) + }) ], tl: { hd: [ "return", - (param => ({ + param => ({ TAG: "Eq", _0: "something", _1: Caml_option.null_to_opt("something") - })) + }) ], tl: { hd: [ "test - empty", - (param => ({ + param => ({ TAG: "Eq", _0: true, _1: true - })) + }) ], tl: { hd: [ "test - 'a", - (param => ({ + param => ({ TAG: "Eq", _0: false, _1: false - })) + }) ], tl: { hd: [ "bind - empty", - (param => ({ + param => ({ TAG: "StrictEq", _0: null, - _1: Js_null.bind(null, (v => v)) - })) + _1: Js_null.bind(null, v => v) + }) ], tl: { hd: [ "bind - 'a", - (param => ({ + param => ({ TAG: "StrictEq", _0: 4, - _1: Js_null.bind(2, (n => (n << 1))) - })) + _1: Js_null.bind(2, n => (n << 1)) + }) ], tl: { hd: [ "iter - empty", - (param => { + param => { let hit = { contents: false }; - Js_null.iter(null, (param => { + Js_null.iter(null, param => { hit.contents = true; - })); + }); return { TAG: "Eq", _0: false, _1: hit.contents }; - }) + } ], tl: { hd: [ "iter - 'a", - (param => { + param => { let hit = { contents: 0 }; - Js_null.iter(2, (v => { + Js_null.iter(2, v => { hit.contents = v; - })); + }); return { TAG: "Eq", _0: 2, _1: hit.contents }; - }) + } ], tl: { hd: [ "fromOption - None", - (param => ({ + param => ({ TAG: "Eq", _0: null, _1: Js_null.fromOption(undefined) - })) + }) ], tl: { hd: [ "fromOption - Some", - (param => ({ + param => ({ TAG: "Eq", _0: 2, _1: Js_null.fromOption(2) - })) + }) ], tl: /* [] */0 } diff --git a/jscomp/test/js_null_undefined_test.js b/jscomp/test/js_null_undefined_test.js index 86aac9f8163..b57628e898c 100644 --- a/jscomp/test/js_null_undefined_test.js +++ b/jscomp/test/js_null_undefined_test.js @@ -7,238 +7,238 @@ let Js_null_undefined = require("../../lib/js/js_null_undefined.js"); let suites_0 = [ "toOption - null", - (param => ({ + param => ({ TAG: "Eq", _0: undefined, _1: undefined - })) + }) ]; let suites_1 = { hd: [ "toOption - undefined", - (param => ({ + param => ({ TAG: "Eq", _0: undefined, _1: undefined - })) + }) ], tl: { hd: [ "toOption - empty", - (param => ({ + param => ({ TAG: "Eq", _0: undefined, _1: undefined - })) + }) ], tl: { hd: [ "File \"js_null_undefined_test.res\", line 9, characters 5-12", - (param => ({ + param => ({ TAG: "Eq", _0: "foo", _1: Caml_option.nullable_to_opt("foo") - })) + }) ], tl: { hd: [ "return", - (param => ({ + param => ({ TAG: "Eq", _0: "something", _1: Caml_option.nullable_to_opt("something") - })) + }) ], tl: { hd: [ "test - null", - (param => ({ + param => ({ TAG: "Eq", _0: true, _1: true - })) + }) ], tl: { hd: [ "test - undefined", - (param => ({ + param => ({ TAG: "Eq", _0: true, _1: true - })) + }) ], tl: { hd: [ "test - empty", - (param => ({ + param => ({ TAG: "Eq", _0: true, _1: true - })) + }) ], tl: { hd: [ "File \"js_null_undefined_test.res\", line 14, characters 5-12", - (param => ({ + param => ({ TAG: "Eq", _0: true, _1: true - })) + }) ], tl: { hd: [ "bind - null", - (param => ({ + param => ({ TAG: "StrictEq", _0: null, - _1: Js_null_undefined.bind(null, (v => v)) - })) + _1: Js_null_undefined.bind(null, v => v) + }) ], tl: { hd: [ "bind - undefined", - (param => ({ + param => ({ TAG: "StrictEq", _0: undefined, - _1: Js_null_undefined.bind(undefined, (v => v)) - })) + _1: Js_null_undefined.bind(undefined, v => v) + }) ], tl: { hd: [ "bind - empty", - (param => ({ + param => ({ TAG: "StrictEq", _0: undefined, - _1: Js_null_undefined.bind(undefined, (v => v)) - })) + _1: Js_null_undefined.bind(undefined, v => v) + }) ], tl: { hd: [ "bind - 'a", - (param => ({ + param => ({ TAG: "Eq", _0: 4, - _1: Js_null_undefined.bind(2, (n => (n << 1))) - })) + _1: Js_null_undefined.bind(2, n => (n << 1)) + }) ], tl: { hd: [ "iter - null", - (param => { + param => { let hit = { contents: false }; - Js_null_undefined.iter(null, (param => { + Js_null_undefined.iter(null, param => { hit.contents = true; - })); + }); return { TAG: "Eq", _0: false, _1: hit.contents }; - }) + } ], tl: { hd: [ "iter - undefined", - (param => { + param => { let hit = { contents: false }; - Js_null_undefined.iter(undefined, (param => { + Js_null_undefined.iter(undefined, param => { hit.contents = true; - })); + }); return { TAG: "Eq", _0: false, _1: hit.contents }; - }) + } ], tl: { hd: [ "iter - empty", - (param => { + param => { let hit = { contents: false }; - Js_null_undefined.iter(undefined, (param => { + Js_null_undefined.iter(undefined, param => { hit.contents = true; - })); + }); return { TAG: "Eq", _0: false, _1: hit.contents }; - }) + } ], tl: { hd: [ "iter - 'a", - (param => { + param => { let hit = { contents: 0 }; - Js_null_undefined.iter(2, (v => { + Js_null_undefined.iter(2, v => { hit.contents = v; - })); + }); return { TAG: "Eq", _0: 2, _1: hit.contents }; - }) + } ], tl: { hd: [ "fromOption - None", - (param => ({ + param => ({ TAG: "Eq", _0: undefined, _1: Js_null_undefined.fromOption(undefined) - })) + }) ], tl: { hd: [ "fromOption - Some", - (param => ({ + param => ({ TAG: "Eq", _0: 2, _1: Js_null_undefined.fromOption(2) - })) + }) ], tl: { hd: [ "null <> undefined", - (param => ({ + param => ({ TAG: "Ok", _0: true - })) + }) ], tl: { hd: [ "null <> empty", - (param => ({ + param => ({ TAG: "Ok", _0: true - })) + }) ], tl: { hd: [ "undefined = empty", - (param => ({ + param => ({ TAG: "Ok", _0: true - })) + }) ], tl: { hd: [ "File \"js_null_undefined_test.res\", line 57, characters 6-13", - (param => ({ + param => ({ TAG: "Ok", _0: true - })) + }) ], tl: /* [] */0 } diff --git a/jscomp/test/js_nullable_test.js b/jscomp/test/js_nullable_test.js index 44766475b45..15f396e8626 100644 --- a/jscomp/test/js_nullable_test.js +++ b/jscomp/test/js_nullable_test.js @@ -16,11 +16,11 @@ function eq(loc, x, y) { suites.contents = { hd: [ loc + (" id " + String(test_id.contents)), - (() => ({ + () => ({ TAG: "Eq", _0: x, _1: y - })) + }) ], tl: suites.contents }; diff --git a/jscomp/test/js_obj_test.js b/jscomp/test/js_obj_test.js index 4c2f77c269b..b39bb04e023 100644 --- a/jscomp/test/js_obj_test.js +++ b/jscomp/test/js_obj_test.js @@ -5,17 +5,17 @@ let Mt = require("./mt.js"); let suites_0 = [ "empty", - (param => ({ + param => ({ TAG: "Eq", _0: 0, _1: Object.keys({}).length - })) + }) ]; let suites_1 = { hd: [ "assign", - (param => ({ + param => ({ TAG: "Eq", _0: { a: 1 @@ -23,7 +23,7 @@ let suites_1 = { _1: Object.assign({}, { a: 1 }) - })) + }) ], tl: /* [] */0 }; diff --git a/jscomp/test/js_option_test.js b/jscomp/test/js_option_test.js index 6d242f5aaec..c1052a0514a 100644 --- a/jscomp/test/js_option_test.js +++ b/jscomp/test/js_option_test.js @@ -10,210 +10,210 @@ function simpleEq(a, b) { let option_suites_0 = [ "option_isSome_Some", - (param => ({ + param => ({ TAG: "Eq", _0: true, _1: true - })) + }) ]; let option_suites_1 = { hd: [ "option_isSome_None", - (param => ({ + param => ({ TAG: "Eq", _0: false, _1: false - })) + }) ], tl: { hd: [ "option_isNone_Some", - (param => ({ + param => ({ TAG: "Eq", _0: false, _1: false - })) + }) ], tl: { hd: [ "option_isNone_None", - (param => ({ + param => ({ TAG: "Eq", _0: true, _1: true - })) + }) ], tl: { hd: [ "option_isSomeValue_Eq", - (param => ({ + param => ({ TAG: "Eq", _0: true, _1: Js_option.isSomeValue(simpleEq, 2, 2) - })) + }) ], tl: { hd: [ "option_isSomeValue_Diff", - (param => ({ + param => ({ TAG: "Eq", _0: false, _1: Js_option.isSomeValue(simpleEq, 1, 2) - })) + }) ], tl: { hd: [ "option_isSomeValue_DiffNone", - (param => ({ + param => ({ TAG: "Eq", _0: false, _1: Js_option.isSomeValue(simpleEq, 1, undefined) - })) + }) ], tl: { hd: [ "option_getExn_Some", - (param => ({ + param => ({ TAG: "Eq", _0: 2, _1: Js_option.getExn(2) - })) + }) ], tl: { hd: [ "option_equal_Eq", - (param => ({ + param => ({ TAG: "Eq", _0: true, _1: Js_option.equal(simpleEq, 2, 2) - })) + }) ], tl: { hd: [ "option_equal_Diff", - (param => ({ + param => ({ TAG: "Eq", _0: false, _1: Js_option.equal(simpleEq, 1, 2) - })) + }) ], tl: { hd: [ "option_equal_DiffNone", - (param => ({ + param => ({ TAG: "Eq", _0: false, _1: Js_option.equal(simpleEq, 1, undefined) - })) + }) ], tl: { hd: [ "option_andThen_SomeSome", - (param => ({ + param => ({ TAG: "Eq", _0: true, - _1: Js_option.isSomeValue(simpleEq, 3, Js_option.andThen((a => a + 1 | 0), 2)) - })) + _1: Js_option.isSomeValue(simpleEq, 3, Js_option.andThen(a => a + 1 | 0, 2)) + }) ], tl: { hd: [ "option_andThen_SomeNone", - (param => ({ + param => ({ TAG: "Eq", _0: false, - _1: Js_option.isSomeValue(simpleEq, 3, Js_option.andThen((param => {}), 2)) - })) + _1: Js_option.isSomeValue(simpleEq, 3, Js_option.andThen(param => {}, 2)) + }) ], tl: { hd: [ "option_map_Some", - (param => ({ + param => ({ TAG: "Eq", _0: true, - _1: Js_option.isSomeValue(simpleEq, 3, Js_option.map((a => a + 1 | 0), 2)) - })) + _1: Js_option.isSomeValue(simpleEq, 3, Js_option.map(a => a + 1 | 0, 2)) + }) ], tl: { hd: [ "option_map_None", - (param => ({ + param => ({ TAG: "Eq", _0: undefined, - _1: Js_option.map((a => a + 1 | 0), undefined) - })) + _1: Js_option.map(a => a + 1 | 0, undefined) + }) ], tl: { hd: [ "option_default_Some", - (param => ({ + param => ({ TAG: "Eq", _0: 2, _1: Js_option.getWithDefault(3, 2) - })) + }) ], tl: { hd: [ "option_default_None", - (param => ({ + param => ({ TAG: "Eq", _0: 3, _1: Js_option.getWithDefault(3, undefined) - })) + }) ], tl: { hd: [ "option_filter_Pass", - (param => ({ + param => ({ TAG: "Eq", _0: true, - _1: Js_option.isSomeValue(simpleEq, 2, Js_option.filter((a => a % 2 === 0), 2)) - })) + _1: Js_option.isSomeValue(simpleEq, 2, Js_option.filter(a => a % 2 === 0, 2)) + }) ], tl: { hd: [ "option_filter_Reject", - (param => ({ + param => ({ TAG: "Eq", _0: undefined, - _1: Js_option.filter((a => a % 3 === 0), 2) - })) + _1: Js_option.filter(a => a % 3 === 0, 2) + }) ], tl: { hd: [ "option_filter_None", - (param => ({ + param => ({ TAG: "Eq", _0: undefined, - _1: Js_option.filter((a => a % 3 === 0), undefined) - })) + _1: Js_option.filter(a => a % 3 === 0, undefined) + }) ], tl: { hd: [ "option_firstSome_First", - (param => ({ + param => ({ TAG: "Eq", _0: true, _1: Js_option.isSomeValue(simpleEq, 3, Js_option.firstSome(3, 2)) - })) + }) ], tl: { hd: [ "option_firstSome_First", - (param => ({ + param => ({ TAG: "Eq", _0: true, _1: Js_option.isSomeValue(simpleEq, 2, Js_option.firstSome(undefined, 2)) - })) + }) ], tl: { hd: [ "option_firstSome_None", - (param => ({ + param => ({ TAG: "Eq", _0: undefined, _1: Js_option.firstSome(undefined, undefined) - })) + }) ], tl: /* [] */0 } diff --git a/jscomp/test/js_re_test.js b/jscomp/test/js_re_test.js index 836a53cddea..2fdc4f2d080 100644 --- a/jscomp/test/js_re_test.js +++ b/jscomp/test/js_re_test.js @@ -7,7 +7,7 @@ let Caml_option = require("../../lib/js/caml_option.js"); let suites_0 = [ "captures", - (param => { + param => { let re = /(\d+)-(?:(\d+))?/g; let result = re.exec("3-"); if (result === null) { @@ -29,13 +29,13 @@ let suites_0 = [ $$undefined ] }; - }) + } ]; let suites_1 = { hd: [ "fromString", - (param => { + param => { let contentOf = (tag, xmlString) => { let x = Caml_option.null_to_opt(new RegExp("<" + (tag + (">(.*?)<\\/" + (tag + ">")))).exec(xmlString)); if (x !== undefined) { @@ -48,12 +48,12 @@ let suites_1 = { _0: contentOf("div", "
Hi
"), _1: "Hi" }; - }) + } ], tl: { hd: [ "exec_literal", - (param => { + param => { let res = /[^.]+/.exec("http://xxx.domain.com"); if (res !== null) { return { @@ -67,12 +67,12 @@ let suites_1 = { _0: "regex should match" }; } - }) + } ], tl: { hd: [ "exec_no_match", - (param => { + param => { let match = /https:\/\/(.*)/.exec("http://xxx.domain.com"); if (match !== null) { return { @@ -85,36 +85,36 @@ let suites_1 = { _0: true }; } - }) + } ], tl: { hd: [ "test_str", - (param => { + param => { let res = new RegExp("foo").test("#foo#"); return { TAG: "Eq", _0: true, _1: res }; - }) + } ], tl: { hd: [ "fromStringWithFlags", - (param => { + param => { let res = new RegExp("foo", "g"); return { TAG: "Eq", _0: true, _1: res.global }; - }) + } ], tl: { hd: [ "result_index", - (param => { + param => { let res = new RegExp("zbar").exec("foobarbazbar"); if (res !== null) { return { @@ -128,12 +128,12 @@ let suites_1 = { _0: undefined }; } - }) + } ], tl: { hd: [ "result_input", - (param => { + param => { let input = "foobar"; let res = /foo/g.exec(input); if (res !== null) { @@ -148,39 +148,39 @@ let suites_1 = { _0: undefined }; } - }) + } ], tl: { hd: [ "t_flags", - (param => ({ + param => ({ TAG: "Eq", _0: "gi", _1: /./ig.flags - })) + }) ], tl: { hd: [ "t_global", - (param => ({ + param => ({ TAG: "Eq", _0: true, _1: /./ig.global - })) + }) ], tl: { hd: [ "t_ignoreCase", - (param => ({ + param => ({ TAG: "Eq", _0: true, _1: /./ig.ignoreCase - })) + }) ], tl: { hd: [ "t_lastIndex", - (param => { + param => { let re = /na/g; re.exec("banana"); return { @@ -188,12 +188,12 @@ let suites_1 = { _0: 4, _1: re.lastIndex }; - }) + } ], tl: { hd: [ "t_setLastIndex", - (param => { + param => { let re = /na/g; let before = re.lastIndex; re.lastIndex = 42; @@ -209,43 +209,43 @@ let suites_1 = { after ] }; - }) + } ], tl: { hd: [ "t_multiline", - (param => ({ + param => ({ TAG: "Eq", _0: false, _1: /./ig.multiline - })) + }) ], tl: { hd: [ "t_source", - (param => ({ + param => ({ TAG: "Eq", _0: "f.+o", _1: /f.+o/ig.source - })) + }) ], tl: { hd: [ "t_sticky", - (param => ({ + param => ({ TAG: "Eq", _0: true, _1: /./yg.sticky - })) + }) ], tl: { hd: [ "t_unicode", - (param => ({ + param => ({ TAG: "Eq", _0: false, _1: /./yg.unicode - })) + }) ], tl: /* [] */0 } diff --git a/jscomp/test/js_string_test.js b/jscomp/test/js_string_test.js index 4b6b9d69983..47a498aedef 100644 --- a/jscomp/test/js_string_test.js +++ b/jscomp/test/js_string_test.js @@ -7,284 +7,284 @@ let Caml_option = require("../../lib/js/caml_option.js"); let suites_0 = [ "make", - (param => ({ + param => ({ TAG: "Eq", _0: "null", _1: String(null).concat("") - })) + }) ]; let suites_1 = { hd: [ "fromCharCode", - (param => ({ + param => ({ TAG: "Eq", _0: "a", _1: String.fromCharCode(97) - })) + }) ], tl: { hd: [ "fromCharCodeMany", - (param => ({ + param => ({ TAG: "Eq", _0: "az", _1: String.fromCharCode(97, 122) - })) + }) ], tl: { hd: [ "fromCodePoint", - (param => ({ + param => ({ TAG: "Eq", _0: "a", _1: String.fromCodePoint(97) - })) + }) ], tl: { hd: [ "fromCodePointMany", - (param => ({ + param => ({ TAG: "Eq", _0: "az", _1: String.fromCodePoint(97, 122) - })) + }) ], tl: { hd: [ "length", - (param => ({ + param => ({ TAG: "Eq", _0: 3, _1: "foo".length - })) + }) ], tl: { hd: [ "get", - (param => ({ + param => ({ TAG: "Eq", _0: "a", _1: "foobar"[4] - })) + }) ], tl: { hd: [ "charAt", - (param => ({ + param => ({ TAG: "Eq", _0: "a", _1: "foobar".charAt(4) - })) + }) ], tl: { hd: [ "charCodeAt", - (param => ({ + param => ({ TAG: "Eq", _0: 97, _1: "foobar".charCodeAt(4) - })) + }) ], tl: { hd: [ "codePointAt", - (param => ({ + param => ({ TAG: "Eq", _0: 97, _1: "foobar".codePointAt(4) - })) + }) ], tl: { hd: [ "codePointAt - out of bounds", - (param => ({ + param => ({ TAG: "Eq", _0: undefined, _1: "foobar".codePointAt(98) - })) + }) ], tl: { hd: [ "concat", - (param => ({ + param => ({ TAG: "Eq", _0: "foobar", _1: "foo".concat("bar") - })) + }) ], tl: { hd: [ "concatMany", - (param => ({ + param => ({ TAG: "Eq", _0: "foobarbaz", _1: "foo".concat("bar", "baz") - })) + }) ], tl: { hd: [ "endsWith", - (param => ({ + param => ({ TAG: "Eq", _0: true, _1: "foobar".endsWith("bar") - })) + }) ], tl: { hd: [ "endsWithFrom", - (param => ({ + param => ({ TAG: "Eq", _0: false, _1: "foobar".endsWith("bar", 1) - })) + }) ], tl: { hd: [ "includes", - (param => ({ + param => ({ TAG: "Eq", _0: true, _1: "foobarbaz".includes("bar") - })) + }) ], tl: { hd: [ "includesFrom", - (param => ({ + param => ({ TAG: "Eq", _0: false, _1: "foobarbaz".includes("bar", 4) - })) + }) ], tl: { hd: [ "indexOf", - (param => ({ + param => ({ TAG: "Eq", _0: 3, _1: "foobarbaz".indexOf("bar") - })) + }) ], tl: { hd: [ "indexOfFrom", - (param => ({ + param => ({ TAG: "Eq", _0: -1, _1: "foobarbaz".indexOf("bar", 4) - })) + }) ], tl: { hd: [ "lastIndexOf", - (param => ({ + param => ({ TAG: "Eq", _0: 3, _1: "foobarbaz".lastIndexOf("bar") - })) + }) ], tl: { hd: [ "lastIndexOfFrom", - (param => ({ + param => ({ TAG: "Eq", _0: 3, _1: "foobarbaz".lastIndexOf("bar", 4) - })) + }) ], tl: { hd: [ "localeCompare", - (param => ({ + param => ({ TAG: "Eq", _0: 0, _1: "foo".localeCompare("foo") - })) + }) ], tl: { hd: [ "match", - (param => ({ + param => ({ TAG: "Eq", _0: [ "na", "na" ], _1: Caml_option.null_to_opt("banana".match(/na+/g)) - })) + }) ], tl: { hd: [ "match - no match", - (param => ({ + param => ({ TAG: "Eq", _0: undefined, _1: Caml_option.null_to_opt("banana".match(/nanana+/g)) - })) + }) ], tl: { hd: [ "match - not found capture groups", - (param => ({ + param => ({ TAG: "Eq", _0: [ "hello ", undefined ], - _1: Belt_Option.map(Caml_option.null_to_opt("hello word".match(/hello (world)?/)), (prim => prim.slice())) - })) + _1: Belt_Option.map(Caml_option.null_to_opt("hello word".match(/hello (world)?/)), prim => prim.slice()) + }) ], tl: { hd: [ "normalize", - (param => ({ + param => ({ TAG: "Eq", _0: "foo", _1: "foo".normalize() - })) + }) ], tl: { hd: [ "normalizeByForm", - (param => ({ + param => ({ TAG: "Eq", _0: "foo", _1: "foo".normalize("NFKD") - })) + }) ], tl: { hd: [ "repeat", - (param => ({ + param => ({ TAG: "Eq", _0: "foofoofoo", _1: "foo".repeat(3) - })) + }) ], tl: { hd: [ "replace", - (param => ({ + param => ({ TAG: "Eq", _0: "fooBORKbaz", _1: "foobarbaz".replace("bar", "BORK") - })) + }) ], tl: { hd: [ "replaceByRe", - (param => ({ + param => ({ TAG: "Eq", _0: "fooBORKBORK", _1: "foobarbaz".replace(/ba./g, "BORK") - })) + }) ], tl: { hd: [ "unsafeReplaceBy0", - (param => { + param => { let replace = (whole, offset, s) => { if (whole === "bar") { return "BORK"; @@ -297,12 +297,12 @@ let suites_1 = { _0: "fooBORKDORK", _1: "foobarbaz".replace(/ba./g, replace) }; - }) + } ], tl: { hd: [ "unsafeReplaceBy1", - (param => { + param => { let replace = (whole, p1, offset, s) => { if (whole === "bar") { return "BORK"; @@ -315,12 +315,12 @@ let suites_1 = { _0: "fooBORKDORK", _1: "foobarbaz".replace(/ba./g, replace) }; - }) + } ], tl: { hd: [ "unsafeReplaceBy2", - (param => { + param => { let replace = (whole, p1, p2, offset, s) => { if (whole === "bar") { return "BORK"; @@ -333,12 +333,12 @@ let suites_1 = { _0: "fooBORKDORK", _1: "foobarbaz".replace(/ba./g, replace) }; - }) + } ], tl: { hd: [ "unsafeReplaceBy3", - (param => { + param => { let replace = (whole, p1, p2, p3, offset, s) => { if (whole === "bar") { return "BORK"; @@ -351,39 +351,39 @@ let suites_1 = { _0: "fooBORKDORK", _1: "foobarbaz".replace(/ba./g, replace) }; - }) + } ], tl: { hd: [ "search", - (param => ({ + param => ({ TAG: "Eq", _0: 3, _1: "foobarbaz".search(/ba./g) - })) + }) ], tl: { hd: [ "slice", - (param => ({ + param => ({ TAG: "Eq", _0: "bar", _1: "foobarbaz".slice(3, 6) - })) + }) ], tl: { hd: [ "sliceToEnd", - (param => ({ + param => ({ TAG: "Eq", _0: "barbaz", _1: "foobarbaz".slice(3) - })) + }) ], tl: { hd: [ "split", - (param => ({ + param => ({ TAG: "Eq", _0: [ "foo", @@ -391,24 +391,24 @@ let suites_1 = { "baz" ], _1: "foo bar baz".split(" ") - })) + }) ], tl: { hd: [ "splitAtMost", - (param => ({ + param => ({ TAG: "Eq", _0: [ "foo", "bar" ], _1: "foo bar baz".split(" ", 2) - })) + }) ], tl: { hd: [ "splitByRe", - (param => ({ + param => ({ TAG: "Eq", _0: [ "a", @@ -420,12 +420,12 @@ let suites_1 = { "c" ], _1: "a#b#:c".split(/(#)(:)?/) - })) + }) ], tl: { hd: [ "splitByReAtMost", - (param => ({ + param => ({ TAG: "Eq", _0: [ "a", @@ -433,132 +433,132 @@ let suites_1 = { undefined ], _1: "a#b#:c".split(/(#)(:)?/, 3) - })) + }) ], tl: { hd: [ "startsWith", - (param => ({ + param => ({ TAG: "Eq", _0: true, _1: "foobarbaz".startsWith("foo") - })) + }) ], tl: { hd: [ "startsWithFrom", - (param => ({ + param => ({ TAG: "Eq", _0: false, _1: "foobarbaz".startsWith("foo", 1) - })) + }) ], tl: { hd: [ "substr", - (param => ({ + param => ({ TAG: "Eq", _0: "barbaz", _1: "foobarbaz".substr(3) - })) + }) ], tl: { hd: [ "substrAtMost", - (param => ({ + param => ({ TAG: "Eq", _0: "bar", _1: "foobarbaz".substr(3, 3) - })) + }) ], tl: { hd: [ "substring", - (param => ({ + param => ({ TAG: "Eq", _0: "bar", _1: "foobarbaz".substring(3, 6) - })) + }) ], tl: { hd: [ "substringToEnd", - (param => ({ + param => ({ TAG: "Eq", _0: "barbaz", _1: "foobarbaz".substring(3) - })) + }) ], tl: { hd: [ "toLowerCase", - (param => ({ + param => ({ TAG: "Eq", _0: "bork", _1: "BORK".toLowerCase() - })) + }) ], tl: { hd: [ "toLocaleLowerCase", - (param => ({ + param => ({ TAG: "Eq", _0: "bork", _1: "BORK".toLocaleLowerCase() - })) + }) ], tl: { hd: [ "toUpperCase", - (param => ({ + param => ({ TAG: "Eq", _0: "FUBAR", _1: "fubar".toUpperCase() - })) + }) ], tl: { hd: [ "toLocaleUpperCase", - (param => ({ + param => ({ TAG: "Eq", _0: "FUBAR", _1: "fubar".toLocaleUpperCase() - })) + }) ], tl: { hd: [ "trim", - (param => ({ + param => ({ TAG: "Eq", _0: "foo", _1: " foo ".trim() - })) + }) ], tl: { hd: [ "anchor", - (param => ({ + param => ({ TAG: "Eq", _0: "foo", _1: "foo".anchor("bar") - })) + }) ], tl: { hd: [ "link", - (param => ({ + param => ({ TAG: "Eq", _0: "foo", _1: "foo".link("https://reason.ml") - })) + }) ], tl: { hd: [ "File \"js_string_test.res\", line 138, characters 5-12", - (param => ({ + param => ({ TAG: "Ok", _0: "ab".includes("a") - })) + }) ], tl: /* [] */0 } diff --git a/jscomp/test/js_undefined_test.js b/jscomp/test/js_undefined_test.js index 89d249321aa..9f424779e29 100644 --- a/jscomp/test/js_undefined_test.js +++ b/jscomp/test/js_undefined_test.js @@ -7,118 +7,118 @@ let Js_undefined = require("../../lib/js/js_undefined.js"); let suites_0 = [ "toOption - empty", - (param => ({ + param => ({ TAG: "Eq", _0: undefined, _1: undefined - })) + }) ]; let suites_1 = { hd: [ "File \"js_undefined_test.res\", line 7, characters 5-12", - (param => ({ + param => ({ TAG: "Eq", _0: undefined, _1: undefined - })) + }) ], tl: { hd: [ "return", - (param => ({ + param => ({ TAG: "Eq", _0: "something", _1: Caml_option.undefined_to_opt("something") - })) + }) ], tl: { hd: [ "test - empty", - (param => ({ + param => ({ TAG: "Eq", _0: true, _1: true - })) + }) ], tl: { hd: [ "File \"js_undefined_test.res\", line 10, characters 5-12", - (param => ({ + param => ({ TAG: "Eq", _0: true, _1: true - })) + }) ], tl: { hd: [ "bind - empty", - (param => ({ + param => ({ TAG: "Eq", _0: undefined, - _1: Js_undefined.bind(undefined, (v => v)) - })) + _1: Js_undefined.bind(undefined, v => v) + }) ], tl: { hd: [ "bind - 'a", - (param => ({ + param => ({ TAG: "Eq", _0: 4, - _1: Js_undefined.bind(2, (n => (n << 1))) - })) + _1: Js_undefined.bind(2, n => (n << 1)) + }) ], tl: { hd: [ "iter - empty", - (param => { + param => { let hit = { contents: false }; - Js_undefined.iter(undefined, (param => { + Js_undefined.iter(undefined, param => { hit.contents = true; - })); + }); return { TAG: "Eq", _0: false, _1: hit.contents }; - }) + } ], tl: { hd: [ "iter - 'a", - (param => { + param => { let hit = { contents: 0 }; - Js_undefined.iter(2, (v => { + Js_undefined.iter(2, v => { hit.contents = v; - })); + }); return { TAG: "Eq", _0: 2, _1: hit.contents }; - }) + } ], tl: { hd: [ "fromOption - None", - (param => ({ + param => ({ TAG: "Eq", _0: undefined, _1: Js_undefined.fromOption(undefined) - })) + }) ], tl: { hd: [ "fromOption - Some", - (param => ({ + param => ({ TAG: "Eq", _0: 2, _1: Js_undefined.fromOption(2) - })) + }) ], tl: /* [] */0 } diff --git a/jscomp/test/jsoo_400_test.js b/jscomp/test/jsoo_400_test.js index 52bdb58ba65..12c78d9f5ed 100644 --- a/jscomp/test/jsoo_400_test.js +++ b/jscomp/test/jsoo_400_test.js @@ -17,12 +17,12 @@ function u() { Mt.from_pair_suites("Jsoo_400_test", { hd: [ "File \"jsoo_400_test.res\", line 7, characters 38-45", - (() => ({ + () => ({ TAG: "ThrowAny", - _0: (() => { + _0: () => { u(); - }) - })) + } + }) ], tl: /* [] */0 }); diff --git a/jscomp/test/key_word_property_plus_test.js b/jscomp/test/key_word_property_plus_test.js index 3b204f503ed..db5fb4114d7 100644 --- a/jscomp/test/key_word_property_plus_test.js +++ b/jscomp/test/key_word_property_plus_test.js @@ -17,11 +17,11 @@ function eq(loc, x, y) { suites.contents = { hd: [ loc + (" id " + String(test_id.contents)), - (() => ({ + () => ({ TAG: "Eq", _0: x, _1: y - })) + }) ], tl: suites.contents }; @@ -32,7 +32,7 @@ eq("File \"key_word_property_plus_test.res\", line 10, characters 2-9", [ 2, 3, 4 -].reduce(((prim0, prim1) => prim0 + prim1 | 0), 0), ((Global_mangles.$$__dirname + Global_mangles.$$__filename | 0) + Global_mangles.$$exports | 0) + Global_mangles.$$require | 0); +].reduce((prim0, prim1) => prim0 + prim1 | 0, 0), ((Global_mangles.$$__dirname + Global_mangles.$$__filename | 0) + Global_mangles.$$exports | 0) + Global_mangles.$$require | 0); Mt.from_pair_suites("Key_word_property_plus_test", suites.contents); diff --git a/jscomp/test/lazy_test.js b/jscomp/test/lazy_test.js index ed4b679fb72..9e6b8ca8fef 100644 --- a/jscomp/test/lazy_test.js +++ b/jscomp/test/lazy_test.js @@ -47,7 +47,7 @@ let forward_test = CamlinternalLazy.from_fun(() => f()); let f005 = CamlinternalLazy.from_fun(() => 6); -let f006 = CamlinternalLazy.from_fun(() => ((() => 3))); +let f006 = CamlinternalLazy.from_fun(() => (() => 3)); let f007 = CamlinternalLazy.from_fun(() => { throw new Error("Not_found", { @@ -85,102 +85,102 @@ let a8 = CamlinternalLazy.force(a6); Mt.from_pair_suites("Lazy_test", { hd: [ "simple", - (() => ({ + () => ({ TAG: "Eq", _0: lazy_test(), _1: [ 3, 32 ] - })) + }) ], tl: { hd: [ "lazy_force", - (() => ({ + () => ({ TAG: "Eq", _0: u_v.contents, _1: 2 - })) + }) ], tl: { hd: [ "lazy_from_fun", - (() => ({ + () => ({ TAG: "Eq", _0: CamlinternalLazy.force(l_from_fun), _1: 3 - })) + }) ], tl: { hd: [ "lazy_from_val", - (() => ({ + () => ({ TAG: "Eq", _0: CamlinternalLazy.force(CamlinternalLazy.from_val(3)), _1: 3 - })) + }) ], tl: { hd: [ "lazy_from_val2", - (() => ({ + () => ({ TAG: "Eq", _0: CamlinternalLazy.force(CamlinternalLazy.force(CamlinternalLazy.from_val(CamlinternalLazy.from_fun(() => 3)))), _1: 3 - })) + }) ], tl: { hd: [ "lazy_from_val3", - (() => { + () => { debugger; return { TAG: "Eq", _0: CamlinternalLazy.force(CamlinternalLazy.force(CamlinternalLazy.from_val(forward_test))), _1: 4 }; - }) + } ], tl: { hd: [ "lazy_test.res", - (() => ({ + () => ({ TAG: "Eq", _0: a3, _1: a4 - })) + }) ], tl: { hd: [ "lazy_test.res", - (() => ({ + () => ({ TAG: "Eq", _0: a7, _1: undefined - })) + }) ], tl: { hd: [ "lazy_test.res", - (() => ({ + () => ({ TAG: "Eq", _0: a8, _1: undefined - })) + }) ], tl: { hd: [ "File \"lazy_test.res\", line 95, characters 7-14", - (() => ({ + () => ({ TAG: "Ok", _0: Lazy.is_val(CamlinternalLazy.from_val(3)) - })) + }) ], tl: { hd: [ "File \"lazy_test.res\", line 96, characters 7-14", - (() => ({ + () => ({ TAG: "Ok", _0: !Lazy.is_val(CamlinternalLazy.from_fun(() => { throw new Error("Not_found", { @@ -189,7 +189,7 @@ Mt.from_pair_suites("Lazy_test", { } }); })) - })) + }) ], tl: /* [] */0 } diff --git a/jscomp/test/lib_js_test.js b/jscomp/test/lib_js_test.js index d8341a10838..58a10c1f40b 100644 --- a/jscomp/test/lib_js_test.js +++ b/jscomp/test/lib_js_test.js @@ -18,11 +18,11 @@ console.log("hey"); let suites_0 = [ "anything_to_string", - (param => ({ + param => ({ TAG: "Eq", _0: "3", _1: String(3) - })) + }) ]; let suites = { diff --git a/jscomp/test/libqueue_test.js b/jscomp/test/libqueue_test.js index a1f99f9be0d..693731383c0 100644 --- a/jscomp/test/libqueue_test.js +++ b/jscomp/test/libqueue_test.js @@ -7,10 +7,10 @@ let Caml_obj = require("../../lib/js/caml_obj.js"); let Caml_js_exceptions = require("../../lib/js/caml_js_exceptions.js"); function to_list(q) { - return List.rev(Queue.fold(((l, x) => ({ + return List.rev(Queue.fold((l, x) => ({ hd: x, tl: l - })), /* [] */0, q)); + }), /* [] */0, q)); } let Q = { @@ -863,7 +863,7 @@ let i$7 = { contents: 1 }; -Queue.iter((j => { +Queue.iter(j => { if (i$7.contents !== j) { throw new Error("Assert_failure", { cause: { @@ -877,7 +877,7 @@ Queue.iter((j => { }); } i$7.contents = i$7.contents + 1 | 0; -}), q$5); +}, q$5); let q1$1 = { length: 0, diff --git a/jscomp/test/limits_test.js b/jscomp/test/limits_test.js index f1aeb8d8ded..f760da7ef10 100644 --- a/jscomp/test/limits_test.js +++ b/jscomp/test/limits_test.js @@ -18,11 +18,11 @@ function eq(loc, x, y) { suites.contents = { hd: [ loc + (" id " + String(test_id.contents)), - (() => ({ + () => ({ TAG: "Eq", _0: x, _1: y - })) + }) ], tl: suites.contents }; diff --git a/jscomp/test/list_stack.js b/jscomp/test/list_stack.js index f3a7d15f495..23e5faacef9 100644 --- a/jscomp/test/list_stack.js +++ b/jscomp/test/list_stack.js @@ -3,6 +3,6 @@ let List = require("../../lib/js/list.js"); -List.find((x => x > 3), /* [] */0); +List.find(x => x > 3, /* [] */0); /* Not a pure module */ diff --git a/jscomp/test/list_test.js b/jscomp/test/list_test.js index b0af46e3f6a..ac050214762 100644 --- a/jscomp/test/list_test.js +++ b/jscomp/test/list_test.js @@ -8,7 +8,7 @@ let $$Array = require("../../lib/js/array.js"); let list_suites_0 = [ "length", - (param => ({ + param => ({ TAG: "Eq", _0: 1, _1: List.length({ @@ -21,13 +21,13 @@ let list_suites_0 = [ ], tl: /* [] */0 }) - })) + }) ]; let list_suites_1 = { hd: [ "length2", - (param => ({ + param => ({ TAG: "Eq", _0: 5, _1: List.length({ @@ -46,21 +46,21 @@ let list_suites_1 = { } } }) - })) + }) ], tl: { hd: [ "long_length", - (param => ({ + param => ({ TAG: "Eq", _0: 30000, - _1: List.length($$Array.to_list($$Array.init(30000, (param => 0)))) - })) + _1: List.length($$Array.to_list($$Array.init(30000, param => 0))) + }) ], tl: { hd: [ "sort", - (param => ({ + param => ({ TAG: "Eq", _0: List.sort(Caml.int_compare, { hd: 4, @@ -88,12 +88,12 @@ let list_suites_1 = { } } } - })) + }) ], tl: { hd: [ "File \"list_test.res\", line 20, characters 5-12", - (param => ({ + param => ({ TAG: "Eq", _0: true, _1: List.mem(3, { @@ -106,12 +106,12 @@ let list_suites_1 = { } } }) - })) + }) ], tl: { hd: [ "File \"list_test.res\", line 21, characters 5-12", - (param => ({ + param => ({ TAG: "Eq", _0: false, _1: List.mem(4, { @@ -124,12 +124,12 @@ let list_suites_1 = { } } }) - })) + }) ], tl: { hd: [ "File \"list_test.res\", line 22, characters 5-12", - (param => ({ + param => ({ TAG: "Eq", _0: 9, _1: List.assoc(4, { @@ -145,7 +145,7 @@ let list_suites_1 = { tl: /* [] */0 } }) - })) + }) ], tl: /* [] */0 } diff --git a/jscomp/test/loop_regression_test.js b/jscomp/test/loop_regression_test.js index b3264f5b744..af40ea68752 100644 --- a/jscomp/test/loop_regression_test.js +++ b/jscomp/test/loop_regression_test.js @@ -23,11 +23,11 @@ function f() { let suites_0 = [ "sum", - (param => ({ + param => ({ TAG: "Eq", _0: 55, _1: f() - })) + }) ]; let suites = { diff --git a/jscomp/test/map_find_test.js b/jscomp/test/map_find_test.js index 90a30b36011..fd645f38c27 100644 --- a/jscomp/test/map_find_test.js +++ b/jscomp/test/map_find_test.js @@ -158,7 +158,7 @@ function find(x, _param) { }; } -let m = List.fold_left(((acc, param) => add(param[0], param[1], acc)), "Empty", { +let m = List.fold_left((acc, param) => add(param[0], param[1], acc), "Empty", { hd: [ 10, /* 'a' */97 @@ -337,7 +337,7 @@ function find$1(x, _param) { }; } -let s = List.fold_left(((acc, param) => add$1(param[0], param[1], acc)), "Empty", { +let s = List.fold_left((acc, param) => add$1(param[0], param[1], acc), "Empty", { hd: [ "10", /* 'a' */97 @@ -366,20 +366,20 @@ let s = List.fold_left(((acc, param) => add$1(param[0], param[1], acc)), "Empty" Mt.from_pair_suites("Map_find_test", { hd: [ "int", - (() => ({ + () => ({ TAG: "Eq", _0: find(10, m), _1: /* 'a' */97 - })) + }) ], tl: { hd: [ "string", - (() => ({ + () => ({ TAG: "Eq", _0: find$1("10", s), _1: /* 'a' */97 - })) + }) ], tl: /* [] */0 } diff --git a/jscomp/test/map_test.js b/jscomp/test/map_test.js index eac6bbdcc24..bd37173302e 100644 --- a/jscomp/test/map_test.js +++ b/jscomp/test/map_test.js @@ -2001,12 +2001,12 @@ let String_map = { }; function of_list(kvs) { - return List.fold_left(((acc, param) => add(param[0], param[1], acc)), "Empty", kvs); + return List.fold_left((acc, param) => add(param[0], param[1], acc), "Empty", kvs); } let int_map_suites_0 = [ "add", - (param => { + param => { let v = of_list({ hd: [ 1, @@ -2031,13 +2031,13 @@ let int_map_suites_0 = [ _0: cardinal(v), _1: 3 }; - }) + } ]; let int_map_suites_1 = { hd: [ "equal", - (param => { + param => { let v = of_list({ hd: [ 1, @@ -2081,12 +2081,12 @@ let int_map_suites_1 = { _0: compare$1(Caml.int_compare, u, v), _1: 0 }; - }) + } ], tl: { hd: [ "equal2", - (param => { + param => { let v = of_list({ hd: [ 1, @@ -2128,14 +2128,14 @@ let int_map_suites_1 = { return { TAG: "Eq", _0: true, - _1: equal(((x, y) => x === y), u, v) + _1: equal((x, y) => x === y, u, v) }; - }) + } ], tl: { hd: [ "iteration", - (param => { + param => { let m = "Empty"; for (let i = 0; i <= 10000; ++i) { m = add$1(String(i), String(i), m); @@ -2152,7 +2152,7 @@ let int_map_suites_1 = { _0: v, _1: -1 }; - }) + } ], tl: /* [] */0 } diff --git a/jscomp/test/mario_game.js b/jscomp/test/mario_game.js index f4fdf051483..f1dc0788a9c 100644 --- a/jscomp/test/mario_game.js +++ b/jscomp/test/mario_game.js @@ -948,7 +948,7 @@ function update_player(player, keys, context) { let prev_jumping = player.jumping; let prev_dir = player.dir; let prev_vx = Math.abs(player.vel.x); - List.iter((extra => { + List.iter(extra => { let lr_acc = player.vel.x * 0.2; switch (extra) { case "CLeft" : @@ -988,7 +988,7 @@ function update_player(player, keys, context) { return; } } - }), keys); + }, keys); let v = player.vel.x * 0.9; let vel_damped = Math.abs(v) < 0.1 ? 0 : v; player.vel.x = vel_damped; @@ -2085,13 +2085,13 @@ function process_collision(dir, c1, c2, state) { function broad_phase(collid, all_collids, state) { let obj = collid._2; - return List.filter((c => { + return List.filter(c => { if (in_viewport(state.vpt, obj.pos) || is_player(collid)) { return true; } else { return out_of_viewport_below(state.vpt, obj.pos.y); } - }), all_collids); + }, all_collids); } function check_collisions(collid, all_collids, state) { @@ -2205,7 +2205,7 @@ function translate_keys() { hd: ctrls_0, tl: ctrls_1 }; - return List.fold_left(((a, x) => { + return List.fold_left((a, x) => { if (x[0]) { return { hd: x[1], @@ -2214,7 +2214,7 @@ function translate_keys() { } else { return a; } - }), /* [] */0, ctrls); + }, /* [] */0, ctrls); } function run_update_collid(state, collid, all_collids) { @@ -2299,10 +2299,10 @@ function update_loop(canvas, param, map_dim) { multiplier: state.multiplier, game_over: state.game_over }; - List.iter((obj => { + List.iter(obj => { run_update_collid(state$1, obj, objs); - }), objs); - List.iter((part => { + }, objs); + List.iter(part => { process(part); let x = part.pos.x - state$1.vpt.pos.x; let y = part.pos.y - state$1.vpt.pos.y; @@ -2318,7 +2318,7 @@ function update_loop(canvas, param, map_dim) { return; } - }), parts); + }, parts); fps(canvas, fps$1); hud(canvas, state$1.score, state$1.coins); requestAnimationFrame(t => update_helper(t, state$1, player$1, collid_objs.contents, particles.contents)); @@ -3306,15 +3306,15 @@ function inc_counter(param) { } function preload(param) { - return List.map((img_src => { + return List.map(img_src => { let img_src$1 = "sprites/" + img_src; let img = document.createElement("img"); img.src = img_src$1; - img.addEventListener("load", (ev => { + img.addEventListener("load", ev => { inc_counter(); return true; - }), true); - }), { + }, true); + }, { hd: "blocks.png", tl: { hd: "items.png", @@ -3329,10 +3329,10 @@ function preload(param) { }); } -window.onload = (param => { +window.onload = param => { preload(); return true; -}); +}; let Main = { Html: undefined, diff --git a/jscomp/test/method_name_test.js b/jscomp/test/method_name_test.js index 4ddab5af07e..16e1e0db931 100644 --- a/jscomp/test/method_name_test.js +++ b/jscomp/test/method_name_test.js @@ -16,11 +16,11 @@ function eq(loc, x, y) { suites.contents = { hd: [ loc + (" id " + String(test_id.contents)), - (() => ({ + () => ({ TAG: "Eq", _0: x, _1: y - })) + }) ], tl: suites.contents }; diff --git a/jscomp/test/mock_mt.js b/jscomp/test/mock_mt.js index f5c1d4ffb20..0858be78e96 100644 --- a/jscomp/test/mock_mt.js +++ b/jscomp/test/mock_mt.js @@ -8,7 +8,7 @@ function from_pair_suites(name, suites) { name, "testing" ]); - List.iter((param => { + List.iter(param => { let name = param[0]; let fn = param[1](); switch (fn.TAG) { @@ -79,7 +79,7 @@ function from_pair_suites(name, suites) { console.log("failed: " + fn._0); return; } - }), suites); + }, suites); } exports.from_pair_suites = from_pair_suites; diff --git a/jscomp/test/module_alias_test.js b/jscomp/test/module_alias_test.js index 4e116da9fd5..c65e0a81c6e 100644 --- a/jscomp/test/module_alias_test.js +++ b/jscomp/test/module_alias_test.js @@ -17,11 +17,11 @@ function eq(loc, x, y) { suites.contents = { hd: [ loc + (" id " + String(test_id.contents)), - (() => ({ + () => ({ TAG: "Eq", _0: x, _1: y - })) + }) ], tl: suites.contents }; diff --git a/jscomp/test/module_parameter_test.js b/jscomp/test/module_parameter_test.js index 49c3302bd7d..aaab7e92b99 100644 --- a/jscomp/test/module_parameter_test.js +++ b/jscomp/test/module_parameter_test.js @@ -22,21 +22,21 @@ function v(x) { let suites_0 = [ "const", - (param => ({ + param => ({ TAG: "Eq", _0: 1, _1: v0 - })) + }) ]; let suites_1 = { hd: [ "other", - (param => ({ + param => ({ TAG: "Eq", _0: 3, _1: v("abc") - })) + }) ], tl: /* [] */0 }; diff --git a/jscomp/test/module_splice_test.js b/jscomp/test/module_splice_test.js index 5b0664da091..2472d3f58be 100644 --- a/jscomp/test/module_splice_test.js +++ b/jscomp/test/module_splice_test.js @@ -20,11 +20,11 @@ function eq(loc, param) { suites.contents = { hd: [ loc + (" id " + String(test_id.contents)), - (() => ({ + () => ({ TAG: "Eq", _0: x, _1: y - })) + }) ], tl: suites.contents }; diff --git a/jscomp/test/mpr_6033_test.js b/jscomp/test/mpr_6033_test.js index c52692dd5ae..d082011a65d 100644 --- a/jscomp/test/mpr_6033_test.js +++ b/jscomp/test/mpr_6033_test.js @@ -17,11 +17,11 @@ function eq(loc, x, y) { suites.contents = { hd: [ loc + (" id " + String(test_id.contents)), - (() => ({ + () => ({ TAG: "Eq", _0: x, _1: y - })) + }) ], tl: suites.contents }; diff --git a/jscomp/test/mt.js b/jscomp/test/mt.js index 052e0f61ee9..39789af3cf8 100644 --- a/jscomp/test/mt.js +++ b/jscomp/test/mt.js @@ -220,13 +220,13 @@ function old_from_promise_suites_donotuse(name, suites) { let match = $$Array.to_list(Process.argv); if (match) { if (is_mocha()) { - describe(name, (() => List.iter((param => { + describe(name, () => List.iter(param => { let code = param[1]; - it(param[0], (() => code.then(x => { + it(param[0], () => code.then(x => { handleCode(x); return val_unit; - }))); - }), suites))); + })); + }, suites)); } else { console.log("promise suites"); } @@ -240,11 +240,11 @@ function eq_suites(test_id, suites, loc, x, y) { suites.contents = { hd: [ loc + (" id " + String(test_id.contents)), - (param => ({ + param => ({ TAG: "Eq", _0: x, _1: y - })) + }) ], tl: suites.contents }; @@ -255,10 +255,10 @@ function bool_suites(test_id, suites, loc, x) { suites.contents = { hd: [ loc + (" id " + String(test_id.contents)), - (param => ({ + param => ({ TAG: "Ok", _0: x - })) + }) ], tl: suites.contents }; @@ -269,10 +269,10 @@ function throw_suites(test_id, suites, loc, x) { suites.contents = { hd: [ loc + (" id " + String(test_id.contents)), - (param => ({ + param => ({ TAG: "ThrowAny", _0: x - })) + }) ], tl: suites.contents }; diff --git a/jscomp/test/mt_global.js b/jscomp/test/mt_global.js index 2c4315ca7bd..77c1aa2db37 100644 --- a/jscomp/test/mt_global.js +++ b/jscomp/test/mt_global.js @@ -7,11 +7,11 @@ function collect_eq(test_id, suites, loc, x, y) { suites.contents = { hd: [ loc + (" id " + String(test_id.contents)), - (param => ({ + param => ({ TAG: "Eq", _0: x, _1: y - })) + }) ], tl: suites.contents }; @@ -22,11 +22,11 @@ function collect_neq(test_id, suites, loc, x, y) { suites.contents = { hd: [ loc + (" id " + String(test_id.contents)), - (param => ({ + param => ({ TAG: "Neq", _0: x, _1: y - })) + }) ], tl: suites.contents }; @@ -37,11 +37,11 @@ function collect_approx(test_id, suites, loc, x, y) { suites.contents = { hd: [ loc + (" id " + String(test_id.contents)), - (param => ({ + param => ({ TAG: "Approx", _0: x, _1: y - })) + }) ], tl: suites.contents }; diff --git a/jscomp/test/mutable_obj_test.js b/jscomp/test/mutable_obj_test.js index 1baa2d4647e..19f7c687a99 100644 --- a/jscomp/test/mutable_obj_test.js +++ b/jscomp/test/mutable_obj_test.js @@ -3,10 +3,10 @@ function f(x) { - x.dec = (x => ({ + x.dec = x => ({ x: x, y: x - })); + }); } exports.f = f; diff --git a/jscomp/test/name_mangle_test.js b/jscomp/test/name_mangle_test.js index 328148dedaa..82e3e3bcb20 100644 --- a/jscomp/test/name_mangle_test.js +++ b/jscomp/test/name_mangle_test.js @@ -16,11 +16,11 @@ function eq(loc, x, y) { suites.contents = { hd: [ loc + (" id " + String(test_id.contents)), - (() => ({ + () => ({ TAG: "Eq", _0: x, _1: y - })) + }) ], tl: suites.contents }; diff --git a/jscomp/test/obj_literal_ppx.js b/jscomp/test/obj_literal_ppx.js index 7e561a3188d..2d58df4583f 100644 --- a/jscomp/test/obj_literal_ppx.js +++ b/jscomp/test/obj_literal_ppx.js @@ -11,7 +11,7 @@ let b = { x: 3, y: [1], z: 3, - u: ((x, y) => x + y | 0) + u: (x, y) => x + y | 0 }; function f(obj) { diff --git a/jscomp/test/obj_magic_test.js b/jscomp/test/obj_magic_test.js index 49b6dfbe3f9..7e6071f1f27 100644 --- a/jscomp/test/obj_magic_test.js +++ b/jscomp/test/obj_magic_test.js @@ -9,42 +9,42 @@ function is_block(x) { let suites_0 = [ "is_block_test1", - (param => ({ + param => ({ TAG: "Eq", _0: false, _1: "number" !== "number" - })) + }) ]; let suites_1 = { hd: [ "is_block_test2", - (param => ({ + param => ({ TAG: "Eq", _0: true, _1: typeof ({ hd: 3, tl: /* [] */0 }) !== "number" - })) + }) ], tl: { hd: [ "is_block_test3", - (param => ({ + param => ({ TAG: "Eq", _0: true, _1: "string" !== "number" - })) + }) ], tl: { hd: [ "is_block_test4", - (param => ({ + param => ({ TAG: "Eq", _0: false, _1: "number" !== "number" - })) + }) ], tl: /* [] */0 } diff --git a/jscomp/test/ocaml_re_test.js b/jscomp/test/ocaml_re_test.js index 86f33fecb6e..38aef77e7a6 100644 --- a/jscomp/test/ocaml_re_test.js +++ b/jscomp/test/ocaml_re_test.js @@ -31,11 +31,11 @@ function eq(loc, x, y) { suites.contents = { hd: [ loc + (" id " + String(test_id.contents)), - (() => ({ + () => ({ TAG: "Eq", _0: x, _1: y - })) + }) ], tl: suites.contents }; @@ -788,7 +788,7 @@ function rename(ids, x) { case "Alt" : return mk_expr(ids, { TAG: "Alt", - _0: List.map((extra => rename(ids, extra)), l._0) + _0: List.map(extra => rename(ids, extra), l._0) }); case "Seq" : return mk_expr(ids, { @@ -997,7 +997,7 @@ function reset_table(a) { } function mark_used_indices(tbl) { - return extra => List.iter((x => { + return extra => List.iter(x => { switch (x.TAG) { case "TSeq" : return mark_used_indices(tbl)(x._0); @@ -1005,14 +1005,14 @@ function mark_used_indices(tbl) { case "TMatch" : break; } - List.iter((param => { + List.iter(param => { let i = param[1]; if (i >= 0) { return Caml_array.set(tbl, i, true); } - }), x._0.marks); - }), extra); + }, x._0.marks); + }, extra); } function find_free(tbl, _idx, len) { @@ -1039,7 +1039,7 @@ function free_index(tbl_ref, l) { } function remove_matches(extra) { - return List.filter((x => { + return List.filter(x => { switch (x.TAG) { case "TSeq" : case "TExp" : @@ -1047,7 +1047,7 @@ function remove_matches(extra) { case "TMatch" : return false; } - }), extra); + }, extra); } function split_at_match_rec(_l$p, _x) { @@ -1192,14 +1192,14 @@ function set_idx(idx, x) { function filter_marks(b, e, marks) { return { - marks: List.filter((param => { + marks: List.filter(param => { let i = param[0]; if (i < b) { return true; } else { return i > e; } - }), marks.marks), + }, marks.marks), pmarks: marks.pmarks }; } @@ -1237,7 +1237,7 @@ function delta_1(marks, c, next_cat, prev_cat, x, rem) { case "Rep" : let kind = s._1; let y$p$1 = delta_1(marks, c, next_cat, prev_cat, s._2, /* [] */0); - let marks$p = first((x => { + let marks$p = first(x => { switch (x.TAG) { case "TSeq" : case "TExp" : @@ -1245,7 +1245,7 @@ function delta_1(marks, c, next_cat, prev_cat, x, rem) { case "TMatch" : return x._0; } - }), y$p$1); + }, y$p$1); let match = marks$p !== undefined ? [ remove_matches(y$p$1), marks$p @@ -1350,7 +1350,7 @@ function delta_2(marks, c, next_cat, prev_cat, l, rem) { } function delta_seq(c, next_cat, prev_cat, kind, y, z, rem) { - let marks = first((x => { + let marks = first(x => { switch (x.TAG) { case "TSeq" : case "TExp" : @@ -1358,7 +1358,7 @@ function delta_seq(c, next_cat, prev_cat, kind, y, z, rem) { case "TMatch" : return x._0; } - }), y); + }, y); if (marks === undefined) { return tseq(kind, y, z, rem); } @@ -1403,9 +1403,9 @@ function delta(tbl_ref, next_cat, char, st) { } function flatten_match(m) { - let ma = List.fold_left(((ma, param) => Caml.int_max(ma, param[0])), -1, m); + let ma = List.fold_left((ma, param) => Caml.int_max(ma, param[0]), -1, m); let res = Caml_array.make(ma + 1 | 0, -1); - List.iter((param => Caml_array.set(res, param[0], param[1])), m); + List.iter(param => Caml_array.set(res, param[0], param[1]), m); return res; } @@ -1737,7 +1737,7 @@ function trans_set(cache, cm, s) { } catch (raw_exn) { let exn = Caml_js_exceptions.internalToOCamlException(raw_exn); if (exn.RE_EXN_ID === "Not_found") { - let l = List.fold_right(((param, l) => union(seq(Caml_bytes.get(cm, param[0]), Caml_bytes.get(cm, param[1])), l)), s, /* [] */0); + let l = List.fold_right((param, l) => union(seq(Caml_bytes.get(cm, param[0]), Caml_bytes.get(cm, param[1])), l), s, /* [] */0); cache.contents = add(v, l, cache.contents); return l; } @@ -2396,10 +2396,10 @@ function translate(ids, kind, _ign_group, ign_case, _greedy, pos, cache, c, _x) ]; } return [ - alt(ids, List.map((r$p => { + alt(ids, List.map(r$p => { let match = translate(ids, kind, ign_group, ign_case, greedy, pos, cache, c, r$p); return enforce_kind(ids, kind, match[1], match[0]); - }), merged_sequences)), + }, merged_sequences)), kind ]; case "Repeat" : @@ -2410,25 +2410,25 @@ function translate(ids, kind, _ign_group, ign_case, _greedy, pos, cache, c, _x) let cr = match$1[0]; let rem; if (j !== undefined) { - let f = greedy === "Non_greedy" ? (rem => alt(ids, { + let f = greedy === "Non_greedy" ? rem => alt(ids, { hd: mk_expr(ids, "Eps"), tl: { hd: seq$1(ids, kind$p, rename(ids, cr), rem), tl: /* [] */0 } - })) : (rem => alt(ids, { + }) : rem => alt(ids, { hd: seq$1(ids, kind$p, rename(ids, cr), rem), tl: { hd: mk_expr(ids, "Eps"), tl: /* [] */0 } - })); + }); rem = iter(j - i | 0, f, mk_expr(ids, "Eps")); } else { rem = rep(ids, greedy, kind$p, cr); } return [ - iter(i, (rem => seq$1(ids, kind$p, rename(ids, cr), rem)), rem), + iter(i, rem => seq$1(ids, kind$p, rename(ids, cr), rem), rem), kind ]; case "Sem" : @@ -2578,17 +2578,17 @@ function handle_case(_ign_case, _x) { case "Sequence" : return { TAG: "Sequence", - _0: List.map((extra => handle_case(ign_case, extra)), x._0) + _0: List.map(extra => handle_case(ign_case, extra), x._0) }; case "Alternative" : - let l$p = List.map((extra => handle_case(ign_case, extra)), x._0); + let l$p = List.map(extra => handle_case(ign_case, extra), x._0); if (is_charset({ TAG: "Alternative", _0: l$p })) { return { TAG: "Set", - _0: List.fold_left(((s, r) => union(s, as_set(r))), /* [] */0, l$p) + _0: List.fold_left((s, r) => union(s, as_set(r)), /* [] */0, l$p) }; } else { return { @@ -2659,16 +2659,16 @@ function handle_case(_ign_case, _x) { _ign_case = true; continue; case "Intersection" : - let l$p$1 = List.map((r => handle_case(ign_case, r)), x._0); + let l$p$1 = List.map(r => handle_case(ign_case, r), x._0); return { TAG: "Set", - _0: List.fold_left(((s, r) => inter(s, as_set(r))), cany, l$p$1) + _0: List.fold_left((s, r) => inter(s, as_set(r)), cany, l$p$1) }; case "Complement" : - let l$p$2 = List.map((r => handle_case(ign_case, r)), x._0); + let l$p$2 = List.map(r => handle_case(ign_case, r), x._0); return { TAG: "Set", - _0: diff(cany, List.fold_left(((s, r) => union(s, as_set(r))), /* [] */0, l$p$2)) + _0: diff(cany, List.fold_left((s, r) => union(s, as_set(r)), /* [] */0, l$p$2)) }; case "Difference" : return { @@ -4138,7 +4138,7 @@ function parse(multiline, dollar_endonly, dotall, ungreedy, s) { function re(flagsOpt, pat) { let flags = flagsOpt !== undefined ? flagsOpt : /* [] */0; - let opts = List.map((x => { + let opts = List.map(x => { if (x === "CASELESS") { return "Caseless"; } else if (x === "ANCHORED") { @@ -4146,7 +4146,7 @@ function re(flagsOpt, pat) { } else { return "Multiline"; } - }), flags); + }, flags); let optsOpt = opts; let opts$1 = optsOpt !== undefined ? optsOpt : /* [] */0; let r = parse(List.memq("Multiline", opts$1), List.memq("Dollar_endonly", opts$1), List.memq("Dotall", opts$1), List.memq("Ungreedy", opts$1), pat); diff --git a/jscomp/test/of_string_test.js b/jscomp/test/of_string_test.js index 0e945b0ea7b..4eaffc2f4a2 100644 --- a/jscomp/test/of_string_test.js +++ b/jscomp/test/of_string_test.js @@ -6,30 +6,30 @@ let Pervasives = require("../../lib/js/pervasives.js"); let suites_0 = [ "string_of_float_1", - (param => ({ + param => ({ TAG: "Eq", _0: "10.", _1: Pervasives.string_of_float(10) - })) + }) ]; let suites_1 = { hd: [ "string_of_int", - (param => ({ + param => ({ TAG: "Eq", _0: "10", _1: String(10) - })) + }) ], tl: { hd: [ "valid_float_lexem", - (param => ({ + param => ({ TAG: "Eq", _0: "10.", _1: Pervasives.valid_float_lexem("10") - })) + }) ], tl: /* [] */0 } diff --git a/jscomp/test/option_repr_test.js b/jscomp/test/option_repr_test.js index 1e63ed6743b..b4435fe07e0 100644 --- a/jscomp/test/option_repr_test.js +++ b/jscomp/test/option_repr_test.js @@ -104,9 +104,9 @@ function f12(x) { return x; } -let length_8_id = Belt_List.makeBy(8, (x => x)); +let length_8_id = Belt_List.makeBy(8, x => x); -let length_10_id = Belt_List.makeBy(10, (x => x)); +let length_10_id = Belt_List.makeBy(10, x => x); function f13$1() { return Caml_obj.equal(Belt_List.take(length_10_id, 8), { @@ -166,7 +166,7 @@ function neqx(a, b) { } function all_true(xs) { - return Belt_List.every(xs, (x => x)); + return Belt_List.every(xs, x => x); } let xs_0 = gtx(Caml_option.some(null), Caml_option.some(undefined)); @@ -176,7 +176,7 @@ let xs = { tl: /* [] */0 }; -b("File \"option_repr_test.res\", line 125, characters 8-15", Belt_List.every(xs, (x => x))); +b("File \"option_repr_test.res\", line 125, characters 8-15", Belt_List.every(xs, x => x)); let xs_0$1 = ltx(Caml_option.some(undefined), 3); @@ -197,7 +197,7 @@ let xs_1 = { tl: { hd: ltx(undefined, null), tl: { - hd: ltx(undefined, (x => x)), + hd: ltx(undefined, x => x), tl: { hd: ltx(null, 3), tl: /* [] */0 @@ -217,7 +217,7 @@ let xs$1 = { tl: xs_1 }; -b("File \"option_repr_test.res\", line 128, characters 4-11", Belt_List.every(xs$1, (x => x))); +b("File \"option_repr_test.res\", line 128, characters 4-11", Belt_List.every(xs$1, x => x)); let xs_0$2 = eqx(undefined, undefined); @@ -240,7 +240,7 @@ let xs$2 = { tl: xs_1$1 }; -b("File \"option_repr_test.res\", line 145, characters 4-11", Belt_List.every(xs$2, (x => x))); +b("File \"option_repr_test.res\", line 145, characters 4-11", Belt_List.every(xs$2, x => x)); function v(x) { return x; diff --git a/jscomp/test/optional_ffi_test.js b/jscomp/test/optional_ffi_test.js index 893f71b4f02..9b6651b5cc9 100644 --- a/jscomp/test/optional_ffi_test.js +++ b/jscomp/test/optional_ffi_test.js @@ -19,11 +19,11 @@ function eq(loc, param) { suites.contents = { hd: [ loc + (" id " + String(test_id.contents)), - (() => ({ + () => ({ TAG: "Eq", _0: x, _1: y - })) + }) ], tl: suites.contents }; diff --git a/jscomp/test/pipe_send_readline.js b/jscomp/test/pipe_send_readline.js index 60f57ace99a..5d450e7f9ef 100644 --- a/jscomp/test/pipe_send_readline.js +++ b/jscomp/test/pipe_send_readline.js @@ -3,11 +3,11 @@ function u(rl) { - return rl.on("line", (x => { + return rl.on("line", x => { console.log(x); - })).on("close", (() => { + }).on("close", () => { console.log("finished"); - })); + }); } function xx(h) { diff --git a/jscomp/test/poly_variant_test.js b/jscomp/test/poly_variant_test.js index 18550b9914d..a52acfbb731 100644 --- a/jscomp/test/poly_variant_test.js +++ b/jscomp/test/poly_variant_test.js @@ -16,11 +16,11 @@ function eq(loc, x, y) { suites.contents = { hd: [ loc + (" id " + String(test_id.contents)), - (() => ({ + () => ({ TAG: "Eq", _0: x, _1: y - })) + }) ], tl: suites.contents }; diff --git a/jscomp/test/polymorphic_raw_test.js b/jscomp/test/polymorphic_raw_test.js index 2ed59b38025..063688f6184 100644 --- a/jscomp/test/polymorphic_raw_test.js +++ b/jscomp/test/polymorphic_raw_test.js @@ -16,11 +16,11 @@ function eq(loc, x, y) { suites.contents = { hd: [ loc + (" id " + String(test_id.contents)), - (() => ({ + () => ({ TAG: "Eq", _0: x, _1: y - })) + }) ], tl: suites.contents }; diff --git a/jscomp/test/ppx_apply_test.js b/jscomp/test/ppx_apply_test.js index c357e35921c..43e26e376d9 100644 --- a/jscomp/test/ppx_apply_test.js +++ b/jscomp/test/ppx_apply_test.js @@ -16,11 +16,11 @@ function eq(loc, x, y) { suites.contents = { hd: [ loc + (" id " + String(test_id.contents)), - (() => ({ + () => ({ TAG: "Eq", _0: x, _1: y - })) + }) ], tl: suites.contents }; diff --git a/jscomp/test/prepend_data_ffi.js b/jscomp/test/prepend_data_ffi.js index db22b3f52e4..a2b0584725f 100644 --- a/jscomp/test/prepend_data_ffi.js +++ b/jscomp/test/prepend_data_ffi.js @@ -12,13 +12,13 @@ let v2 = { v: 2 }; -process.on("exit", (exit_code => String(exit_code))); +process.on("exit", exit_code => String(exit_code)); -process.on(1, (param => {})); +process.on(1, param => {}); -process.on((i => String(i)), "exit"); +process.on(i => String(i), "exit"); -process.on((i => String(i)), 1); +process.on(i => String(i), 1); xx(3, 3, "xxx", "a", "b"); @@ -38,14 +38,14 @@ function f(x) { x.xx(76, 3, true, false, "你好", ["你好",1,2,3] , [{ "arr" : ["你好",1,2,3], "encoding" : "utf8"}] , [{ "arr" : ["你好",1,2,3], "encoding" : "utf8"}] , "xxx", 0, "yyy", "b", 1, 2, 3, 4, 5); } -process.on("exit", (exit_code => { +process.on("exit", exit_code => { console.log("error code: " + String(exit_code)); -})); +}); function register(p) { - p.on("exit", (i => { + p.on("exit", i => { console.log(i); - })); + }); } let config = { diff --git a/jscomp/test/print_alpha_test.js b/jscomp/test/print_alpha_test.js index 8d029466004..36dc07f7076 100644 --- a/jscomp/test/print_alpha_test.js +++ b/jscomp/test/print_alpha_test.js @@ -11,11 +11,11 @@ function f(h, param) { Mt.from_pair_suites("Print_alpha_test", { hd: [ "File \"print_alpha_test.res\", line 16, characters 10-17", - (() => ({ + () => ({ TAG: "Eq", - _0: f(((prim0, prim1) => prim0 + prim1 | 0), undefined)(1, 2), + _0: f((prim0, prim1) => prim0 + prim1 | 0, undefined)(1, 2), _1: 3 - })) + }) ], tl: /* [] */0 }); diff --git a/jscomp/test/queue_test.js b/jscomp/test/queue_test.js index a80fa32cfcf..f27062e4194 100644 --- a/jscomp/test/queue_test.js +++ b/jscomp/test/queue_test.js @@ -10,15 +10,15 @@ let Caml_array = require("../../lib/js/caml_array.js"); function Test(Queue) { let to_array = q => { let v = Caml_array.make(Queue.length(q), 0); - Queue.fold(((i, e) => { + Queue.fold((i, e) => { Caml_array.set(v, i, e); return i + 1 | 0; - }), 0, q); + }, 0, q); return v; }; let queue_1 = x => { let q = Queue.create(); - $$Array.iter((x => Queue.add(x, q)), x); + $$Array.iter(x => Queue.add(x, q), x); return to_array(q); }; return { @@ -29,10 +29,10 @@ function Test(Queue) { function to_array(q) { let v = Caml_array.make(q.length, 0); - Queue.fold(((i, e) => { + Queue.fold((i, e) => { Caml_array.set(v, i, e); return i + 1 | 0; - }), 0, q); + }, 0, q); return v; } @@ -42,7 +42,7 @@ function queue_1(x) { first: "Nil", last: "Nil" }; - $$Array.iter((x => Queue.add(x, q)), x); + $$Array.iter(x => Queue.add(x, q), x); return to_array(q); } @@ -53,10 +53,10 @@ let T1 = { function to_array$1(q) { let v = Caml_array.make(q.length, 0); - Queue_402.fold(((i, e) => { + Queue_402.fold((i, e) => { Caml_array.set(v, i, e); return i + 1 | 0; - }), 0, q); + }, 0, q); return v; } @@ -65,7 +65,7 @@ function queue_1$1(x) { length: 0, tail: undefined }; - $$Array.iter((x => Queue_402.add(x, q)), x); + $$Array.iter(x => Queue_402.add(x, q), x); return to_array$1(q); } @@ -76,7 +76,7 @@ let T2 = { let suites_0 = [ "File \"queue_test.res\", line 34, characters 6-13", - (param => { + param => { let x = [ 3, 4, @@ -88,13 +88,13 @@ let suites_0 = [ _0: x, _1: queue_1(x) }; - }) + } ]; let suites_1 = { hd: [ "File \"queue_test.res\", line 41, characters 6-13", - (param => { + param => { let x = [ 3, 4, @@ -106,7 +106,7 @@ let suites_1 = { _0: x, _1: queue_1$1(x) }; - }) + } ], tl: /* [] */0 }; diff --git a/jscomp/test/reactTestUtils.js b/jscomp/test/reactTestUtils.js index 8f37e360d5f..946b17773fc 100644 --- a/jscomp/test/reactTestUtils.js +++ b/jscomp/test/reactTestUtils.js @@ -49,11 +49,11 @@ function findByAllSelector(element, selector) { } function findBySelectorAndTextContent(element, selector, content) { - return Belt_Array.getBy(Array.from(element.querySelectorAll(selector)), (node => node.textContent === content)); + return Belt_Array.getBy(Array.from(element.querySelectorAll(selector)), node => node.textContent === content); } function findBySelectorAndPartialTextContent(element, selector, content) { - return Belt_Array.getBy(Array.from(element.querySelectorAll(selector)), (node => node.textContent.includes(content))); + return Belt_Array.getBy(Array.from(element.querySelectorAll(selector)), node => node.textContent.includes(content)); } let DOM = { @@ -65,14 +65,14 @@ let DOM = { function prepareContainer(container, param) { let containerElement = document.createElement("div"); - Belt_Option.map(document.body, (body => body.appendChild(containerElement))); + Belt_Option.map(document.body, body => body.appendChild(containerElement)); container.contents = Caml_option.some(containerElement); } function cleanupContainer(container, param) { - Belt_Option.map(container.contents, (prim => { + Belt_Option.map(container.contents, prim => { prim.remove(); - })); + }); container.contents = undefined; } diff --git a/jscomp/test/reasonReact.js b/jscomp/test/reasonReact.js index 840e9cfae66..afbce1d0359 100644 --- a/jscomp/test/reasonReact.js +++ b/jscomp/test/reasonReact.js @@ -92,7 +92,7 @@ function wrapReasonForJs(component, jsPropsToReason) { let dummyInteropComponent = basicComponent("interop"); function wrapJsForReason(reactClass, props, children) { - let jsElementWrapped = ((extra, extra$1) => { + let jsElementWrapped = (extra, extra$1) => { let props$1 = Object.assign(Object.assign({}, props), { ref: extra$1, key: extra @@ -102,7 +102,7 @@ function wrapJsForReason(reactClass, props, children) { props$1 ].concat(children); return React.createElement.apply(null, varargs); - }); + }; return { debugName: dummyInteropComponent.debugName, reactClassInternal: dummyInteropComponent.reactClassInternal, diff --git a/jscomp/test/reasonReactRouter.js b/jscomp/test/reasonReactRouter.js index 5c2ca324920..0c2e3102bca 100644 --- a/jscomp/test/reasonReactRouter.js +++ b/jscomp/test/reasonReactRouter.js @@ -164,14 +164,14 @@ function useUrl(serverUrl, param) { }); let setUrl = match[1]; let url$1 = match[0]; - React.useEffect((() => { + React.useEffect(() => { let watcherId = watchUrl(url => setUrl(param => url)); let newUrl = url(); if (urlNotEqual(newUrl, url$1)) { setUrl(param => newUrl); } - return (() => unwatchUrl(watcherId)); - }), []); + return () => unwatchUrl(watcherId); + }, []); return url$1; } diff --git a/jscomp/test/rec_fun_test.js b/jscomp/test/rec_fun_test.js index d435a8a47bf..c29dad50674 100644 --- a/jscomp/test/rec_fun_test.js +++ b/jscomp/test/rec_fun_test.js @@ -17,11 +17,11 @@ function eq(loc, x, y) { suites.contents = { hd: [ loc + (" id " + String(test_id.contents)), - (() => ({ + () => ({ TAG: "Eq", _0: x, _1: y - })) + }) ], tl: suites.contents }; diff --git a/jscomp/test/rec_module_test.js b/jscomp/test/rec_module_test.js index 705c40613bd..eeeeb1eb4c1 100644 --- a/jscomp/test/rec_module_test.js +++ b/jscomp/test/rec_module_test.js @@ -1218,7 +1218,7 @@ Caml_module.update_mod({ let suites_0 = [ "test1", - (param => ({ + param => ({ TAG: "Eq", _0: [ true, @@ -1232,58 +1232,58 @@ let suites_0 = [ B.odd(2), BB.odd(4) ] - })) + }) ]; let suites_1 = { hd: [ "test2", - (param => ({ + param => ({ TAG: "Eq", _0: BB.y(), _1: 32 - })) + }) ], tl: { hd: [ "test3", - (param => ({ + param => ({ TAG: "Eq", _0: AA.x(), _1: 35 - })) + }) ], tl: { hd: [ "test4", - (param => ({ + param => ({ TAG: "Eq", _0: true, _1: A.even(2) - })) + }) ], tl: { hd: [ "test4", - (param => ({ + param => ({ TAG: "Eq", _0: true, _1: AA.even(4) - })) + }) ], tl: { hd: [ "test5", - (param => ({ + param => ({ TAG: "Eq", _0: false, _1: B.odd(2) - })) + }) ], tl: { hd: [ "test6", - (param => ({ + param => ({ TAG: "Eq", _0: 2, _1: cardinal(of_list({ @@ -1305,7 +1305,7 @@ let suites_1 = { } } })) - })) + }) ], tl: /* [] */0 } diff --git a/jscomp/test/record_with_test.js b/jscomp/test/record_with_test.js index 86dba75c33e..174a4a9d9d2 100644 --- a/jscomp/test/record_with_test.js +++ b/jscomp/test/record_with_test.js @@ -38,11 +38,11 @@ function f(g, h) { let suites_0 = [ "eq_with", - (param => ({ + param => ({ TAG: "Eq", _0: v, _1: u_v - })) + }) ]; let suites = { diff --git a/jscomp/test/recursive_module.js b/jscomp/test/recursive_module.js index d7b13eb7601..70ee5b42eeb 100644 --- a/jscomp/test/recursive_module.js +++ b/jscomp/test/recursive_module.js @@ -20,7 +20,7 @@ function eq(loc, x, y) { } let Xx = { - f: ((prim0, prim1) => hfiehi(prim0, prim1)) + f: (prim0, prim1) => hfiehi(prim0, prim1) }; let Int3 = Caml_module.init_mod([ diff --git a/jscomp/test/recursive_module_test.js b/jscomp/test/recursive_module_test.js index db13ddaea60..e6360c30558 100644 --- a/jscomp/test/recursive_module_test.js +++ b/jscomp/test/recursive_module_test.js @@ -17,11 +17,11 @@ function eq(loc, x, y) { suites.contents = { hd: [ loc + (" id " + String(test_id.contents)), - (() => ({ + () => ({ TAG: "Eq", _0: x, _1: y - })) + }) ], tl: suites.contents }; @@ -95,12 +95,12 @@ eq("File \"recursive_module_test.res\", line 29, characters 12-19", 120, fact$1( add([ "File \"recursive_module_test.res\", line 31, characters 14-21", - (() => ({ + () => ({ TAG: "ThrowAny", - _0: (() => { + _0: () => { Int3.u(3); - }) - })) + } + }) ]); Mt.from_pair_suites("Recursive_module_test", suites.contents); diff --git a/jscomp/test/res_debug.js b/jscomp/test/res_debug.js index b432508cf66..d4b4fe2ee90 100644 --- a/jscomp/test/res_debug.js +++ b/jscomp/test/res_debug.js @@ -33,13 +33,13 @@ function optionMap(x, f) { } -let ok_name = optionMap(undefined, (x => x)); +let ok_name = optionMap(undefined, x => x); let ok = { name: ok_name }; -let bad_name = optionMap(undefined, (x => x)); +let bad_name = optionMap(undefined, x => x); let bad = { name: bad_name diff --git a/jscomp/test/sexp.js b/jscomp/test/sexp.js index 5be61afb379..3ad3c16eaee 100644 --- a/jscomp/test/sexp.js +++ b/jscomp/test/sexp.js @@ -136,7 +136,7 @@ function of_field(name, t) { function of_record(l) { return { NAME: "List", - VAL: List.map((param => of_field(param[0], param[1])), l) + VAL: List.map(param => of_field(param[0], param[1]), l) }; } @@ -251,7 +251,7 @@ function to_float(e) { } function to_string(e) { - return _try_atom(e, (x => x)); + return _try_atom(e, x => x); } function to_pair(e) { @@ -276,13 +276,13 @@ function to_pair(e) { } function to_pair_with(f1, f2) { - return e => $great$great$eq(to_pair(e), (param => { + return e => $great$great$eq(to_pair(e), param => { let y = param[1]; - return $great$great$eq(f1(param[0]), (x => $great$great$eq(f2(y), (y => [ + return $great$great$eq(f1(param[0]), x => $great$great$eq(f2(y), y => [ x, y - ])))); - })); + ])); + }); } function to_triple(e) { @@ -312,15 +312,15 @@ function to_triple(e) { } function to_triple_with(f1, f2, f3) { - return e => $great$great$eq(to_triple(e), (param => { + return e => $great$great$eq(to_triple(e), param => { let z = param[2]; let y = param[1]; - return $great$great$eq(f1(param[0]), (x => $great$great$eq(f2(y), (y => $great$great$eq(f3(z), (z => [ + return $great$great$eq(f1(param[0]), x => $great$great$eq(f2(y), y => $great$great$eq(f3(z), z => [ x, y, z - ])))))); - })); + ]))); + }); } function to_list(e) { diff --git a/jscomp/test/sexpm.js b/jscomp/test/sexpm.js index 19cf40d943d..ee81d710c78 100644 --- a/jscomp/test/sexpm.js +++ b/jscomp/test/sexpm.js @@ -96,12 +96,12 @@ function to_buf(b, t) { if (l) { if (l.tl) { Buffer.add_char(b, /* '(' */40); - List.iteri(((i, t$p) => { + List.iteri((i, t$p) => { if (i > 0) { Buffer.add_char(b, /* ' ' */32); } to_buf(b, t$p); - }), l); + }, l); return Buffer.add_char(b, /* ')' */41); } else { Buffer.add_string(b, "("); @@ -203,7 +203,7 @@ function _error_eof(t) { function expr(k, t) { while (true) { if (t.i === t.len) { - return _refill(t, (extra => expr(k, extra)), _error_eof); + return _refill(t, extra => expr(k, extra), _error_eof); } let c = _get(t); if (c >= 11) { @@ -222,7 +222,7 @@ function expr(k, t) { function expr_starting_with(c, k, t) { if (c >= 42) { if (c === 59) { - return skip_comment(((param, param$1) => expr(k, t)), t); + return skip_comment((param, param$1) => expr(k, t), t); } if (c === 92) { return _error(t, "unexpected '\\'"); @@ -277,7 +277,7 @@ function expr_starting_with(c, k, t) { function expr_list(acc, k, t) { while (true) { if (t.i === t.len) { - return _refill(t, (extra => expr_list(acc, k, extra)), _error_eof); + return _refill(t, extra => expr_list(acc, k, extra), _error_eof); } let c = _get(t); if (c > 32 || c < 9) { @@ -291,7 +291,7 @@ function expr_list(acc, k, t) { } else if (c > 31 || c < 11) { continue; } - return expr_starting_with(c, ((last, e) => { + return expr_starting_with(c, (last, e) => { if (last !== undefined) { if (last !== 40) { if (last !== 41) { @@ -309,10 +309,10 @@ function expr_list(acc, k, t) { }); } } else { - return expr_list(/* [] */0, ((param, l) => expr_list({ + return expr_list(/* [] */0, (param, l) => expr_list({ hd: l, tl: acc - }, k, t)), t); + }, k, t), t); } } else { return expr_list({ @@ -320,7 +320,7 @@ function expr_list(acc, k, t) { tl: acc }, k, t); } - }), t); + }, t); }; } @@ -336,7 +336,7 @@ function _return_atom(last, k, t) { function atom(k, t) { while (true) { if (t.i === t.len) { - return _refill(t, (extra => atom(k, extra)), (extra => _return_atom(undefined, k, extra))); + return _refill(t, extra => atom(k, extra), extra => _return_atom(undefined, k, extra)); } let c = _get(t); let exit = 0; @@ -380,17 +380,17 @@ function atom(k, t) { function quoted(k, t) { while (true) { if (t.i === t.len) { - return _refill(t, (extra => quoted(k, extra)), _error_eof); + return _refill(t, extra => quoted(k, extra), _error_eof); } let c = _get(t); if (c === 34) { return _return_atom(undefined, k, t); } if (c === 92) { - return escaped((c => { + return escaped(c => { Buffer.add_char(t.atom, c); return quoted(k, t); - }), t); + }, t); } Buffer.add_char(t.atom, c); continue; @@ -399,7 +399,7 @@ function quoted(k, t) { function escaped(k, t) { if (t.i === t.len) { - return _refill(t, (extra => escaped(k, extra)), _error_eof); + return _refill(t, extra => escaped(k, extra), _error_eof); } let c = _get(t); if (c >= 92) { @@ -443,7 +443,7 @@ function escaped(k, t) { return k(/* '"' */34); } if (_is_digit(c)) { - return read2int(c - /* '0' */48 | 0, (n => k(Char.chr(n))), t); + return read2int(c - /* '0' */48 | 0, n => k(Char.chr(n)), t); } else { return _error(t, "unexpected escaped char '" + (c + "'")); } @@ -451,7 +451,7 @@ function escaped(k, t) { function read2int(i, k, t) { if (t.i === t.len) { - return _refill(t, (extra => read2int(i, k, extra)), _error_eof); + return _refill(t, extra => read2int(i, k, extra), _error_eof); } let c = _get(t); if (_is_digit(c)) { @@ -463,7 +463,7 @@ function read2int(i, k, t) { function read1int(i, k, t) { if (t.i === t.len) { - return _refill(t, (extra => read1int(i, k, extra)), _error_eof); + return _refill(t, extra => read1int(i, k, extra), _error_eof); } let c = _get(t); if (_is_digit(c)) { @@ -476,7 +476,7 @@ function read1int(i, k, t) { function skip_comment(k, t) { while (true) { if (t.i === t.len) { - return _refill(t, (extra => skip_comment(k, extra)), _error_eof); + return _refill(t, extra => skip_comment(k, extra), _error_eof); } let match = _get(t); if (match === 10) { @@ -489,7 +489,7 @@ function skip_comment(k, t) { function expr_or_end(k, t) { while (true) { if (t.i === t.len) { - return _refill(t, (extra => expr_or_end(k, extra)), (param => "End")); + return _refill(t, extra => expr_or_end(k, extra), param => "End"); } let c = _get(t); if (c >= 11) { @@ -506,10 +506,10 @@ function expr_or_end(k, t) { } function next(t) { - return expr_or_end(((param, x) => ({ + return expr_or_end((param, x) => ({ NAME: "Ok", VAL: x - })), t); + }), t); } function parse_string(s) { diff --git a/jscomp/test/sexpm_test.js b/jscomp/test/sexpm_test.js index 642975259dc..073a85ff9ee 100644 --- a/jscomp/test/sexpm_test.js +++ b/jscomp/test/sexpm_test.js @@ -19,11 +19,11 @@ function eq(loc, param) { suites.contents = { hd: [ loc + (" id " + String(test_id.contents)), - (() => ({ + () => ({ TAG: "Eq", _0: x, _1: y - })) + }) ], tl: suites.contents }; diff --git a/jscomp/test/side_effect2.js b/jscomp/test/side_effect2.js index 59a117f9f19..575c6b65a63 100644 --- a/jscomp/test/side_effect2.js +++ b/jscomp/test/side_effect2.js @@ -3,7 +3,7 @@ let Belt_Array = require("../../lib/js/belt_Array.js"); -let a = Belt_Array.map([1], (x => x)); +let a = Belt_Array.map([1], x => x); exports.a = a; /* a Not a pure module */ diff --git a/jscomp/test/stack_comp_test.js b/jscomp/test/stack_comp_test.js index 9d05ffd7a43..e48789bbee3 100644 --- a/jscomp/test/stack_comp_test.js +++ b/jscomp/test/stack_comp_test.js @@ -31,12 +31,12 @@ function to_list(s) { let l = { contents: /* [] */0 }; - List.iter((x => { + List.iter(x => { l.contents = { hd: x, tl: l.contents }; - }), s.c); + }, s.c); return l.contents; } @@ -358,10 +358,10 @@ let i$7 = { contents: 1 }; -List.iter((j => { +List.iter(j => { assert_("File \"stack_comp_test.res\", line 143, characters 12-19", i$7.contents === j); i$7.contents = i$7.contents + 1 | 0; -}), s$5.c); +}, s$5.c); let s1$1 = { c: /* [] */0, diff --git a/jscomp/test/stack_test.js b/jscomp/test/stack_test.js index 7ced4562591..2dc90165f61 100644 --- a/jscomp/test/stack_test.js +++ b/jscomp/test/stack_test.js @@ -29,7 +29,7 @@ function v() { let suites_0 = [ "push_test", - (param => ({ + param => ({ TAG: "Eq", _0: { hd: 1, @@ -42,7 +42,7 @@ let suites_0 = [ } }, _1: v() - })) + }) ]; let suites = { diff --git a/jscomp/test/stream_parser_test.js b/jscomp/test/stream_parser_test.js index 31ace2f643d..2c52c450396 100644 --- a/jscomp/test/stream_parser_test.js +++ b/jscomp/test/stream_parser_test.js @@ -111,10 +111,10 @@ function parse(token) { let r = parse_expr_aux(parse_term()); return [ r, - Queue.fold(((acc, x) => ({ + Queue.fold((acc, x) => ({ hd: x, tl: acc - })), /* [] */0, look_ahead) + }), /* [] */0, look_ahead) ]; } @@ -252,10 +252,10 @@ function l_parse(token) { let r = parse_t_aux(parse_t()); return [ r, - Queue.fold(((acc, x) => ({ + Queue.fold((acc, x) => ({ hd: x, tl: acc - })), /* [] */0, look_ahead) + }), /* [] */0, look_ahead) ]; } @@ -272,11 +272,11 @@ function eq(loc, x, y) { suites.contents = { hd: [ loc + (" id " + String(test_id.contents)), - (() => ({ + () => ({ TAG: "Eq", _0: x, _1: y - })) + }) ], tl: suites.contents }; diff --git a/jscomp/test/string_get_set_test.js b/jscomp/test/string_get_set_test.js index 9f9eda11496..11516e72254 100644 --- a/jscomp/test/string_get_set_test.js +++ b/jscomp/test/string_get_set_test.js @@ -7,11 +7,11 @@ let Caml_string = require("../../lib/js/caml_string.js"); Mt.from_pair_suites("string_get_set_test.res", { hd: [ "File \"string_get_set_test.res\", line 4, characters 36-43", - (() => ({ + () => ({ TAG: "Eq", _0: Caml_string.get("h", 0), _1: /* 'h' */104 - })) + }) ], tl: /* [] */0 }); diff --git a/jscomp/test/string_runtime_test.js b/jscomp/test/string_runtime_test.js index 05cd2877b03..29e44751c31 100644 --- a/jscomp/test/string_runtime_test.js +++ b/jscomp/test/string_runtime_test.js @@ -9,25 +9,25 @@ let Caml_bytes = require("../../lib/js/caml_bytes.js"); let suites_0 = [ "?is_printable", - (param => ({ + param => ({ TAG: "Eq", _0: Test_char.caml_is_printable(/* 'a' */97), _1: true - })) + }) ]; let suites_1 = { hd: [ "?string_of_bytes", - (param => { - let match = List.split(List.map((x => { + param => { + let match = List.split(List.map(x => { let b = Caml_bytes.create(x); Bytes.fill(b, 0, x, /* 'c' */99); return [ Bytes.to_string(b), - Bytes.unsafe_to_string(Bytes.init(x, (param => /* 'c' */99))) + Bytes.unsafe_to_string(Bytes.init(x, param => /* 'c' */99)) ]; - }), { + }, { hd: 1000, tl: { hd: 1024, @@ -54,7 +54,7 @@ let suites_1 = { _0: match[0], _1: match[1] }; - }) + } ], tl: /* [] */0 }; diff --git a/jscomp/test/string_set.js b/jscomp/test/string_set.js index 2ffde8842a7..75578cd7f23 100644 --- a/jscomp/test/string_set.js +++ b/jscomp/test/string_set.js @@ -272,7 +272,7 @@ function of_list(l) { } function of_array(l) { - return $$Array.fold_left(((acc, x) => add(x, acc)), "Empty", l); + return $$Array.fold_left((acc, x) => add(x, acc), "Empty", l); } function invariant(t) { diff --git a/jscomp/test/string_set_test.js b/jscomp/test/string_set_test.js index f767c0fab0b..09ef35775ca 100644 --- a/jscomp/test/string_set_test.js +++ b/jscomp/test/string_set_test.js @@ -17,11 +17,11 @@ function eq(loc, x, y) { suites.contents = { hd: [ loc + (" id " + String(test_id.contents)), - (() => ({ + () => ({ TAG: "Eq", _0: x, _1: y - })) + }) ], tl: suites.contents }; diff --git a/jscomp/test/string_test.js b/jscomp/test/string_test.js index d0a5bc55a9b..ecfd8148562 100644 --- a/jscomp/test/string_test.js +++ b/jscomp/test/string_test.js @@ -125,59 +125,59 @@ function xsplit(delim, s) { } function string_of_chars(x) { - let xs = List.map((prim => String.fromCharCode(prim)), x); + let xs = List.map(prim => String.fromCharCode(prim), x); return $$Array.of_list(xs).join(""); } Mt.from_pair_suites("String_test", { hd: [ "mutliple switch", - (() => ({ + () => ({ TAG: "Eq", _0: 9, _1: ff("4") - })) + }) ], tl: { hd: [ "int switch", - (() => ({ + () => ({ TAG: "Eq", _0: 9, _1: gg(4) - })) + }) ], tl: { hd: [ "escape_normal", - (() => ({ + () => ({ TAG: "Eq", _0: "haha", _1: $$String.escaped("haha") - })) + }) ], tl: { hd: [ "escape_bytes", - (() => ({ + () => ({ TAG: "Eq", _0: Bytes.of_string("haha"), _1: Bytes.escaped(Bytes.of_string("haha")) - })) + }) ], tl: { hd: [ "escape_quote", - (() => ({ + () => ({ TAG: "Eq", _0: "\\\"\\\"", _1: $$String.escaped("\"\"") - })) + }) ], tl: { hd: [ "rev_split_by_char", - (() => ({ + () => ({ TAG: "Eq", _0: { hd: "", @@ -190,24 +190,24 @@ Mt.from_pair_suites("String_test", { } }, _1: rev_split_by_char(/* 'a' */97, "bbbbabbbba") - })) + }) ], tl: { hd: [ "File \"string_test.res\", line 86, characters 5-12", - (() => ({ + () => ({ TAG: "Eq", _0: { hd: "aaaa", tl: /* [] */0 }, _1: rev_split_by_char(/* ',' */44, "aaaa") - })) + }) ], tl: { hd: [ "xsplit", - (() => ({ + () => ({ TAG: "Eq", _0: { hd: "a", @@ -220,96 +220,96 @@ Mt.from_pair_suites("String_test", { } }, _1: xsplit(/* '.' */46, "a.b.c") - })) + }) ], tl: { hd: [ "split_empty", - (() => ({ + () => ({ TAG: "Eq", _0: /* [] */0, _1: Ext_string_test.split(undefined, "", /* '_' */95) - })) + }) ], tl: { hd: [ "split_empty2", - (() => ({ + () => ({ TAG: "Eq", _0: { hd: "test_unsafe_obj_ffi_ppx.cmi", tl: /* [] */0 }, _1: Ext_string_test.split(false, " test_unsafe_obj_ffi_ppx.cmi", /* ' ' */32) - })) + }) ], tl: { hd: [ "rfind", - (() => ({ + () => ({ TAG: "Eq", _0: 7, _1: Ext_string_test.rfind("__", "__index__js") - })) + }) ], tl: { hd: [ "rfind_2", - (() => ({ + () => ({ TAG: "Eq", _0: 0, _1: Ext_string_test.rfind("__", "__index_js") - })) + }) ], tl: { hd: [ "rfind_3", - (() => ({ + () => ({ TAG: "Eq", _0: -1, _1: Ext_string_test.rfind("__", "_index_js") - })) + }) ], tl: { hd: [ "find", - (() => ({ + () => ({ TAG: "Eq", _0: 0, _1: Ext_string_test.find(undefined, "__", "__index__js") - })) + }) ], tl: { hd: [ "find_2", - (() => ({ + () => ({ TAG: "Eq", _0: 6, _1: Ext_string_test.find(undefined, "__", "_index__js") - })) + }) ], tl: { hd: [ "find_3", - (() => ({ + () => ({ TAG: "Eq", _0: -1, _1: Ext_string_test.find(undefined, "__", "_index_js") - })) + }) ], tl: { hd: [ "of_char", - (() => ({ + () => ({ TAG: "Eq", _0: String.fromCharCode(/* '0' */48), _1: "0" - })) + }) ], tl: { hd: [ "of_chars", - (() => ({ + () => ({ TAG: "Eq", _0: string_of_chars({ hd: /* '0' */48, @@ -322,7 +322,7 @@ Mt.from_pair_suites("String_test", { } }), _1: "012" - })) + }) ], tl: /* [] */0 } diff --git a/jscomp/test/string_unicode_test.js b/jscomp/test/string_unicode_test.js index f3f6683e25f..9f37cd91b2c 100644 --- a/jscomp/test/string_unicode_test.js +++ b/jscomp/test/string_unicode_test.js @@ -16,11 +16,11 @@ function eq(loc, x, y) { suites.contents = { hd: [ loc + (" id " + String(test_id.contents)), - (() => ({ + () => ({ TAG: "Eq", _0: x, _1: y - })) + }) ], tl: suites.contents }; diff --git a/jscomp/test/switch_case_test.js b/jscomp/test/switch_case_test.js index a0eafaf70ef..3dfead52d69 100644 --- a/jscomp/test/switch_case_test.js +++ b/jscomp/test/switch_case_test.js @@ -16,11 +16,11 @@ function eq(loc, x, y) { suites.contents = { hd: [ loc + (" id " + String(test_id.contents)), - (() => ({ + () => ({ TAG: "Eq", _0: x, _1: y - })) + }) ], tl: suites.contents }; diff --git a/jscomp/test/tagged_template_test.js b/jscomp/test/tagged_template_test.js index fa694368b41..f4537c3b6cc 100644 --- a/jscomp/test/tagged_template_test.js +++ b/jscomp/test/tagged_template_test.js @@ -44,56 +44,56 @@ let res = foo([ Mt.from_pair_suites("tagged templates", { hd: [ "with externals, it should return a string with the correct interpolations", - (() => ({ + () => ({ TAG: "Eq", _0: query, _1: "SELECT * FROM 'users' WHERE id = '5'" - })) + }) ], tl: { hd: [ "with module scoped externals, it should also return a string with the correct interpolations", - (() => ({ + () => ({ TAG: "Eq", _0: queryWithModule, _1: "SELECT * FROM 'users' WHERE id = '5'" - })) + }) ], tl: { hd: [ "with externals, it should return the result of the function", - (() => ({ + () => ({ TAG: "Eq", _0: length, _1: 52 - })) + }) ], tl: { hd: [ "with rescript function, it should return a string with the correct encoding and interpolations", - (() => ({ + () => ({ TAG: "Eq", _0: res, _1: "| 5 × 10 = 50 |" - })) + }) ], tl: { hd: [ "a template literal tagged with json should generate a regular string interpolation for now", - (() => ({ + () => ({ TAG: "Eq", _0: "some random " + "string", _1: "some random string" - })) + }) ], tl: { hd: [ "a regular string interpolation should continue working", - (() => ({ + () => ({ TAG: "Eq", _0: "some random string interpolation", _1: "some random string interpolation" - })) + }) ], tl: /* [] */0 } diff --git a/jscomp/test/tailcall_inline_test.js b/jscomp/test/tailcall_inline_test.js index cd87f5f3b94..7308fc182ec 100644 --- a/jscomp/test/tailcall_inline_test.js +++ b/jscomp/test/tailcall_inline_test.js @@ -27,7 +27,7 @@ function f() { let suites_0 = [ "acc", - (param => ({ + param => ({ TAG: "Eq", _0: f(), _1: [ @@ -42,13 +42,13 @@ let suites_0 = [ 36, 45 ] - })) + }) ]; let suites_1 = { hd: [ "array_to_list", - (param => ({ + param => ({ TAG: "Eq", _0: { hd: 1, @@ -65,7 +65,7 @@ let suites_1 = { 2, 3 ]) - })) + }) ], tl: /* [] */0 }; diff --git a/jscomp/test/test_bs_this.js b/jscomp/test/test_bs_this.js index a2890643aa5..0edc78d1379 100644 --- a/jscomp/test/test_bs_this.js +++ b/jscomp/test/test_bs_this.js @@ -27,22 +27,22 @@ function bark() { } let js_obj = { - bark: (function (x, y) { + bark: function (x, y) { let o = this ; console.log(o); return x + y | 0; - }) + } }; function f(x) { - x.onload = (function () { + x.onload = function () { let o = this ; console.log(o); - }); - return x.addEventListener("onload", (function () { + }; + return x.addEventListener("onload", function () { let o = this ; console.log(o.response); - })); + }); } function u(x) { diff --git a/jscomp/test/test_closure.js b/jscomp/test/test_closure.js index 6a794c4d6e8..50cf48ad0aa 100644 --- a/jscomp/test/test_closure.js +++ b/jscomp/test/test_closure.js @@ -9,18 +9,18 @@ let v = { }; function f() { - let arr = Caml_array.make(10, (param => {})); + let arr = Caml_array.make(10, param => {}); for (let i = 0; i <= 9; ++i) { - Caml_array.set(arr, i, (param => { + Caml_array.set(arr, i, param => { v.contents = v.contents + i | 0; - })); + }); } return arr; } let u = f(); -$$Array.iter((x => x()), u); +$$Array.iter(x => x(), u); if (v.contents !== 45) { throw new Error("Assert_failure", { diff --git a/jscomp/test/test_cps.js b/jscomp/test/test_cps.js index 4debc9c34fa..89fb5b1893e 100644 --- a/jscomp/test/test_cps.js +++ b/jscomp/test/test_cps.js @@ -10,24 +10,24 @@ function f(_n, _acc) { if (n === 0) { return acc(); } - _acc = (() => { + _acc = () => { console.log(String(n)); return acc(); - }); + }; _n = n - 1 | 0; continue; }; } function test_closure() { - let arr = Caml_array.make(6, (x => x)); + let arr = Caml_array.make(6, x => x); for (let i = 0; i <= 6; ++i) { - Caml_array.set(arr, i, (param => i)); + Caml_array.set(arr, i, param => i); } return arr; } -f(10, (() => {})); +f(10, () => {}); exports.f = f; exports.test_closure = test_closure; diff --git a/jscomp/test/test_for_loop.js b/jscomp/test/test_for_loop.js index 3355b631f5d..0f6d8cfd28a 100644 --- a/jscomp/test/test_for_loop.js +++ b/jscomp/test/test_for_loop.js @@ -20,14 +20,14 @@ function for_3(x) { let v = { contents: 0 }; - let arr = $$Array.map((param => ((() => {}))), x); + let arr = $$Array.map(param => (() => {}), x); for (let i = 0, i_finish = x.length; i <= i_finish; ++i) { let j = (i << 1); - Caml_array.set(arr, i, (() => { + Caml_array.set(arr, i, () => { v.contents = v.contents + j | 0; - })); + }); } - $$Array.iter((x => x()), arr); + $$Array.iter(x => x(), arr); return v.contents; } @@ -35,15 +35,15 @@ function for_4(x) { let v = { contents: 0 }; - let arr = $$Array.map((param => ((() => {}))), x); + let arr = $$Array.map(param => (() => {}), x); for (let i = 0, i_finish = x.length; i <= i_finish; ++i) { let j = (i << 1); let k = (j << 1); - Caml_array.set(arr, i, (() => { + Caml_array.set(arr, i, () => { v.contents = v.contents + k | 0; - })); + }); } - $$Array.iter((x => x()), arr); + $$Array.iter(x => x(), arr); return v.contents; } @@ -51,14 +51,14 @@ function for_5(x, u) { let v = { contents: 0 }; - let arr = $$Array.map((param => ((() => {}))), x); + let arr = $$Array.map(param => (() => {}), x); for (let i = 0, i_finish = x.length; i <= i_finish; ++i) { let k = Math.imul((u << 1), u); - Caml_array.set(arr, i, (() => { + Caml_array.set(arr, i, () => { v.contents = v.contents + k | 0; - })); + }); } - $$Array.iter((x => x()), arr); + $$Array.iter(x => x(), arr); return v.contents; } @@ -66,7 +66,7 @@ function for_6(x, u) { let v = { contents: 0 }; - let arr = $$Array.map((param => ((() => {}))), x); + let arr = $$Array.map(param => (() => {}), x); let v4 = { contents: 0 }; @@ -83,12 +83,12 @@ function for_6(x, u) { let k = Math.imul((u << 1), u); let h = (v5.contents << 1); v2.contents = v2.contents + 1 | 0; - Caml_array.set(arr, i, (() => { + Caml_array.set(arr, i, () => { v.contents = (((((v.contents + k | 0) + v2.contents | 0) + u | 0) + v4.contents | 0) + v5.contents | 0) + h | 0; - })); + }); } } - $$Array.iter((x => x()), arr); + $$Array.iter(x => x(), arr); return v.contents; } diff --git a/jscomp/test/test_google_closure.js b/jscomp/test/test_google_closure.js index a06184cbe54..7bcdc1a2f9a 100644 --- a/jscomp/test/test_google_closure.js +++ b/jscomp/test/test_google_closure.js @@ -20,7 +20,7 @@ function f3(extra) { let b = f3(2); -let arr = $$Array.init(2, (param => 0)); +let arr = $$Array.init(2, param => 0); for (let i = 0; i <= 1; ++i) { let f3$1 = extra => i + 1 | 0; diff --git a/jscomp/test/test_int_map_find.js b/jscomp/test/test_int_map_find.js index 677c695320c..8accca8abef 100644 --- a/jscomp/test/test_int_map_find.js +++ b/jscomp/test/test_int_map_find.js @@ -138,7 +138,7 @@ function add(x, data, param) { } } -List.fold_left(((acc, param) => add(param[0], param[1], acc)), "Empty", { +List.fold_left((acc, param) => add(param[0], param[1], acc), "Empty", { hd: [ 10, /* 'a' */97 diff --git a/jscomp/test/test_react.js b/jscomp/test/test_react.js index 36e8789b47d..ef127b34872 100644 --- a/jscomp/test/test_react.js +++ b/jscomp/test/test_react.js @@ -11,9 +11,9 @@ let ReactDom = require("react-dom"); console.log(32); ReactDom.render(React.createClass({ - render: (() => React.DOM.div({ + render: () => React.DOM.div({ alt: "pic" - }, React.DOM.h1(undefined, "hello react"), React.DOM.h2(undefined, "type safe!"), React.DOM.h3(undefined, "type safe!"))) + }, React.DOM.h1(undefined, "hello react"), React.DOM.h2(undefined, "type safe!"), React.DOM.h3(undefined, "type safe!")) }), document.getElementById("hi")); function f() { diff --git a/jscomp/test/test_string_map.js b/jscomp/test/test_string_map.js index 34f0af33a02..21d8f1df73d 100644 --- a/jscomp/test/test_string_map.js +++ b/jscomp/test/test_string_map.js @@ -166,16 +166,16 @@ function assertion_test() { let m = { contents: "Empty" }; - timing("building", (() => { + timing("building", () => { for (let i = 0; i <= 1000000; ++i) { m.contents = add(String(i), String(i), m.contents); } - })); - timing("querying", (() => { + }); + timing("querying", () => { for (let i = 0; i <= 1000000; ++i) { find(String(i), m.contents); } - })); + }); } exports.assertion_test = assertion_test; diff --git a/jscomp/test/test_while_closure.js b/jscomp/test/test_while_closure.js index 1662d6d3f05..7235c903b0f 100644 --- a/jscomp/test/test_while_closure.js +++ b/jscomp/test/test_while_closure.js @@ -8,22 +8,22 @@ let v = { contents: 0 }; -let arr = Caml_array.make(10, (() => {})); +let arr = Caml_array.make(10, () => {}); function f() { let n = 0; while (n < 10) { let j = n; - Caml_array.set(arr, j, (() => { + Caml_array.set(arr, j, () => { v.contents = v.contents + j | 0; - })); + }); n = n + 1 | 0; }; } f(); -$$Array.iter((x => x()), arr); +$$Array.iter(x => x(), arr); console.log(String(v.contents)); diff --git a/jscomp/test/test_while_side_effect.js b/jscomp/test/test_while_side_effect.js index abea782887c..7ee8034a2a1 100644 --- a/jscomp/test/test_while_side_effect.js +++ b/jscomp/test/test_while_side_effect.js @@ -22,13 +22,13 @@ let x = { contents: 3 }; -while ((() => { +while (((() => { let y = 3; console.log(String(x.contents)); y = y + 1 | 0; x.contents = x.contents + 1 | 0; return (fib(x.contents) + fib(x.contents) | 0) < 20; - })()) { + }))()) { console.log(String(3)); }; diff --git a/jscomp/test/test_zero_nullable.js b/jscomp/test/test_zero_nullable.js index ceef20a2c9e..cdb2f1b2a55 100644 --- a/jscomp/test/test_zero_nullable.js +++ b/jscomp/test/test_zero_nullable.js @@ -17,11 +17,11 @@ function eq(loc, x, y) { suites.contents = { hd: [ loc + (" id " + String(test_id.contents)), - (() => ({ + () => ({ TAG: "Eq", _0: x, _1: y - })) + }) ], tl: suites.contents }; diff --git a/jscomp/test/ticker.js b/jscomp/test/ticker.js index 26c0d269cd7..8f8c2e3a23b 100644 --- a/jscomp/test/ticker.js +++ b/jscomp/test/ticker.js @@ -80,17 +80,17 @@ function string_of_rank(x) { } function find_ticker_by_name(all_tickers, ticker) { - return List.find((param => param.ticker_name === ticker), all_tickers); + return List.find(param => param.ticker_name === ticker, all_tickers); } function print_all_composite(all_tickers) { - List.iter((x => { + List.iter(x => { let tmp = x.type_; if (typeof tmp !== "object") { return; } console.log(x.ticker_name); - }), all_tickers); + }, all_tickers); } function height(param) { @@ -1088,7 +1088,7 @@ let Ticker_map = { }; function compute_update_sequences(all_tickers) { - List.fold_left(((counter, ticker) => { + List.fold_left((counter, ticker) => { let loop = (counter, ticker) => { let rank = ticker.rank; if (typeof rank === "object") { @@ -1118,8 +1118,8 @@ function compute_update_sequences(all_tickers) { return counter$4; }; return loop(counter, ticker); - }), 0, all_tickers); - let map = List.fold_left(((map, ticker) => { + }, 0, all_tickers); + let map = List.fold_left((map, ticker) => { let tmp = ticker.type_; if (typeof tmp !== "object") { return add(ticker.ticker_name, { @@ -1153,9 +1153,9 @@ function compute_update_sequences(all_tickers) { }; }; return loop(/* [] */0, map, ticker); - }), "Empty", List.rev(all_tickers)); - return fold(((k, l, map) => { - let l$1 = List.sort_uniq(((lhs, rhs) => { + }, "Empty", List.rev(all_tickers)); + return fold((k, l, map) => { + let l$1 = List.sort_uniq((lhs, rhs) => { let x = lhs.rank; if (typeof x !== "object") { if (x === "Uninitialized") { @@ -1192,14 +1192,14 @@ function compute_update_sequences(all_tickers) { } }); } - }), l); + }, l); return add(k, l$1, map); - }), map, map); + }, map, map); } function process_quote(ticker_map, new_ticker, new_value) { let update_sequence = find(new_ticker, ticker_map); - List.iter((ticker => { + List.iter(ticker => { let match = ticker.type_; if (typeof match !== "object") { if (ticker.ticker_name === new_ticker) { @@ -1220,7 +1220,7 @@ function process_quote(ticker_map, new_ticker, new_value) { match$1.op === "PLUS" ? match$2 + match$3 : match$2 - match$3 ) : undefined; ticker.value = value; - }), update_sequence); + }, update_sequence); } function process_input_line(ticker_map, all_tickers, line) { diff --git a/jscomp/test/to_string_test.js b/jscomp/test/to_string_test.js index d2f9631c420..3d3f92b3250 100644 --- a/jscomp/test/to_string_test.js +++ b/jscomp/test/to_string_test.js @@ -13,20 +13,20 @@ function f(v) { Mt.from_pair_suites("To_string_test", { hd: [ "File \"to_string_test.res\", line 6, characters 8-15", - (() => ({ + () => ({ TAG: "Eq", _0: Pervasives.string_of_float(Pervasives.infinity), _1: "inf" - })) + }) ], tl: { hd: [ "File \"to_string_test.res\", line 6, characters 49-56", - (() => ({ + () => ({ TAG: "Eq", _0: Pervasives.string_of_float(Pervasives.neg_infinity), _1: "-inf" - })) + }) ], tl: /* [] */0 } diff --git a/jscomp/test/topsort_test.js b/jscomp/test/topsort_test.js index abad6b818b6..286b48e8059 100644 --- a/jscomp/test/topsort_test.js +++ b/jscomp/test/topsort_test.js @@ -61,7 +61,7 @@ let graph = { }; function nexts(x, g) { - return List.fold_left(((acc, param) => { + return List.fold_left((acc, param) => { if (param[0] === x) { return { hd: param[1], @@ -70,7 +70,7 @@ function nexts(x, g) { } else { return acc; } - }), /* [] */0, g); + }, /* [] */0, g); } function dfs1(_nodes, graph, _visited) { @@ -281,11 +281,11 @@ function dfs3(nodes, graph) { hd: node, tl: visited.contents }; - return List.iter((x => aux(x, graph)), nexts(node, graph)); + return List.iter(x => aux(x, graph), nexts(node, graph)); } }; - List.iter((node => aux(node, graph)), nodes); + List.iter(node => aux(node, graph), nodes); return List.rev(visited.contents); } @@ -416,7 +416,7 @@ function unsafe_topsort(graph) { tl: visited.contents }; }; - List.iter((param => sort_node(param[0])), graph); + List.iter(param => sort_node(param[0]), graph); return visited.contents; } @@ -1490,7 +1490,7 @@ function pathsort(graph) { } ]; }; - let sort_nodes = (path, nodes) => List.iter((node => sort_node(path, node)), nodes); + let sort_nodes = (path, nodes) => List.iter(node => sort_node(path, node), nodes); let sort_node = (path, node) => { if (!List.mem(node, visited.contents)) { sort_nodes($plus$great(node, path), nexts(node, graph)); @@ -1502,7 +1502,7 @@ function pathsort(graph) { } }; - List.iter((param => sort_node(empty_path, param[0])), graph); + List.iter(param => sort_node(empty_path, param[0]), graph); return visited.contents; } diff --git a/jscomp/test/tramp_fib.js b/jscomp/test/tramp_fib.js index ed6a66445ca..e1b4d77b910 100644 --- a/jscomp/test/tramp_fib.js +++ b/jscomp/test/tramp_fib.js @@ -21,15 +21,15 @@ function fib(n, k) { } else { return { TAG: "Suspend", - _0: (() => fib(n - 1 | 0, (v0 => fib(n - 2 | 0, (v1 => k(v0 + v1 | 0)))))) + _0: () => fib(n - 1 | 0, v0 => fib(n - 2 | 0, v1 => k(v0 + v1 | 0))) }; } } -let u = fib(10, (x => ({ +let u = fib(10, x => ({ TAG: "Continue", _0: x -}))); +})); function iter(_bounce) { while (true) { @@ -47,7 +47,7 @@ function isEven(n) { if (n !== 1) { return { TAG: "Suspend", - _0: (() => isOdd(n - 1 | 0)) + _0: () => isOdd(n - 1 | 0) }; } else { return { diff --git a/jscomp/test/tuple_alloc.js b/jscomp/test/tuple_alloc.js index 23e9647cd12..2e63775eebd 100644 --- a/jscomp/test/tuple_alloc.js +++ b/jscomp/test/tuple_alloc.js @@ -39,7 +39,7 @@ function kf(cb, v) { } function ikf(v) { - return kf((prim => {}), v); + return kf(prim => {}, v); } exports.v = v; diff --git a/jscomp/test/typeof_test.js b/jscomp/test/typeof_test.js index 592d3f407a7..3fd9ae29985 100644 --- a/jscomp/test/typeof_test.js +++ b/jscomp/test/typeof_test.js @@ -33,113 +33,113 @@ function string_or_number(x) { let suites_0 = [ "int_type", - (param => ({ + param => ({ TAG: "Eq", _0: "number", _1: "number" - })) + }) ]; let suites_1 = { hd: [ "string_type", - (param => ({ + param => ({ TAG: "Eq", _0: "string", _1: "string" - })) + }) ], tl: { hd: [ "number_gadt_test", - (param => ({ + param => ({ TAG: "Eq", _0: Js_types.test(3, "Number"), _1: true - })) + }) ], tl: { hd: [ "boolean_gadt_test", - (param => ({ + param => ({ TAG: "Eq", _0: Js_types.test(true, "Boolean"), _1: true - })) + }) ], tl: { hd: [ "undefined_gadt_test", - (param => ({ + param => ({ TAG: "Eq", _0: Js_types.test(undefined, "Undefined"), _1: true - })) + }) ], tl: { hd: [ "string_on_number1", - (param => ({ + param => ({ TAG: "Eq", _0: string_or_number("xx"), _1: true - })) + }) ], tl: { hd: [ "string_on_number2", - (param => ({ + param => ({ TAG: "Eq", _0: string_or_number(3.02), _1: true - })) + }) ], tl: { hd: [ "string_on_number3", - (param => ({ + param => ({ TAG: "Eq", _0: string_or_number(x => x), _1: false - })) + }) ], tl: { hd: [ "string_gadt_test", - (param => ({ + param => ({ TAG: "Eq", _0: Js_types.test("3", "String"), _1: true - })) + }) ], tl: { hd: [ "string_gadt_test_neg", - (param => ({ + param => ({ TAG: "Eq", _0: Js_types.test(3, "String"), _1: false - })) + }) ], tl: { hd: [ "function_gadt_test", - (param => ({ + param => ({ TAG: "Eq", - _0: Js_types.test((x => x), "Function"), + _0: Js_types.test(x => x, "Function"), _1: true - })) + }) ], tl: { hd: [ "object_gadt_test", - (param => ({ + param => ({ TAG: "Eq", _0: Js_types.test({ x: 3 }, "Object"), _1: true - })) + }) ], tl: /* [] */0 } diff --git a/jscomp/test/uncurried_cast.js b/jscomp/test/uncurried_cast.js index d71ffebbaac..5ed7b4c208d 100644 --- a/jscomp/test/uncurried_cast.js +++ b/jscomp/test/uncurried_cast.js @@ -37,7 +37,7 @@ let l = Belt_List.map({ hd: 2, tl: /* [] */0 } -}, (x => x + 1 | 0)); +}, x => x + 1 | 0); function partial(x) { return Belt_List.map({ @@ -79,7 +79,7 @@ let l$1 = Belt_List.map({ hd: 2, tl: /* [] */0 } -}, (x => x + 1 | 0)); +}, x => x + 1 | 0); function partial$1(extra) { return Belt_List.map({ diff --git a/jscomp/test/uncurry_external_test.js b/jscomp/test/uncurry_external_test.js index 2e657206548..cb3e10f486a 100644 --- a/jscomp/test/uncurry_external_test.js +++ b/jscomp/test/uncurry_external_test.js @@ -16,11 +16,11 @@ function eq(loc, x, y) { suites.contents = { hd: [ loc + (" id " + String(test_id.contents)), - (() => ({ + () => ({ TAG: "Eq", _0: x, _1: y - })) + }) ], tl: suites.contents }; diff --git a/jscomp/test/unsafe_ppx_test.js b/jscomp/test/unsafe_ppx_test.js index 41f2ee2083a..df95ed722f8 100644 --- a/jscomp/test/unsafe_ppx_test.js +++ b/jscomp/test/unsafe_ppx_test.js @@ -26,7 +26,7 @@ function g(a) { regression(a, Pervasives.failwith); regression2(3, 2); regression3(3, 2); - regression4(3, (x => x)); + regression4(3, x => x); } let max2 = Math.max; @@ -52,38 +52,38 @@ let v = $$test(1, 2); Mt.from_pair_suites("Unsafe_ppx_test", { hd: [ "unsafe_max", - (() => ({ + () => ({ TAG: "Eq", _0: 2, _1: max(1, 2) - })) + }) ], tl: { hd: [ "unsafe_test", - (() => ({ + () => ({ TAG: "Eq", _0: 3, _1: v - })) + }) ], tl: { hd: [ "unsafe_max2", - (() => ({ + () => ({ TAG: "Eq", _0: 2, _1: Math.max(1, 2) - })) + }) ], tl: { hd: [ "ffi_keys", - (() => ({ + () => ({ TAG: "Eq", _0: ["a"], _1: Ffi_js_test.keys({a : 3}) - })) + }) ], tl: /* [] */0 } diff --git a/jscomp/test/update_record_test.js b/jscomp/test/update_record_test.js index f5ee68ae629..075e04543b0 100644 --- a/jscomp/test/update_record_test.js +++ b/jscomp/test/update_record_test.js @@ -21,11 +21,11 @@ function eq(loc, x, y) { suites.contents = { hd: [ loc + (" id " + String(test_id.contents)), - (() => ({ + () => ({ TAG: "Eq", _0: x, _1: y - })) + }) ], tl: suites.contents }; diff --git a/jscomp/test/webpack_config.js b/jscomp/test/webpack_config.js index 96c4740dd16..dacb56068a1 100644 --- a/jscomp/test/webpack_config.js +++ b/jscomp/test/webpack_config.js @@ -39,18 +39,18 @@ let B = {}; function f() { return [ - (prim => { + prim => { List$3.ff(); - }), - (prim => { + }, + prim => { List$3.ff2(); - }), - (prim => { + }, + prim => { List$2.ff(); - }), - (prim => { + }, + prim => { List$2.ff2(); - }) + } ]; } diff --git a/lib/es6/arg.js b/lib/es6/arg.js index 4562b3b8a55..865ef5a72a7 100644 --- a/lib/es6/arg.js +++ b/lib/es6/arg.js @@ -50,7 +50,7 @@ function split(s) { function make_symlist(prefix, sep, suffix, l) { if (l) { - return List.fold_left(((x, y) => x + (sep + y)), prefix + l.hd, l.tl) + suffix; + return List.fold_left((x, y) => x + (sep + y), prefix + l.hd, l.tl) + suffix; } else { return ""; } @@ -122,7 +122,7 @@ function add_help(speclist) { function usage_b(buf, speclist, errmsg) { Buffer.add_string(buf, errmsg + "\n"); - List.iter((x => { + List.iter(x => { let doc = x[2]; if (doc.length === 0) { return; @@ -134,7 +134,7 @@ function usage_b(buf, speclist, errmsg) { } let sym = make_symlist("{", "|", "}", spec._0); Buffer.add_string(buf, " " + key + " " + sym + doc + "\n"); - }), add_help(speclist)); + }, add_help(speclist)); } function usage_string(speclist, errmsg) { @@ -666,14 +666,14 @@ function replace_leading_tab(s) { let seen = { contents: false }; - return $$String.map((c => { + return $$String.map(c => { if (c !== 9 || seen.contents) { return c; } else { seen.contents = true; return /* ' ' */32; } - }), s); + }, s); } function align(limitOpt, speclist) { @@ -681,7 +681,7 @@ function align(limitOpt, speclist) { let completed = add_help(speclist); let len = List.fold_left(max_arg_len, 0, completed); let len$1 = len < limit ? len : limit; - return List.map((x => { + return List.map(x => { let spec = x[1]; let kwd = x[0]; if (x[2] === "") { @@ -716,7 +716,7 @@ function align(limitOpt, speclist) { spec, prefix + (spaces$1 + suffix) ]; - }), completed); + }, completed); } export { diff --git a/lib/es6/belt_MapDict.js b/lib/es6/belt_MapDict.js index 4366e9de421..9326d3fd621 100644 --- a/lib/es6/belt_MapDict.js +++ b/lib/es6/belt_MapDict.js @@ -196,13 +196,13 @@ function split(n, x, cmp) { function merge(s1, s2, f, cmp) { if (s1 === undefined) { if (s2 !== undefined) { - return Belt_internalAVLtree.keepMap(s2, ((k, v) => f(k, undefined, Caml_option.some(v)))); + return Belt_internalAVLtree.keepMap(s2, (k, v) => f(k, undefined, Caml_option.some(v))); } else { return; } } if (s2 === undefined) { - return Belt_internalAVLtree.keepMap(s1, ((k, v) => f(k, Caml_option.some(v), undefined))); + return Belt_internalAVLtree.keepMap(s1, (k, v) => f(k, Caml_option.some(v), undefined)); } if (s1.h >= s2.h) { let v1 = s1.k; diff --git a/lib/es6/belt_internalAVLset.js b/lib/es6/belt_internalAVLset.js index 49a2c83a99f..3e680658a9a 100644 --- a/lib/es6/belt_internalAVLset.js +++ b/lib/es6/belt_internalAVLset.js @@ -827,7 +827,7 @@ function fromArray(xs, cmp) { if (len === 0) { return; } - let next = Belt_SortArray.strictlySortedLength(xs, ((x, y) => cmp(x, y) < 0)); + let next = Belt_SortArray.strictlySortedLength(xs, (x, y) => cmp(x, y) < 0); let result; if (next >= 0) { result = fromSortedArrayAux(xs, 0, next); diff --git a/lib/es6/belt_internalAVLtree.js b/lib/es6/belt_internalAVLtree.js index cdf3edeb9ee..dcbd04e32ec 100644 --- a/lib/es6/belt_internalAVLtree.js +++ b/lib/es6/belt_internalAVLtree.js @@ -1001,7 +1001,7 @@ function fromArray(xs, cmp) { if (len === 0) { return; } - let next = Belt_SortArray.strictlySortedLength(xs, ((param, param$1) => cmp(param[0], param$1[0]) < 0)); + let next = Belt_SortArray.strictlySortedLength(xs, (param, param$1) => cmp(param[0], param$1[0]) < 0); let result; if (next >= 0) { result = fromSortedArrayAux(xs, 0, next); diff --git a/lib/es6/belt_internalBuckets.js b/lib/es6/belt_internalBuckets.js index 498b0963e55..6d6027ff47b 100644 --- a/lib/es6/belt_internalBuckets.js +++ b/lib/es6/belt_internalBuckets.js @@ -108,23 +108,23 @@ function reduce(h, init, f) { } function getMaxBucketLength(h) { - return Belt_Array.reduce(h.buckets, 0, ((m, b) => { + return Belt_Array.reduce(h.buckets, 0, (m, b) => { let len = bucketLength(0, b); if (m > len) { return m; } else { return len; } - })); + }); } function getBucketHistogram(h) { let mbl = getMaxBucketLength(h); - let histo = Belt_Array.makeBy(mbl + 1 | 0, (param => 0)); - Belt_Array.forEach(h.buckets, (b => { + let histo = Belt_Array.makeBy(mbl + 1 | 0, param => 0); + Belt_Array.forEach(h.buckets, b => { let l = bucketLength(0, b); histo[l] = histo[l] + 1 | 0; - })); + }); return histo; } @@ -231,18 +231,18 @@ function linear(h, f) { } function keysToArray(h) { - return linear(h, (x => x.key)); + return linear(h, x => x.key); } function valuesToArray(h) { - return linear(h, (x => x.value)); + return linear(h, x => x.value); } function toArray(h) { - return linear(h, (x => [ + return linear(h, x => [ x.key, x.value - ])); + ]); } let C; diff --git a/lib/es6/belt_internalMapInt.js b/lib/es6/belt_internalMapInt.js index 0080d087d61..7f54f84751d 100644 --- a/lib/es6/belt_internalMapInt.js +++ b/lib/es6/belt_internalMapInt.js @@ -303,7 +303,7 @@ function fromArray(xs) { if (len === 0) { return; } - let next = Belt_SortArray.strictlySortedLength(xs, ((param, param$1) => param[0] < param$1[0])); + let next = Belt_SortArray.strictlySortedLength(xs, (param, param$1) => param[0] < param$1[0]); let result; if (next >= 0) { result = Belt_internalAVLtree.fromSortedArrayAux(xs, 0, next); diff --git a/lib/es6/belt_internalMapString.js b/lib/es6/belt_internalMapString.js index 2fdb3856e1b..d048bcc96fa 100644 --- a/lib/es6/belt_internalMapString.js +++ b/lib/es6/belt_internalMapString.js @@ -303,7 +303,7 @@ function fromArray(xs) { if (len === 0) { return; } - let next = Belt_SortArray.strictlySortedLength(xs, ((param, param$1) => param[0] < param$1[0])); + let next = Belt_SortArray.strictlySortedLength(xs, (param, param$1) => param[0] < param$1[0]); let result; if (next >= 0) { result = Belt_internalAVLtree.fromSortedArrayAux(xs, 0, next); diff --git a/lib/es6/belt_internalSetBuckets.js b/lib/es6/belt_internalSetBuckets.js index 7971eed6167..f98cc4c5954 100644 --- a/lib/es6/belt_internalSetBuckets.js +++ b/lib/es6/belt_internalSetBuckets.js @@ -134,23 +134,23 @@ function reduce(h, init, f) { } function getMaxBucketLength(h) { - return Belt_Array.reduce(h.buckets, 0, ((m, b) => { + return Belt_Array.reduce(h.buckets, 0, (m, b) => { let len = bucketLength(0, b); if (m > len) { return m; } else { return len; } - })); + }); } function getBucketHistogram(h) { let mbl = getMaxBucketLength(h); - let histo = Belt_Array.makeBy(mbl + 1 | 0, (param => 0)); - Belt_Array.forEach(h.buckets, (b => { + let histo = Belt_Array.makeBy(mbl + 1 | 0, param => 0); + Belt_Array.forEach(h.buckets, b => { let l = bucketLength(0, b); histo[l] = histo[l] + 1 | 0; - })); + }); return histo; } diff --git a/lib/es6/caml_format.js b/lib/es6/caml_format.js index e0441baf86c..d466796c3ac 100644 --- a/lib/es6/caml_format.js +++ b/lib/es6/caml_format.js @@ -404,10 +404,10 @@ function parse_format(fmt) { case 46 : f.prec = 0; let j = i + 1 | 0; - while ((() => { + while (((() => { let w = fmt.codePointAt(j) - 48 | 0; return w >= 0 && w <= 9; - })()) { + }))()) { f.prec = (Math.imul(f.prec, 10) + fmt.codePointAt(j) | 0) - 48 | 0; j = j + 1 | 0; }; @@ -443,10 +443,10 @@ function parse_format(fmt) { case 3 : f.width = 0; let j$1 = i; - while ((() => { + while (((() => { let w = fmt.codePointAt(j$1) - 48 | 0; return w >= 0 && w <= 9; - })()) { + }))()) { f.width = (Math.imul(f.width, 10) + fmt.codePointAt(j$1) | 0) - 48 | 0; j$1 = j$1 + 1 | 0; }; @@ -676,10 +676,10 @@ function format_float(fmt, x) { p = p - (exp + 1 | 0) | 0; s = x$1.toFixed(p); } else { - while ((() => { + while (((() => { s = x$1.toFixed(p); return s.length > (prec$1 + 1 | 0); - })()) { + }))()) { p = p - 1 | 0; }; } diff --git a/lib/es6/caml_hash.js b/lib/es6/caml_hash.js index fcf71d9eb60..c238fbd048e 100644 --- a/lib/es6/caml_hash.js +++ b/lib/es6/caml_hash.js @@ -84,7 +84,7 @@ function hash(count, _limit, seed, obj) { ++ size } return size - })(obj$1, (v => push_back(queue, v))); + })(obj$1, v => push_back(queue, v)); s = Caml_hash_primitive.hash_mix_int(s, (size$1 << 10) | 0); } } diff --git a/lib/es6/camlinternalLazy.js b/lib/es6/camlinternalLazy.js index a1b4ebe8afb..59fa0b914d8 100644 --- a/lib/es6/camlinternalLazy.js +++ b/lib/es6/camlinternalLazy.js @@ -32,11 +32,11 @@ function force(lzv) { try { return forward_with_closure(lzv, closure); } catch (e) { - lzv.VAL = (() => { + lzv.VAL = () => { throw new Error(e.RE_EXN_ID, { cause: e }); - }); + }; throw new Error(e.RE_EXN_ID, { cause: e }); diff --git a/lib/es6/genlex.js b/lib/es6/genlex.js index 1a1fc4b0094..d3d551a9797 100644 --- a/lib/es6/genlex.js +++ b/lib/es6/genlex.js @@ -43,10 +43,10 @@ function get_string() { function make_lexer(keywords) { let kwd_table = Hashtbl.create(undefined, 17); - List.iter((s => Hashtbl.add(kwd_table, s, { + List.iter(s => Hashtbl.add(kwd_table, s, { TAG: "Kwd", _0: s - })), keywords); + }), keywords); let ident_or_keyword = id => { try { return Hashtbl.find(kwd_table, id); diff --git a/lib/es6/hashtbl.js b/lib/es6/hashtbl.js index 4b074047bb9..4337892b110 100644 --- a/lib/es6/hashtbl.js +++ b/lib/es6/hashtbl.js @@ -594,12 +594,12 @@ function bucket_length(_accu, _param) { } function stats(h) { - let mbl = $$Array.fold_left(((m, b) => Caml.int_max(m, bucket_length(0, b))), 0, h.data); + let mbl = $$Array.fold_left((m, b) => Caml.int_max(m, bucket_length(0, b)), 0, h.data); let histo = Caml_array.make(mbl + 1 | 0, 0); - $$Array.iter((b => { + $$Array.iter(b => { let l = bucket_length(0, b); Caml_array.set(histo, l, Caml_array.get(histo, l) + 1 | 0); - }), h.data); + }, h.data); return { num_bindings: h.size, num_buckets: h.data.length, diff --git a/lib/es6/hashtblLabels.js b/lib/es6/hashtblLabels.js index 3d27d7beaca..830e53d19f9 100644 --- a/lib/es6/hashtblLabels.js +++ b/lib/es6/hashtblLabels.js @@ -11,15 +11,15 @@ function replace(tbl, key, data) { } function iter(f, tbl) { - Hashtbl.iter(((key, data) => f(key, data)), tbl); + Hashtbl.iter((key, data) => f(key, data), tbl); } function filter_map_inplace(f, tbl) { - Hashtbl.filter_map_inplace(((key, data) => f(key, data)), tbl); + Hashtbl.filter_map_inplace((key, data) => f(key, data), tbl); } function fold(f, tbl, init) { - return Hashtbl.fold(((key, data, acc) => f(key, data, acc)), tbl, init); + return Hashtbl.fold((key, data, acc) => f(key, data, acc), tbl, init); } function MakeSeeded(H) { @@ -31,9 +31,9 @@ function MakeSeeded(H) { let fold = include.fold; let add$1 = (tbl, key, data) => add(tbl, key, data); let replace$1 = (tbl, key, data) => replace(tbl, key, data); - let iter$1 = (f, tbl) => iter(((key, data) => f(key, data)), tbl); - let filter_map_inplace$1 = (f, tbl) => filter_map_inplace(((key, data) => f(key, data)), tbl); - let fold$1 = (f, tbl, init) => fold(((key, data, acc) => f(key, data, acc)), tbl, init); + let iter$1 = (f, tbl) => iter((key, data) => f(key, data), tbl); + let filter_map_inplace$1 = (f, tbl) => filter_map_inplace((key, data) => f(key, data), tbl); + let fold$1 = (f, tbl, init) => fold((key, data, acc) => f(key, data, acc), tbl, init); return { create: include.create, clear: include.clear, @@ -70,9 +70,9 @@ function Make(H) { let fold = include.fold; let add$1 = (tbl, key, data) => add(tbl, key, data); let replace$1 = (tbl, key, data) => replace(tbl, key, data); - let iter$1 = (f, tbl) => iter(((key, data) => f(key, data)), tbl); - let filter_map_inplace$1 = (f, tbl) => filter_map_inplace(((key, data) => f(key, data)), tbl); - let fold$1 = (f, tbl, init) => fold(((key, data, acc) => f(key, data, acc)), tbl, init); + let iter$1 = (f, tbl) => iter((key, data) => f(key, data), tbl); + let filter_map_inplace$1 = (f, tbl) => filter_map_inplace((key, data) => f(key, data), tbl); + let fold$1 = (f, tbl, init) => fold((key, data, acc) => f(key, data, acc), tbl, init); let create$1 = sz => create(false, sz); return { create: create$1, diff --git a/lib/es6/lexing.js b/lib/es6/lexing.js index df2d0973773..cb6ad1c864e 100644 --- a/lib/es6/lexing.js +++ b/lib/es6/lexing.js @@ -44,7 +44,7 @@ let zero_pos = { function from_function(f) { return { - refill_buff: (x => { + refill_buff: x => { let aux_buffer = Caml_bytes.create(512); let read = f(aux_buffer, aux_buffer.length); let n = read > 0 ? read : (x.lex_eof_reached = true, 0); @@ -82,7 +82,7 @@ function from_function(f) { } Bytes.blit(aux_buffer, 0, x.lex_buffer, x.lex_buffer_len, n); x.lex_buffer_len = x.lex_buffer_len + n | 0; - }), + }, lex_buffer: Caml_bytes.create(1024), lex_buffer_len: 0, lex_abs_pos: 0, @@ -99,9 +99,9 @@ function from_function(f) { function from_string(s) { return { - refill_buff: (lexbuf => { + refill_buff: lexbuf => { lexbuf.lex_eof_reached = true; - }), + }, lex_buffer: Bytes.of_string(s), lex_buffer_len: s.length, lex_abs_pos: 0, diff --git a/lib/es6/moreLabels.js b/lib/es6/moreLabels.js index dbddb144109..5ab48c27219 100644 --- a/lib/es6/moreLabels.js +++ b/lib/es6/moreLabels.js @@ -32,7 +32,7 @@ let Hashtbl = { }; let $$Map = { - Make: (funarg => { + Make: funarg => { let height = param => { if (typeof param !== "object") { return 0; @@ -979,11 +979,11 @@ let $$Map = { map: map, mapi: mapi }; - }) + } }; let $$Set = { - Make: (funarg => { + Make: funarg => { let height = param => { if (typeof param !== "object") { return 0; @@ -1955,7 +1955,7 @@ let $$Set = { find_last_opt: find_last_opt, of_list: of_list }; - }) + } }; export { diff --git a/lib/es6/parsing.js b/lib/es6/parsing.js index eac6d6f2274..c2eb456f4f1 100644 --- a/lib/es6/parsing.js +++ b/lib/es6/parsing.js @@ -55,7 +55,7 @@ function clear_parser() { } let current_lookahead_fun = { - contents: (param => false) + contents: param => false }; function yyparse(tables, start, lexer, lexbuf) { @@ -143,13 +143,13 @@ function yyparse(tables, start, lexer, lexbuf) { if (exn$1.RE_EXN_ID === YYexit) { return exn$1._1; } - current_lookahead_fun.contents = (tok => { + current_lookahead_fun.contents = tok => { if (typeof tok !== "number") { return Caml_array.get(tables.transl_block, tok.TAG) === curr_char; } else { return Caml_array.get(tables.transl_const, tok) === curr_char; } - }); + }; throw new Error(exn$1.RE_EXN_ID, { cause: exn$1 }); diff --git a/lib/es6/pervasives.js b/lib/es6/pervasives.js index 26e76d54f3c..e066b6e51c1 100644 --- a/lib/es6/pervasives.js +++ b/lib/es6/pervasives.js @@ -191,15 +191,15 @@ function print_string(prim) { } let exit_function = { - contents: (prim => {}) + contents: prim => {} }; function at_exit(f) { let g = exit_function.contents; - exit_function.contents = (() => { + exit_function.contents = () => { f(); g(); - }); + }; } function exit(retcode) { diff --git a/lib/es6/stream.js b/lib/es6/stream.js index 29ea43dfad8..2ed7fbfc14d 100644 --- a/lib/es6/stream.js +++ b/lib/es6/stream.js @@ -284,11 +284,11 @@ function from(f) { function of_list(l) { return { count: 0, - data: List.fold_right(((x, l) => ({ + data: List.fold_right((x, l) => ({ TAG: "Scons", _0: x, _1: l - })), l, "Sempty") + }), l, "Sempty") }; } diff --git a/lib/js/arg.js b/lib/js/arg.js index 242f7643ab4..89c4a762468 100644 --- a/lib/js/arg.js +++ b/lib/js/arg.js @@ -50,7 +50,7 @@ function split(s) { function make_symlist(prefix, sep, suffix, l) { if (l) { - return List.fold_left(((x, y) => x + (sep + y)), prefix + l.hd, l.tl) + suffix; + return List.fold_left((x, y) => x + (sep + y), prefix + l.hd, l.tl) + suffix; } else { return ""; } @@ -122,7 +122,7 @@ function add_help(speclist) { function usage_b(buf, speclist, errmsg) { Buffer.add_string(buf, errmsg + "\n"); - List.iter((x => { + List.iter(x => { let doc = x[2]; if (doc.length === 0) { return; @@ -134,7 +134,7 @@ function usage_b(buf, speclist, errmsg) { } let sym = make_symlist("{", "|", "}", spec._0); Buffer.add_string(buf, " " + key + " " + sym + doc + "\n"); - }), add_help(speclist)); + }, add_help(speclist)); } function usage_string(speclist, errmsg) { @@ -666,14 +666,14 @@ function replace_leading_tab(s) { let seen = { contents: false }; - return $$String.map((c => { + return $$String.map(c => { if (c !== 9 || seen.contents) { return c; } else { seen.contents = true; return /* ' ' */32; } - }), s); + }, s); } function align(limitOpt, speclist) { @@ -681,7 +681,7 @@ function align(limitOpt, speclist) { let completed = add_help(speclist); let len = List.fold_left(max_arg_len, 0, completed); let len$1 = len < limit ? len : limit; - return List.map((x => { + return List.map(x => { let spec = x[1]; let kwd = x[0]; if (x[2] === "") { @@ -716,7 +716,7 @@ function align(limitOpt, speclist) { spec, prefix + (spaces$1 + suffix) ]; - }), completed); + }, completed); } exports.parse = parse; diff --git a/lib/js/belt_MapDict.js b/lib/js/belt_MapDict.js index fc98f4b09c7..a4581f83e9a 100644 --- a/lib/js/belt_MapDict.js +++ b/lib/js/belt_MapDict.js @@ -196,13 +196,13 @@ function split(n, x, cmp) { function merge(s1, s2, f, cmp) { if (s1 === undefined) { if (s2 !== undefined) { - return Belt_internalAVLtree.keepMap(s2, ((k, v) => f(k, undefined, Caml_option.some(v)))); + return Belt_internalAVLtree.keepMap(s2, (k, v) => f(k, undefined, Caml_option.some(v))); } else { return; } } if (s2 === undefined) { - return Belt_internalAVLtree.keepMap(s1, ((k, v) => f(k, Caml_option.some(v), undefined))); + return Belt_internalAVLtree.keepMap(s1, (k, v) => f(k, Caml_option.some(v), undefined)); } if (s1.h >= s2.h) { let v1 = s1.k; diff --git a/lib/js/belt_internalAVLset.js b/lib/js/belt_internalAVLset.js index 883fd807f3b..bd0e013f017 100644 --- a/lib/js/belt_internalAVLset.js +++ b/lib/js/belt_internalAVLset.js @@ -827,7 +827,7 @@ function fromArray(xs, cmp) { if (len === 0) { return; } - let next = Belt_SortArray.strictlySortedLength(xs, ((x, y) => cmp(x, y) < 0)); + let next = Belt_SortArray.strictlySortedLength(xs, (x, y) => cmp(x, y) < 0); let result; if (next >= 0) { result = fromSortedArrayAux(xs, 0, next); diff --git a/lib/js/belt_internalAVLtree.js b/lib/js/belt_internalAVLtree.js index 5294437d9e0..825157acc4c 100644 --- a/lib/js/belt_internalAVLtree.js +++ b/lib/js/belt_internalAVLtree.js @@ -1001,7 +1001,7 @@ function fromArray(xs, cmp) { if (len === 0) { return; } - let next = Belt_SortArray.strictlySortedLength(xs, ((param, param$1) => cmp(param[0], param$1[0]) < 0)); + let next = Belt_SortArray.strictlySortedLength(xs, (param, param$1) => cmp(param[0], param$1[0]) < 0); let result; if (next >= 0) { result = fromSortedArrayAux(xs, 0, next); diff --git a/lib/js/belt_internalBuckets.js b/lib/js/belt_internalBuckets.js index 94a321b95f7..159c1934fd0 100644 --- a/lib/js/belt_internalBuckets.js +++ b/lib/js/belt_internalBuckets.js @@ -108,23 +108,23 @@ function reduce(h, init, f) { } function getMaxBucketLength(h) { - return Belt_Array.reduce(h.buckets, 0, ((m, b) => { + return Belt_Array.reduce(h.buckets, 0, (m, b) => { let len = bucketLength(0, b); if (m > len) { return m; } else { return len; } - })); + }); } function getBucketHistogram(h) { let mbl = getMaxBucketLength(h); - let histo = Belt_Array.makeBy(mbl + 1 | 0, (param => 0)); - Belt_Array.forEach(h.buckets, (b => { + let histo = Belt_Array.makeBy(mbl + 1 | 0, param => 0); + Belt_Array.forEach(h.buckets, b => { let l = bucketLength(0, b); histo[l] = histo[l] + 1 | 0; - })); + }); return histo; } @@ -231,18 +231,18 @@ function linear(h, f) { } function keysToArray(h) { - return linear(h, (x => x.key)); + return linear(h, x => x.key); } function valuesToArray(h) { - return linear(h, (x => x.value)); + return linear(h, x => x.value); } function toArray(h) { - return linear(h, (x => [ + return linear(h, x => [ x.key, x.value - ])); + ]); } let C; diff --git a/lib/js/belt_internalMapInt.js b/lib/js/belt_internalMapInt.js index 39afb187463..033567d0f4c 100644 --- a/lib/js/belt_internalMapInt.js +++ b/lib/js/belt_internalMapInt.js @@ -303,7 +303,7 @@ function fromArray(xs) { if (len === 0) { return; } - let next = Belt_SortArray.strictlySortedLength(xs, ((param, param$1) => param[0] < param$1[0])); + let next = Belt_SortArray.strictlySortedLength(xs, (param, param$1) => param[0] < param$1[0]); let result; if (next >= 0) { result = Belt_internalAVLtree.fromSortedArrayAux(xs, 0, next); diff --git a/lib/js/belt_internalMapString.js b/lib/js/belt_internalMapString.js index 26d2d497314..0db017ec4e1 100644 --- a/lib/js/belt_internalMapString.js +++ b/lib/js/belt_internalMapString.js @@ -303,7 +303,7 @@ function fromArray(xs) { if (len === 0) { return; } - let next = Belt_SortArray.strictlySortedLength(xs, ((param, param$1) => param[0] < param$1[0])); + let next = Belt_SortArray.strictlySortedLength(xs, (param, param$1) => param[0] < param$1[0]); let result; if (next >= 0) { result = Belt_internalAVLtree.fromSortedArrayAux(xs, 0, next); diff --git a/lib/js/belt_internalSetBuckets.js b/lib/js/belt_internalSetBuckets.js index 89cd83d0fa6..c899bd03dd0 100644 --- a/lib/js/belt_internalSetBuckets.js +++ b/lib/js/belt_internalSetBuckets.js @@ -134,23 +134,23 @@ function reduce(h, init, f) { } function getMaxBucketLength(h) { - return Belt_Array.reduce(h.buckets, 0, ((m, b) => { + return Belt_Array.reduce(h.buckets, 0, (m, b) => { let len = bucketLength(0, b); if (m > len) { return m; } else { return len; } - })); + }); } function getBucketHistogram(h) { let mbl = getMaxBucketLength(h); - let histo = Belt_Array.makeBy(mbl + 1 | 0, (param => 0)); - Belt_Array.forEach(h.buckets, (b => { + let histo = Belt_Array.makeBy(mbl + 1 | 0, param => 0); + Belt_Array.forEach(h.buckets, b => { let l = bucketLength(0, b); histo[l] = histo[l] + 1 | 0; - })); + }); return histo; } diff --git a/lib/js/caml_format.js b/lib/js/caml_format.js index 7ec916dc577..d693282bb85 100644 --- a/lib/js/caml_format.js +++ b/lib/js/caml_format.js @@ -404,10 +404,10 @@ function parse_format(fmt) { case 46 : f.prec = 0; let j = i + 1 | 0; - while ((() => { + while (((() => { let w = fmt.codePointAt(j) - 48 | 0; return w >= 0 && w <= 9; - })()) { + }))()) { f.prec = (Math.imul(f.prec, 10) + fmt.codePointAt(j) | 0) - 48 | 0; j = j + 1 | 0; }; @@ -443,10 +443,10 @@ function parse_format(fmt) { case 3 : f.width = 0; let j$1 = i; - while ((() => { + while (((() => { let w = fmt.codePointAt(j$1) - 48 | 0; return w >= 0 && w <= 9; - })()) { + }))()) { f.width = (Math.imul(f.width, 10) + fmt.codePointAt(j$1) | 0) - 48 | 0; j$1 = j$1 + 1 | 0; }; @@ -676,10 +676,10 @@ function format_float(fmt, x) { p = p - (exp + 1 | 0) | 0; s = x$1.toFixed(p); } else { - while ((() => { + while (((() => { s = x$1.toFixed(p); return s.length > (prec$1 + 1 | 0); - })()) { + }))()) { p = p - 1 | 0; }; } diff --git a/lib/js/caml_hash.js b/lib/js/caml_hash.js index 6faffbdce90..76a6293626b 100644 --- a/lib/js/caml_hash.js +++ b/lib/js/caml_hash.js @@ -84,7 +84,7 @@ function hash(count, _limit, seed, obj) { ++ size } return size - })(obj$1, (v => push_back(queue, v))); + })(obj$1, v => push_back(queue, v)); s = Caml_hash_primitive.hash_mix_int(s, (size$1 << 10) | 0); } } diff --git a/lib/js/camlinternalLazy.js b/lib/js/camlinternalLazy.js index b5e07541d69..b92f4ac1453 100644 --- a/lib/js/camlinternalLazy.js +++ b/lib/js/camlinternalLazy.js @@ -32,11 +32,11 @@ function force(lzv) { try { return forward_with_closure(lzv, closure); } catch (e) { - lzv.VAL = (() => { + lzv.VAL = () => { throw new Error(e.RE_EXN_ID, { cause: e }); - }); + }; throw new Error(e.RE_EXN_ID, { cause: e }); diff --git a/lib/js/genlex.js b/lib/js/genlex.js index df0c1c90b70..0b989249f2e 100644 --- a/lib/js/genlex.js +++ b/lib/js/genlex.js @@ -43,10 +43,10 @@ function get_string() { function make_lexer(keywords) { let kwd_table = Hashtbl.create(undefined, 17); - List.iter((s => Hashtbl.add(kwd_table, s, { + List.iter(s => Hashtbl.add(kwd_table, s, { TAG: "Kwd", _0: s - })), keywords); + }), keywords); let ident_or_keyword = id => { try { return Hashtbl.find(kwd_table, id); diff --git a/lib/js/hashtbl.js b/lib/js/hashtbl.js index 9b1c3f98c66..b22fa9064a1 100644 --- a/lib/js/hashtbl.js +++ b/lib/js/hashtbl.js @@ -594,12 +594,12 @@ function bucket_length(_accu, _param) { } function stats(h) { - let mbl = $$Array.fold_left(((m, b) => Caml.int_max(m, bucket_length(0, b))), 0, h.data); + let mbl = $$Array.fold_left((m, b) => Caml.int_max(m, bucket_length(0, b)), 0, h.data); let histo = Caml_array.make(mbl + 1 | 0, 0); - $$Array.iter((b => { + $$Array.iter(b => { let l = bucket_length(0, b); Caml_array.set(histo, l, Caml_array.get(histo, l) + 1 | 0); - }), h.data); + }, h.data); return { num_bindings: h.size, num_buckets: h.data.length, diff --git a/lib/js/hashtblLabels.js b/lib/js/hashtblLabels.js index b0aae8f594e..26214bb36bf 100644 --- a/lib/js/hashtblLabels.js +++ b/lib/js/hashtblLabels.js @@ -11,15 +11,15 @@ function replace(tbl, key, data) { } function iter(f, tbl) { - Hashtbl.iter(((key, data) => f(key, data)), tbl); + Hashtbl.iter((key, data) => f(key, data), tbl); } function filter_map_inplace(f, tbl) { - Hashtbl.filter_map_inplace(((key, data) => f(key, data)), tbl); + Hashtbl.filter_map_inplace((key, data) => f(key, data), tbl); } function fold(f, tbl, init) { - return Hashtbl.fold(((key, data, acc) => f(key, data, acc)), tbl, init); + return Hashtbl.fold((key, data, acc) => f(key, data, acc), tbl, init); } function MakeSeeded(H) { @@ -31,9 +31,9 @@ function MakeSeeded(H) { let fold = include.fold; let add$1 = (tbl, key, data) => add(tbl, key, data); let replace$1 = (tbl, key, data) => replace(tbl, key, data); - let iter$1 = (f, tbl) => iter(((key, data) => f(key, data)), tbl); - let filter_map_inplace$1 = (f, tbl) => filter_map_inplace(((key, data) => f(key, data)), tbl); - let fold$1 = (f, tbl, init) => fold(((key, data, acc) => f(key, data, acc)), tbl, init); + let iter$1 = (f, tbl) => iter((key, data) => f(key, data), tbl); + let filter_map_inplace$1 = (f, tbl) => filter_map_inplace((key, data) => f(key, data), tbl); + let fold$1 = (f, tbl, init) => fold((key, data, acc) => f(key, data, acc), tbl, init); return { create: include.create, clear: include.clear, @@ -70,9 +70,9 @@ function Make(H) { let fold = include.fold; let add$1 = (tbl, key, data) => add(tbl, key, data); let replace$1 = (tbl, key, data) => replace(tbl, key, data); - let iter$1 = (f, tbl) => iter(((key, data) => f(key, data)), tbl); - let filter_map_inplace$1 = (f, tbl) => filter_map_inplace(((key, data) => f(key, data)), tbl); - let fold$1 = (f, tbl, init) => fold(((key, data, acc) => f(key, data, acc)), tbl, init); + let iter$1 = (f, tbl) => iter((key, data) => f(key, data), tbl); + let filter_map_inplace$1 = (f, tbl) => filter_map_inplace((key, data) => f(key, data), tbl); + let fold$1 = (f, tbl, init) => fold((key, data, acc) => f(key, data, acc), tbl, init); let create$1 = sz => create(false, sz); return { create: create$1, diff --git a/lib/js/lexing.js b/lib/js/lexing.js index 0386e15071a..8b7d2f0f20d 100644 --- a/lib/js/lexing.js +++ b/lib/js/lexing.js @@ -44,7 +44,7 @@ let zero_pos = { function from_function(f) { return { - refill_buff: (x => { + refill_buff: x => { let aux_buffer = Caml_bytes.create(512); let read = f(aux_buffer, aux_buffer.length); let n = read > 0 ? read : (x.lex_eof_reached = true, 0); @@ -82,7 +82,7 @@ function from_function(f) { } Bytes.blit(aux_buffer, 0, x.lex_buffer, x.lex_buffer_len, n); x.lex_buffer_len = x.lex_buffer_len + n | 0; - }), + }, lex_buffer: Caml_bytes.create(1024), lex_buffer_len: 0, lex_abs_pos: 0, @@ -99,9 +99,9 @@ function from_function(f) { function from_string(s) { return { - refill_buff: (lexbuf => { + refill_buff: lexbuf => { lexbuf.lex_eof_reached = true; - }), + }, lex_buffer: Bytes.of_string(s), lex_buffer_len: s.length, lex_abs_pos: 0, diff --git a/lib/js/moreLabels.js b/lib/js/moreLabels.js index 199e9967575..fdbe98c04b6 100644 --- a/lib/js/moreLabels.js +++ b/lib/js/moreLabels.js @@ -32,7 +32,7 @@ let Hashtbl = { }; let $$Map = { - Make: (funarg => { + Make: funarg => { let height = param => { if (typeof param !== "object") { return 0; @@ -979,11 +979,11 @@ let $$Map = { map: map, mapi: mapi }; - }) + } }; let $$Set = { - Make: (funarg => { + Make: funarg => { let height = param => { if (typeof param !== "object") { return 0; @@ -1955,7 +1955,7 @@ let $$Set = { find_last_opt: find_last_opt, of_list: of_list }; - }) + } }; exports.Hashtbl = Hashtbl; diff --git a/lib/js/parsing.js b/lib/js/parsing.js index 44fb74a6d2d..b4a3eef0111 100644 --- a/lib/js/parsing.js +++ b/lib/js/parsing.js @@ -55,7 +55,7 @@ function clear_parser() { } let current_lookahead_fun = { - contents: (param => false) + contents: param => false }; function yyparse(tables, start, lexer, lexbuf) { @@ -143,13 +143,13 @@ function yyparse(tables, start, lexer, lexbuf) { if (exn$1.RE_EXN_ID === YYexit) { return exn$1._1; } - current_lookahead_fun.contents = (tok => { + current_lookahead_fun.contents = tok => { if (typeof tok !== "number") { return Caml_array.get(tables.transl_block, tok.TAG) === curr_char; } else { return Caml_array.get(tables.transl_const, tok) === curr_char; } - }); + }; throw new Error(exn$1.RE_EXN_ID, { cause: exn$1 }); diff --git a/lib/js/pervasives.js b/lib/js/pervasives.js index d95a78d5785..445c238f4b1 100644 --- a/lib/js/pervasives.js +++ b/lib/js/pervasives.js @@ -191,15 +191,15 @@ function print_string(prim) { } let exit_function = { - contents: (prim => {}) + contents: prim => {} }; function at_exit(f) { let g = exit_function.contents; - exit_function.contents = (() => { + exit_function.contents = () => { f(); g(); - }); + }; } function exit(retcode) { diff --git a/lib/js/stream.js b/lib/js/stream.js index 7bca04f1b4d..ac7705230de 100644 --- a/lib/js/stream.js +++ b/lib/js/stream.js @@ -284,11 +284,11 @@ function from(f) { function of_list(l) { return { count: 0, - data: List.fold_right(((x, l) => ({ + data: List.fold_right((x, l) => ({ TAG: "Scons", _0: x, _1: l - })), l, "Sempty") + }), l, "Sempty") }; } From 04101834d8f4d126b4fbc7128c6ffcafea5f68aa Mon Sep 17 00:00:00 2001 From: Hyeseong Kim Date: Wed, 21 Aug 2024 07:01:18 +0900 Subject: [PATCH 7/8] add changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index ad9d276661c..633db87633b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -23,6 +23,7 @@ - Removed empty line at the end of `switch` statement - Removed empty `default` case from `switch` statement in the generated code - Optimised the Type Extension runtime code and removed trailing `/1` from `RE_EXN_ID` https://github.com/rescript-lang/rescript-compiler/pull/6958 +- Compact output for anonymous functions. https://github.com/rescript-lang/rescript-compiler/pull/6945 #### :bug: Bug Fix - Fix issue where long layout break added a trailing comma in partial application `...`. https://github.com/rescript-lang/rescript-compiler/pull/6949 From 4d1c94492542b476d778727f4c4ff69cd0ed9213 Mon Sep 17 00:00:00 2001 From: Hyeseong Kim Date: Wed, 21 Aug 2024 17:19:30 +0900 Subject: [PATCH 8/8] remove unnecessary parens of iife --- jscomp/core/j.ml | 1 - jscomp/core/js_dump.ml | 18 +++++++----------- jscomp/core/js_exp_make.ml | 7 ++----- jscomp/core/js_exp_make.mli | 2 -- jscomp/test/complex_while_loop.js | 8 ++++---- jscomp/test/ext_string_test.js | 8 ++++---- jscomp/test/test_while_side_effect.js | 4 ++-- lib/es6/caml_format.js | 12 ++++++------ lib/js/caml_format.js | 12 ++++++------ 9 files changed, 31 insertions(+), 41 deletions(-) diff --git a/jscomp/core/j.ml b/jscomp/core/j.ml index b1bc39659f5..3ab61124957 100644 --- a/jscomp/core/j.ml +++ b/jscomp/core/j.ml @@ -135,7 +135,6 @@ and expression_desc = env : Js_fun_env.t; return_unit : bool; async : bool; - iife : bool; directive : string option; } | Str of { delim : delim; txt : string } diff --git a/jscomp/core/js_dump.ml b/jscomp/core/js_dump.ml index 2fe52b35eb4..44fdebef6bb 100644 --- a/jscomp/core/js_dump.ml +++ b/jscomp/core/js_dump.ml @@ -301,7 +301,7 @@ let rec try_optimize_curry cxt f len function_id = Curry_gen.pp_optimize_curry f len; P.paren_group f 1 (fun _ -> expression ~level:1 cxt f function_id) -and pp_function ~return_unit ~async ~is_method ~iife ?directive cxt (f : P.t) ~fn_state +and pp_function ~return_unit ~async ~is_method ?directive cxt (f : P.t) ~fn_state (l : Ident.t list) (b : J.block) (env : Js_fun_env.t) : cxt = match b with | [ @@ -426,9 +426,8 @@ and pp_function ~return_unit ~async ~is_method ~iife ?directive cxt (f : P.t) ~f P.string f (L.function_ ~async ~arrow); param_body () | No_name _ -> - P.cond_paren_group f (iife) (fun _ -> - P.string f (L.function_ ~async ~arrow); - param_body ()) + P.string f (L.function_ ~async ~arrow); + param_body () | Name_non_top x -> ignore (pp_var_assign inner_cxt f x : cxt); P.string f (L.function_ ~async ~arrow); @@ -524,9 +523,9 @@ and expression_desc cxt ~(level : int) f x : cxt = let cxt = expression ~level:0 cxt f e1 in comma_sp f; expression ~level:0 cxt f e2) - | Fun { is_method; params; body; env; return_unit; async; iife; directive } -> + | Fun { is_method; params; body; env; return_unit; async; directive } -> (* TODO: dump for comments *) - pp_function ?directive ~is_method ~return_unit ~async ~iife + pp_function ?directive ~is_method ~return_unit ~async ~fn_state:default_fn_exp_state cxt f params body env (* TODO: @@ -561,12 +560,11 @@ and expression_desc cxt ~(level : int) f x : cxt = env; return_unit; async; - iife; directive; }; }; ] -> - pp_function ?directive ~is_method ~return_unit ~async ~iife + pp_function ?directive ~is_method ~return_unit ~async ~fn_state:(No_name { single_arg = true }) cxt f params body env | _ -> @@ -970,7 +968,6 @@ and variable_declaration top cxt f (variable : J.variable_declaration) : cxt = match e.expression_desc with | Fun { is_method; params; body; env; return_unit; async; directive } -> pp_function ?directive ~is_method ~return_unit ~async - ~iife:false ~fn_state:(if top then Name_top name else Name_non_top name) cxt f params body env | _ -> @@ -1178,10 +1175,9 @@ and statement_desc top cxt f (s : J.statement_desc) : cxt = cxt | Return e -> ( match e.expression_desc with - | Fun { is_method; params; body; env; return_unit; async; iife; directive } -> + | Fun { is_method; params; body; env; return_unit; async; directive } -> let cxt = pp_function ?directive ~return_unit ~is_method ~async - ~iife ~fn_state:Is_return cxt f params body env in diff --git a/jscomp/core/js_exp_make.ml b/jscomp/core/js_exp_make.ml index b320a6a9479..ebbd80d2816 100644 --- a/jscomp/core/js_exp_make.ml +++ b/jscomp/core/js_exp_make.ml @@ -207,7 +207,7 @@ let unit : t = { expression_desc = Undefined {is_unit = true}; comment = None } [Js_fun_env.empty] is a mutable state .. *) -let ocaml_fun ?comment ?immutable_mask ?(iife = false) ?directive ~return_unit ~async ~one_unit_arg params body : t = +let ocaml_fun ?comment ?immutable_mask ?directive ~return_unit ~async ~one_unit_arg params body : t = let params = if one_unit_arg then [] else params in let len = List.length params in { @@ -220,13 +220,12 @@ let ocaml_fun ?comment ?immutable_mask ?(iife = false) ?directive ~return_unit ~ env = Js_fun_env.make ?immutable_mask len; return_unit; async; - iife; directive; }; comment; } -let method_ ?comment ?immutable_mask ?(iife = false) ~return_unit params body : t = +let method_ ?comment ?immutable_mask ~return_unit params body : t = let len = List.length params in { expression_desc = @@ -238,7 +237,6 @@ let method_ ?comment ?immutable_mask ?(iife = false) ~return_unit params body : env = Js_fun_env.make ?immutable_mask len; return_unit; async = false; - iife; directive = None; }; comment; @@ -1305,7 +1303,6 @@ let of_block ?comment ?e block : t = env = Js_fun_env.make 0; return_unit; async = false; - iife = true; directive = None; }; } diff --git a/jscomp/core/js_exp_make.mli b/jscomp/core/js_exp_make.mli index b15cbe1ddc4..2e1cd072bb0 100644 --- a/jscomp/core/js_exp_make.mli +++ b/jscomp/core/js_exp_make.mli @@ -88,7 +88,6 @@ val str : ?delim: J.delim -> ?comment: string -> string -> t val ocaml_fun : ?comment:string -> ?immutable_mask:bool array -> - ?iife:bool -> ?directive:string -> return_unit:bool -> async:bool -> @@ -100,7 +99,6 @@ val ocaml_fun : val method_ : ?comment:string -> ?immutable_mask:bool array -> - ?iife:bool -> return_unit:bool -> J.ident list -> J.block -> diff --git a/jscomp/test/complex_while_loop.js b/jscomp/test/complex_while_loop.js index b927bd5dfe7..74fe66fea80 100644 --- a/jscomp/test/complex_while_loop.js +++ b/jscomp/test/complex_while_loop.js @@ -4,7 +4,7 @@ function f() { let n = 0; - while (((() => { + while ((() => { let fib = x => { if (x === 0 || x === 1) { return 1; @@ -13,17 +13,17 @@ function f() { } }; return fib(n) > 10; - }))()) { + })()) { console.log(String(n)); n = n + 1 | 0; }; } function ff() { - while (((() => { + while ((() => { let b = 9; return (3 + b | 0) > 10; - }))()) { + })()) { }; } diff --git a/jscomp/test/ext_string_test.js b/jscomp/test/ext_string_test.js index b7cada73096..69409ccddfc 100644 --- a/jscomp/test/ext_string_test.js +++ b/jscomp/test/ext_string_test.js @@ -54,25 +54,25 @@ function split_by(keep_emptyOpt, is_delim, str) { function trim(s) { let i = 0; let j = s.length; - while (((() => { + while ((() => { let tmp = false; if (i < j) { let u = s.codePointAt(i); tmp = u === /* '\t' */9 || u === /* '\n' */10 || u === /* ' ' */32; } return tmp; - }))()) { + })()) { i = i + 1 | 0; }; let k = j - 1 | 0; - while (((() => { + while ((() => { let tmp = false; if (k >= i) { let u = s.codePointAt(k); tmp = u === /* '\t' */9 || u === /* '\n' */10 || u === /* ' ' */32; } return tmp; - }))()) { + })()) { k = k - 1 | 0; }; return $$String.sub(s, i, (k - i | 0) + 1 | 0); diff --git a/jscomp/test/test_while_side_effect.js b/jscomp/test/test_while_side_effect.js index 7ee8034a2a1..abea782887c 100644 --- a/jscomp/test/test_while_side_effect.js +++ b/jscomp/test/test_while_side_effect.js @@ -22,13 +22,13 @@ let x = { contents: 3 }; -while (((() => { +while ((() => { let y = 3; console.log(String(x.contents)); y = y + 1 | 0; x.contents = x.contents + 1 | 0; return (fib(x.contents) + fib(x.contents) | 0) < 20; - }))()) { + })()) { console.log(String(3)); }; diff --git a/lib/es6/caml_format.js b/lib/es6/caml_format.js index d466796c3ac..e0441baf86c 100644 --- a/lib/es6/caml_format.js +++ b/lib/es6/caml_format.js @@ -404,10 +404,10 @@ function parse_format(fmt) { case 46 : f.prec = 0; let j = i + 1 | 0; - while (((() => { + while ((() => { let w = fmt.codePointAt(j) - 48 | 0; return w >= 0 && w <= 9; - }))()) { + })()) { f.prec = (Math.imul(f.prec, 10) + fmt.codePointAt(j) | 0) - 48 | 0; j = j + 1 | 0; }; @@ -443,10 +443,10 @@ function parse_format(fmt) { case 3 : f.width = 0; let j$1 = i; - while (((() => { + while ((() => { let w = fmt.codePointAt(j$1) - 48 | 0; return w >= 0 && w <= 9; - }))()) { + })()) { f.width = (Math.imul(f.width, 10) + fmt.codePointAt(j$1) | 0) - 48 | 0; j$1 = j$1 + 1 | 0; }; @@ -676,10 +676,10 @@ function format_float(fmt, x) { p = p - (exp + 1 | 0) | 0; s = x$1.toFixed(p); } else { - while (((() => { + while ((() => { s = x$1.toFixed(p); return s.length > (prec$1 + 1 | 0); - }))()) { + })()) { p = p - 1 | 0; }; } diff --git a/lib/js/caml_format.js b/lib/js/caml_format.js index d693282bb85..7ec916dc577 100644 --- a/lib/js/caml_format.js +++ b/lib/js/caml_format.js @@ -404,10 +404,10 @@ function parse_format(fmt) { case 46 : f.prec = 0; let j = i + 1 | 0; - while (((() => { + while ((() => { let w = fmt.codePointAt(j) - 48 | 0; return w >= 0 && w <= 9; - }))()) { + })()) { f.prec = (Math.imul(f.prec, 10) + fmt.codePointAt(j) | 0) - 48 | 0; j = j + 1 | 0; }; @@ -443,10 +443,10 @@ function parse_format(fmt) { case 3 : f.width = 0; let j$1 = i; - while (((() => { + while ((() => { let w = fmt.codePointAt(j$1) - 48 | 0; return w >= 0 && w <= 9; - }))()) { + })()) { f.width = (Math.imul(f.width, 10) + fmt.codePointAt(j$1) | 0) - 48 | 0; j$1 = j$1 + 1 | 0; }; @@ -676,10 +676,10 @@ function format_float(fmt, x) { p = p - (exp + 1 | 0) | 0; s = x$1.toFixed(p); } else { - while (((() => { + while ((() => { s = x$1.toFixed(p); return s.length > (prec$1 + 1 | 0); - }))()) { + })()) { p = p - 1 | 0; }; }