Open
Bug 580880
Opened 14 years ago
Updated 2 years ago
chrome JS access to setTimeout enumeration
Categories
(Core :: DOM: Core & HTML, defect, P5)
Core
DOM: Core & HTML
Tracking
()
NEW
People
(Reporter: johnjbarton, Unassigned)
References
Details
(Whiteboard: [firebug-p2])
Gradually Firebug has learned how to stop JS and Web page events when we halt on a breakpoint. However, this causes Web apps to fail because setTimeout events (apparently) fail if you are halted. See: Issue 3264: setTimeouts are skipped while stopped in the debugger http://code.google.com/p/fbug/issues/detail?id=3264 Boris says there is SuspendTimeouts but no way to call it in JS. Ideally it would stop the timer until we resume it. This would allow programs to be correct even if we halt them. Even better would be a way to enumerate the pending timeouts. We just need access to the functions and delay time. Then we can help devs by showing them what timeout functions they have set and allowing them to eg set breakpoints in these functions. That would go a long way to making setTimeout code less mysterious.
Reporter | ||
Updated•14 years ago
|
Whiteboard: [firebug-p2]
Comment 1•14 years ago
|
||
smaug, would it make sense for nsDOMWindowUtils::SuppressEventHandling to SuspendTimeouts on the window? Or do we need to add a new API here?
Comment 2•14 years ago
|
||
The enumeration sounds like a good idea too, but would need to be separate from the issue of timeouts firing while debugging, right? You need that part no matter what happens with enumeration....
Reporter | ||
Comment 3•14 years ago
|
||
Rather I would say: no need to bother opening a bug for enumeration until we can suspend ;-)
Comment 4•14 years ago
|
||
DOMWindowUtils could have just a new method for suspending/resuming timeouts.
Comment 5•14 years ago
|
||
Sure; the question is whether suppressEventHandling should do it automatically or whether we should create said new method.
Comment 6•14 years ago
|
||
Turns out I need this for the test for bug 581072 anyway.
Depends on: 581072
Comment 7•14 years ago
|
||
Any news on this one? Please also have a look at http://code.google.com/p/fbug/issues/detail?id=3017, which needs this to be processed.
Comment 8•14 years ago
|
||
> Any news on this one? Chrome access to suspending timeouts is implemented; see bug 581072. John, do you want to morph this bug to cover enumeration, or file a clean bug (this is why we do one bug per problem!).
Reporter | ||
Comment 9•14 years ago
|
||
I've added bug 581072 to our Firebug 1.7 todo list http://code.google.com/p/fbug/issues/detail?id=3372 and changed the title here to focus on enumeration. My summary lies however because we also need to list the objects bound by setTimeout functions: function bar() { var foo = window.myProp; setTimeout(function xx(){ alert(foo); }, 5000); delete window.myProp; } bar(); // now who is still pointing to the object myProp refed? But you can tell me this is another bug also?, because the same problem affects event handlers even more important.
Summary: chrome JS access to SuspendTimeouts and setTimeout enumeration → chrome JS access to setTimeout enumeration
Comment 10•14 years ago
|
||
> // now who is still pointing to the object myProp refed?
The function passed to setTimeout is. I believe, in particular, that the parent of the function object (see jsParent on jsdIValue) will hae a property called "foo" on it. Though there may be various cases where we optimize things away (e.g. if you didn't use foo in the function, we wouldn't hold a ref to it from the function).
If you want nicer accessors to find values in scope in given functions (so following the scope chain and proto chains both), that would be a separate bug, yes...
Comment 11•6 years ago
|
||
https://bugzilla.mozilla.org/show_bug.cgi?id=1472046 Move all DOM bugs that haven’t been updated in more than 3 years and has no one currently assigned to P5. If you have questions, please contact :mdaly.
Priority: -- → P5
Updated•2 years ago
|
Severity: normal → S3
You need to log in
before you can comment on or make changes to this bug.
Description
•