@@ -61,14 +61,14 @@ var $flushConsole = function () { };
61
61
var $throwRuntimeError ; /* set by package "runtime" */
62
62
var $throwNilPointerError = function ( ) { $throwRuntimeError ( "invalid memory address or nil pointer dereference" ) ; } ;
63
63
var $call = function ( fn , rcvr , args ) { return fn . apply ( rcvr , args ) ; } ;
64
- var $makeFunc = function ( fn ) { return function ( ) { return $externalize ( fn ( this , new ( $sliceType ( $jsObjectPtr ) ) ( $global . Array . prototype . slice . call ( arguments , [ ] ) ) ) , $emptyInterface ) ; } ; } ;
64
+ var $makeFunc = function ( fn ) { return function ( ... args ) { return $externalize ( fn ( this , new ( $sliceType ( $jsObjectPtr ) ) ( $global . Array . prototype . slice . call ( args , [ ] ) ) ) , $emptyInterface ) ; } ; } ;
65
65
var $unused = function ( v ) { } ;
66
66
var $print = console . log ;
67
67
// Under Node we can emulate print() more closely by avoiding a newline.
68
68
if ( ( $global . process !== undefined ) && $global . require ) {
69
69
try {
70
70
var util = $global . require ( 'util' ) ;
71
- $print = function ( ) { $global . process . stderr . write ( util . format . apply ( this , arguments ) ) ; } ;
71
+ $print = function ( ... args ) { $global . process . stderr . write ( util . format . apply ( this , args ) ) ; } ;
72
72
} catch ( e ) {
73
73
// Failed to require util module, keep using console.log().
74
74
}
@@ -119,13 +119,13 @@ var $methodVal = function (recv, name) {
119
119
var $methodExpr = function ( typ , name ) {
120
120
var method = typ . prototype [ name ] ;
121
121
if ( method . $expr === undefined ) {
122
- method . $expr = function ( ) {
122
+ method . $expr = function ( ... args ) {
123
123
$stackDepthOffset -- ;
124
124
try {
125
125
if ( typ . wrapped ) {
126
- arguments [ 0 ] = new typ ( arguments [ 0 ] ) ;
126
+ args [ 0 ] = new typ ( args [ 0 ] ) ;
127
127
}
128
- return Function . call . apply ( method , arguments ) ;
128
+ return Function . call . apply ( method , args ) ;
129
129
} finally {
130
130
$stackDepthOffset ++ ;
131
131
}
@@ -138,10 +138,10 @@ var $ifaceMethodExprs = {};
138
138
var $ifaceMethodExpr = function ( name ) {
139
139
var expr = $ifaceMethodExprs [ "$" + name ] ;
140
140
if ( expr === undefined ) {
141
- expr = $ifaceMethodExprs [ "$" + name ] = function ( ) {
141
+ expr = $ifaceMethodExprs [ "$" + name ] = function ( ... args ) {
142
142
$stackDepthOffset -- ;
143
143
try {
144
- return Function . call . apply ( arguments [ 0 ] [ name ] , arguments ) ;
144
+ return Function . call . apply ( args [ 0 ] [ name ] , args ) ;
145
145
} finally {
146
146
$stackDepthOffset ++ ;
147
147
}
0 commit comments