Closed Bug 1039686 Opened 6 years ago Closed 6 years ago

Symbol seems break the console.log on Nigthly (33)

Categories

(DevTools :: Console, defect, P2)

x86
macOS
defect

Tracking

(firefox33 fixed, firefox34 fixed)

RESOLVED FIXED
Firefox 34
Tracking Status
firefox33 --- fixed
firefox34 --- fixed

People

(Reporter: zer0, Assigned: past)

References

Details

Attachments

(1 file)

Steps to reproduce:

1. Open the Web Console
2. Start to log something (e.g. "foo", 1, etc) and see that it's properly logged
3. Try to log a Symbol – (e.g. `Symbol("foo")`)
4. Notice that nothing is logged by the console
5. Try to log again something else (e.g. "foo", 1, etc)
6. Notice that nothing is logged by the console anymore

This is happens at least since the last two build, on OS X.
My educated guess is that there is an exception somewhere but is swallowed; maybe because a promise not handled properly?
Bug 881480 is about supporting symbols.
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → DUPLICATE
Duplicate of bug: 881480
Matteo rightly mentions that the console should at least not break in the face of a symbol. The exception we get is this:

onPacket threw an exception: Error: Server did not specify an actor, dropping packet: {"error":"unknownError","message":"error occurred while processing 'evaluateJS: TypeError: can't convert symbol to string\nStack: ThreadActor.prototype.createValueGrip@resource://gre/modules/commonjs/toolkit/loader.js -> resource://gre/modules/devtools/server/actors/script.js:2043:9\nWCA_createValueGrip@resource://gre/modules/commonjs/toolkit/loader.js -> resource://gre/modules/devtools/server/actors/webconsole.js:390:12\nWCA_onEvaluateJS@resource://gre/modules/commonjs/toolkit/loader.js -> resource://gre/modules/devtools/server/actors/webconsole.js:756:15\nDSC_onPacket@resource://gre/modules/commonjs/toolkit/loader.js -> resource://gre/modules/devtools/server/main.js:1223:15\nLocalDebuggerTransport.prototype.send/<@resource://gre/modules/devtools/dbg-client.jsm -> resource://gre/modules/devtools/transport/transport.js:545:11\nmakeInfallible/<@resource://gre/modules/commonjs/toolkit/loader.js -> resource://gre/modules/devtools/DevToolsUtils.js:83:14\nmakeInfallible/<@resource://gre/modules/commonjs/toolkit/loader.js -> resource://gre/modules/devtools/DevToolsUtils.js:83:14\nLine: 2043, column: 8"}
Stack: DebuggerClient.prototype.onPacket/<@resource://gre/modules/devtools/dbg-client.jsm:865:1
resolve@resource://gre/modules/devtools/deprecated-sync-thenables.js:40:40
then@resource://gre/modules/devtools/deprecated-sync-thenables.js:20:43
then@resource://gre/modules/devtools/deprecated-sync-thenables.js:58:9
DebuggerClient.prototype.onPacket@resource://gre/modules/devtools/dbg-client.jsm:861:1
LocalDebuggerTransport.prototype.send/<@resource://gre/modules/devtools/dbg-client.jsm -> resource://gre/modules/devtools/transport/transport.js:545:11
makeInfallible/<@resource://gre/modules/commonjs/toolkit/loader.js -> resource://gre/modules/devtools/DevToolsUtils.js:83:14
makeInfallible/<@resource://gre/modules/commonjs/toolkit/loader.js -> resource://gre/modules/devtools/DevToolsUtils.js:83:14
Line: 865, column: 0
Status: RESOLVED → REOPENED
Resolution: DUPLICATE → ---
The fix is pretty simple and the funny thing is that I can't add a test that won't be obsolete once we add support for the new value type.
Attachment #8458656 - Flags: review?(rcampbell)
Assignee: nobody → past
Status: REOPENED → ASSIGNED
Component: Developer Tools → Developer Tools: Console
Priority: -- → P2
Comment on attachment 8458656 [details] [diff] [review]
Properly handle unsupported value types in the console

Review of attachment 8458656 [details] [diff] [review]:
-----------------------------------------------------------------

::: toolkit/devtools/server/actors/webconsole.js
@@ +762,4 @@
>      return {
>        from: this.actorID,
>        input: input,
> +      result: resultGrip,

the callee of this doesn't care if resultGrip is null/undefined?
Attachment #8458656 - Flags: review?(rcampbell) → review+
(In reply to Rob Campbell [:rc] (:robcee) from comment #5)
> the callee of this doesn't care if resultGrip is null/undefined?

In just prints the contents of errorMessage, which is exactly what we need.
https://hg.mozilla.org/mozilla-central/rev/cebc0f24e839
Status: ASSIGNED → RESOLVED
Closed: 6 years ago6 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 34
Comment on attachment 8458656 [details] [diff] [review]
Properly handle unsupported value types in the console

Approval Request Comment
[Feature/regressing bug #]: bug 645416 introduced Symbols
[User impact if declined]: inspecting symbols in the web console will render it broken for the lifetime of the tab
[Describe test coverage new/current, TBPL]: tested in m-c and nightly
[Risks and why]: minor risk, devtools-only change, trivial patch
[String/UUID change made/needed]: none
Attachment #8458656 - Flags: approval-mozilla-aurora?
Attachment #8458656 - Flags: approval-mozilla-aurora? → approval-mozilla-aurora+
QA Whiteboard: [good first verify]
QA Whiteboard: [good first verify] → [qa-]
Product: Firefox → DevTools
You need to log in before you can comment on or make changes to this bug.