Skip to content

Commit fff4e0c

Browse files
committed
promote
1 parent 13dd856 commit fff4e0c

13 files changed

+66
-69
lines changed

compiler/tests-compiler/effects.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ let fff () =
4747
_b_ =
4848
[0,
4949
function(e, cont){
50-
return e === E
50+
return Object.is(e, E)
5151
? cont([0, function(k, cont){return cont(11);}])
5252
: cont(0);
5353
}],

compiler/tests-compiler/effects_continuations.ml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ let%expect_test "test-compiler/lib-effects/test1.ml" =
101101
try{var _C_ = runtime.caml_int_of_string(s), n = _C_;}
102102
catch(_G_){
103103
var _v_ = caml_wrap_exception(_G_);
104-
if(_v_[1] !== Stdlib[7]){
104+
if(! Object.is(_v_[1], Stdlib[7])){
105105
var raise$1 = caml_pop_trap();
106106
return raise$1(caml_maybe_attach_backtrace(_v_, 0));
107107
}
@@ -114,15 +114,15 @@ let%expect_test "test-compiler/lib-effects/test1.ml" =
114114
}
115115
catch(_F_){
116116
var _x_ = caml_wrap_exception(_F_);
117-
if(_x_ !== Stdlib[8]){
117+
if(! Object.is(_x_, Stdlib[8])){
118118
var raise$0 = caml_pop_trap();
119119
return raise$0(caml_maybe_attach_backtrace(_x_, 0));
120120
}
121121
var m = 0, _y_ = 0;
122122
}
123123
runtime.caml_push_trap
124124
(function(_E_){
125-
if(_E_ === Stdlib[8]) return cont(0);
125+
if(Object.is(_E_, Stdlib[8])) return cont(0);
126126
var raise = caml_pop_trap();
127127
return raise(caml_maybe_attach_backtrace(_E_, 0));
128128
});

compiler/tests-compiler/effects_exceptions.ml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ let%expect_test "test-compiler/lib-effects/test1.ml" =
6060
try{var _p_ = runtime.caml_int_of_string(s), n = _p_;}
6161
catch(_t_){
6262
var _i_ = caml_wrap_exception(_t_);
63-
if(_i_[1] !== Stdlib[7]){
63+
if(! Object.is(_i_[1], Stdlib[7])){
6464
var raise$1 = caml_pop_trap();
6565
return raise$1(caml_maybe_attach_backtrace(_i_, 0));
6666
}
@@ -73,15 +73,15 @@ let%expect_test "test-compiler/lib-effects/test1.ml" =
7373
}
7474
catch(_s_){
7575
var _k_ = caml_wrap_exception(_s_);
76-
if(_k_ !== Stdlib[8]){
76+
if(! Object.is(_k_, Stdlib[8])){
7777
var raise$0 = caml_pop_trap();
7878
return raise$0(caml_maybe_attach_backtrace(_k_, 0));
7979
}
8080
var m = 0, _l_ = 0;
8181
}
8282
caml_push_trap
8383
(function(_r_){
84-
if(_r_ === Stdlib[8]) return cont(0);
84+
if(Object.is(_r_, Stdlib[8])) return cont(0);
8585
var raise = caml_pop_trap();
8686
return raise(caml_maybe_attach_backtrace(_r_, 0));
8787
});

compiler/tests-compiler/effects_toplevel.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ let%expect_test "test-compiler/lib-effects/test1.ml" =
8383
_d_,
8484
function(_e_){
8585
var _f_ = i + 1 | 0;
86-
if(5 !== i) return caml_cps_exact_call1(_c_, _f_);
86+
if(! Object.is(5, i)) return caml_cps_exact_call1(_c_, _f_);
8787
caml_callback(g, [0]);
8888
var Test = [0];
8989
runtime.caml_register_global(2, Test, "Test");

compiler/tests-compiler/gh1007.ml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ let () = M.myfun M.x
163163
next = x$0[1],
164164
rev_sort =
165165
function(n, l){
166-
if(2 === n){
166+
if(Object.is(2, n)){
167167
if(l){
168168
var match = l[2];
169169
if(match){
@@ -179,7 +179,7 @@ let () = M.myfun M.x
179179
}
180180
}
181181
}
182-
else if(3 === n && l){
182+
else if(Object.is(3, n) && l){
183183
var _d_ = l[2];
184184
if(_d_){
185185
var match$2 = _d_[2];
@@ -241,7 +241,7 @@ let () = M.myfun M.x
241241
},
242242
sort =
243243
function(n, l){
244-
if(2 === n){
244+
if(Object.is(2, n)){
245245
if(l){
246246
var match = l[2];
247247
if(match){
@@ -257,7 +257,7 @@ let () = M.myfun M.x
257257
}
258258
}
259259
}
260-
else if(3 === n && l){
260+
else if(Object.is(3, n) && l){
261261
var _b_ = l[2];
262262
if(_b_){
263263
var match$2 = _b_[2];
@@ -394,7 +394,7 @@ let () = M.run ()
394394
};
395395
even(i);
396396
var _a_ = i + 1 | 0;
397-
if(4 === i) return 0;
397+
if(Object.is(4, i)) return 0;
398398
var i = _a_;
399399
}
400400
}
@@ -496,7 +496,7 @@ let () = M.run ()
496496
even = closures$0[1];
497497
even(i);
498498
var _e_ = i + 1 | 0;
499-
if(4 !== i){var i = _e_; continue;}
499+
if(! Object.is(4, i)){var i = _e_; continue;}
500500
var
501501
_c_ = caml_call1(Stdlib_List[9], delayed[1]),
502502
_d_ = function(f){return caml_call1(f, 0);};
@@ -623,7 +623,7 @@ let () = M.run ()
623623
continue;
624624
}
625625
var _g_ = i + 1 | 0;
626-
if(4 !== i){var i = _g_; continue a;}
626+
if(! Object.is(4, i)){var i = _g_; continue a;}
627627
var
628628
_e_ = caml_call1(Stdlib_List[9], delayed[1]),
629629
_f_ = function(f){return caml_call1(f, 0);};

compiler/tests-compiler/gh1320.ml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ let () = myfun ()
5151
function(i){
5252
function g(x){return app(f, x);}
5353
function f(x){
54-
return 0 === x ? 1 : runtime.caml_mul(i, app(g, x - 1 | 0));
54+
return Object.is(0, x) ? 1 : runtime.caml_mul(i, app(g, x - 1 | 0));
5555
}
5656
var block = [0, g, f];
5757
return block;
@@ -61,7 +61,7 @@ let () = myfun ()
6161
_b_ = g(i);
6262
caml_call2(Stdlib_Printf[3], _a_, _b_);
6363
var _c_ = i + 1 | 0;
64-
if(4 === i) return 0;
64+
if(Object.is(4, i)) return 0;
6565
var i = _c_;
6666
}
6767
}

compiler/tests-compiler/gh1354.ml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ with Exit ->
6666
try{0; _b_ = _a_ + 1 | 0; throw caml_maybe_attach_backtrace(Stdlib[3], 1);}
6767
catch(_e_){
6868
var _c_ = caml_wrap_exception(_e_);
69-
if(_c_ !== Stdlib[3]) throw caml_maybe_attach_backtrace(_c_, 0);
69+
if(! Object.is(_c_, Stdlib[3])) throw caml_maybe_attach_backtrace(_c_, 0);
7070
caml_call2(Stdlib_Printf[3], _d_, _b_ | 0);
7171
var Test = [0];
7272
runtime.caml_register_global(3, Test, "Test");
@@ -153,7 +153,7 @@ with Exit ->
153153
}
154154
catch(_j_){
155155
var _d_ = caml_wrap_exception(_j_);
156-
if(_d_ !== Stdlib[3]) throw caml_maybe_attach_backtrace(_d_, 0);
156+
if(! Object.is(_d_, Stdlib[3])) throw caml_maybe_attach_backtrace(_d_, 0);
157157
caml_call3(Stdlib_Printf[3], _e_, _c_ | 0, _b_);
158158
var Test = [0];
159159
runtime.caml_register_global(4, Test, "Test");
@@ -229,7 +229,7 @@ with Exit ->
229229
}
230230
catch(_h_){
231231
var _c_ = caml_wrap_exception(_h_);
232-
if(_c_ !== Stdlib[3]) throw caml_maybe_attach_backtrace(_c_, 0);
232+
if(! Object.is(_c_, Stdlib[3])) throw caml_maybe_attach_backtrace(_c_, 0);
233233
caml_call2(Stdlib_Printf[3], _d_, _b_);
234234
var Test = [0];
235235
runtime.caml_register_global(4, Test, "Test");

compiler/tests-compiler/lazy.ml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,13 @@ let%expect_test "static eval of string get" =
3434
[%expect
3535
{|
3636
function do_the_lazy_rec(n){
37-
if(0 === n) return 0;
37+
if(Object.is(0, n)) return 0;
3838
var _b_ = do_the_lazy_rec(n - 1 | 0), _c_ = runtime.caml_obj_tag(lz);
39-
if(250 === _c_)
39+
if(Object.is(250, _c_))
4040
var _d_ = lz[1];
4141
else{
4242
var switch$0 = 0;
43-
if(246 !== _c_ && 244 !== _c_){var _d_ = lz; switch$0 = 1;}
43+
if(! Object.is(246, _c_) && ! Object.is(244, _c_)){var _d_ = lz; switch$0 = 1;}
4444
if(! switch$0) var _d_ = caml_call1(CamlinternalLazy[2], lz);
4545
}
4646
return [0, _d_, _b_];

compiler/tests-compiler/loops.ml

Lines changed: 24 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -85,20 +85,20 @@ let rec fun_with_loop acc = function
8585
return caml_call1(Stdlib_List[9], _d_);
8686
}
8787
var x = param$0[1];
88-
if(1 === x && ! param$0[2]){
88+
if(Object.is(1, x) && ! param$0[2]){
8989
var a$0 = [0, acc$0], i$0 = 0;
9090
for(;;){
9191
a$0[1] = [0, 1, a$0[1]];
9292
var _b_ = i$0 + 1 | 0;
93-
if(10 === i$0) return a$0[1];
93+
if(Object.is(10, i$0)) return a$0[1];
9494
var i$0 = _b_;
9595
}
9696
}
9797
var xs = param$0[2], a = [0, acc$0], i = 0;
9898
for(;;){
9999
a[1] = [0, 1, a[1]];
100100
var _a_ = i + 1 | 0;
101-
if(10 !== i){var i = _a_; continue;}
101+
if(! Object.is(10, i)){var i = _a_; continue;}
102102
var acc$1 = [0, x, a[1]], acc$0 = acc$1, param$0 = xs;
103103
continue a;
104104
}
@@ -135,9 +135,9 @@ let for_for_while () =
135135
for(;;){
136136
if(10 > runtime.caml_mul(k, j)){id[1]++; continue;}
137137
var _b_ = j + 1 | 0;
138-
if(10 !== j){var j = _b_; continue b;}
138+
if(! Object.is(10, j)){var j = _b_; continue b;}
139139
var _a_ = k + 1 | 0;
140-
if(10 === k) return 0;
140+
if(Object.is(10, k)) return 0;
141141
var k = _a_;
142142
continue a;
143143
}
@@ -179,9 +179,9 @@ let for_for_while () =
179179
continue;
180180
}
181181
var _b_ = j + 1 | 0;
182-
if(10 !== j){var j = _b_; continue b;}
182+
if(! Object.is(10, j)){var j = _b_; continue b;}
183183
var _a_ = k + 1 | 0;
184-
if(10 === k) return 0;
184+
if(Object.is(10, k)) return 0;
185185
var k = _a_;
186186
continue a;
187187
}
@@ -257,7 +257,7 @@ let f t x =
257257
try{var val$0 = caml_call2(Stdlib_Hashtbl[6], t, x);}
258258
catch(_f_){
259259
var _c_ = caml_wrap_exception(_f_);
260-
if(_c_ === Stdlib[8]) return - 1;
260+
if(Object.is(_c_, Stdlib[8])) return - 1;
261261
throw caml_maybe_attach_backtrace(_c_, 0);
262262
}
263263
if(val$0 && ! val$0[2]){
@@ -267,13 +267,13 @@ let f t x =
267267
try{var val = caml_call2(Stdlib_Hashtbl[6], t, x$0); switch$0 = 1;}
268268
catch(_e_){
269269
var _a_ = caml_wrap_exception(_e_);
270-
if(_a_ !== Stdlib[3]) throw caml_maybe_attach_backtrace(_a_, 0);
270+
if(! Object.is(_a_, Stdlib[3])) throw caml_maybe_attach_backtrace(_a_, 0);
271271
var _d_ = 0;
272272
}
273273
if(switch$0){
274274
var switch$1 = 0;
275275
if(val && ! val[2]){
276-
var y = val[1], _b_ = y === (x$0 + 1 | 0) ? 1 : 0;
276+
var y = val[1], _b_ = Object.is(y, x$0 + 1 | 0) ? 1 : 0;
277277
if(! _b_){var x$0 = y; continue;}
278278
var _d_ = _b_;
279279
switch$1 = 1;
@@ -313,8 +313,8 @@ in loop x
313313
function inspect(x){
314314
var x$1 = x;
315315
for(;;){
316-
if(0 === x$1) return 1;
317-
if(1 !== x$1){var x$2 = x$1 + 1 | 0, x$1 = x$2; continue;}
316+
if(Object.is(0, x$1)) return 1;
317+
if(! Object.is(1, x$1)){var x$2 = x$1 + 1 | 0, x$1 = x$2; continue;}
318318
var x$0 = 2;
319319
for(;;){
320320
var switch$0 = 0;
@@ -431,34 +431,34 @@ let add_substitute =
431431
var lim$1 = caml_ml_string_length(s), previous = 32, i$4 = 0;
432432
for(;;){
433433
if(i$4 >= lim$1){
434-
var _b_ = 92 === previous ? 1 : 0;
434+
var _b_ = Object.is(92, previous) ? 1 : 0;
435435
return _b_ ? caml_call2(add_char, b, previous) : _b_;
436436
}
437437
var previous$0 = caml_string_get(s, i$4);
438-
if(36 !== previous$0){
439-
if(92 === previous){
438+
if(! Object.is(36, previous$0)){
439+
if(Object.is(92, previous)){
440440
caml_call2(add_char, b, 92);
441441
caml_call2(add_char, b, previous$0);
442442
var i$6 = i$4 + 1 | 0, previous = 32, i$4 = i$6;
443443
continue;
444444
}
445-
if(92 === previous$0){
445+
if(Object.is(92, previous$0)){
446446
var i$7 = i$4 + 1 | 0, previous = previous$0, i$4 = i$7;
447447
continue;
448448
}
449449
caml_call2(add_char, b, previous$0);
450450
var i$8 = i$4 + 1 | 0, previous = previous$0, i$4 = i$8;
451451
continue;
452452
}
453-
if(92 === previous){
453+
if(Object.is(92, previous)){
454454
caml_call2(add_char, b, previous$0);
455455
var i$5 = i$4 + 1 | 0, previous = 32, i$4 = i$5;
456456
continue;
457457
}
458458
var start$0 = i$4 + 1 | 0;
459459
if(lim$1 <= start$0) throw caml_maybe_attach_backtrace(Stdlib[8], 1);
460460
var opening = caml_string_get(s, start$0), switch$0 = 0;
461-
if(40 !== opening && 123 !== opening){
461+
if(! Object.is(40, opening) && ! Object.is(123, opening)){
462462
var start = start$0 + 1 | 0, lim$0 = caml_ml_string_length(s), i$2 = start;
463463
for(;;){
464464
if(lim$0 <= i$2)
@@ -469,7 +469,7 @@ let add_substitute =
469469
if(97 <= match){
470470
if(123 > match) switch$1 = 1;
471471
}
472-
else if(95 === match) switch$1 = 1;
472+
else if(Object.is(95, match)) switch$1 = 1;
473473
}
474474
else if(58 <= match){
475475
if(65 <= match) switch$1 = 1;
@@ -489,25 +489,22 @@ let add_substitute =
489489
}
490490
if(! switch$0){
491491
var new_start = start$0 + 1 | 0, k$2 = 0;
492-
if(40 === opening)
492+
if(Object.is(40, opening))
493493
var closing = 41;
494494
else{
495-
if(123 !== opening)
495+
if(! Object.is(123, opening))
496496
throw caml_maybe_attach_backtrace([0, Assert_failure, _a_], 1);
497497
var closing = 125;
498498
}
499499
var lim = caml_ml_string_length(s), k = k$2, stop = new_start;
500500
for(;;){
501501
if(lim <= stop) throw caml_maybe_attach_backtrace(Stdlib[8], 1);
502-
if(caml_string_get(s, stop) === opening){
502+
if(Object.is(caml_string_get(s, stop), opening)){
503503
var i = stop + 1 | 0, k$0 = k + 1 | 0, k = k$0, stop = i;
504504
continue;
505505
}
506-
if(caml_string_get(s, stop) !== closing){
507-
var i$1 = stop + 1 | 0, stop = i$1;
508-
continue;
509-
}
510-
if(0 !== k){
506+
if(! Object.is(caml_string_get(s, stop), closing)){var i$1 = stop + 1 | 0, stop = i$1; continue;}
507+
if(! Object.is(0, k)){
511508
var i$0 = stop + 1 | 0, k$1 = k - 1 | 0, k = k$1, stop = i$0;
512509
continue;
513510
}

compiler/tests-compiler/match_with_exn.ml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -77,13 +77,13 @@ let fun2 () =
7777
try{var i$1 = caml_call1(Stdlib_Random[5], 2);}
7878
catch(_e_){
7979
var _d_ = caml_wrap_exception(_e_);
80-
if(_d_[1] !== A) throw caml_maybe_attach_backtrace(_d_, 0);
80+
if(! Object.is(_d_[1], A)) throw caml_maybe_attach_backtrace(_d_, 0);
8181
var i = _d_[2];
82-
if(2 !== i) return i + 2 | 0;
82+
if(! Object.is(2, i)) return i + 2 | 0;
8383
var i$0 = i;
8484
switch$0 = 1;
8585
}
86-
if(! switch$0){if(0 !== i$1) return i$1 + 1 | 0; var i$0 = i$1;}
86+
if(! switch$0){if(! Object.is(0, i$1)) return i$1 + 1 | 0; var i$0 = i$1;}
8787
return i$0;
8888
}
8989
//end
@@ -92,15 +92,15 @@ let fun2 () =
9292
try{var i$0 = caml_call1(Stdlib_Random[5], 2);}
9393
catch(_c_){
9494
var _a_ = caml_wrap_exception(_c_), switch$1 = 0;
95-
if(_a_[1] === A){
95+
if(Object.is(_a_[1], A)){
9696
var _b_ = _a_[2];
97-
if(2 === _b_){var i = _b_; switch$0 = 1;} else switch$1 = 1;
97+
if(Object.is(2, _b_)){var i = _b_; switch$0 = 1;} else switch$1 = 1;
9898
}
9999
else
100100
switch$1 = 1;
101101
if(switch$1) throw caml_maybe_attach_backtrace(_a_, 0);
102102
}
103-
if(! switch$0){if(0 !== i$0) return i$0 + 1 | 0; var i = i$0;}
103+
if(! switch$0){if(! Object.is(0, i$0)) return i$0 + 1 | 0; var i = i$0;}
104104
return i;
105105
}
106106
//end |}]

0 commit comments

Comments
 (0)