Mon, 25 Aug 2014 08:46:42 +0530
8055830: JDK-8015969.js is silently failing
Reviewed-by: lagergren, jlaskey, hannesw
test/script/basic/JDK-8015969.js | file | annotate | diff | comparison | revisions |
1.1 --- a/test/script/basic/JDK-8015969.js Fri Aug 22 15:47:28 2014 +0530 1.2 +++ b/test/script/basic/JDK-8015969.js Mon Aug 25 08:46:42 2014 +0530 1.3 @@ -32,43 +32,26 @@ 1.4 var m = new javax.script.ScriptEngineManager(); 1.5 var e = m.getEngineByName("nashorn"); 1.6 1.7 +e.put("fail", fail); 1.8 e.eval(<<EOF 1.9 1.10 'use strict'; 1.11 1.12 try { 1.13 - context = 444; 1.14 - print("FAILED!! context write should have thrown error"); 1.15 -} catch (e) { 1.16 - if (! (e instanceof TypeError)) { 1.17 - print("TypeError expected but got " + e); 1.18 - } 1.19 -} 1.20 - 1.21 -try { 1.22 - engine = "hello"; 1.23 - print("FAILED!! engine write should have thrown error"); 1.24 -} catch (e) { 1.25 - if (! (e instanceof TypeError)) { 1.26 - print("TypeError expected but got " + e); 1.27 - } 1.28 -} 1.29 - 1.30 -try { 1.31 delete context; 1.32 - print("FAILED!! context delete should have thrown error"); 1.33 + fail("FAILED!! context delete should have thrown error"); 1.34 } catch (e) { 1.35 if (! (e instanceof SyntaxError)) { 1.36 - print("SyntaxError expected but got " + e); 1.37 + fail("SyntaxError expected but got " + e); 1.38 } 1.39 } 1.40 1.41 try { 1.42 delete engine; 1.43 - print("FAILED!! engine delete should have thrown error"); 1.44 + fail("FAILED!! engine delete should have thrown error"); 1.45 } catch (e) { 1.46 if (! (e instanceof SyntaxError)) { 1.47 - print("SyntaxError expected but got " + e); 1.48 + fail("SyntaxError expected but got " + e); 1.49 } 1.50 } 1.51