Skip to content

Commit 4098109

Browse files
committedJun 26, 2021
then is not a keyword in js
1 parent e7d305e commit 4098109

6 files changed

+47
-4
lines changed
 

‎jscomp/ext/js_reserved_map.ml

-1
Original file line numberDiff line numberDiff line change
@@ -681,7 +681,6 @@ let sorted_keywords = [|
681681
"super";
682682
"switch";
683683
"synchronized";
684-
"then";
685684
"this";
686685
"throw";
687686
"transient";

‎jscomp/test/406_primitive_test.ml

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ let test_id = ref 0
77

88
let eq loc x y : unit = Mt.eq_suites ~test_id loc ~suites x y
99

10-
#if OCAML_VERSION =~ ">4.03.0"
10+
1111

1212
external int_size : unit -> int = "%int_size"
1313

@@ -37,6 +37,6 @@ let f () =
3737
done
3838
with A _ -> ()
3939

40-
#end
40+
4141

4242
;; Mt.from_pair_suites __MODULE__ !suites

‎jscomp/test/build.ninja

+1
Original file line numberDiff line numberDiff line change
@@ -688,6 +688,7 @@ o test/test_unsupported_primitive.cmi test/test_unsupported_primitive.cmj : cc t
688688
o test/test_while_closure.cmi test/test_while_closure.cmj : cc test/test_while_closure.ml | $stdlib
689689
o test/test_while_side_effect.cmi test/test_while_side_effect.cmj : cc test/test_while_side_effect.ml | $stdlib
690690
o test/test_zero_nullable.cmi test/test_zero_nullable.cmj : cc test/test_zero_nullable.ml | test/mt.cmj $stdlib
691+
o test/then_mangle_test.cmi test/then_mangle_test.cmj : cc test/then_mangle_test.res | test/mt.cmj $stdlib
691692
o test/ticker.cmi test/ticker.cmj : cc test/ticker.ml | $stdlib
692693
o test/to_string_test.cmi test/to_string_test.cmj : cc test/to_string_test.ml | test/mt.cmj $stdlib
693694
o test/topsort_test.cmi test/topsort_test.cmj : cc test/topsort_test.ml | $stdlib

‎jscomp/test/then_mangle_test.js

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
'use strict';
2+
3+
var Mt = require("./mt.js");
4+
5+
var suites = {
6+
contents: /* [] */0
7+
};
8+
9+
var test_id = {
10+
contents: 0
11+
};
12+
13+
function eq(loc, x, y) {
14+
return Mt.eq_suites(test_id, suites, loc, x, y);
15+
}
16+
17+
function then(a, b) {
18+
console.log("no inline");
19+
return Math.imul(a, a) + Math.imul(b, b) | 0;
20+
}
21+
22+
eq("File \"then_mangle_test.res\", line 14, characters 3-10", then(1, 2), 5);
23+
24+
Mt.from_pair_suites("then_mangle_test.res", suites.contents);
25+
26+
/* Not a pure module */

‎jscomp/test/then_mangle_test.res

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
@@config({no_export})
2+
3+
let suites : ref<Mt.pair_suites> = ref (list{})
4+
let test_id = ref(0)
5+
6+
let {eq_suites} = module (Mt)
7+
let eq = (loc,x,y) => eq_suites(loc,x,y,~test_id,~suites)
8+
9+
let then = (a,b)=>{
10+
Js.log("no inline")
11+
a*a+b*b
12+
}
13+
14+
eq(__LOC__,then(1,2),5)
15+
16+
17+
Mt.from_pair_suites(__FILE__ ,suites.contents)

‎scripts/build_sorted.ml

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
"debugger";"default";"delete";"do";
3131
"else";
3232
"finally";"for";"function";
33-
"if"; "then"; "in";"instanceof";
33+
"if"; (* "then"; *) "in";"instanceof";
3434
"new";
3535
"return";
3636
"switch";

0 commit comments

Comments
 (0)
Please sign in to comment.