|
1 /* vim:set ts=2 sw=2 sts=2 et: */ |
|
2 /* ***** BEGIN LICENSE BLOCK ***** |
|
3 * Any copyright is dedicated to the Public Domain. |
|
4 * http://creativecommons.org/publicdomain/zero/1.0/ |
|
5 * |
|
6 * Contributor(s): |
|
7 * Julian Viereck <jviereck@mozilla.com> |
|
8 * Patrick Walton <pcwalton@mozilla.com> |
|
9 * Mihai Șucan <mihai.sucan@gmail.com> |
|
10 * |
|
11 * ***** END LICENSE BLOCK ***** */ |
|
12 |
|
13 // Tests that, when the user types an extraneous closing bracket, no error |
|
14 // appears. |
|
15 |
|
16 function test() { |
|
17 addTab("data:text/html;charset=utf-8,test for bug 592442"); |
|
18 browser.addEventListener("load", function onLoad() { |
|
19 browser.removeEventListener("load", onLoad, true); |
|
20 openConsole(null, testExtraneousClosingBrackets); |
|
21 }, true); |
|
22 } |
|
23 |
|
24 function testExtraneousClosingBrackets(hud) { |
|
25 let jsterm = hud.jsterm; |
|
26 |
|
27 jsterm.setInputValue("document.getElementById)"); |
|
28 |
|
29 let error = false; |
|
30 try { |
|
31 jsterm.complete(jsterm.COMPLETE_HINT_ONLY); |
|
32 } |
|
33 catch (ex) { |
|
34 error = true; |
|
35 } |
|
36 |
|
37 ok(!error, "no error was thrown when an extraneous bracket was inserted"); |
|
38 |
|
39 finishTest(); |
|
40 } |
|
41 |