Skip to content

Commit 46d6894

Browse files
committed
snapshot
1 parent 0fa9c8f commit 46d6894

28 files changed

+708
-728
lines changed

Diff for: jscomp/test/a_filename_test.js

+55-55
Original file line numberDiff line numberDiff line change
@@ -44,61 +44,61 @@ eq("File \"a_filename_test.ml\", line 10, characters 5-12", /* tuple */[
4444
"/a/tmp.txt/subdir/file.txt"
4545
]);
4646

47-
eq("File \"a_filename_test.ml\", line 22, characters 5-12", Ext_filename_test.node_relative_path(true, /* `File */[
48-
781515420,
49-
"./a/b.c"
50-
], /* `File */[
51-
781515420,
52-
"./a/u/g.c"
53-
]), "./u/g.c");
54-
55-
eq("File \"a_filename_test.ml\", line 27, characters 5-12", Ext_filename_test.node_relative_path(true, /* `File */[
56-
781515420,
57-
"./a/b.c"
58-
], /* `File */[
59-
781515420,
60-
"xxxghsoghos/ghsoghso/node_modules/buckle-stdlib/list.js"
61-
]), "buckle-stdlib/list.js");
62-
63-
eq("File \"a_filename_test.ml\", line 33, characters 5-12", Ext_filename_test.node_relative_path(true, /* `File */[
64-
781515420,
65-
"./a/b.c"
66-
], /* `File */[
67-
781515420,
68-
"xxxghsoghos/ghsoghso/node_modules//buckle-stdlib/list.js"
69-
]), "buckle-stdlib/list.js");
70-
71-
eq("File \"a_filename_test.ml\", line 39, characters 5-12", Ext_filename_test.node_relative_path(true, /* `File */[
72-
781515420,
73-
"./a/b.c"
74-
], /* `File */[
75-
781515420,
76-
"xxxghsoghos/ghsoghso/node_modules/./buckle-stdlib/list.js"
77-
]), "buckle-stdlib/list.js");
78-
79-
eq("File \"a_filename_test.ml\", line 45, characters 5-12", Ext_filename_test.node_relative_path(true, /* `File */[
80-
781515420,
81-
"./a/c.js"
82-
], /* `File */[
83-
781515420,
84-
"./a/b"
85-
]), "./b");
86-
87-
eq("File \"a_filename_test.ml\", line 50, characters 5-12", Ext_filename_test.node_relative_path(true, /* `File */[
88-
781515420,
89-
"./a/c"
90-
], /* `File */[
91-
781515420,
92-
"./a/b.js"
93-
]), "./b.js");
94-
95-
eq("File \"a_filename_test.ml\", line 55, characters 5-12", Ext_filename_test.node_relative_path(true, /* `Dir */[
96-
3405101,
97-
"./a/"
98-
], /* `File */[
99-
781515420,
100-
"./a/b.js"
101-
]), "./b.js");
47+
eq("File \"a_filename_test.ml\", line 22, characters 5-12", Ext_filename_test.node_relative_path(true, {
48+
HASH: /* File */781515420,
49+
value: "./a/b.c"
50+
}, {
51+
HASH: /* File */781515420,
52+
value: "./a/u/g.c"
53+
}), "./u/g.c");
54+
55+
eq("File \"a_filename_test.ml\", line 27, characters 5-12", Ext_filename_test.node_relative_path(true, {
56+
HASH: /* File */781515420,
57+
value: "./a/b.c"
58+
}, {
59+
HASH: /* File */781515420,
60+
value: "xxxghsoghos/ghsoghso/node_modules/buckle-stdlib/list.js"
61+
}), "buckle-stdlib/list.js");
62+
63+
eq("File \"a_filename_test.ml\", line 33, characters 5-12", Ext_filename_test.node_relative_path(true, {
64+
HASH: /* File */781515420,
65+
value: "./a/b.c"
66+
}, {
67+
HASH: /* File */781515420,
68+
value: "xxxghsoghos/ghsoghso/node_modules//buckle-stdlib/list.js"
69+
}), "buckle-stdlib/list.js");
70+
71+
eq("File \"a_filename_test.ml\", line 39, characters 5-12", Ext_filename_test.node_relative_path(true, {
72+
HASH: /* File */781515420,
73+
value: "./a/b.c"
74+
}, {
75+
HASH: /* File */781515420,
76+
value: "xxxghsoghos/ghsoghso/node_modules/./buckle-stdlib/list.js"
77+
}), "buckle-stdlib/list.js");
78+
79+
eq("File \"a_filename_test.ml\", line 45, characters 5-12", Ext_filename_test.node_relative_path(true, {
80+
HASH: /* File */781515420,
81+
value: "./a/c.js"
82+
}, {
83+
HASH: /* File */781515420,
84+
value: "./a/b"
85+
}), "./b");
86+
87+
eq("File \"a_filename_test.ml\", line 50, characters 5-12", Ext_filename_test.node_relative_path(true, {
88+
HASH: /* File */781515420,
89+
value: "./a/c"
90+
}, {
91+
HASH: /* File */781515420,
92+
value: "./a/b.js"
93+
}), "./b.js");
94+
95+
eq("File \"a_filename_test.ml\", line 55, characters 5-12", Ext_filename_test.node_relative_path(true, {
96+
HASH: /* Dir */3405101,
97+
value: "./a/"
98+
}, {
99+
HASH: /* File */781515420,
100+
value: "./a/b.js"
101+
}), "./b.js");
102102

