michael@0: /* vim:set ts=2 sw=2 sts=2 et: */ michael@0: /* ***** BEGIN LICENSE BLOCK ***** michael@0: * Any copyright is dedicated to the Public Domain. michael@0: * http://creativecommons.org/publicdomain/zero/1.0/ michael@0: * michael@0: * Contributor(s): michael@0: * Julian Viereck michael@0: * Patrick Walton michael@0: * Mihai Șucan michael@0: * michael@0: * ***** END LICENSE BLOCK ***** */ michael@0: michael@0: // Tests that, when the user types an extraneous closing bracket, no error michael@0: // appears. michael@0: michael@0: function test() { michael@0: addTab("data:text/html;charset=utf-8,test for bug 592442"); michael@0: browser.addEventListener("load", function onLoad() { michael@0: browser.removeEventListener("load", onLoad, true); michael@0: openConsole(null, testExtraneousClosingBrackets); michael@0: }, true); michael@0: } michael@0: michael@0: function testExtraneousClosingBrackets(hud) { michael@0: let jsterm = hud.jsterm; michael@0: michael@0: jsterm.setInputValue("document.getElementById)"); michael@0: michael@0: let error = false; michael@0: try { michael@0: jsterm.complete(jsterm.COMPLETE_HINT_ONLY); michael@0: } michael@0: catch (ex) { michael@0: error = true; michael@0: } michael@0: michael@0: ok(!error, "no error was thrown when an extraneous bracket was inserted"); michael@0: michael@0: finishTest(); michael@0: } michael@0: