dexapier / android-scripting

Automatically exported from code.google.com/p/android-scripting
0 stars 0 forks source link

A herd of Rhinos #510

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
/* This script should be sent to Rhino only once, and Rhino should interpret it 
only once, but for some reason this entire script is executed 143 times. */

/* On the first run var i is undefined, but it must be defined before it can be 
incremented so this line ensures that it is set to 0 only on the first run: */

if(typeof(i)=="undefined") i=0;

/* Do nothing except increment the global 'i' and print the value:*/

Packages.org.mozilla.javascript.tools.shell.Main.exec(
  ["-e", "print(++i)"]
);

/* This problem also occurs with the option "-f" and a script file. */

/* Frank Westlake */

Original issue reported on code.google.com by frank.we...@gmail.com on 23 Jan 2011 at 11:30

GoogleCodeExporter commented 9 years ago
This error is with SL4AR3x and Rhino 1.7R2x so I should not have placed it here 
-- but here it is!

Frank

Original comment by frank.we...@gmail.com on 25 Jan 2011 at 10:30

GoogleCodeExporter commented 9 years ago
Please delete this issue -- the script is incorrectly applying an option to the 
exec() method.

Frank

Original comment by frank.we...@gmail.com on 1 Feb 2011 at 6:26

GoogleCodeExporter commented 9 years ago
Ok, done.

Original comment by rjmatthews62 on 1 Feb 2011 at 9:40