Objects logged in a worker come through as [Object object]
Categories
(DevTools :: Console, defect, P2)
Tracking
(firefox44 affected)
Tracking | Status | |
---|---|---|
firefox44 | --- | affected |
People
(Reporter: bgrins, Unassigned)
References
(Blocks 2 open bugs)
Details
Reporter | ||
Updated•9 years ago
|
Reporter | ||
Comment 1•9 years ago
|
||
Reporter | ||
Updated•9 years ago
|
Reporter | ||
Updated•9 years ago
|
Updated•6 years ago
|
Updated•6 years ago
|
Comment 3•6 years ago
|
||
Yulia, can you just confirm if the Fission protocol work fixes this; or if there is more work needed?
Comment 4•6 years ago
|
||
I haven't looked very much into this so I might not be the best person to ask. but we have had work done with service workers to allow target switching, and the bug is still there. Maybe Brian Hackett knows more? He has been working on this.
Comment 5•6 years ago
|
||
console.log(this) in a worker now produces '[object DedicatedWorkerGlobalScope]', though I don't know what fixed this.
Comment 6•6 years ago
|
||
(In reply to Brian Hackett (:bhackett) from comment #5)
console.log(this) in a worker now produces '[object DedicatedWorkerGlobalScope]', though I don't know what fixed this.
Oops, I didn't read this bug closely enough, the behavior here is still the same as in comment 0.
Comment 7•6 years ago
|
||
The problem here is that when the console tries to encode the global used in the worker for sending to the ConsoleAPIStorage service in the main thread (from which the worker console messages will be retrieved), that encoding fails and we fall back to converting the object to a string. The relevant code is in ConsoleRunnable::CustomWriteHandler() in dom/console/Console.cpp; the UNWRAP_OBJECT() macro produces a NS_ERROR_XPC_BAD_CONVERT_JS error.
Comment 8•5 years ago
|
||
Brian, would bug 1252945 help with this?
Updated•5 years ago
|
Comment 9•5 years ago
|
||
(In reply to :Harald Kirschner :digitarald from comment #8)
Brian, would bug 1252945 help with this?
I think it would be better to look at this again once the related fission work for a multithreaded console is done, as Nicolas refers to in comment 21 of that bug. When console messages do not need to be dispatched from the worker thread to the main thread, it will be a lot easier to show those messages in the console without losing information.
Comment 10•5 years ago
|
||
Thanks Brian for clarifying.
Nicolas, could you please mark the right bug as a dependency.
Updated•5 years ago
|
Updated•2 years ago
|
Description
•