8055830: JDK-8015969.js is silently failing
Reviewed-by: lagergren, jlaskey, hannesw
--- 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);
}
}