1

为什么 system.js 先执行__extends后初始化?

虽然我根本看不到初始化,因为第一件事被称为__extends并抛出错误。如何解决?

var __extends = (this && this.__extends) || function (d, b) {

        console.log('set:__extends', d, b); // set:__extends undefined undefined

    for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
    function __() { this.constructor = d; }
    __.prototype = b.prototype;
    d.prototype = new __();
};System.register(['some.js'], function(exports_1) {

    console.log('set:exports', exports_1); // #####

    var some_js_1;
    var Index;
    return {
        setters:[
            function (_some_js_1) {

                console.log('set:setters'); // #####

                some_js_1 = _some_js_1;
            }],
        execute: function() {

            console.log('set:execute'); // #####

            Index = (function (_super) {

                console.log('set:before __extends'); // #####

                __extends(Index, _super);
                function Index() {
                    _super.call(this);
                    //console.log('some', some_js_1.SomeSuperClass);
                }
                return Index;
            })(some_js_1.SomeSuperClass);

            console.log('set:before exports_1'); // #####

            exports_1("default", Index);
        }
    }
});
4

0 回答 0