mirror of
https://github.com/openjdk/jdk.git
synced 2026-05-11 22:19:43 +00:00
8055830: JDK-8015969.js is silently failing
Reviewed-by: lagergren, jlaskey, hannesw
This commit is contained in:
parent
9700f06b1b
commit
cb277efc44
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user