Rhino throws uncaught JavaScript runtime exception: ReferenceError: "window" is not defined #20

Closed
madr opened this Issue Mar 7, 2012 · 2 comments

Projects

None yet

2 participants

@madr

I cloned the repo and tried to run Yslow in Rhino with the following:

make
cd build/rhino
java -jar rhino.jar yslow.js http://example.com/

and got this:

js: uncaught JavaScript runtime exception: ReferenceError: "window" is not defined.

In several Google groups some extra parameters were suggested, for example -opt -1 which I tried too.

java -jar rhino.jar yslow.js -opt -1 http://example.com/

Same thing.

Is this a bug or am I doing it wrong? My skills in env.js is too brief for me to find it out myself.
If it works, please describe the correct use with Rhino here and update the README with Rhino instructions.

@marcelduran
Owner

Rhino is still experimental, thus is not list in the official flavors on README. Moreover it's supposed to work with .har files and not directly fetching URLs.

rhino yslow.js foobar.har

Where rhino is an alias for java org.mozilla.javascript.tools.shell.Main -opt -1

I've just created an issue #21 to finish Rhino support.

@marcelduran marcelduran closed this Mar 7, 2012
@madr

Thanks for the reply. Will read more about .har files, then.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment