; http://lxr.mozilla.org/mozilla/source/js/rhino/examples/RunScript.java (defun hello-javascript (string) ; 53 Context cx = Context.enter(); (let ((cx (#"enter" 'javascript.internal.Context))) ; 54 try { ; 55 // Initialize the standard objects (Object, Function, etc.) ; 56 // This must be done before scripts can be executed. Returns ; 57 // a scope object that we use in later calls. (unwind-protect ; 58 Scriptable scope = cx.initStandardObjects(); (let ((scope (#"initStandardObjects" cx))) ; 66 // Now evaluate the string we've colected. ; 67 Object result = cx.evaluateString(scope, s, "", 1, null); ; 68 ; 69 // Convert the result to a string and print it. ; 70 System.err.println(Context.toString(result)); (#"toString" 'javascript.internal.Context (#"evaluateString" cx scope string "" 1 (make-immediate-object nil :ref)))) ; 72 } finally { ; 73 // Exit from the context. ; 74 Context.exit(); ; 75 } (#"exit" 'javascript.internal.Context))))