Imported Upstream version 1.0.0
[platform/upstream/js.git] / js / jsd / test / bug507448.js
1 netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
2
3 function f() {}
4 function g(a,b) {}
5 function h(me, too, here) { var x = 1; }
6 function annoying(a, b, a, b, b, a) {}
7 function manyLocals(a, b, c, d, e, f, g, h, i, j, k, l, m) {
8   var n, o, p, q, r, s, t, u, v, w, x, y, z;
9 }
10
11 assertArraysEqual(jsd.wrapValue(f).script.getParameterNames(), []);
12 assertArraysEqual(jsd.wrapValue(g).script.getParameterNames(), ["a", "b"]);
13 assertArraysEqual(jsd.wrapValue(h).script.getParameterNames(), ["me", "too", "here"]);
14 assertArraysEqual(jsd.wrapValue(annoying).script.getParameterNames(),
15                   ["a", "b", "a", "b", "b", "a"]);
16 assertArraysEqual(jsd.wrapValue(manyLocals).script.getParameterNames(),
17                   "abcdefghijklm".split(""));
18
19 if (!jsdOnAtStart) {
20   // turn JSD off if it wasn't on when this test started
21   jsd.off();
22   ok(!jsd.isOn, "JSD shouldn't be running at the end of this test.");
23 }
24
25 SimpleTest.finish();