test/script/nosecurity/JDK-8055034.js
Print this page
rev 1349 : 8080471: fix usage of replace and file separator in Nashorn tests
Summary: Two tests should use replace instead of replaceAll, and there is a typo in the usage of File.separator.
Reviewed-by: attila, hannesw
@@ -46,11 +46,11 @@
var nashornJarDir = nashornJar.parentFile.absolutePath;
// we want to use nashorn.jar passed and not the one that comes with JRE
var jjsCmd = javahome + "/../bin/jjs";
jjsCmd += " -J-Djava.ext.dirs=" + nashornJarDir;
-jjsCmd = jjsCmd.toString().replaceAll(/\//g, File.separater);
+jjsCmd = jjsCmd.toString().replace(/\//g, File.separator);
$ENV.PWD=System.getProperty("user.dir") // to avoid RE on Cygwin
$EXEC(jjsCmd, "var x = Object.create(null);\nx;\nprint('PASSED');\nexit(0)");
// $ERR has all interactions including prompts! Just check for error substring.
var err = $ERR.trim();