Closed
Bug 605470
Opened 14 years ago
Closed 14 years ago
Variables defined in web console can disappear with no warning
Categories
(DevTools :: General, defect)
Tracking
(blocking2.0 final+)
RESOLVED
WORKSFORME
Tracking | Status | |
---|---|---|
blocking2.0 | --- | final+ |
People
(Reporter: jdm, Unassigned)
References
Details
Open a blank page, and open the web console. Type |var f = document.createElement("iframe")|, then |f| to verify that f contains a value, and sit back and wait for (presumably) a GC to occur. Type |f| in the console again, note that you now have "ReferenceError: f is not defined" instead of the previous value.
Reporter | ||
Comment 1•14 years ago
|
||
This is a surprising and unfortunate user experience; I suspect blocking is in order.
blocking2.0: --- → ?
Comment 2•14 years ago
|
||
It's unfortunate for a lot of reasons!
Comment 3•14 years ago
|
||
(In reply to comment #0)
> Open a blank page, and open the web console. Type |var f =
> document.createElement("iframe")|, then |f| to verify that f contains a value,
> and sit back and wait for (presumably) a GC to occur. Type |f| in the console
> again, note that you now have "ReferenceError: f is not defined" instead of the
> previous value.
Could you retest with today's nightly? There were some changes made to evalInSandbox (oustanding wrapper+compartments fixes) last night that may have fixed this.
Updated•14 years ago
|
Blocks: devtools4b7
Reporter | ||
Comment 4•14 years ago
|
||
The error message has changed to "10:44:27.213: Error: Permission denied to access property 'f'" in today's nightly.
Updated•14 years ago
|
blocking2.0: ? → final+
Comment 5•14 years ago
|
||
curious to hear if this is still happening in current nightlies. I'm hoping the modifications to the evaluation code in bug 599940 have cured this.
Reporter | ||
Comment 6•14 years ago
|
||
I tried to reproduce and no longer can.
Status: NEW → RESOLVED
Closed: 14 years ago
Resolution: --- → WORKSFORME
Comment 7•14 years ago
|
||
great success!
thanks for the follow-up.
Comment 8•14 years ago
|
||
For future generations, my theory as to what was happening, was that
evalInSandbox(with(__helpers__) { with(__window__) { var a = Object; } });
Was executing | var a = Object | inside a separate scope from the sandbox itself. This allowed the garbage collector to detect that these variables were disconnected and clean them up.
The magic sauce was removing the always awful with() statements.
Comment 9•14 years ago
|
||
That should be quoted, as in:
evalInSandbox("with(__helpers__) { with(__window__) { var a = Object; } }");
(bugzilla needs a js parser)
Comment 10•14 years ago
|
||
let this be a lesson to us! 'with' is one of the "bad parts" of JS:)
Comment 11•14 years ago
|
||
(In reply to comment #10)
> let this be a lesson to us! 'with' is one of the "bad parts" of JS:)
I'm pretty sure I read that in a book somewhere. hmm...
Updated•7 years ago
|
Product: Firefox → DevTools
You need to log in
before you can comment on or make changes to this bug.
Description
•