17 lines
437 B
TypeScript
17 lines
437 B
TypeScript
//// [emitRestParametersFunction.ts]
|
|
function bar(...rest) { }
|
|
function foo(x: number, y: string, ...rest) { }
|
|
|
|
//// [emitRestParametersFunction.js]
|
|
function bar() {
|
|
var rest = [];
|
|
for (var _i = 0; _i < arguments.length; _i++) {
|
|
rest[_i - 0] = arguments[_i];
|
|
}
|
|
}
|
|
function foo(x, y) {
|
|
var rest = [];
|
|
for (var _i = 2; _i < arguments.length; _i++) {
|
|
rest[_i - 2] = arguments[_i];
|
|
}
|
|
}
|