blob: a638b1ddb31c6352d9c01f4a516def0d47fee60b [file] [log] [blame]
This test verifies the result returned by the eval function when exceptions are thrown and caught whithin the contents of the evaluated string.
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
PASS eval("1;") is 1
PASS eval("1; try { foo = [2,3,throwFunc(), 4]; } catch (e){}") is 1
PASS eval("1; try { 2; throw \"\"; } catch (e){}") is 2
PASS eval("1; try { 2; throwFunc(); } catch (e){}") is 2
PASS eval("1; try { 2; throwFunc(); } catch (e){3;} finally {}") is 3
PASS eval("1; try { 2; throwFunc(); } catch (e){3;} finally {4;}") is 4
PASS eval("function blah() { 1; }\n blah();") is undefined
PASS eval("var x = 1;") is undefined
PASS eval("if (true) { 1; } else { 2; }") is 1
PASS eval("if (false) { 1; } else { 2; }") is 2
PASS eval("try{1; if (true) { 2; throw \"\"; } else { 2; }} catch(e){}") is 2
PASS eval("1; var i = 0; do { ++i; 2; } while(i!=1);") is 2
PASS eval("try{1; var i = 0; do { ++i; 2; throw \"\"; } while(i!=1);} catch(e){}") is 2
PASS eval("1; try{2; throwOnReturn();} catch(e){}") is 2
PASS eval("1; twoFunc();") is undefined
PASS eval("1; with ( { a: 0 } ) { 2; }") is 2
PASS successfullyParsed is true
TEST COMPLETE