I have a JS module:
var myModule = {
f1 : function(){...},
f2 : function(){...},
f3 : function(){
// this works
this.f2();
var objRef = this;
chrome.alarms.onAlarm.addListener(function(){
// this works
objRef.f2();
// this doesn't work
this.f2();
}
When, from the body of the listener block inside f3 I call f2 using this, I can't call it, probably because of a scope issue.
Question: is there any way to avoid the objRef solution to reference f2 function from the body of the listener?