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;
|
2015-03-09 02:23:23 +01:00
|
|
|
if (x === void 0) { x = function () {
|
|
|
|
return _this;
|
|
|
|
}; }
|
2014-07-13 01:04:16 +02:00
|
|
|
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
|