test = {
store: {
actions:{},
getters: {},
state: {}
},
init: function(){
console.log(this);
},
registerGetter:function(name, object){
this.store.getters[name] = object;
},
registerAction: function(name, object){
this.store.actions[name] = object;
}
}
test.registerGetter('test', function(){
console.log(this)
});
test.init();
My question is, why is the test function via registerGetter referencing the window object and not the internal object