js/jsd/test/bug507448.js

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/js/jsd/test/bug507448.js	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,24 @@
     1.4 +
     1.5 +function f() {}
     1.6 +function g(a,b) {}
     1.7 +function h(me, too, here) { var x = 1; }
     1.8 +function annoying(a, b, a, b, b, a) {}
     1.9 +function manyLocals(a, b, c, d, e, f, g, h, i, j, k, l, m) {
    1.10 +  var n, o, p, q, r, s, t, u, v, w, x, y, z;
    1.11 +}
    1.12 +
    1.13 +assertArraysEqual(jsd.wrapValue(f).script.getParameterNames(), []);
    1.14 +assertArraysEqual(jsd.wrapValue(g).script.getParameterNames(), ["a", "b"]);
    1.15 +assertArraysEqual(jsd.wrapValue(h).script.getParameterNames(), ["me", "too", "here"]);
    1.16 +assertArraysEqual(jsd.wrapValue(annoying).script.getParameterNames(),
    1.17 +                  ["a", "b", "a", "b", "b", "a"]);
    1.18 +assertArraysEqual(jsd.wrapValue(manyLocals).script.getParameterNames(),
    1.19 +                  "abcdefghijklm".split(""));
    1.20 +
    1.21 +if (!jsdOnAtStart) {
    1.22 +  // turn JSD off if it wasn't on when this test started
    1.23 +  jsd.off();
    1.24 +  ok(!jsd.isOn, "JSD shouldn't be running at the end of this test.");
    1.25 +}
    1.26 +
    1.27 +SimpleTest.finish();
    1.28 \ No newline at end of file

mercurial