Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Firebug: watch private var
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  13 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
AlphaPage  
View profile  
 More options May 9 2012, 8:38 am
From: AlphaPage <alphap...@gmail.com>
Date: Wed, 9 May 2012 05:38:03 -0700 (PDT)
Local: Wed, May 9 2012 8:38 am
Subject: Firebug: watch private var
Hello,
Is there a way to watch and display a private var in the watch tree ?
It would be great to be able to do that.
Thanks in advance for your help.

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jan Honza Odvarko  
View profile  
 More options May 9 2012, 9:54 am
From: Jan Honza Odvarko <odva...@gmail.com>
Date: Wed, 9 May 2012 06:54:08 -0700 (PDT)
Local: Wed, May 9 2012 9:54 am
Subject: Re: Firebug: watch private var
I am not sure if I understand the question, but you should be able
to create a breakpoint in the scope where the var is defined
break on it and use the Watch side panel window.

Honza

On May 9, 2:38 pm, AlphaPage <alphap...@gmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
AlphaPage  
View profile  
 More options May 9 2012, 12:08 pm
From: AlphaPage <alphap...@gmail.com>
Date: Wed, 9 May 2012 09:08:24 -0700 (PDT)
Local: Wed, May 9 2012 12:08 pm
Subject: Re: Firebug: watch private var
For now, I'm only able to watch 'public' var, but I'd like to watch
private var.
To bypass the problem, I need to add 'this' before my var to make it
'public' which is very boring.

 Honza, your answer works if my object is used 3 or 4 times max, but
my object is often inside a for loop, so it will break to often.
That's why I hope 'private' or 'nested' var could be displayed in
watch tree without depending on internal breakpoint.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Sebo  
View profile  
 More options May 9 2012, 1:24 pm
From: Sebo <sebastianzart...@gmx.de>
Date: Wed, 9 May 2012 10:24:08 -0700 (PDT)
Local: Wed, May 9 2012 1:24 pm
Subject: Re: Firebug: watch private var

Note that you can add a condition to a breakpoint<http://getfirebug.com/wiki/index.php/Script_Panel#Conditions>.
Also you can call console.log()<http://getfirebug.com/wiki/index.php/Console_API#console.log.28object...>inside your loop and print the value for each step if you don't like to use
step debugging.

Sebastian


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jan Honza Odvarko  
View profile  
 More options May 10 2012, 1:59 am
From: Jan Honza Odvarko <odva...@gmail.com>
Date: Wed, 9 May 2012 22:59:56 -0700 (PDT)
Local: Thurs, May 10 2012 1:59 am
Subject: Re: Firebug: watch private var
On May 9, 6:08 pm, AlphaPage <alphap...@gmail.com> wrote:
> For now, I'm only able to watch 'public' var, but I'd like to watch
> private var.
> To bypass the problem, I need to add 'this' before my var to make it
> 'public' which is very boring.

You can watch only variables that are available in the current scope
(e.g. the place where the breakpoint is).

Apart from your "this" solution and Sebastian's suggestions, we also
plan "Hit counts for breakooints"
http://code.google.com/p/fbug/issues/detail?id=2817
Should be in Firebug 1.10

Honza


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
AlphaPage  
View profile  
 More options May 10 2012, 6:04 am
From: AlphaPage <alphap...@gmail.com>
Date: Thu, 10 May 2012 03:04:59 -0700 (PDT)
Local: Thurs, May 10 2012 6:04 am
Subject: Re: Firebug: watch private var
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 must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Simon Lindholm  
View profile  
 More options May 11 2012, 2:12 am
From: Simon Lindholm <simon.lindhol...@gmail.com>
Date: Thu, 10 May 2012 23:12:34 -0700 (PDT)
Local: Fri, May 11 2012 2:12 am
Subject: Re: Firebug: watch private var

Den torsdagen den 10:e maj 2012 kl. 12:04:59 UTC+2 skrev AlphaPage:

> 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".

So, for functions with .length === 0, a right-click option "watch return
value" would be good?

