Skip to content

Commit 0d005b7

Browse files
committed
Use spread operator instead of apply() where applicable
> lebab --replace . --transform arg-spread
1 parent c74f4ef commit 0d005b7

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

compiler/prelude/goroutines.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ var $go = function (fun, args) {
131131
var $goroutine = function () {
132132
try {
133133
$curGoroutine = $goroutine;
134-
var r = fun.apply(undefined, args);
134+
var r = fun(...args);
135135
if (r && r.$blk !== undefined) {
136136
fun = function () { return r.$blk(); };
137137
args = [];

compiler/prelude/types.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ var $newType = function (size, kind, string, named, pkg, exported, constructor)
288288
if (v.$val === undefined) {
289289
v = new f.typ(v);
290290
}
291-
return v[m.prop].apply(v, args);
291+
return v[m.prop](...args);
292292
};
293293
};
294294
fields.forEach(function (f) {

0 commit comments

Comments
 (0)