console.log from Jetpack prints string [Object object]

RESOLVED DUPLICATE of bug 850296

Status

()

Firefox
Developer Tools: Console
RESOLVED DUPLICATE of bug 850296
5 years ago
5 years ago

People

(Reporter: canuckistani, Unassigned)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

Created attachment 757633 [details]
screenshot of problem

This might be an SDK bug - the output from the SDK's console.log to the browser Console does not inspect objects correctly, probably because the output from the SDK's console is stringified with a prefix containing the name of the extension:

scratch-kit: [object Object]

Test code ( run in Gozala's scratch-kit extension [1] ):

// Jetpack scratchpad
var { Cu } = require("chrome");

var c = Cu.import("resource://gre/modules/devtools/Console.jsm").console;

console.log(o);
c.log(o);


[1] https://github.com/Gozala/scratch-kit/
I remember Alex told me that the console object implementation in addon-sdk stringifies all the arguments, hence the problem you see.

Alex, should this bug move to the addon-sdk component?
You're right. All messages are piped to the console here and stringified:
https://github.com/mozilla/addon-sdk/blob/master/lib/sdk/system/globals.js#L29-L37

This bug will be fixed when we will really integrate SDK with the devtool console and plug our console directly to Console.jsm.
Status: NEW → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → DUPLICATE
Duplicate of bug: 850296
You need to log in before you can comment on or make changes to this bug.