< prev index next >

test/nashorn/script/nosecurity/JDK-8193137.js

Print this page




  37 var nashornJar = new File(System.getProperty("nashorn.jar"));
  38 if (! nashornJar.isAbsolute()) {
  39     nashornJar = new File(".", nashornJar);
  40 }
  41 
  42 // we want to use nashorn.jar passed and not the one that comes with JRE
  43 var jjsCmd = javahome + "/../bin/jjs";
  44 jjsCmd = jjsCmd.toString().replace(/\//g, File.separator);
  45 if (! new File(jjsCmd).isFile()) {
  46     jjsCmd = javahome + "/bin/jjs";
  47     jjsCmd = jjsCmd.toString().replace(/\//g, File.separator);
  48 }
  49 jjsCmd += " -J--patch-module=jdk.scripting.nashorn=" + nashornJar;
  50 
  51 $ENV.PWD=System.getProperty("user.dir")
  52 
  53 var emptyFile = new File($ENV.PWD+File.separator+"empty.js");
  54 emptyFile.createNewFile();
  55 emptyFile.deleteOnExit();
  56 
  57 $EXEC(jjsCmd + " empty.js");
  58 if($ERR != "")
  59     fail("jjs fails with empty script file");


  37 var nashornJar = new File(System.getProperty("nashorn.jar"));
  38 if (! nashornJar.isAbsolute()) {
  39     nashornJar = new File(".", nashornJar);
  40 }
  41 
  42 // we want to use nashorn.jar passed and not the one that comes with JRE
  43 var jjsCmd = javahome + "/../bin/jjs";
  44 jjsCmd = jjsCmd.toString().replace(/\//g, File.separator);
  45 if (! new File(jjsCmd).isFile()) {
  46     jjsCmd = javahome + "/bin/jjs";
  47     jjsCmd = jjsCmd.toString().replace(/\//g, File.separator);
  48 }
  49 jjsCmd += " -J--patch-module=jdk.scripting.nashorn=" + nashornJar;
  50 
  51 $ENV.PWD=System.getProperty("user.dir")
  52 
  53 var emptyFile = new File($ENV.PWD+File.separator+"empty.js");
  54 emptyFile.createNewFile();
  55 emptyFile.deleteOnExit();
  56 
  57 $EXEC(jjsCmd + " --no-deprecation-warning empty.js");
  58 if($ERR != "")
  59     fail("jjs fails with empty script file");
< prev index next >