cljs.repl.rhino/rhino-eval

functionremoved v1.10.738added v0.0-927Edit
(rhino-eval {:keys [scope], :as repl-env} filename line js)

Source code @ clojurescript:src/main/clojure/cljs/repl/rhino.clj
(defn rhino-eval
  [{:keys [scope] :as repl-env} filename line js]
  (try
    (let [linenum (or line Integer/MIN_VALUE)]
      {:status :success
       :value (eval-result (-eval js repl-env filename linenum))})
    (catch Throwable ex
      ;; manually set *e
      (let [top-level (-> scope
                        (ScriptableObject/getProperty "cljs")
                        (ScriptableObject/getProperty "core"))]
        (ScriptableObject/putProperty top-level "_STAR_e"
          (Context/javaToJS ex scope))
        {:status :exception
         :value  (cljs.repl/ex-str (cljs.repl/ex-triage (Throwable->map ex)))}))))