2

Typescript と Traceur はどちらも ES6 を ES5 に正しくコンパイルします。第二に、typescript-runtime がないのはなぜですか?

PS: traceur-runtimeは「不足している」関数をシムし、それ以上のことを行い、一部の機能で使用されるヘルパー関数を提供することを読みましたが、それが実際に何を意味するのかわかりません

4

1 に答える 1

3

第二に、typescript-runtime がない理由

ユーザーが自分で必要なものを追加することを前提としています

クラス継承などの他のものについては、ヘルパーをインラインで提供します。

class Base{ }
class Child extends Base { }

生成します (通知__extends):

var __extends = this.__extends || function (d, b) {
    for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
    function __() { this.constructor = d; }
    __.prototype = b.prototype;
    d.prototype = new __();
};
var Base = (function () {
    function Base() {
    }
    return Base;
})();
var Child = (function (_super) {
    __extends(Child, _super);
    function Child() {
        _super.apply(this, arguments);
    }
    return Child;
})(Base);
于 2015-05-29T00:24:00.693 に答える