summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/debug/Object-parameterNames.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/src/jit-test/tests/debug/Object-parameterNames.js')
-rw-r--r--js/src/jit-test/tests/debug/Object-parameterNames.js32
1 files changed, 32 insertions, 0 deletions
diff --git a/js/src/jit-test/tests/debug/Object-parameterNames.js b/js/src/jit-test/tests/debug/Object-parameterNames.js
new file mode 100644
index 0000000000..3e3c504714
--- /dev/null
+++ b/js/src/jit-test/tests/debug/Object-parameterNames.js
@@ -0,0 +1,32 @@
+load(libdir + 'array-compare.js');
+
+var g = newGlobal({newCompartment: true});
+var dbg = new Debugger;
+var gDO = dbg.addDebuggee(g);
+var hits = 0;
+
+function check(expr, expected) {
+ print("checking " + JSON.stringify(expr));
+
+ let completion = gDO.executeInGlobal(expr);
+ if (completion.throw)
+ throw completion.throw.unsafeDereference();
+
+ let fn = completion.return;
+ if (expected === undefined)
+ assertEq(fn.parameterNames, undefined);
+ else
+ assertEq(arraysEqual(fn.parameterNames, expected), true);
+}
+
+check('(function () {})', []);
+check('(function (x) {})', ["x"]);
+check('(function (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z) {})',
+ ["a","b","c","d","e","f","g","h","i","j","k","l","m",
+ "n","o","p","q","r","s","t","u","v","w","x","y","z"]);
+check('(function (a, [b, c], {d, e:f}) { })',
+ ["a", undefined, undefined]);
+check('({a:1})', undefined);
+check('Math.atan2', [undefined, undefined]);
+check('(async function (a, b, c) {})', ["a", "b", "c"]);
+check('(async function* (d, e, f) {})', ["d", "e", "f"]);