diff --git a/src/clj/clj_rhino.clj b/src/clj/clj_rhino.clj index ef07f35..e23e076 100644 --- a/src/clj/clj_rhino.clj +++ b/src/clj/clj_rhino.clj @@ -146,6 +146,14 @@ (.evaluateString ctx scope code filename line-number sec-domain) (finally (Context/exit))))) +(defn call-timeout-raw [scope fun timeout-ms & args] + (let [factory (TimedContextFactory. timeout-ms) + ctx (.enterContext factory) + args (into-array Object args)] + (try + (.call fun ctx scope nil args) + (finally (Context/exit))))) + (defn call-timeout [scope fun timeout-ms & args] (let [factory (TimedContextFactory. timeout-ms) ctx (.enterContext factory)