Skip to content

Commit 19fdb93

Browse files
committed
fmt
1 parent fb1b284 commit 19fdb93

File tree

6 files changed

+130
-53
lines changed

6 files changed

+130
-53
lines changed

runtime/js/array.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -120,8 +120,9 @@ function caml_array_set(array, index, newval) {
120120
//Alias: caml_floatarray_unsafe_set
121121
//Alias: caml_array_unsafe_set_addr
122122
//Inline
123-
function caml_array_unsafe_set(a,i,v) { return a[i + 1] = v}
124-
123+
function caml_array_unsafe_set(a, i, v) {
124+
return (a[i + 1] = v);
125+
}
125126

126127
//Provides: caml_array_get mutable (mutable, const)
127128
//Requires: caml_array_bound_error
@@ -137,7 +138,9 @@ function caml_array_get(array, index) {
137138
//Alias: caml_array_unsafe_get_float
138139
//Alias: caml_floatarray_unsafe_get
139140
//Inline
140-
function caml_array_unsafe_get(a,i) { return a[i + 1] }
141+
function caml_array_unsafe_get(a, i) {
142+
return a[i + 1];
143+
}
141144
//Provides: caml_array_fill
142145
function caml_array_fill(array, ofs, len, v) {
143146
for (var i = 0; i < len; i++) {

runtime/js/format.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,8 +141,9 @@ function caml_finish_formatting(f, rawbuffer) {
141141
return caml_string_of_jsbytes(buffer);
142142
}
143143

144-
145144
//Provides: caml_format_int_special
146145
//Alias: %caml_format_int_special
147146
//Inline
148-
function caml_format_int_special(x) { return "" + x }
147+
function caml_format_int_special(x) {
148+
return "" + x;
149+
}

runtime/js/ieee_754.js

Lines changed: 78 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -275,114 +275,159 @@ function caml_float_compare(x, y) {
275275

276276
//Provides: caml_eq_float const
277277
//Inline
278-
function caml_eq_float(a,b) { return a === b ? 1 : 0; }
278+
function caml_eq_float(a, b) {
279+
return a === b ? 1 : 0;
280+
}
279281

280282
//Provides: caml_neq_float const
281283
//Inline
282-
function caml_neq_float(a,b) { return a !== b ? 1 : 0; }
284+
function caml_neq_float(a, b) {
285+
return a !== b ? 1 : 0;
286+
}
283287

284288
//Provides: caml_ge_float const
285289
//Inline
286-
function caml_ge_float(a,b) { return a >= b ? 1 : 0; }
290+
function caml_ge_float(a, b) {
291+
return a >= b ? 1 : 0;
292+
}
287293

288294
//Provides: caml_le_float const
289295
//Inline
290-
function caml_le_float(a,b) { return a <= b? 1 : 0; }
296+
function caml_le_float(a, b) {
297+
return a <= b ? 1 : 0;
298+
}
291299

292300
//Provides: caml_gt_float const
293301
//Inline
294-
function caml_gt_float(a,b) { return a > b? 1 : 0; }
302+
function caml_gt_float(a, b) {
303+
return a > b ? 1 : 0;
304+
}
295305

296306
//Provides: caml_lt_float const
297307
//Inline
298-
function caml_lt_float(a,b) { return a < b? 1 : 0; }
299-
308+
function caml_lt_float(a, b) {
309+
return a < b ? 1 : 0;
310+
}
300311

301312
//Provides: caml_add_float const
302313
//Inline
303-
function caml_add_float(a,b) { return a + b }
314+
function caml_add_float(a, b) {
315+
return a + b;
316+
}
304317

305318
//Provides: caml_sub_float const
306319
//Inline
307-
function caml_sub_float(a,b) { return a - b; }
320+
function caml_sub_float(a, b) {
321+
return a - b;
322+
}
308323

309324
//Provides: caml_mul_float const
310325
//Inline
311-
function caml_mul_float(a,b) { return a * b; }
326+
function caml_mul_float(a, b) {
327+
return a * b;
328+
}
312329

313330
//Provides: caml_div_float const
314331
//Inline
315-
function caml_div_float(a,b) { return a / b; }
332+
function caml_div_float(a, b) {
333+
return a / b;
334+
}
316335

317336
//Provides: caml_neg_float const
318337
//Inline
319-
function caml_neg_float(a) { return -a ; }
338+
function caml_neg_float(a) {
339+
return -a;
340+
}
320341

321342
//Provides: caml_fmod_float const
322343
//Inline
323-
function caml_fmod_float(a,b) { return a % b; }
344+
function caml_fmod_float(a, b) {
345+
return a % b;
346+
}
324347

325348
//Provides: caml_abs_float const
326349
//Inline
327-
function caml_abs_float (a) { return Math.abs(a) }
350+
function caml_abs_float(a) {
351+
return Math.abs(a);
352+
}
328353

329354
//Provides: caml_acos_float const
330355
//Inline
331-
function caml_acos_float (a) { return Math.acos(a) }
332-
356+
function caml_acos_float(a) {
357+
return Math.acos(a);
358+
}
333359

334360
//Provides: caml_asin_float const
335361
//Inline
336-
function caml_asin_float (a) { return Math.asin(a) }
362+
function caml_asin_float(a) {
363+
return Math.asin(a);
364+
}
337365

338366
//Provides: caml_atan_float const
339367
//Inline
340-
function caml_atan_float (a) { return Math.atan(a) }
368+
function caml_atan_float(a) {
369+
return Math.atan(a);
370+
}
341371

342372
//Provides: caml_atan2_float const
343373
//Inline
344-
function caml_atan2_float (a,b) { return Math.atan2(a,b) }
374+
function caml_atan2_float(a, b) {
375+
return Math.atan2(a, b);
376+
}
345377

346378
//Provides: caml_ceil_float const
347379
//Inline
348-
function caml_ceil_float (a) { return Math.ceil(a) }
380+
function caml_ceil_float(a) {
381+
return Math.ceil(a);
382+
}
349383

350384
//Provides: caml_cos_float const
351385
//Inline
352-
function caml_cos_float (a) { return Math.cos(a) }
386+
function caml_cos_float(a) {
387+
return Math.cos(a);
388+
}
353389

354390
//Provides: caml_exp_float const
355391
//Inline
356-
function caml_exp_float (a) { return Math.exp(a) }
357-
392+
function caml_exp_float(a) {
393+
return Math.exp(a);
394+
}
358395

359396
//Provides: caml_floor_float const
360397
//Inline
361-
function caml_floor_float (a) { return Math.floor(a) }
362-
398+
function caml_floor_float(a) {
399+
return Math.floor(a);
400+
}
363401

364402
//Provides: caml_log_float const
365403
//Inline
366-
function caml_log_float (a) { return Math.log(a) }
404+
function caml_log_float(a) {
405+
return Math.log(a);
406+
}
367407

368408
//Provides: caml_power_float const
369409
//Inline
370-
function caml_power_float (a,b) { return Math.pow(a,b) }
410+
function caml_power_float(a, b) {
411+
return Math.pow(a, b);
412+
}
371413

372414
//Provides: caml_sin_float const
373415
//Inline
374-
function caml_sin_float (a) { return Math.sin(a) }
416+
function caml_sin_float(a) {
417+
return Math.sin(a);
418+
}
375419

376420
//Provides: caml_sqrt_float const
377421
//Inline
378-
function caml_sqrt_float (a) { return Math.sqrt(a) }
422+
function caml_sqrt_float(a) {
423+
return Math.sqrt(a);
424+
}
379425

380426
//Provides: caml_tan_float const
381427
//Inline
382-
function caml_tan_float (a) { return Math.tan(a) }
383-
384-
385-
428+
function caml_tan_float(a) {
429+
return Math.tan(a);
430+
}
386431

387432
//Provides: caml_copysign_float const
388433
function caml_copysign_float(x, y) {

runtime/js/ints.js

Lines changed: 36 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -145,78 +145,102 @@ function caml_mul(a, b) {
145145
//Alias: caml_int32_add
146146
//Alias: caml_nativeint_add
147147
//Inline
148-
function caml_add(a,b) { return (a + b) | 0 }
148+
function caml_add(a, b) {
149+
return (a + b) | 0;
150+
}
149151

150152
//Provides: caml_sub const
151153
//Alias: %int_sub
152154
//Alias: caml_int32_sub
153155
//Alias: caml_nativeint_sub
154156
//Inline
155-
function caml_sub(a,b) { return (a - b) | 0 }
157+
function caml_sub(a, b) {
158+
return (a - b) | 0;
159+
}
156160

157161
//Provides: caml_mul_direct const
158162
//Alias: %direct_int_mul
159163
//Inline
160-
function caml_mul_direct(a,b) { return (a * b) | 0 }
164+
function caml_mul_direct(a, b) {
165+
return (a * b) | 0;
166+
}
161167

162168
//Provides: caml_div_direct const
163169
//Alias: %direct_int_div
164170
//Inline
165-
function caml_div_direct(a,b) { return (a / b) | 0 }
171+
function caml_div_direct(a, b) {
172+
return (a / b) | 0;
173+
}
166174

167175
//Provides: caml_mod_direct const
168176
//Alias: %direct_int_mod
169177
//Inline
170-
function caml_mod_direct(a,b) { return (a % b) | 0 }
178+
function caml_mod_direct(a, b) {
179+
return (a % b) | 0;
180+
}
171181

172182
//Provides: caml_int_and const
173183
//Alias: %int_and
174184
//Alias: caml_int32_and
175185
//Alias: caml_nativeint_and
176186
//Inline
177-
function caml_int_and(a,b) { return a & b }
187+
function caml_int_and(a, b) {
188+
return a & b;
189+
}
178190

179191
//Provides: caml_int_or const
180192
//Alias: %int_or
181193
//Alias: caml_int32_or
182194
//Alias: caml_nativeint_or
183195
//Inline
184-
function caml_int_or(a,b) { return a | b }
196+
function caml_int_or(a, b) {
197+
return a | b;
198+
}
185199

186200
//Provides: caml_int_xor const
187201
//Alias: %int_xor
188202
//Alias: caml_int32_xor
189203
//Alias: caml_nativeint_xor
190204
//Inline
191-
function caml_int_xor(a,b) { return a ^ b }
205+
function caml_int_xor(a, b) {
206+
return a ^ b;
207+
}
192208

193209
//Provides: caml_int_shift_left const
194210
//Alias: %int_lsl
195211
//Alias: caml_int32_shift_left
196212
//Alias: caml_nativeint_shift_left
197213
//Inline
198-
function caml_int_shift_left(a,i) { return a << i }
214+
function caml_int_shift_left(a, i) {
215+
return a << i;
216+
}
199217

200218
//Provides: caml_int_shift_right_unsigned const
201219
//Alias: %int_lsr
202220
//Alias: caml_int32_shift_right_unsigned
203221
//Alias: caml_nativeint_shift_right_unsigned
204222
//Inline
205-
function caml_int_shift_right_unsigned(a,i) { return (a >>> i) | 0 }
223+
function caml_int_shift_right_unsigned(a, i) {
224+
return (a >>> i) | 0;
225+
}
206226

207227
//Provides: caml_int_shift_right const
208228
//Alias: %int_asr
209229
//Alias: caml_int32_shift_right
210230
//Alias: caml_nativeint_shift_right
211231
//Inline
212-
function caml_int_shift_right(a,i) { return a >> i }
232+
function caml_int_shift_right(a, i) {
233+
return a >> i;
234+
}
213235

214236
//Provides: caml_int_neg const
215237
//Alias: %int_neg
216238
//Alias: caml_int32_neg
217239
//Alias: caml_nativeint_neg
218240
//Inline
219-
function caml_int_neg(a) { return (-a) | 0 }
241+
function caml_int_neg(a) {
242+
return -a | 0;
243+
}
220244

221245
//Provides: caml_div
222246
//Requires: caml_raise_zero_divide

runtime/js/obj.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,9 @@ function caml_alloc_dummy_infix() {
4141
//Provides: caml_alloc_dummy
4242
//Alias: caml_alloc_dummy_float
4343
//Inline
44-
function caml_alloc_dummy(_unit) { return [] }
44+
function caml_alloc_dummy(_unit) {
45+
return [];
46+
}
4547

4648
//Provides: caml_obj_tag
4749
//Requires: caml_is_ml_bytes, caml_is_ml_string
@@ -57,7 +59,9 @@ function caml_obj_tag(x) {
5759
//Provides: caml_obj_tag_direct
5860
//Alias: %direct_obj_tag
5961
//Inline
60-
function caml_obj_tag_direct(b) { return b[0] }
62+
function caml_obj_tag_direct(b) {
63+
return b[0];
64+
}
6165

6266
//Provides: caml_obj_set_tag (mutable, const)
6367
//Version: < 5.0

runtime/js/toplevel.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ function caml_dynlink_get_bytecode_sections() {
7777
//Provides: jsoo_get_runtime_aliases
7878
//Requires: caml_global_data, caml_failwith
7979
function jsoo_get_runtime_aliases() {
80-
if (caml_global_data.aliases == undefined) {
80+
if (caml_global_data.aliases === undefined) {
8181
caml_failwith("Program not compiled with --toplevel");
8282
}
8383
return caml_global_data.aliases;

0 commit comments

Comments
 (0)