Closed Bug 879019 Opened 11 years ago Closed 11 years ago

console.log from Jetpack prints string [Object object]

Categories

(DevTools :: Console, defect)

x86
macOS
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED DUPLICATE of bug 850296

People

(Reporter: canuckistani, Unassigned)

Details

Attachments

(1 file)

Attached image 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
Closed: 11 years ago
Resolution: --- → DUPLICATE
Product: Firefox → DevTools
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: