diff --git a/toolkit/components/console/hudservice/HUDService.jsm b/toolkit/components/console/hudservice/HUDService.jsm index 7e44b3d69d5..15d459a88c5 100644 --- a/toolkit/components/console/hudservice/HUDService.jsm +++ b/toolkit/components/console/hudservice/HUDService.jsm @@ -707,7 +707,11 @@ function createAndAppendElement(aParent, aTag, aAttributes) function unwrap(aObject) { - return XPCNativeWrapper.unwrap(aObject); + try { + return XPCNativeWrapper.unwrap(aObject); + } catch(e) { + return aObject; + } } /////////////////////////////////////////////////////////////////////////// diff --git a/toolkit/components/console/hudservice/tests/browser/browser_webconsole_jsterm.js b/toolkit/components/console/hudservice/tests/browser/browser_webconsole_jsterm.js index fff32cbc32e..30852331e02 100644 --- a/toolkit/components/console/hudservice/tests/browser/browser_webconsole_jsterm.js +++ b/toolkit/components/console/hudservice/tests/browser/browser_webconsole_jsterm.js @@ -137,5 +137,11 @@ function testJSTerm() let labels = jsterm.outputNode.querySelectorAll(".jsterm-output-line"); ok(labels.length, "more than 0 lines of output for keys(window)"); + jsterm.clearOutput(); + jsterm.execute("pprint('hi')"); + // Doesn't conform to checkResult format, bug 614561 + let label = jsterm.outputNode.querySelector(".jsterm-output-line"); + is(label.textContent.trim(), '0: "h"\n 1: "i"', 'pprint("hi") worked'); + finishTest(); }