Closed
Bug 1261904
Opened 8 years ago
Closed 8 years ago
Refactor Debugger.Object.getErrorMessageName
Categories
(Core :: JavaScript Engine, defect)
Core
JavaScript Engine
Tracking
()
RESOLVED
FIXED
mozilla48
Tracking | Status | |
---|---|---|
firefox48 | --- | fixed |
People
(Reporter: mrrrgn, Assigned: mrrrgn)
References
Details
Attachments
(1 file, 4 obsolete files)
9.05 KB,
patch
|
jimb
:
review+
|
Details | Diff | Splinter Review |
This API doesn't make proper use of the Debugger object. In short, this method should not take an argument.
Assignee | ||
Updated•8 years ago
|
Assignee: nobody → winter2718
Comment 1•8 years ago
|
||
Sorry I didn't do a better job reviewing that patch!
Comment 2•8 years ago
|
||
(In reply to Morgan Phillips [:mrrrgn] from comment #0) > This API doesn't make proper use of the Debugger object. In short, this > method should not take an argument. It shouldn't take an argument, and it should possibly be just an accessor property of the Debugger.Object (see DebuggerObject_properties).
Assignee | ||
Comment 3•8 years ago
|
||
Assignee | ||
Comment 4•8 years ago
|
||
(In reply to Jim Blandy :jimb from comment #2) > (In reply to Morgan Phillips [:mrrrgn] from comment #0) > > This API doesn't make proper use of the Debugger object. In short, this > > method should not take an argument. > > It shouldn't take an argument, and it should possibly be just an accessor > property of the Debugger.Object (see DebuggerObject_properties). Yeah, 100% agree about it being a property.
Assignee | ||
Comment 5•8 years ago
|
||
Attachment #8738287 -
Attachment is obsolete: true
Attachment #8738317 -
Flags: review?(jimb)
Assignee | ||
Comment 6•8 years ago
|
||
Attachment #8738317 -
Attachment is obsolete: true
Attachment #8738317 -
Flags: review?(jimb)
Attachment #8738319 -
Flags: review?(jimb)
Comment 7•8 years ago
|
||
Comment on attachment 8738319 [details] [diff] [review] getErrorMsgName.diff Review of attachment 8738319 [details] [diff] [review]: ----------------------------------------------------------------- Tests are excellent. One minor issue to address. ::: js/src/vm/Debugger.cpp @@ +8039,5 @@ > + THIS_DEBUGOBJECT_REFERENT(cx, argc, vp, "get errorMessageName", args, referent); > + > + JSObject* obj = referent; > + if (IsCrossCompartmentWrapper(obj)) > + obj = CheckedUnwrap(obj); It looks to me like CheckedUnwrap can return nullptr if the unwrap isn't permitted. If this happens, the is<ErrorObject> check will segfault. We need to report an error on cx and return false; see how Debugger::unwrapDebuggeeArgument checks the return value from its call to CheckedUnwrap for an example to emulate.
Attachment #8738319 -
Flags: review?(jimb) → review-
Assignee | ||
Comment 8•8 years ago
|
||
(In reply to Jim Blandy :jimb from comment #7) > Comment on attachment 8738319 [details] [diff] [review] > getErrorMsgName.diff > > Review of attachment 8738319 [details] [diff] [review]: > ----------------------------------------------------------------- > > Tests are excellent. One minor issue to address. > > ::: js/src/vm/Debugger.cpp > @@ +8039,5 @@ > > + THIS_DEBUGOBJECT_REFERENT(cx, argc, vp, "get errorMessageName", args, referent); > > + > > + JSObject* obj = referent; > > + if (IsCrossCompartmentWrapper(obj)) > > + obj = CheckedUnwrap(obj); > > It looks to me like CheckedUnwrap can return nullptr if the unwrap isn't > permitted. If this happens, the is<ErrorObject> check will segfault. We need > to report an error on cx and return false; see how > Debugger::unwrapDebuggeeArgument checks the return value from its call to > CheckedUnwrap for an example to emulate. Oy vey, fixing it up. Thanks ! https://49.media.tumblr.com/38430f1e34abf51dc21bd62bdc7f2063/tumblr_myy2yekXjj1rrx588o1_500.gif
Assignee | ||
Comment 9•8 years ago
|
||
Attachment #8738319 -
Attachment is obsolete: true
Assignee | ||
Comment 10•8 years ago
|
||
Attachment #8738366 -
Attachment is obsolete: true
Attachment #8738391 -
Flags: review?(jimb)
Comment 11•8 years ago
|
||
Comment on attachment 8738391 [details] [diff] [review] getErrorMsgName.diff Review of attachment 8738391 [details] [diff] [review]: ----------------------------------------------------------------- Looks great, thanks!
Attachment #8738391 -
Flags: review?(jimb) → review+
Comment 13•8 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/4b76e05f7ecf
Status: NEW → RESOLVED
Closed: 8 years ago
status-firefox48:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla48
You need to log in
before you can comment on or make changes to this bug.
Description
•