Open
Bug 1271655
Opened 9 years ago
Updated 2 years ago
Implement a C++ interface for Debugger.Source instances.
Categories
(Core :: JavaScript Engine, defect, P3)
Core
JavaScript Engine
Tracking
()
NEW
People
(Reporter: ejpbruel, Unassigned)
References
(Blocks 2 open bugs)
Details
Attachments
(3 files, 1 obsolete file)
(deleted),
patch
|
jimb
:
review+
|
Details | Diff | Splinter Review |
(deleted),
patch
|
jimb
:
review-
|
Details | Diff | Splinter Review |
(deleted),
patch
|
jimb
:
review+
|
Details | Diff | Splinter Review |
This bug is part of the effort to implement a C++ interface for the debugger API. See the parent bug 1271641 for more context.
Reporter | ||
Updated•9 years ago
|
Whiteboard: [devtools-html] [triage]
Updated•9 years ago
|
Flags: qe-verify-
Priority: -- → P2
Whiteboard: [devtools-html] [triage] → [devtools-html]
Updated•8 years ago
|
Whiteboard: [devtools-html]
Reporter | ||
Comment 1•8 years ago
|
||
Assignee: nobody → ejpbruel
Attachment #8815687 -
Flags: review?(jimb)
Reporter | ||
Comment 2•8 years ago
|
||
Attachment #8816115 -
Flags: review?(jimb)
Reporter | ||
Comment 3•8 years ago
|
||
That was the wrong patch.
Attachment #8816115 -
Attachment is obsolete: true
Attachment #8816115 -
Flags: review?(jimb)
Attachment #8816128 -
Flags: review?(jimb)
Reporter | ||
Comment 4•8 years ago
|
||
Attachment #8816148 -
Flags: review?(jimb)
Comment 5•8 years ago
|
||
Could we make DebuggerSource_{trace,construct,check,checkThis} into DebuggerSource::X, too?
Comment 6•8 years ago
|
||
Oh, `construct` is already in there...
Comment 7•8 years ago
|
||
Comment on attachment 8815687 [details] [diff] [review]
Implement a Debugger.Source class.
Review of attachment 8815687 [details] [diff] [review]:
-----------------------------------------------------------------
Looks good!
::: js/src/vm/Debugger.cpp
@@ +6844,5 @@
> ReturnType match(Handle<WasmInstanceObject*> instance) { obj_->setPrivateGCThing(instance); }
> };
>
> +/* static */ NativeObject*
> +DebuggerSource::initClass(JSContext* cx, HandleObject debugCtor, HandleObject obj)
These argument names are reversed in Debugger.h.
Calls to various initClass methods presently in Debugger.cpp:
frameProto = DebuggerFrame::initClass(cx, debugCtor, obj);
objectProto = DebuggerObject::initClass(cx, obj, debugCtor);
envProto = DebuggerEnvironment::initClass(cx, debugCtor, obj);
This is not a recipe for happiness.
@@ +6856,5 @@
> +
> + if (!sourceProto)
> + return nullptr;
> +
> + return sourceProto;
I understand we have an "early return" rule, but I think it'd be okay to just "return sourceProto".
@@ +6880,5 @@
> Debugger::newDebuggerSource(JSContext* cx, Handle<DebuggerSourceReferent> referent)
> {
> assertSameCompartment(cx, object.get());
>
> + RootedNativeObject debugger(cx, object);
I would move this to the top, and then use it in the assertSameCompartment, and in the JSSLOT_DEBUG_SOURCE_PROTO fetch.
@@ +6936,5 @@
> {
> JSObject* thisobj = NonNullObject(cx, thisv);
> if (!thisobj)
> return nullptr;
> + if (thisobj->getClass() != &DebuggerSource::class_) {
You can just say `class_` here.
Attachment #8815687 -
Flags: review?(jimb) → review+
Comment 8•8 years ago
|
||
Comment on attachment 8816128 [details] [diff] [review]
Implement a C++ interface for DebuggerSource.text.
Review of attachment 8816128 [details] [diff] [review]:
-----------------------------------------------------------------
::: js/src/vm/Debugger.cpp
@@ +6965,5 @@
> + }
> +
> + Rooted<DebuggerSourceReferent> referent(cx, source->referent());
> + DebuggerSourceGetTextMatcher matcher(cx);
> + result.set(referent.match(matcher));
Can't this call to referent.match fail? You'll end up returning true with `result` and the JSSLOT_DEBUGSOURCE_TEXT slot set to nullptr.
If I'm right that this is a problem, then we'll need a test case to catch it.
Attachment #8816128 -
Flags: review?(jimb) → review-
Comment 9•8 years ago
|
||
Comment on attachment 8816148 [details] [diff] [review]
Implement a C++ interface for DebuggerSource.url.
Review of attachment 8816148 [details] [diff] [review]:
-----------------------------------------------------------------
Looks good to me.
Attachment #8816148 -
Flags: review?(jimb) → review+
Reporter | ||
Updated•8 years ago
|
Assignee: ejpbruel → nobody
Comment 10•6 years ago
|
||
Moving to p3 because no activity for at least 1 year(s).
See https://github.com/mozilla/bug-handling/blob/master/policy/triage-bugzilla.md#how-do-you-triage for more information
Priority: P2 → P3
Updated•4 years ago
|
Blocks: js-debugger
Updated•2 years ago
|
Severity: normal → S3
You need to log in
before you can comment on or make changes to this bug.
Description
•