There is a concept of "strict mode" for running rhino. See, for example,
the shell documentation page:
https://developer.mozilla.org/en/Rhino_Shell
In strict mode, your script produces a warning error
mypc:~/$ java -jar js.jar -strict <--NOTE use of strict flag
Rhino 1.7 release 3 PRERELEASE 2009 01 17
js> a = 10;
js: warning: "<stdin>", line 2: Assignment to undeclared variable a
10
mypc:~/$ java -jar js.jar <- Not strict by default
Rhino 1.7 release 3 PRERELEASE 2009 01 17
js> a = 10;
10
js>
migou wrote:
Rhino 1.7R1
If I execute the following script:
<script>y = 5;</script>
I was expecting to have an exception telling me that y is not declared.
But in my case, it seems that rhino auto declare it.
Any suggestion how to control it ?
Thanks
_______________________________________________
dev-tech-js-engine-rhino mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-tech-js-engine-rhino