我有以下代码这是一个
JavaScript模块.
@H_403_2@(function() {
// Object
var Cahootsy;
Cahootsy = {
hello: function () {
alert('test');
},};
(Cahootsy.scope = (function() {
return this;
})()).Cahootsy = Cahootsy;
return Cahootsy;
}).call(this);
我不明白的部分:
@H_403_2@(Cahootsy.scope = (function() { return this; })()).Cahootsy = Cahootsy;我认为它正在创建引用“this”模块的对象,然后将Cahootsy变量分配给全局Cahootsy变量.我不明白为什么“这”需要分配给Cahootsy.scope