Skip to content

Commit 31672bc

Browse files
committed
snapshot diffs
1 parent d2124fb commit 31672bc

14 files changed

+1567
-706
lines changed

Diff for: jscomp/test/bigarray_test.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ function sum() {
1414

1515
function init(v) {
1616
for(var i = 0 ,i_finish = Caml_missing_polyfill.not_implemented("caml_ba_dim_1") - 1 | 0; i <= i_finish; ++i){
17-
v[i] = /* array */[
18-
Caml_int32.imul(i, i),
19-
Caml_int32.imul(Caml_int32.imul(i, i), i)
17+
v[i] = /* record */[
18+
/* re */Caml_int32.imul(i, i),
19+
/* im */Caml_int32.imul(Caml_int32.imul(i, i), i)
2020
];
2121
}
2222
return /* () */0;

Diff for: jscomp/test/complex_test.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ var suites_000 = /* tuple */[
88
"basic_add",
99
(function () {
1010
return /* Eq */Block.__(0, [
11-
/* array */[
12-
2,
13-
2
11+
/* record */[
12+
/* re */2,
13+
/* im */2
1414
],
1515
Complex.add(Complex.add(Complex.add(Complex.one, Complex.one), Complex.i), Complex.i)
1616
]);

Diff for: jscomp/test/flow_parser_reg_test.js

+30-6
Original file line numberDiff line numberDiff line change
@@ -4467,9 +4467,21 @@ function mem(x, _param) {
44674467

44684468
function create$1(lex_env, mode) {
44694469
var lexbuf = lex_env[/* lex_lb */1];
4470-
var newrecord = lexbuf.slice();
4471-
newrecord[/* lex_buffer */1] = lexbuf[/* lex_buffer */1];
4472-
var lex_env$1 = with_lexbuf(newrecord, lex_env);
4470+
var lexbuf$1 = /* record */[
4471+
/* refill_buff */lexbuf[/* refill_buff */0],
4472+
/* lex_buffer */lexbuf[/* lex_buffer */1],
4473+
/* lex_buffer_len */lexbuf[/* lex_buffer_len */2],
4474+
/* lex_abs_pos */lexbuf[/* lex_abs_pos */3],
4475+
/* lex_start_pos */lexbuf[/* lex_start_pos */4],
4476+
/* lex_curr_pos */lexbuf[/* lex_curr_pos */5],
4477+
/* lex_last_pos */lexbuf[/* lex_last_pos */6],
4478+
/* lex_last_action */lexbuf[/* lex_last_action */7],
4479+
/* lex_eof_reached */lexbuf[/* lex_eof_reached */8],
4480+
/* lex_mem */lexbuf[/* lex_mem */9],
4481+
/* lex_start_p */lexbuf[/* lex_start_p */10],
4482+
/* lex_curr_p */lexbuf[/* lex_curr_p */11]
4483+
];
4484+
var lex_env$1 = with_lexbuf(lexbuf$1, lex_env);
44734485
return /* record */[
44744486
/* la_results : array */[],
44754487
/* la_num_lexed */0,
@@ -4537,9 +4549,21 @@ function lex(t) {
45374549
}
45384550
var lex_env$1 = match$1[0];
45394551
var lexbuf = lex_env$1[/* lex_lb */1];
4540-
var newrecord = lexbuf.slice();
4541-
newrecord[/* lex_buffer */1] = lexbuf[/* lex_buffer */1];
4542-
var cloned_env = with_lexbuf(newrecord, lex_env$1);
4552+
var lexbuf$1 = /* record */[
4553+
/* refill_buff */lexbuf[/* refill_buff */0],
4554+
/* lex_buffer */lexbuf[/* lex_buffer */1],
4555+
/* lex_buffer_len */lexbuf[/* lex_buffer_len */2],
4556+
/* lex_abs_pos */lexbuf[/* lex_abs_pos */3],
4557+
/* lex_start_pos */lexbuf[/* lex_start_pos */4],
4558+
/* lex_curr_pos */lexbuf[/* lex_curr_pos */5],
4559+
/* lex_last_pos */lexbuf[/* lex_last_pos */6],
4560+
/* lex_last_action */lexbuf[/* lex_last_action */7],
4561+
/* lex_eof_reached */lexbuf[/* lex_eof_reached */8],
4562+
/* lex_mem */lexbuf[/* lex_mem */9],
4563+
/* lex_start_p */lexbuf[/* lex_start_p */10],
4564+
/* lex_curr_p */lexbuf[/* lex_curr_p */11]
4565+
];
4566+
var cloned_env = with_lexbuf(lexbuf$1, lex_env$1);
45434567
t[/* la_lex_env */3] = lex_env$1;
45444568
Caml_array.caml_array_set(t[/* la_results */0], t[/* la_num_lexed */1], /* Some */[/* tuple */[
45454569
cloned_env,

Diff for: jscomp/test/mario_game.js

+46-38
Original file line numberDiff line numberDiff line change
@@ -694,9 +694,9 @@ var Sprite = /* module */[
694694
];
695695

696696
function pair_to_xy(pair) {
697-
return /* array */[
698-
pair[0],
699-
pair[1]
697+
return /* record */[
698+
/* x */pair[0],
699+
/* y */pair[1]
700700
];
701701
}
702702

@@ -850,13 +850,13 @@ function make$2($staropt$star, $staropt$star$1, spawnable, context, param) {
850850
var id$1 = id ? id[0] : new_id(/* () */0);
851851
var obj = /* record */[
852852
/* params */params,
853-
/* pos : array */[
854-
param[0],
855-
param[1]
853+
/* pos : record */[
854+
/* x */param[0],
855+
/* y */param[1]
856856
],
857-
/* vel : array */[
858-
0.0,
859-
0.0
857+
/* vel : record */[
858+
/* x */0.0,
859+
/* y */0.0
860860
],
861861
/* id */id$1,
862862
/* jumping */false,
@@ -1221,13 +1221,13 @@ function get_aabb(obj) {
12211221
var sy = match$1[1];
12221222
var sx = match$1[0];
12231223
return /* record */[
1224-
/* center : array */[
1225-
box + sx / 2,
1226-
boy + sy / 2
1224+
/* center : record */[
1225+
/* x */box + sx / 2,
1226+
/* y */boy + sy / 2
12271227
],
1228-
/* half : array */[
1229-
sx / 2,
1230-
sy / 2
1228+
/* half : record */[
1229+
/* x */sx / 2,
1230+
/* y */sy / 2
12311231
]
12321232
];
12331233
}
@@ -1512,17 +1512,17 @@ var Draw = /* module */[
15121512

15131513
function make$3(param, param$1) {
15141514
return /* record */[
1515-
/* pos : array */[
1516-
0,
1517-
0
1515+
/* pos : record */[
1516+
/* x */0,
1517+
/* y */0
15181518
],
1519-
/* v_dim : array */[
1520-
param[0],
1521-
param[1]
1519+
/* v_dim : record */[
1520+
/* x */param[0],
1521+
/* y */param[1]
15221522
],
1523-
/* m_dim : array */[
1524-
param$1[0],
1525-
param$1[1]
1523+
/* m_dim : record */[
1524+
/* x */param$1[0],
1525+
/* y */param$1[1]
15261526
]
15271527
];
15281528
}
@@ -1552,18 +1552,18 @@ function out_of_viewport_below(v, y) {
15521552
}
15531553

15541554
function coord_to_viewport(viewport, coord) {
1555-
return /* array */[
1556-
coord[/* x */0] - viewport[/* pos */0][/* x */0],
1557-
coord[/* y */1] - viewport[/* pos */0][/* y */1]
1555+
return /* record */[
1556+
/* x */coord[/* x */0] - viewport[/* pos */0][/* x */0],
1557+
/* y */coord[/* y */1] - viewport[/* pos */0][/* y */1]
15581558
];
15591559
}
15601560

15611561
function update(vpt, ctr) {
15621562
var new_x = calc_viewport_point(ctr[/* x */0], vpt[/* v_dim */1][/* x */0], vpt[/* m_dim */2][/* x */0]);
15631563
var new_y = calc_viewport_point(ctr[/* y */1], vpt[/* v_dim */1][/* y */1], vpt[/* m_dim */2][/* y */1]);
1564-
var pos = /* array */[
1565-
new_x,
1566-
new_y
1564+
var pos = /* record */[
1565+
/* x */new_x,
1566+
/* y */new_y
15671567
];
15681568
return /* record */[
15691569
/* pos */pos,
@@ -2234,18 +2234,26 @@ function update_loop(canvas, param, map_dim) {
22342234
if (player$1[2][/* kill */8] === true) {
22352235
return game_loss(state[/* ctx */1]);
22362236
} else {
2237-
var newrecord = state.slice();
2238-
newrecord[/* vpt */2] = update(state[/* vpt */2], player$1[2][/* pos */1]);
2237+
var state$1 = /* record */[
2238+
/* bgd */state[/* bgd */0],
2239+
/* ctx */state[/* ctx */1],
2240+
/* vpt */update(state[/* vpt */2], player$1[2][/* pos */1]),
2241+
/* map */state[/* map */3],
2242+
/* score */state[/* score */4],
2243+
/* coins */state[/* coins */5],
2244+
/* multiplier */state[/* multiplier */6],
2245+
/* game_over */state[/* game_over */7]
2246+
];
22392247
List.iter((function (obj) {
2240-
run_update_collid(newrecord, obj, objs);
2248+
run_update_collid(state$1, obj, objs);
22412249
return /* () */0;
22422250
}), objs);
22432251
List.iter((function (part) {
2244-
var state = newrecord;
2252+
var state$2 = state$1;
22452253
var part$1 = part;
22462254
$$process(part$1);
2247-
var x = part$1[/* pos */2][/* x */0] - state[/* vpt */2][/* pos */0][/* x */0];
2248-
var y = part$1[/* pos */2][/* y */1] - state[/* vpt */2][/* pos */0][/* y */1];
2255+
var x = part$1[/* pos */2][/* x */0] - state$2[/* vpt */2][/* pos */0][/* x */0];
2256+
var y = part$1[/* pos */2][/* y */1] - state$2[/* vpt */2][/* pos */0][/* y */1];
22492257
render(part$1[/* params */0][/* sprite */0], /* tuple */[
22502258
x,
22512259
y
@@ -2261,9 +2269,9 @@ function update_loop(canvas, param, map_dim) {
22612269
}
22622270
}), parts);
22632271
fps(canvas, fps$1);
2264-
hud(canvas, newrecord[/* score */4], newrecord[/* coins */5]);
2272+
hud(canvas, state$1[/* score */4], state$1[/* coins */5]);
22652273
requestAnimationFrame((function (t) {
2266-
return update_helper(t, newrecord, player$1, collid_objs[0], particles[0]);
2274+
return update_helper(t, state$1, player$1, collid_objs[0], particles[0]);
22672275
}));
22682276
return /* () */0;
22692277
}

Diff for: jscomp/test/ocaml_proto_test.js

+78-66
Original file line numberDiff line numberDiff line change
@@ -98,73 +98,85 @@ function proto(syntax, file_option, $$package, $$import, message, $$enum, proto$
9898
/* enums : [] */0,
9999
/* extends : [] */0
100100
];
101-
var proto$3;
102-
if (syntax) {
103-
var newrecord = proto$2.slice();
104-
newrecord[/* syntax */0] = syntax;
105-
proto$3 = newrecord;
106-
} else {
107-
proto$3 = proto$2;
108-
}
109-
var proto$4;
110-
if ($$package) {
111-
var newrecord$1 = proto$3.slice();
112-
newrecord$1[/* package */3] = $$package;
113-
proto$4 = newrecord$1;
114-
} else {
115-
proto$4 = proto$3;
116-
}
117-
var proto$5;
118-
if (message) {
119-
var newrecord$2 = proto$4.slice();
120-
newrecord$2[/* messages */4] = /* :: */[
121-
message[0],
122-
proto$2[/* messages */4]
123-
];
124-
proto$5 = newrecord$2;
125-
} else {
126-
proto$5 = proto$4;
127-
}
128-
var proto$6;
129-
if ($$enum) {
130-
var newrecord$3 = proto$5.slice();
131-
newrecord$3[/* enums */5] = /* :: */[
132-
$$enum[0],
133-
proto$2[/* enums */5]
134-
];
135-
proto$6 = newrecord$3;
136-
} else {
137-
proto$6 = proto$5;
138-
}
139-
var proto$7;
140-
if ($$import) {
141-
var newrecord$4 = proto$6.slice();
142-
newrecord$4[/* imports */1] = /* :: */[
143-
$$import[0],
144-
proto$2[/* imports */1]
145-
];
146-
proto$7 = newrecord$4;
147-
} else {
148-
proto$7 = proto$6;
149-
}
150-
var proto$8;
151-
if (file_option) {
152-
var newrecord$5 = proto$7.slice();
153-
newrecord$5[/* file_options */2] = /* :: */[
154-
file_option[0],
155-
proto$2[/* file_options */2]
156-
];
157-
proto$8 = newrecord$5;
158-
} else {
159-
proto$8 = proto$7;
160-
}
101+
var proto$3 = syntax ? /* record */[
102+
/* syntax */syntax,
103+
/* imports */proto$2[/* imports */1],
104+
/* file_options */proto$2[/* file_options */2],
105+
/* package */proto$2[/* package */3],
106+
/* messages */proto$2[/* messages */4],
107+
/* enums */proto$2[/* enums */5],
108+
/* extends */proto$2[/* extends */6]
109+
] : proto$2;
110+
var proto$4 = $$package ? /* record */[
111+
/* syntax */proto$3[/* syntax */0],
112+
/* imports */proto$3[/* imports */1],
113+
/* file_options */proto$3[/* file_options */2],
114+
/* package */$$package,
115+
/* messages */proto$3[/* messages */4],
116+
/* enums */proto$3[/* enums */5],
117+
/* extends */proto$3[/* extends */6]
118+
] : proto$3;
119+
var proto$5 = message ? /* record */[
120+
/* syntax */proto$4[/* syntax */0],
121+
/* imports */proto$4[/* imports */1],
122+
/* file_options */proto$4[/* file_options */2],
123+
/* package */proto$4[/* package */3],
124+
/* messages : :: */[
125+
message[0],
126+
proto$2[/* messages */4]
127+
],
128+
/* enums */proto$4[/* enums */5],
129+
/* extends */proto$4[/* extends */6]
130+
] : proto$4;
131+
var proto$6 = $$enum ? /* record */[
132+
/* syntax */proto$5[/* syntax */0],
133+
/* imports */proto$5[/* imports */1],
134+
/* file_options */proto$5[/* file_options */2],
135+
/* package */proto$5[/* package */3],
136+
/* messages */proto$5[/* messages */4],
137+
/* enums : :: */[
138+
$$enum[0],
139+
proto$2[/* enums */5]
140+
],
141+
/* extends */proto$5[/* extends */6]
142+
] : proto$5;
143+
var proto$7 = $$import ? /* record */[
144+
/* syntax */proto$6[/* syntax */0],
145+
/* imports : :: */[
146+
$$import[0],
147+
proto$2[/* imports */1]
148+
],
149+
/* file_options */proto$6[/* file_options */2],
150+
/* package */proto$6[/* package */3],
151+
/* messages */proto$6[/* messages */4],
152+
/* enums */proto$6[/* enums */5],
153+
/* extends */proto$6[/* extends */6]
154+
] : proto$6;
155+
var proto$8 = file_option ? /* record */[
156+
/* syntax */proto$7[/* syntax */0],
157+
/* imports */proto$7[/* imports */1],
158+
/* file_options : :: */[
159+
file_option[0],
160+
proto$2[/* file_options */2]
161+
],
162+
/* package */proto$7[/* package */3],
163+
/* messages */proto$7[/* messages */4],
164+
/* enums */proto$7[/* enums */5],
165+
/* extends */proto$7[/* extends */6]
166+
] : proto$7;
161167
if (extend) {
162-
var newrecord$6 = proto$8.slice();
163-
newrecord$6[/* extends */6] = /* :: */[
164-
extend[0],
165-
proto$2[/* extends */6]
166-
];
167-
return newrecord$6;
168+
return /* record */[
169+
/* syntax */proto$8[/* syntax */0],
170+
/* imports */proto$8[/* imports */1],
171+
/* file_options */proto$8[/* file_options */2],
172+
/* package */proto$8[/* package */3],
173+
/* messages */proto$8[/* messages */4],
174+
/* enums */proto$8[/* enums */5],
175+
/* extends : :: */[
176+
extend[0],
177+
proto$2[/* extends */6]
178+
]
179+
];
168180
} else {
169181
return proto$8;
170182
}

0 commit comments

Comments
 (0)