Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

a very weird problem from Rhino js shell

1 view
Skip to first unread message

Peng Li

unread,
Oct 25, 2009, 4:14:53 AM10/25/09
to dev-tech-js-...@lists.mozilla.org
HI

When I use Rhino JS shell to execute the following code,

Main m = new Main(); // rhino js shell main function
String argsServer[] = {"interpreterRun.js",
"addTags_coordinatorScript.js"};
m.main(argsServer); *// 1*
System.out.println("----------------------------------");
Main m2 = new Main();
String argsServer2[] = {"interpreterRun.js",
"addTags_coordinatorScript.js"};
m.main(argsServer); *// 2*

the execution result for 1 is totally correct
s_checkTagsWF
s_checkIsExistingWF
s_storeTagsDBWF
----------------------------------

the execution result for 2 is wrong because everything has been executed
twice!
s_checkTagsWF
s_checkIsExistingWF
s_storeTagsDBWF
s_checkTagsWF
s_checkIsExistingWF
s_storeTagsDBWF

if I call m.main(argsServer) 3 times, the execution result is as following
s_checkTagsWF
s_checkIsExistingWF
s_storeTagsDBWF
s_checkTagsWF
s_checkIsExistingWF
s_storeTagsDBWF
s_checkTagsWF
s_checkIsExistingWF
s_storeTagsDBWF

Can anyone give me some clues about why this happens? Are there any contexts
which I should clean before I call the js shell main function again?

Cheers
Peng

0 new messages