我遇到了这个问题。
too much recursion
并指向underscore.js
// Extend a given object with all the properties in passed-in object(s).
_.extend = function(obj) {
each(slice.call(arguments, 1), function(source) {
if (source) {
for (var prop in source) {
obj[prop] = source[prop];
}
}
});
return obj;
};
顺便说一句,我使用Backbone 0.9.10,jQuery 1.8.2,jQuery Mobile 1.2.0,需要2.1.4,并且下划线1.4.4
这是我的main.js
require.config({
paths:{
jquery : 'libs/jQuery/1.8.2/jquery-1.8.2',
mobile : 'libs/jQuery/jMobile/1.2.0/jquery.mobile-1.2.0',
base64 : 'libs/base64/webtoolkit.base64',
backbone : 'libs/backbone/0.9.10/backbone',
localstorage : 'libs/backbone/localstorage/backbone.localStorage',
underscore : 'libs/underscore/1.4.4/underscore',
text : 'libs/require/2.1.4/text/text',
template : '../template'
},
shim: {
backbone: { deps: ["underscore", "jquery", "mobile"], exports: "Backbone" },
underscore: { exports: "_" }
}
});
require([
// Load our app module and pass it to our definition function
'router'
], function(Router){
Router.initialize();
});
所以我的问题是Backbone 0.9.10与下划线1.4.4不兼容吗?它们都是AMD版本,我得到了https://github.com/amdjs。
当我尝试将Backbone降级到0.9.2而下划线是1.4.4时,问题是我希望Backbone得到更新。有任何想法吗?感谢