Can't assign value to a variable in Firebug 1.1.0b1

30 megtekintés
Ugrás az első olvasatlan üzenetre

paan

olvasatlan,
2007. szept. 14. 7:50:452007. 09. 14.
– Firebug
I upgrade firebug to 1.1b because it support eval debugging. But in
command line, I can't declare variable even as simple as "var a = 1".
Should I report a bug?

Ben Lowery

olvasatlan,
2007. szept. 14. 9:45:112007. 09. 14.
– fir...@googlegroups.com
I'm seeing similar behavior. Syntax errors in code entered into the
console are not reported, and new variables cannot be defined. Open
about:blank and enter:
var a = 1;
a

and you'll get no echo of a's value for either statement.

--b

John J Barton

olvasatlan,
2007. szept. 14. 12:30:482007. 09. 14.
– Firebug
If I type into the command line

var a = 1; a;

then the console prints

>>> var a = 1; a;
1

If I type

var a = 1;

it says:

>>> var a = 1;

Do you think this is not correct?

John J Barton

olvasatlan,
2007. szept. 14. 12:37:332007. 09. 14.
– Firebug
Syntax errors for the command line are not being reported. I think
this is because of code I added to prevent errors from other tabs and
windows from showing up in the console for this window. The command
line errors I think are being treated as another window.
Unfortunately the Firefox support for errors is based on a single
window model so it is hard to get this capability; I'll have to try
another way.

Separately about:blank cannot evaluate the command line input. It
gives an error that is then filtered out of the view because of the
problem above. So it looks like nothing happens.

paan

olvasatlan,
2007. szept. 15. 1:18:242007. 09. 15.
– Firebug
Yes, those are correct but if I type
>>> a
after type
>>> var a = 1;
console print
>>> a
It just repeat my code instead of print value of 'a'

On Sep 14, 11:30 pm, John J Barton <johnjbar...@johnjbarton.com>
wrote:

John J Barton

olvasatlan,
2007. szept. 15. 14:53:142007. 09. 15.
– Firebug
Ah, I understand. It just prints 'a' because of the bug in failing to
print command line error messages. In my version it now prints:
>>> a;
a is not defined
Each command line evaluation is independent so variables introduced in
one run are not visible to the next run. If you did
window.b = 1;
then later
window.b;
it would print the value '1'.

The error message fix will be in b2 when it goes out.

Ben Lowery

olvasatlan,
2007. szept. 17. 10:37:292007. 09. 17.
– fir...@googlegroups.com


On 9/15/07, John J Barton <johnj...@johnjbarton.com> wrote:

Each command line evaluation is independent so variables introduced in
one run are not visible to the next run.  If you did
window.b = 1;
then later
window.b;
it would print the value '1'.

To me, that's a bug. If I say var a = 1; and hit enter, a should be available to future expressions. I'm pretty sure this is how it works in firebug 1.0, no?

Having to assign things to the window instance just seems like a dirty trick. I don't know of any other repl environment that forces you to hang instances off a special instance to keep them around...

Ben Lowery

olvasatlan,
2007. szept. 17. 10:47:262007. 09. 17.
– fir...@googlegroups.com


On 9/14/07, John J Barton <johnj...@johnjbarton.com> wrote:

Separately about:blank cannot evaluate the command line input.  It
gives an error that is then filtered out of the view because of the
problem above.  So it looks like nothing happens.

Using firebug from an about:blank page works just fine for me in 1.0.  As does reusing variables assigned in previous statements.

--b

John J Barton

olvasatlan,
2007. szept. 17. 12:30:562007. 09. 17.
– Firebug
Firebug 1.1 uses "evalInSandBox" to be compatible with Firefox 3. So,
no it does not work the same as Firebug 1.0.
The effect of evalInSandBox is similar to putting function(){...}
around your statements.

If you use Console->Options->LargerCommandLine, then the lines you
type do not disappear every time you hit enter. You can put multiple
statements in the box and you can re-evaluate them without thinking
about what you did earlier. You don't have to hang things off
'window'.

The small (single line) command line could be numbered and add to the
sandbox. That way the behavior you are used to from 1.0 would
continue.

The about:blank is related, it gives
"evalInSandbox FAILS Permission denied to get property
Window.__scope__"
where __scope__ is something Firebug uses to get into the window. I
don't know why this happens.

On Sep 17, 7:37 am, "Ben Lowery" <blow...@gmail.com> wrote:

Wara Songkran

olvasatlan,
2007. szept. 17. 17:34:362007. 09. 17.
– Firebug
I'm glad to hear this. When firebug 1.1 will be ready?

On Sep 17, 11:30 pm, John J Barton <johnjbar...@johnjbarton.com>
wrote:

John J Barton

olvasatlan,
2007. szept. 17. 20:51:152007. 09. 17.
– Firebug

Wara Songkran

olvasatlan,
2007. szept. 18. 5:35:572007. 09. 18.
– Firebug
I mean the completed, full-feature one.

SteveR

olvasatlan,
2007. szept. 27. 18:22:522007. 09. 27.
– Firebug
if I type anything in the console, all I get is

commandLine.evaluate FAILS: Components.utils.Sandbox evalInSandbox
FAILS TypeError: win.__scope__ has no properties

Using Firebug 1.1.0b2 on Firefox 2.0.0.7

