Closed
Bug 1173385
Opened 5 years ago
Closed 5 years ago
Calling $$("") should throw an exception
Categories
(DevTools :: Console, defect)
Not set
Tracking
(firefox41 fixed)
RESOLVED
FIXED
Firefox 41
Tracking | Status | |
---|---|---|
firefox41 | --- | fixed |
People
(Reporter: bgrins, Assigned: fayolle-florent)
References
Details
Attachments
(3 files, 3 obsolete files)
39.01 KB,
image/png
|
Details | |
60.93 KB,
image/png
|
Details | |
3.51 KB,
patch
|
Details | Diff | Splinter Review |
There is a $$ command line helper that's a wrapper for document.querySelectorAll. It seems to swallow errors though, we should just let any errors propagate to the console. > $$("") undefined > document.querySelectorAll("") SyntaxError: An invalid or illegal string was specified
Assignee | ||
Comment 1•5 years ago
|
||
That trick should work.
Quoting :fitzgen about the use of |error.unsafeDereference()|:
> at a glance, I think it would be safe, since there would still be
> cross-compartment/xray wrappers and it is clear we are OK with potential side
> effects in the debuggee
Florent
Attachment #8620510 -
Flags: review?(bgrinstead)
Reporter | ||
Comment 2•5 years ago
|
||
Comment on attachment 8620510 [details] [diff] [review] 1173385.patch Review of attachment 8620510 [details] [diff] [review]: ----------------------------------------------------------------- Forwarding this to fitzgen, he's better qualified to review this change. The changes to test_jsterm_queryselector.html look fine
Attachment #8620510 -
Flags: review?(bgrinstead) → review?(nfitzgerald)
Reporter | ||
Updated•5 years ago
|
Assignee: nobody → fayolle-florent
Status: NEW → ASSIGNED
Comment 3•5 years ago
|
||
Comment on attachment 8620510 [details] [diff] [review] 1173385.patch Review of attachment 8620510 [details] [diff] [review]: ----------------------------------------------------------------- ::: toolkit/devtools/server/actors/webconsole.js @@ +819,5 @@ > let error = evalResult.throw; > errorGrip = this.createValueGrip(error); > + errorMessage = error && (typeof error === "object" ) ? > + error.unsafeDereference().toString() : > + '' + error; Let's do `DevToolsUtils.safeErrorString(error.unsafeDereference())` instead of `error.unsafeDereference().toString()`. DevToolsUtils.safeErrorString: https://dxr.mozilla.org/mozilla-central/source/toolkit/devtools/DevToolsUtils.js#16 Nitpick: also, please format multiline `a : b ? c` expressions like this: obj.prop = foo ? bar : baz; Which is consistent with the way we do it elsewhere.
Attachment #8620510 -
Flags: review?(nfitzgerald) → review+
Assignee | ||
Comment 4•5 years ago
|
||
Attachment #8620510 -
Attachment is obsolete: true
Assignee | ||
Comment 5•5 years ago
|
||
I updated the patch (though not the tests yet). I attached how the exception is rendered with the patch. The use of |DevToolsUtils.safeErrorString| appends the callstack to the error string (so the internal one). Nick, are you sure we want to use this function? Florent
Flags: needinfo?(nfitzgerald)
Comment 6•5 years ago
|
||
Ah, ok. My bad. Carry on with the last iteration.
Flags: needinfo?(nfitzgerald)
Assignee | ||
Comment 7•5 years ago
|
||
No problem, thanks for the answer! Try push: https://ftp-ssl.mozilla.org/pub/mozilla.org/firefox/try-builds/florent.fayolle69@gmail.com-d398984dbc85 Florent
Assignee | ||
Comment 8•5 years ago
|
||
(forgot the updated patch) Florent
Attachment #8622040 -
Attachment is obsolete: true
Assignee | ||
Comment 9•5 years ago
|
||
(real try-push link): https://treeherder.mozilla.org/#/jobs?repo=try&revision=d398984dbc85 Florent
Assignee | ||
Comment 10•5 years ago
|
||
(Just an update to fix the summary)
Attachment #8622583 -
Attachment is obsolete: true
Assignee | ||
Updated•5 years ago
|
Keywords: checkin-needed
Comment 11•5 years ago
|
||
https://hg.mozilla.org/integration/fx-team/rev/4a5c802618fe
Keywords: checkin-needed
Comment 12•5 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/4a5c802618fe
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
status-firefox41:
--- → fixed
Flags: in-testsuite+
Resolution: --- → FIXED
Target Milestone: --- → Firefox 41
Updated•2 years ago
|
Product: Firefox → DevTools
You need to log in
before you can comment on or make changes to this bug.
Description
•