this
depends only on how you call a function. It can be implicit, but in your case, you lost the context. You need to cache this
in the upper scope:
function MFCommentsHandler(node, type, item) {
var self = this;
this.get = function(returnType){
...
}
function getButton(){
self.get(); // cached reference
...
}
}
Or you can explicitly pass the context when you call getButton
:
function MFCommentsHandler(node, type, item) {
this.get = function(returnType){
...
}
function getButton(){
this.get();
...
}
getButton.call(this); // explicit context
...