TypeScript/tests/baselines/reference/restElementWithNullInitializer.js

28 lines
525 B
TypeScript
Raw Normal View History

2015-02-21 21:41:20 +01:00
//// [restElementWithNullInitializer.ts]
2015-02-22 04:33:53 +01:00
function foo1([...r] = null) {
}
function foo2([...r] = undefined) {
}
function foo3([...r] = {}) {
}
function foo4([...r] = []) {
}
2015-02-21 21:41:20 +01:00
//// [restElementWithNullInitializer.js]
2015-02-22 04:33:53 +01:00
function foo1(_a) {
var r = (_a === void 0 ? null : _a).slice(0);
2015-02-22 04:33:53 +01:00
}
function foo2(_a) {
var r = (_a === void 0 ? undefined : _a).slice(0);
2015-02-22 04:33:53 +01:00
}
function foo3(_a) {
var r = (_a === void 0 ? {} : _a).slice(0);
2015-02-22 04:33:53 +01:00
}
function foo4(_a) {
var r = (_a === void 0 ? [] : _a).slice(0);
2015-02-22 04:33:53 +01:00
}