mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-11-11 21:58:41 +02:00
MozReview-Commit-ID: XeWrs0cNL5 Differential Revision: https://phabricator.services.mozilla.com/D5074 --HG-- extra : moz-landing-system : lando
16 lines
396 B
JavaScript
16 lines
396 B
JavaScript
function run_test() {
|
|
var sbContent = Cu.Sandbox(null);
|
|
let xrayedArgs = sbContent.eval("(function(a, b) { return arguments; })('hi', 42)");
|
|
|
|
function checkArgs(a) {
|
|
Assert.equal(a.length, 2);
|
|
Assert.equal(a[0], 'hi');
|
|
Assert.equal(a[1], 42);
|
|
}
|
|
|
|
// Check Xrays to the args.
|
|
checkArgs(xrayedArgs);
|
|
|
|
// Make sure the spread operator works.
|
|
checkArgs([...xrayedArgs]);
|
|
}
|