103103
eq("File \"a_filename_test.ml\", line 60, characters 5-12", Ext_filename_test.get_extension("a.txt"), ".txt");
104104

Diff for: jscomp/test/bs_unwrap_test.js

+24-24
Original file line numberDiff line numberDiff line change
@@ -12,22 +12,22 @@ console.log(1337);
1212

1313
console.log("hello world");
1414

15-
var arg_string = /* `String */[
16-
-976970511,
17-
"hi runtime"
18-
];
15+
var arg_string = {
16+
HASH: /* String */-976970511,
17+
value: "hi runtime"
18+
};
1919

20-
console.log(arg_string[1]);
20+
console.log(arg_string.value);
2121

22-
var arg_pair = /* `Pair */[
23-
892012602,
24-
/* tuple */[
22+
var arg_pair = {
23+
HASH: /* Pair */892012602,
24+
value: /* tuple */[
2525
"hi",
2626
1
2727
]
28-
];
28+
};
2929

30-
console.log(arg_pair[1]);
30+
console.log(arg_pair.value);
3131

3232
console.log(undefined);
3333

@@ -39,10 +39,10 @@ console.log(3, "hi");
3939

4040
console.log(4, undefined);
4141

42-
var some_arg = /* `Bool */[
43-
737456202,
44-
true
45-
];
42+
var some_arg = {
43+
HASH: /* Bool */737456202,
44+
value: true
45+
};
4646

4747
console.log(5, Caml_option.option_unwrap(some_arg));
4848

@@ -51,17 +51,17 @@ console.log(6, undefined);
5151
console.log(7, Caml_option.option_unwrap((console.log("trace"), undefined)));
5252

5353
function dyn_log3(prim, prim$1, prim$2) {
54-
console.log(prim[1], Caml_option.option_unwrap(prim$1));
54+
console.log(prim.value, Caml_option.option_unwrap(prim$1));
5555

5656
}
5757

58-
dyn_log3(/* `Int */[
59-
3654863,
60-
8
61-
], /* `Bool */[
62-
737456202,
63-
true
64-
], undefined);
58+
dyn_log3({
59+
HASH: /* Int */3654863,
60+
value: 8
61+
}, {
62+
HASH: /* Bool */737456202,
63+
value: true
64+
}, undefined);
6565

6666
console.log("foo");
6767

@@ -70,7 +70,7 @@ console.log({
7070
});
7171

7272
function dyn_log4(prim) {
73-
console.log(prim[1]);
73+
console.log(prim.value);
7474

7575
}
7676

@@ -79,7 +79,7 @@ console.log({
7979
});
8080

8181
function f(x) {
82-
console.log(x[1]);
82+
console.log(x.value);
8383

8484
}
8585

Diff for: jscomp/test/ext_array_test.js

+8-8
Original file line numberDiff line numberDiff line change
@@ -201,13 +201,13 @@ function rfind_and_split(arr, cmp, v) {
201201
if (i < 0) {
202202
return /* No_split */-226265796;
203203
} else {
204-
return /* `Split */[
205-
345791162,
206-
/* tuple */[
204+
return {
205+
HASH: /* Split */345791162,
206+
value: /* tuple */[
207207
$$Array.sub(arr, 0, i),
208208
$$Array.sub(arr, i + 1 | 0, (arr.length - i | 0) - 1 | 0)
209209
]
210-
];
210+
};
211211
}
212212
}
213213

@@ -232,13 +232,13 @@ function find_and_split(arr, cmp, v) {
232232
if (i < 0) {
233233
return /* No_split */-226265796;
234234
} else {
235-
return /* `Split */[
236-
345791162,
237-
/* tuple */[
235+
return {
236+
HASH: /* Split */345791162,
237+
value: /* tuple */[
238238
$$Array.sub(arr, 0, i),
239239
$$Array.sub(arr, i + 1 | 0, (arr.length - i | 0) - 1 | 0)
240240
]
241-
];
241+
};
242242
}
243243
}
244244

Diff for: jscomp/test/ext_filename_test.js

+16-16
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,8 @@ function chop_extension_if_any(fname) {
111111
var os_path_separator_char = Filename.dir_sep.charCodeAt(0);
112112

113113
function relative_path(file_or_dir_1, file_or_dir_2) {
114-
var relevant_dir1 = file_or_dir_1[0] >= 781515420 ? Curry._1(Filename.dirname, file_or_dir_1[1]) : file_or_dir_1[1];
115-
var relevant_dir2 = file_or_dir_2[0] >= 781515420 ? Curry._1(Filename.dirname, file_or_dir_2[1]) : file_or_dir_2[1];
114+
var relevant_dir1 = file_or_dir_1.HASH >= 781515420 ? Curry._1(Filename.dirname, file_or_dir_1.value) : file_or_dir_1.value;
115+
var relevant_dir2 = file_or_dir_2.HASH >= 781515420 ? Curry._1(Filename.dirname, file_or_dir_2.value) : file_or_dir_2.value;
116116
var dir1 = Ext_string_test.split(undefined, relevant_dir1, os_path_separator_char);
117117
var dir2 = Ext_string_test.split(undefined, relevant_dir2, os_path_separator_char);
118118
var go = function (_dir1, _dir2) {
@@ -141,23 +141,23 @@ function relative_path(file_or_dir_1, file_or_dir_2) {
141141
}
142142

143143
function node_relative_path(node_modules_shorten, file1, dep_file) {
144-
var file2 = dep_file[1];
144+
var file2 = dep_file.value;
145145
var v = Ext_string_test.find(undefined, Test_literals.node_modules, file2);
146146
var len = file2.length;
147147
if (!(node_modules_shorten && v >= 0)) {
148-
return relative_path(dep_file[0] >= 781515420 ? /* `File */[
149-
781515420,
150-
absolute_path(dep_file[1])
151-
] : /* `Dir */[
152-
3405101,
153-
absolute_path(dep_file[1])
154-
], file1[0] >= 781515420 ? /* `File */[
155-
781515420,
156-
absolute_path(file1[1])
157-
] : /* `Dir */[
158-
3405101,
159-
absolute_path(file1[1])
160-
]) + (node_sep + Curry._1(Filename.basename, file2));
148+
return relative_path(dep_file.HASH >= 781515420 ? ({
149+
HASH: /* File */781515420,
150+
value: absolute_path(dep_file.value)
151+
}) : ({
152+
HASH: /* Dir */3405101,
153+
value: absolute_path(dep_file.value)
154+
}), file1.HASH >= 781515420 ? ({
155+
HASH: /* File */781515420,
156+
value: absolute_path(file1.value)
157+
}) : ({
158+
HASH: /* Dir */3405101,
159+
value: absolute_path(file1.value)
160+
})) + (node_sep + Curry._1(Filename.basename, file2));
161161
}
162162
var skip = function (_i) {
163163
while(true) {

Diff for: jscomp/test/fun_pattern_match.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -71,18 +71,18 @@ function f4(param) {
7171
};
7272
}
7373

74-
var x = /* `A */[
75-
65,
76-
r
77-
];
74+
var x = {
75+
HASH: /* A */65,
76+
value: r
77+
};
7878

7979
function r(param) {
8080
return x;
8181
}
8282

8383
var match = r(undefined);
8484

85-
var v = Curry._1(match[1], undefined);
85+
var v = Curry._1(match.value, undefined);
8686

8787
console.log(v);
8888

Diff for: jscomp/test/gpr_1891_test.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
var Curry = require("../../lib/js/curry.js");
44

55
function foo(x) {
6-
if (typeof x === "number" || x[0] !== 3505894 || x[1] !== 3) {
6+
if (typeof x === "number" || x.HASH !== 3505894 || x.value !== 3) {
77
console.log("2");
88
} else {
99
console.log("1");
@@ -12,31 +12,31 @@ function foo(x) {
1212
}
1313

1414
function foo2(x) {
15-
if (typeof x === "number" || x[0] !== 3505894 || x[1] !== 3) {
15+
if (typeof x === "number" || x.HASH !== 3505894 || x.value !== 3) {
1616
return "xxx";
1717
} else {
1818
return "xxxx";
1919
}
2020
}
2121

2222
function foo3(x) {
23-
if (typeof x === "number" || x[0] !== 3505894 || x[1] !== 3) {
23+
if (typeof x === "number" || x.HASH !== 3505894 || x.value !== 3) {
2424
return 2;
2525
} else {
2626
return 1;
2727
}
2828
}
2929

3030
function foo4(x, h) {
31-
if (typeof x === "number" || x[0] !== 3505894 || x[1] !== 3) {
31+
if (typeof x === "number" || x.HASH !== 3505894 || x.value !== 3) {
3232
return ;
3333
} else {
3434
return Curry._1(h, undefined);
3535
}
3636
}
3737

3838
function foo5(x) {
39-
if (typeof x === "number" || x[0] !== 3505894 || x[1] !== 3) {
39+
if (typeof x === "number" || x.HASH !== 3505894 || x.value !== 3) {
4040
console.log("x");
4141
} else {
4242
console.log("hi");

Diff for: jscomp/test/gpr_2633_test.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -4,27 +4,27 @@ var Curry = require("../../lib/js/curry.js");
44

55
function on1(foo, $$event) {
66
foo.on((function () {
7-
switch ($$event[0]) {
7+
switch ($$event.HASH) {
88
case 4895187 :
99
return "bar";
1010
case 5097222 :
1111
return "foo";
1212

1313
}
14-
})(), $$event[1]);
14+
})(), $$event.value);
1515

1616
}
1717

1818
function on2(foo, h, $$event) {
1919
foo.on((function () {
20-
switch (Curry._1(h, $$event)[0]) {
20+
switch (Curry._1(h, $$event).HASH) {
2121
case 4895187 :
2222
return "bar";
2323
case 5097222 :
2424
return "foo";
2525

2626
}
27-
})(), Curry._1(h, $$event)[1]);
27+
})(), Curry._1(h, $$event).value);
2828

2929
}
3030

0 commit comments

Comments
 (0)