-
Notifications
You must be signed in to change notification settings - Fork 460
/
Copy pathundef_regression2_test.js
97 lines (81 loc) · 1.94 KB
/
undef_regression2_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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
// Generated by ReScript, PLEASE EDIT WITH CARE
'use strict';
let Mt = require("./mt.js");
let Caml_option = require("../../lib/js/caml_option.js");
let suites = {
contents: /* [] */0
};
let test_id = {
contents: 0
};
function eq(loc, x, y) {
test_id.contents = test_id.contents + 1 | 0;
suites.contents = {
hd: [
loc + (" id " + String(test_id.contents)),
(function () {
return {
TAG: "Eq",
_0: x,
_1: y
};
})
],
tl: suites.contents
};
}
function ok(loc, x) {
test_id.contents = test_id.contents + 1 | 0;
suites.contents = {
hd: [
loc + (" id " + String(test_id.contents)),
(function () {
return {
TAG: "Ok",
_0: x
};
})
],
tl: suites.contents
};
}
let match = typeof ___undefined_value === "undefined" ? undefined : ___undefined_value;
let a = match !== undefined ? 2 : 1;
function test() {
let match = typeof __DEV__ === "undefined" ? undefined : __DEV__;
if (match !== undefined) {
console.log("dev mode");
} else {
console.log("producton mode");
}
}
function test2() {
let f = typeof __filename === "undefined" ? undefined : __filename;
if (f !== undefined) {
console.log(f);
} else {
console.log("non node environment");
}
}
function test3() {
if (Caml_option.undefined_to_opt(typeof __DEV__ === "undefined" ? undefined : __DEV__) === undefined) {
console.log("production mode");
return;
}
}
function f(x) {
return x === undefined;
}
ok("File \"undef_regression2_test.res\", line 40, characters 5-12", a > 0);
eq("File \"undef_regression2_test.res\", line 41, characters 5-12", a, 1);
Mt.from_pair_suites("Undef_regression2_test", suites.contents);
exports.suites = suites;
exports.test_id = test_id;
exports.eq = eq;
exports.ok = ok;
exports.a = a;
exports.test = test;
exports.test2 = test2;
exports.test3 = test3;
exports.f = f;
/* match Not a pure module */