Switched to non-internal javascript Context class in eval1 fn #1

wants to merge 1 commit into


None yet
0 participants

ghost commented Jul 21, 2011

I'm running on Ubuntu 11.04, java -version:

java version "1.6.0_22"
OpenJDK Runtime Environment (IcedTea6 1.10.2) (6b22-1.10.2-0ubuntu1~11.04.1)
OpenJDK Server VM (build 20.0-b11, mixed mode)

When I run script/repljs, I get:

Exception in thread "main" java.lang.RuntimeException: java.lang.ClassNotFoundException: sun.org.mozilla.javascript.internal.Context, compiling:(cljs/compiler.clj:919)
    at clojure.lang.Compiler.analyzeSeq(Compiler.java:6357)

This appears to be due to the use of the 'internal' javascript Context class, which is not included in OpenJDK. This appears to be a Sun JVM implementation class. This commit switches to the non-internal Context class.

Note: the repl now starts up after this change, and I'm able to use the repl, but only after this error:

"Error evaluating:" (defn test-stuff
...(omitting lots of text)...
sun.org.mozilla.javascript.EvaluatorException: Encountered code generation error while compiling function "test_stuff": generated bytecode for method exceeds 64K limit. (cljs/core.cljs#2701)

My guess is this is a different issue, so I decided to just make this one commit and issue the pull request. Advance apologies if that's not the right thing to do.


ghost commented Jul 21, 2011

Sorry, that was premature--I misunderstood what I was seeing in Rhino...I mistakenly thought there was a sun.org.mozilla.javascript.Context class in OpenJDK and Sun's JDK. But I see now that is not the case. Sun only has the classes in the internal package. Not sure why that is yet, but in any case, this pull request isn't correct for both JDKs. Sorry about that.

@ghost ghost closed this Jul 21, 2011

This issue was closed.

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