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=1298597 */
9 var sb = Cu.Sandbox("http://www.blah.com");
11 var p1 = new sb.Promise((res, rej) => {resolveFun = res});
13 var p2 = new sb.Promise((res, rej) => {rejectFun = rej});
15 Assert.ok(Cu.isDeadWrapper(sb), "sb should be dead");
16 Assert.ok(Cu.isDeadWrapper(p1), "p1 should be dead");
17 Assert.ok(Cu.isDeadWrapper(p2), "p2 should be dead");
27 Assert.ok(exception.toString().includes("can't access dead object"),
28 "Resolving dead wrapped promise should throw");
30 exception = undefined;
37 Assert.ok(exception.toString().includes("can't access dead object"),
38 "Rejecting dead wrapped promise should throw");