2014-07-13 01:04:16 +02:00
|
|
|
//// [restArgAssignmentCompat.ts]
|
|
|
|
function f(...x: number[]) {
|
|
|
|
x.forEach((n, i) => void ('item ' + i + ' = ' + n));
|
|
|
|
}
|
|
|
|
function g(x: number[], y: string) { }
|
|
|
|
|
|
|
|
var n = g;
|
|
|
|
n = f;
|
|
|
|
n([4], 'foo');
|
|
|
|
|
|
|
|
|
|
|
|
//// [restArgAssignmentCompat.js]
|
|
|
|
function f() {
|
|
|
|
var x = [];
|
|
|
|
for (var _i = 0; _i < arguments.length; _i++) {
|
|
|
|
x[_i - 0] = arguments[_i];
|
|
|
|
}
|
2015-03-09 02:23:23 +01:00
|
|
|
x.forEach(function (n, i) {
|
|
|
|
return void ('item ' + i + ' = ' + n);
|
|
|
|
});
|
|
|
|
}
|
|
|
|
function g(x, y) {
|
2014-07-13 01:04:16 +02:00
|
|
|
}
|
|
|
|
var n = g;
|
|
|
|
n = f;
|
2015-03-09 02:23:23 +01:00
|
|
|
n([
|
|
|
|
4
|
|
|
|
], 'foo');
|