jdk-24/jdk/test/tools/jjs/args.js
Athijegannathan Sundararajan 4ab55ae7c1 8145750: jjs fails to run simple scripts with security manager turned on
Reviewed-by: hannesw, alanb
2015-12-21 09:40:00 +05:30

22 lines
433 B
JavaScript

/*
* This is the test JavaScript program used in jjs-argsTest.sh
*/
if (typeof(arguments) == 'undefined') {
throw new Error("arguments expected");
}
if (arguments.length != 2) {
throw new Error("2 arguments are expected here");
}
if (arguments[0] != 'hello') {
throw new Error("First arg should be 'hello'");
}
if (arguments[1] != 'world') {
throw new Error("Second arg should be 'world'");
}
print("Passed");