Permalink
Browse files

typeof operator

  • Loading branch information...
1 parent 169e879 commit c499b1bc23a11799ffe119d8a974729c6936c4ad @ujihisa committed Jan 5, 2013
Showing with 6 additions and 0 deletions.
  1. +6 −0 runtime.clj
View
@@ -65,6 +65,12 @@
(run- (:body func) (merge env applied-params)))
(fn? func) (func args)
:else (prn 'must-not-happen 'missing-function func)))
+ typeof (let [x (first cdr)]
+ (if (= clojure.lang.Symbol (type x))
+ (if-let [x (get env x)]
+ (js-type (evaluate x env))
+ 'undefined)
+ (js-type (evaluate x env))))
quote (get env (first cdr) 'missing-local-var)
expr))
expr))

0 comments on commit c499b1b

Please sign in to comment.