eval.ss
#lang scheme/base

(require scheme/contract
         "private/syntax/parse.ss"
         "private/syntax/sexp.ss"
         (prefix-in eval: "private/runtime/eval.ss")
         "private/runtime/namespace.ss")

;; (or input-source syntax) * [js-namespace] -> any
(define (js-eval src [ns (make-js-namespace)])
  (cond
    [(syntax? src) (eval:eval-compiled-javascript src ns)]
    [else (eval:eval-javascript-string src ns)]))

;; sexp * [js-namespace] -> any
(define (js-eval/sexp src [ns (make-js-namespace)])
  (eval:eval-javascript src ns))

(provide/contract [js-eval (((or/c input-source? syntax?)) (namespace?) . ->* . any)]
                  [js-eval/sexp ((sexp?) (namespace?) . ->* . any)])