Permalink
Browse files

Revert "Warn on invalid js forms. refs #455"

This reverts commit b2df2c2.
  • Loading branch information...
jonase authored and swannodette committed Feb 4, 2013
1 parent fc306c3 commit e2444f6c981a96eea96c392e646dc4797e78fdda
@@ -9,13 +9,13 @@
(ns twitterbuzz.anneal)
(defn exp [x]
- (.exp js/Math x))
+ (js/Math.exp x))
(defn abs [x]
- (.abs js/Math x))
+ (js/Math.abs x))
(defn random []
- (.random js/Math))
+ (js/Math.random))
(defn standard-prob [e e1 temp]
(if (< e1 e)
@@ -18,7 +18,7 @@
(* x x))
(defn sqrt [x]
- (.sqrt js/Math x))
+ (js/Math.sqrt x))
(defn dist [{x1 :x y1 :y} {x2 :x y2 :y}]
(sqrt (+ (sqr (- x2 x1)) (sqr (- y2 y1)))))
@@ -45,7 +45,7 @@
(+ (* unit-arg (- canvas-size avatar-size)) (/ avatar-size 2)))
(defn log [& args]
- (.log js/console (apply pr-str args)))
+ (js/console.log (apply pr-str args)))
(def avatar-hover
(doto
@@ -151,9 +151,7 @@
([env sym] (resolve-var env sym nil))
([env sym confirm]
(if (= (namespace sym) "js")
- (do (when (some #{\.} (-> sym name str))
- (warning env (str "Invalid js form " sym)))
- {:name sym :ns 'js})
+ {:name sym :ns 'js}
(let [s (str sym)
lb (-> env :locals sym)]
(cond
View
@@ -1800,7 +1800,7 @@ reduces them without incurring seq initialization"
([this coll not-found]
(get coll (.toString this) not-found))))
-(set! (.-apply (.-prototype js/String))
+(set! js/String.prototype.apply
(fn
[s args]
(if (< (count args) 2)
@@ -6026,7 +6026,7 @@ reduces them without incurring seq initialization"
(-count [rng]
(if-not (-seq rng)
0
- (.ceil js/Math (/ (- end start) step))))
+ (js/Math.ceil (/ (- end start) step))))
IIndexed
(-nth [rng n]
@@ -6050,7 +6050,7 @@ reduces them without incurring seq initialization"
"Returns a lazy seq of nums from start (inclusive) to end
(exclusive), by step, where start defaults to 0, step to 1,
and end to infinity."
- ([] (range 0 (.-MAX_VALUE js/Number) 1))
+ ([] (range 0 js/Number.MAX_VALUE 1))
([end] (range 0 end 1))
([start end] (range start end 1))
([start end step] (Range. nil start end step nil)))

0 comments on commit e2444f6

Please sign in to comment.