Basically the the console doesn't work at all...

On Sep 15, 11:53 am, John J Barton <johnjbar...@johnjbarton.com>

SteveR

olvasatlan,
2007. szept. 27. 18:50:172007. 09. 27.
– Firebug
OK, only on the pages I work on (of course!). I found an example for
you that is public though:

http://extjs.com/playpen/ext-2.0-dev5/examples/feed-viewer/view.html

John J Barton

olvasatlan,
2007. szept. 27. 20:53:572007. 09. 27.
– Firebug
Yes, I can see that error on the page you link, but the page takes too
long to load to use for debugging.

We need to find a very small example that shows the problem.

John.

S.V. OBHRAI

olvasatlan,
2007. szept. 28. 2:20:472007. 09. 28.
– fir...@googlegroups.com
This is sv...@yahoo.com, a New/OLD Mad Hat..Er
This is what I Discovered on my FirebugDUMP (NoteBook [1]) Page
Kindly make it more Comprehensible...I Undrstand the Language within, but do NOT Fully .....COMPREHEND                        in PLAIN...Vanila Flavour...ENGLISH/Hing-Lish
John J Barton    ...............is... SHOULD....Mentor/Enlight..en  the Crazy Stage
of my FirebugDump                      and working/Dis-Function ?? of FireFox/Mozilla Browser                           ;;;;;;;;;;;;;;;;;;;;;;;;;;;;  I understand ;  is a Code Input....but then Do I need to In-put SOME-THING  (Type in  )   some Direct..ion in the  File....Below ??                to   ACT..ivate    firebug-service.js
HELP !!      ASAP ...

Index: components/firebug-service.js
===================================================================
--- components/firebug-service.js (revisão 154)
+++ components/firebug-service.js (cópia de trabalho)
@@ -2151,11 +2151,11 @@
 {
  try
  {
-  var path = "c:\\download\\tmp\\firebug.txt";  // I welcome your corrections.
-  var file = CC("@mozilla.org/file/local;1").createInstance(CI("nsILocalFile"));
-  file.initWithPath(path);
-  if ( !file.exists())
-   file.create(CI("nsIFile").NORMAL_FILE_TYPE, 664 );
+  var file = Components.classes["@mozilla.org/file/directory_service;1"]
+   .getService(Components.interfaces.nsIProperties)
+   .get("TmpD", Components.interfaces.nsIFile);
+  file.append("firebug.tmp");
+  file.createUnique(Components.interfaces.nsIFile.NORMAL_FILE_TYPE, 0666);
   var stream = CC("@mozilla.org/network/file-output-stream;1").createInstance(CI("nsIFileOutputStream"));
   stream.init(file, 0x04 | 0x08 | 0x20, 664, 0); // write, create, truncate
   return stream;
SteveR <srou...@gmail.com> wrote:

OK, only on the pages I work on (of course!). I found an example for
you that is public though:

http://extjs.com/playpen/ext-2.0-dev5/examples/feed-viewer/view.html

On Sep 27, 3:22 pm, SteveR wrote:
> if I type anything in the console, all I get is
>
> commandLine.evaluate FAILS: Components.utils.Sandbox evalInSandbox
> FAILS TypeError: win.__scope__ has no properties
>
> Using Firebug 1.1.0b2 on Firefox 2.0.0.7
>
> Basically the the console doesn't work at all...
>
> On Sep 15, 11:53 am, John J Barton
> wrote:
>
> > Ah, I understand. It just prints 'a' because of the bug in failing to
> > print command line error messages. In my version it now prints:>>> a;
>
> > a is not defined
> > Each command line evaluation is independent so variables introduced in
> > one run are not visible to the next run. If you did
> > window.b = 1;
> > then later
> > window.b;
> > it would print the value '1'.
>
> > The error message fix will be in b2 when it goes out.
>
> > On Sep 14, 10:18 pm, paan wrote:
>
> > > Yes, those are correct but if I type>>> a
> > > after type
> > > >>> var a = 1;
> > > console print
> > > >>> a
>
> > > It just repeat my code instead of print value of 'a'
>
> > > On Sep 14, 11:30 pm, John J Barton
> > > wrote:
>
> > > > If I type into the command line
>
> > > > var a = 1; a;
>
> > > > then the console prints
>
> > > > >>> var a = 1; a;
>
> > > > 1
>
> > > > If I type
>
> > > > var a = 1;
>
> > > > it says:
>
> > > > >>> var a = 1;
>
> > > > Do you think this is not correct?
>
> > > > On Sep 14, 4:50 am, paan wrote:
>
> > > > > I upgrade firebug to 1.1b because it support eval debugging. But in
> > > > > command line, I can't declare variable even as simple as "var a = 1".
> > > > > Should I report a bug?



Boardwalk for $500? In 2007? Ha!
Play Monopoly Here and Now (it's updated for today's economy) at Yahoo! Games.

John J Barton

olvasatlan,
2007. okt. 2. 1:07:312007. 10. 02.
– Firebug
I found this problem and the fix will be in firebug-1.1.0b3.
Note that for 1.1 the small command line will be a separate sandbox
for each "enter"; Use the large command line (console options) for
multi-line evaluations.
Válasz mindenkinek
Válasz a szerzőnek
Továbbítás
0 új üzenet