2014-07-13 01:04:16 +02:00
|
|
|
//// [fatarrowfunctionsInFunctionParameterDefaults.ts]
|
|
|
|
function fn(x = () => this, y = x()) {
|
|
|
|
|
|
|
|
// should be 4
|
|
|
|
return y;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
fn.call(4); // Should be 4
|
|
|
|
|
|
|
|
|
|
|
|
//// [fatarrowfunctionsInFunctionParameterDefaults.js]
|
|
|
|
function fn(x, y) {
|
|
|
|
var _this = this;
|
|
|
|
if (x === void 0) { x = function () { return _this; }; }
|
|
|
|
if (y === void 0) { y = x(); }
|
2014-08-16 00:16:17 +02:00
|
|
|
// should be 4
|
2014-07-13 01:04:16 +02:00
|
|
|
return y;
|
|
|
|
}
|
2014-08-16 00:49:09 +02:00
|
|
|
fn.call(4); // Should be 4
|