I'm trying to use Rhino to drive a test harness for JavaScript unit
testing, which I stole from the jQuery test suite.

It's mostly working, but there are two issues that we run into again
and again.

Many of our JavaScript files start with the UTF-8 BOM (EF BB BF) and
Rhino chokes on this.

js: "../WebClient/scripts/cozi/core/EventTypes.js", line 1: illegal
character
js: ∩�[┐EventTypes = {
js: .^
js: "../WebClient/scripts/cozi/core/EventTypes.js", line 1: syntax
error
js: ∩�[┐EventTypes = {
js: .^
js: "../WebClient/scripts/cozi/core/EventTypes.js", line 1: illegal
character
js: ∩�[┐EventTypes = {
js: ..^
js: "../WebClient/scripts/cozi/core/EventTypes.js", line 1:
Compilation produced
 3 syntax errors.

Yes, I can manually fix the files (using ":argdo set nobomb|w" in Vim,
for example), but I'd rather not, since I don't control all the
editors that are being used around here, and I can't find an way to
permanently turn off BOMs in Visual Studio 2005. Is there a way to
tell Rhino to ignore the BOM?

If there are errors in the JavaScript code, the error messages from
Rhino are not particularly helpful. There's no file/line number
information displayed. Is there a way to turn on more error
information?

I'm invoking Rhino with
  "%JAVA_HOME%\bin\java.exe" -jar js.jar test.js
if that helps.

Thanks
_______________________________________________
dev-tech-js-engine-rhino mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-tech-js-engine-rhino

Reply via email to