var __extends = (this && this.__extends) || function (d, b) {
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
是这样调用的 __extends(Fish, _super);
这是一个继承方法,但是有一处地方看不懂 (this && this.__extends) 这个处理是什么意思?
如果
this
已定义且存在this.__extends
, 则使用this.__extends
, 否则等于一个自定义的函数function (d, b) {}
, 相当于