-
Notifications
You must be signed in to change notification settings - Fork 464
/
Copy pathcompare_test.js
57 lines (47 loc) · 970 Bytes
/
compare_test.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
// Generated by ReScript, PLEASE EDIT WITH CARE
'use strict';
function compare(x, y) {
switch (x) {
case "A" :
return y === "A";
case "B" :
return y === "B";
case "C" :
return y === "C";
}
}
function compare2(x, y) {
switch (x) {
case "A" :
switch (y) {
case "A" :
return true;
case "B" :
case "C" :
return false;
}
case "B" :
switch (y) {
case "B" :
return true;
case "A" :
case "C" :
return false;
}
case "C" :
switch (y) {
case "A" :
case "B" :
return false;
case "C" :
return true;
}
}
}
function compare3(x, y) {
return x === y;
}
exports.compare = compare;
exports.compare2 = compare2;
exports.compare3 = compare3;
/* No side effect */