Wed, 31 Dec 2014 07:53:36 +0100
Correct small whitespace inconsistency, lost while renaming variables.
1 /* Any copyright is dedicated to the Public Domain.
2 * http://creativecommons.org/publicdomain/zero/1.0/ */
4 _("Define some functions in well defined line positions for the test");
5 function foo(v) bar(v + 1); // line 2
6 function bar(v) baz(v + 1); // line 3
7 function baz(v) { throw new Error(v + 1); } // line 4
9 _("Make sure lazy constructor calling/assignment works");
10 Cu.import("resource://services-common/utils.js");
12 function run_test() {
13 _("Make sure functions, arguments, files are pretty printed in the trace");
14 let trace = "";
15 try {
16 foo(0);
17 }
18 catch(ex) {
19 trace = CommonUtils.stackTrace(ex);
20 }
21 _("Got trace:", trace);
22 do_check_neq(trace, "");
24 let bazPos = trace.indexOf("baz@test_utils_stackTrace.js:7");
25 let barPos = trace.indexOf("bar@test_utils_stackTrace.js:6");
26 let fooPos = trace.indexOf("foo@test_utils_stackTrace.js:5");
27 _("String positions:", bazPos, barPos, fooPos);
29 _("Make sure the desired messages show up");
30 do_check_true(bazPos >= 0);
31 do_check_true(barPos > bazPos);
32 do_check_true(fooPos > barPos);
33 }