Closed
Bug 785174
Opened 12 years ago
Closed 12 years ago
Implement Debugger.Object.prototype.evalInGlobalWithBindings
Categories
(Core :: JavaScript Engine, defect)
Core
JavaScript Engine
Tracking
()
RESOLVED
FIXED
mozilla18
People
(Reporter: espadrine, Assigned: jimb)
References
Details
(Whiteboard: [js:t])
Attachments
(2 files, 1 obsolete file)
3.65 KB,
patch
|
jorendorff
:
review+
|
Details | Diff | Splinter Review |
11.33 KB,
patch
|
jorendorff
:
review+
|
Details | Diff | Splinter Review |
As seen on MDN [1], Debugger.Object instances have a method called evalInGlobalWithBindings() that would be very useful for evaluating WebConsole statements, thereby fixing bug 774753.
[1]: https://developer.mozilla.org/en-US/docs/SpiderMonkey/JS_Debugger_API_Reference/Debugger.Object#evalInGlobalWithBindings()
Assignee | ||
Comment 1•12 years ago
|
||
Assignee: general → jimb
Status: NEW → ASSIGNED
Assignee | ||
Comment 2•12 years ago
|
||
Work in progress. Currently trips cross-compartment assertions.
Assignee | ||
Comment 3•12 years ago
|
||
I'm not sure whether this addresses bug 529474 as well or not.
Reporter | ||
Comment 4•12 years ago
|
||
My understanding is that it would, but Firebug isn't using jsd2 yet. They're making the switch, though, so they'll benefit from it as well!
Assignee | ||
Comment 5•12 years ago
|
||
(In reply to Thaddee Tyl [:espadrine] from comment #4)
> My understanding is that it would, but Firebug isn't using jsd2 yet. They're
> making the switch, though, so they'll benefit from it as well!
Okay, with the caveat that, where bug 529474 talks about a XPCSafeJSObjectWrapper, we're handing back a Debugger.Object. Seems legit.
Assignee | ||
Comment 6•12 years ago
|
||
I'd love suggestions for more tests.
Attachment #658551 -
Attachment is obsolete: true
Attachment #658835 -
Flags: review?(jorendorff)
Assignee | ||
Updated•12 years ago
|
Attachment #658547 -
Flags: review?(jorendorff)
Assignee | ||
Comment 7•12 years ago
|
||
Comment 9•12 years ago
|
||
Comment on attachment 658547 [details] [diff] [review]
Refactor DebuggerFrameEval to be useful for Debugger.Object.prototype.evalInGlobal{,WithBindings}
Review of attachment 658547 [details] [diff] [review]:
-----------------------------------------------------------------
Very nice.
::: js/src/vm/Debugger.cpp
@@ +3427,3 @@
> static JSBool
> +DebuggerGenericEval(JSContext *cx, const char *fullMethodName,
> + Value *code, Value *bindings, Value *vp,
Why does `code` have to be a pointer? const Value & should work, or ValueHandle (but that's more bother for callers).
Attachment #658547 -
Flags: review?(jorendorff) → review+
(In reply to Jason Orendorff [:jorendorff] from comment #9)
> Why does `code` have to be a pointer? const Value & should work, or
> ValueHandle (but that's more bother for callers).
There's no good reason. I just consistently forget that const Value & isn't just as relocating-GC-friendly as a handle.
Er, "is".
Assignee | ||
Comment 12•12 years ago
|
||
Test comment.
Updated•12 years ago
|
Attachment #658835 -
Flags: review?(jorendorff) → review+
Assignee | ||
Comment 13•12 years ago
|
||
I changed DebuggerGenericEval's 'code' argument to be a const Value &, and changed RequireGlobalObject to take a const Value &dbgobj, instead of taking args and calling args.thisv(), because, jeez.
Assignee | ||
Comment 14•12 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/4afed1cd79a6
https://hg.mozilla.org/integration/mozilla-inbound/rev/955f71c08edb
Flags: in-testsuite-
Target Milestone: --- → mozilla18
Comment 15•12 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/4afed1cd79a6
https://hg.mozilla.org/mozilla-central/rev/955f71c08edb
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Updated•12 years ago
|
Whiteboard: [js:t]
You need to log in
before you can comment on or make changes to this bug.
Description
•