michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: /* See https://bugzilla.mozilla.org/show_bug.cgi?id=769273 */ michael@0: michael@0: function run_test() michael@0: { michael@0: var sb = Components.utils.Sandbox("http://www.blah.com"); michael@0: sb.prop = "prop" michael@0: var refToObjFromSb = Components.utils.evalInSandbox("var a = {prop2:'prop2'}; a", sb); michael@0: Components.utils.nukeSandbox(sb); michael@0: do_check_true(Components.utils.isDeadWrapper(sb), "sb should be dead"); michael@0: try{ michael@0: sb.prop; michael@0: do_check_true(false); michael@0: } catch (e) { michael@0: do_check_true(e.toString().indexOf("can't access dead object") > -1); michael@0: } michael@0: michael@0: Components.utils.isDeadWrapper(refToObjFromSb, "ref to object from sb should be dead"); michael@0: try{ michael@0: refToObjFromSb.prop2; michael@0: do_check_true(false); michael@0: } catch (e) { michael@0: do_check_true(e.toString().indexOf("can't access dead object") > -1); michael@0: } michael@0: michael@0: }