1

升级到 v1.0.0-pre.3 时,出现以下错误:

Uncaught Error: assertion failed: Ember.Object.create no longer supports defining methods that call _super.

看来出于性能原因,原始 create() 功能保留在 createWithMixins()

这里回答得相当清楚:

https://github.com/emberjs/ember.js/commit/c1c720781c976f69fd4014ea50a1fee652286048

https://github.com/emberjs/ember.js/pull/1623#issuecomment-11699639

Ember.Application.create 带有 mixin 和参数

但是一旦我做出改变,我现在得到这个错误:

Uncaught Error: assertion failed: Application initialize may only be called once  

搜索我的代码库,我只运行一次 App.initialize() 。

(function(root){
  require(["config"], function(config){
    requirejs.config(config);
    require(["App", "domReady!", "ember"], function(App, doc, Ember){
        var app_name = config.app_name || "App";
        root[app_name] = App = Ember.Application.create(App);
        !App.isInitialized && App.initialize();
    });
  });
 })(this); 

有任何想法吗?

4

1 回答 1

2

我相信您根本不需要使用新版本调用初始化。

于 2013-01-18T04:31:27.253 回答