changeset 47247:42bc5bf0c654

8181792: nashorn samples/exec.js has some incorrect examples Reviewed-by: sundar, hannesw Contributed-by: priya.lakshmi.muthuswamy@oracle.com
author hannesw
date Fri, 22 Sep 2017 12:00:41 +0200
parents 82d45783c133
children 22d665f53a4a
files src/sample/nashorn/exec.js
diffstat 1 files changed, 2 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/src/sample/nashorn/exec.js	Fri Sep 22 11:52:38 2017 +0200
+++ b/src/sample/nashorn/exec.js	Fri Sep 22 12:00:41 2017 +0200
@@ -38,11 +38,8 @@
 // It can also be given a string to use as stdin:
 $EXEC("cat", "Hello, world!")
 
-// Additional arguments can be passed after the stdin argument, as an array of
-// strings, or a sequence of varargs (if there is no stdin, null or undefined
-// can be passed):
-$EXEC("ls", undefined, "-l", "-a")
-$EXEC("ls", undefined, ["-l", "-a"])
+// Arguments can be passed as an array of strings
+$EXEC(["ls","-l","-a"]);
 
 // Output of running external commands is returned from $EXEC:
 print($EXEC("ls"))