TypeScript/tests/baselines/reference/fatarrowfunctionsInFunctionParameterDefaults.js
2014-07-12 17:30:19 -07:00

20 lines
393 B
JavaScript

//// [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(); }
return y;
}
fn.call(4);