Serenity Operating System
at hosted 24 lines 280 B view raw
1try { 2 throw 1; 3} catch (e) { 4 assert(e === 1); 5} 6 7try { 8 throw [99]; 9} catch (e) { 10 assert(typeof e === "object"); 11 assert(e.length === 1); 12} 13 14function foo() { 15 throw "hello"; 16} 17 18try { 19 foo(); 20} catch (e) { 21 assert(e === "hello"); 22} 23 24console.log("PASS");