test_bug845201.js (473B)
1 function sbTest() { 2 var threw = false; 3 try { 4 for (var x in Components) { } 5 ok(false, "Shouldn't be able to enumerate Components"); 6 } catch(e) { 7 ok(true, "Threw appropriately"); 8 threw = true; 9 } 10 ok(threw, "Shouldn't have thrown uncatchable exception"); 11 } 12 13 function run_test() { 14 var sb = Cu.Sandbox('http://www.example.com', { wantComponents: true }); 15 sb.ok = ok; 16 Cu.evalInSandbox(sbTest.toSource(), sb); 17 Cu.evalInSandbox('sbTest();', sb); 18 }