blob: 433156d6f52bd2176528ffb91a067c7019612da2 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
|
function run_test() {
let sandbox1 = new Cu.Sandbox(null);
let sandbox2 = new Cu.Sandbox(null);
let arg = Cu.evalInSandbox('({ buf: new ArrayBuffer(2) })', sandbox1);
let clonedArg = Cu.cloneInto(Cu.waiveXrays(arg), sandbox2);
Assert.equal(typeof Cu.waiveXrays(clonedArg).buf, "object");
clonedArg = Cu.cloneInto(arg, sandbox2);
Assert.equal(typeof Cu.waiveXrays(clonedArg).buf, "object");
Assert.equal(Cu.waiveXrays(clonedArg).buf.constructor.name, "ArrayBuffer");
}
|