FireClosure <https://github.com/simonlindholm/fireclosure> would also give
you exactly what's needed here - you could just add a watch for
"module2.%str". Would you mind trying it out and giving me some feedback?
(It's somewhat fragile, and works only with >= Firefox Aurora.)


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
AlphaPage  
View profile  
 More options May 11 2012, 6:02 am
From: AlphaPage <alphap...@gmail.com>
Date: Fri, 11 May 2012 03:02:36 -0700 (PDT)
Local: Fri, May 11 2012 6:02 am
Subject: Re: Firebug: watch private var
On May 10, 11:12 pm, Simon Lindholm <simon.lindhol...@gmail.com>
wrote:
> So, for functions with .length === 0, a right-click option "watch return
> value" would be good?

I'd just like a button near the function to get the return value of
the function, but if nothing returned, display 'undefined'.
But an even better tool would display 2 toggle buttons next to the
'class' ie module2:
- the 'private' or closure scope button will loop through all the
module2.% var to display all the private var in the scope (and hide
undefined var for example)
- the return value from function button will loop through all the
module2 function to display all the return values in the scope (and
doesn't display data when no value is returned from the function)

> FireClosure <https://github.com/simonlindholm/fireclosure> would also give
> you exactly what's needed here - you could just add a watch for
> "module2.%str". Would you mind trying it out and giving me some feedback?
> (It's somewhat fragile, and works only with >= Firefox Aurora.)

You learned me something with module2.%str to watch 'private' var.
Thank you.
I tried FireClosure and get a closure scope displayed in the quick
watch panel, but no str var from my breakpoint: maybe I am using it
the wrong way ! But seems promising if it is made to give me what I am
trying to achieve.

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Simon Lindholm  
View profile  
 More options May 11 2012, 5:21 pm
From: Simon Lindholm <simon.lindhol...@gmail.com>
Date: Fri, 11 May 2012 14:21:48 -0700 (PDT)
Local: Fri, May 11 2012 5:21 pm
Subject: Re: Firebug: watch private var

Den fredagen den 11:e maj 2012 kl. 12:02:36 UTC+2 skrev AlphaPage:

> I'd just like a button near the function to get the return value of
> the function, but if nothing returned, display 'undefined'.

Where in the UI? (Just draw a picture in Paint or something.)
This and the "display all return values" doesn't seem to work with stateful
functions, and ones taking >0 arguments.
Also, for watches in particular, adding the function as a watch seems to be
conceptually wrong in the first place; you really want the return value.

> But an even better tool would display 2 toggle buttons next to the
> 'class' ie module2:
> - the 'private' or closure scope button will loop through all the
> module2.% var to display all the private var in the scope (and hide
> undefined var for example)

FireClosure should add one such thing in DOM views (though it's hacky and
might be removed later, I dunno), where else should it go? (Again,
mspaint'd screenshot.)

> FireClosure <https://github.com/simonlindholm/fireclosure> would also
> give
> > you exactly what's needed here - you could just add a watch for
> > "module2.%str". Would you mind trying it out and giving me some
> feedback?
> > (It's somewhat fragile, and works only with >= Firefox Aurora.)
> You learned me something with module2.%str to watch 'private' var.

Wellll.. it's not standard and just a syntax I made up for FireClosure. But
I hope that works alright.

I tried FireClosure and get a closure scope displayed in the quick

> watch panel, but no str var from my breakpoint: maybe I am using it
> the wrong way !

Hm, I don't really understand what you're saying. Screenshot of what you
expect to appear?

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
AlphaPage  
View profile  
 More options May 14 2012, 5:27 am
From: AlphaPage <alphap...@gmail.com>
Date: Mon, 14 May 2012 02:27:52 -0700 (PDT)
Local: Mon, May 14 2012 5:27 am
Subject: Re: Firebug: watch private var

> Simon, you are right and to get the return value from a function inside
> the dom is stupid. I apologize, the command bar is made to do so and my
> request was only working on the particular case when the function simulates
> a property.
> But for private var, I attach 2 pictures to show if my request is suitable:
> - Toggle bitmap : a button (the purple square) could be toggled to display
> all the private var in the class or module when the user wants (%str =
> "input" would be displayed: % will tell a private var, or a different color
> formatting)
> - Menu bitmap : an other way would be to be able to select "Show private
> var" from the menu, but maybe it will slow down the dom processing.

Hope my screenshots speak better than me !

  FirebugMenu.png
183K Download

  FirebugToggle.png
188K Download

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
AlphaPage  
View profile  
 More options May 15 2012, 4:00 am
From: AlphaPage <alphap...@gmail.com>
Date: Tue, 15 May 2012 01:00:50 -0700 (PDT)
Local: Tues, May 15 2012 4:00 am
Subject: Re: Firebug: watch private var

Finally, I discovered that FireClosure is doing the job, but only inside
the Dom panel. That's why I wasn't able to find it inside the quick watch
panel.
It would be a fantastic add-on if I could watch in both places and be able
to choose when I want the scoped var tree menu to be auto expanded or not
(for now, the scoped var node is always collapsed).

But I must admit that FireClosure shows me private var as you tell me Simon.
Thank you.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Simon Lindholm  
View profile  
 More options May 16 2012, 2:05 am
From: Simon Lindholm <simon.lindhol...@gmail.com>
Date: Wed, 16 May 2012 08:05:50 +0200
Local: Wed, May 16 2012 2:05 am
Subject: Re: [firebug] Re: Firebug: watch private var

2012/5/15 AlphaPage <alphap...@gmail.com>

> Finally, I discovered that FireClosure is doing the job, but only inside
> the Dom panel. That's why I wasn't able to find it inside the quick watch
> panel.

Ah, will fix, when I get the time.

Simon


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Simon Lindholm  
View profile  
 More options May 22 2012, 8:48 pm
From: Simon Lindholm <simon.lindhol...@gmail.com>
Date: Wed, 23 May 2012 02:48:35 +0200
Local: Tues, May 22 2012 8:48 pm
Subject: Re: [firebug] Re: Firebug: watch private var

2012/5/16 Simon Lindholm <simon.lindhol...@gmail.com>

> 2012/5/15 AlphaPage <alphap...@gmail.com>

>> Finally, I discovered that FireClosure is doing the job, but only inside
>> the Dom panel. That's why I wasn't able to find it inside the quick watch
>> panel.

> Ah, will fix, when I get the time.

Fixed, with the same kind of UI as in the DOM panel. Download
link.<https://github.com/downloads/simonlindholm/fireclosure/fireclosure-0....>

It's not entirely clear how a flat view of closures would work; what levels
of the closure chain are included? What if only relatively global
properties are available (could be from optimizations etc.)? Also the
purple square looks a bit weird. Having '%member' in purple looks cool,
admittedly.

More suggestions/feedback is absolutely welcome.

Simon


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »