This is a change then?

I used to have no problem declaring on one line and using it again
later. If the solution is simply to leave off 'var' then so be it.

...while I was typing this I actually gave it a try:
d = new Date();
d

Does seem to work fine (and inspecting the DOM I found it was
basically window['d']).

>From what you said, it seems as if the result of declaring with 'var'
and it not being available the next command is unintentional.
If that is true, and since declaring without the 'var' already
attaches it to the window object, why not attach it to the window when
we are declaring with 'var'?
Seems like an easy enough solution, and is what basically happens
anyway when declaring global variables in the js files.

On Dec 23, 4:51 pm, John J Barton <[email protected]> wrote:
> Each line in the short command line is sent to the page separately.
> So I guess it similar to
> {
> var d ...}
>
> {
> d; // not in this scope.
>
> }
>
> So:
> {
> var d = new Date(); d}
>
> works as does
> {
> d = new Date();  // apparently the same as window.d = new Date(); ?
>
> }
>
> I don't know if there is a good solution.  We could re-submit previous
> commands, but that might be confusing as well. Or just use the large
> command line.
>
> jjb
>
> On Dec 23, 12:05 pm, pacmon <[email protected]> wrote:
>
> > Hi.
>
> > I am having a bit of an issue and I was hoping someone might have an
> > idea. Currently when I open firebug and attempt to use the command
> > line (on any site), variables seem to disappear after each command.
>
> > For example:
> > var d = new Date();  <i hit enter>
> > d <i hit enter>
> > --Then I get a ReferenceError: d is not defined.
>
> > Nothing I do seems to make this work... However the following *does*
> > work:
>
> > var d = new Date(); d
>
> > This will successfully output the d variable.
>
> > One person I talked to said they thought it was a change to the way
> > scope was handled on the command line, but I have been unable to find
> > anything with information about this.
>
> > I'm currently running Firefox 3.0.4 with Firebug 1.3.0b6.
--~--~---------~--~----~------------~-------~--~----~
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 
http://groups.google.com/group/firebug?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to