diff -r 000000000000 -r 6474c204b198 js/xpconnect/tests/unit/test_bug845201.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/js/xpconnect/tests/unit/test_bug845201.js Wed Dec 31 06:09:35 2014 +0100 @@ -0,0 +1,18 @@ +function sbTest() { + var threw = false; + try { + for (var x in Components) { } + do_check_true(false, "Shouldn't be able to enumerate Components"); + } catch(e) { + do_check_true(true, "Threw appropriately"); + threw = true; + } + do_check_true(threw, "Shouldn't have thrown uncatchable exception"); +} + +function run_test() { + var sb = Components.utils.Sandbox('http://www.example.com', { wantComponents: true }); + sb.do_check_true = do_check_true; + Components.utils.evalInSandbox(sbTest.toSource(), sb); + Components.utils.evalInSandbox('sbTest();', sb); +}