Skip to content

Commit 1358f63

Browse files
committed
runtime: use *.push
Signed-off-by: Sora Morimoto <[email protected]>
1 parent 2bf050d commit 1358f63

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

runtime/fail.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ function caml_raise_with_arg(tag, arg) {
3131
//Provides: caml_raise_with_args (const, mutable)
3232
//Requires: caml_maybe_attach_backtrace
3333
function caml_raise_with_args(tag, args) {
34-
throw caml_maybe_attach_backtrace([0, tag].concat(args));
34+
throw caml_maybe_attach_backtrace([0, tag].push(args));
3535
}
3636

3737
//Provides: caml_raise_with_string (const, const)

runtime/jslib.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -411,7 +411,7 @@ function caml_js_wrap_callback_unsafe(f) {
411411
//Requires: caml_callback, caml_js_wrap_callback
412412
function caml_js_wrap_meth_callback(f) {
413413
return function (...args) {
414-
const res = caml_callback(f, [this, ...args]);
414+
const res = caml_callback(f, [this].push(...args));
415415
return res instanceof Function ? caml_js_wrap_callback(res) : res;
416416
};
417417
}
@@ -427,7 +427,7 @@ function caml_js_wrap_meth_callback_arguments(f) {
427427
function caml_js_wrap_meth_callback_strict(arity, f) {
428428
return function (...args) {
429429
args.length = arity;
430-
return caml_callback(f, [this, ...args]);
430+
return caml_callback(f, [this].push(...args));
431431
};
432432
}
433433
//Provides: caml_js_wrap_meth_callback_unsafe const (const)
@@ -436,7 +436,7 @@ function caml_js_wrap_meth_callback_unsafe(f) {
436436
return function (...args) {
437437
const len = caml_js_function_arity(f) - 1;
438438
args.length = len;
439-
return caml_callback(f, [this, ...args]);
439+
return caml_callback(f, [this].push(...args));
440440
};
441441
}
442442

0 commit comments

Comments
 (0)