I know I can bypass the problem, but it would be great to get private
var or return value from function more quickly.
I mean for example:
MyModule2 = function (strInput) {
if (false === (this instanceof MyModule2)) {
return new MyModule2();
}
var str = strInput;
this.getStr = function () {
return str;
}
this.customStr = "custom str";
};
document.getElementById("Button2").onclick = function () {
var module2 = new MyModule2("input");
console.log(module2.getStr());
debugger;
}
In the quick watch panel (very nice feature), this.customStr is
displaying "custom str" because it is public :perfect.
It's impossible to spy the str var because it is private. If I add a
watch, str var is undefined which is wrong because str="input".
So to get the str var, I use my public Getter function getStr(). The
quick watch panel shows getStr with a link to jump to the code (no
problem), but it would be perfect if another row helps to watch the
data returned when asked. I need to right click getStr, select "add
watch" then reformat the watch from "module2.getStr" to
"module2.getStr()" and finally get the data "input".
I think being able to spy private var and spy returned value from
function when needed would be a great feature to ease javascript
debugging.
But this is just my opinion.
--
You received this message because you are subscribed to the Google
Groups "Firebug" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
https://groups.google.com/forum/#!forum/firebug