changeset 26238:829648e12198

8055830: JDK-8015969.js is silently failing Reviewed-by: lagergren, jlaskey, hannesw
author sundar
date Fri, 22 Aug 2014 22:50:38 +0530
parents b6509e37ce64
children f38221b60b31
files nashorn/test/script/basic/JDK-8015969.js
diffstat 1 files changed, 5 insertions(+), 22 deletions(-) [+]
line wrap: on
line diff
--- a/nashorn/test/script/basic/JDK-8015969.js	Fri Aug 22 15:47:28 2014 +0530
+++ b/nashorn/test/script/basic/JDK-8015969.js	Fri Aug 22 22:50:38 2014 +0530
@@ -32,43 +32,26 @@
 var m = new javax.script.ScriptEngineManager();
 var e = m.getEngineByName("nashorn");
 
+e.put("fail", fail);
 e.eval(<<EOF
 
 'use strict';
 
 try {
-    context = 444;
-    print("FAILED!! context write should have thrown error");
-} catch (e) {
-    if (! (e instanceof TypeError)) {
-        print("TypeError expected but got " + e);
-    }
-}
-
-try {
-    engine = "hello";
-    print("FAILED!! engine write should have thrown error");
-} catch (e) {
-    if (! (e instanceof TypeError)) {
-        print("TypeError expected but got " + e);
-    }
-}
-
-try {
     delete context;
-    print("FAILED!! context delete should have thrown error");
+    fail("FAILED!! context delete should have thrown error");
 } catch (e) {
     if (! (e instanceof SyntaxError)) {
-        print("SyntaxError expected but got " + e);
+        fail("SyntaxError expected but got " + e);
     }
 }
 
 try {
     delete engine;
-    print("FAILED!! engine delete should have thrown error");
+    fail("FAILED!! engine delete should have thrown error");
 } catch (e) {
     if (! (e instanceof SyntaxError)) {
-        print("SyntaxError expected but got " + e);
+        fail("SyntaxError expected but got " + e);
     }
 }