1 /* This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this
3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
5 /* See https://bugzilla.mozilla.org/show_bug.cgi?id=1354733 */
11 var sb = Cu.Sandbox(global);
12 let obj = new sb.Object();
15 ok(Cu.isDeadWrapper(obj), "object should be a dead wrapper");
17 // Create a new sandbox to wrap objects for.
19 var sb = Cu.Sandbox(global);
20 Cu.evalInSandbox(function echo(val) { return val; },
23 let echoed = sb.echo(obj);
24 ok(Cu.isDeadWrapper(echoed), "Rewrapped object should be a dead wrapper");
25 ok(echoed !== obj, "Rewrapped object should be a new dead wrapper");
27 ok(obj === obj, "Dead wrapper object should be equal to itself");
30 ok(liveObj === sb.echo(liveObj), "Rewrapped live object should be equal to itself");