From 7fd70d3c5e1e372998d79f98dc8377d1d58a0ed9 Mon Sep 17 00:00:00 2001
From: Jonas Enlund <jonas.enlund@gmail.com>
Date: Mon, 4 Feb 2013 06:22:04 +0200
Subject: [PATCH] Revert "Warn on invalid js forms. refs #455"

This reverts commit b2df2c2a69a4f1c9be8d698b74122c98b1e22491.
---
 samples/twitterbuzz/src/twitterbuzz/anneal.cljs    |    6 +++---
 samples/twitterbuzz/src/twitterbuzz/layout.cljs    |    2 +-
 samples/twitterbuzz/src/twitterbuzz/showgraph.cljs |    2 +-
 src/clj/cljs/analyzer.clj                          |    4 +---
 src/cljs/cljs/core.cljs                            |    6 +++---
 5 files changed, 9 insertions(+), 11 deletions(-)

diff --git a/samples/twitterbuzz/src/twitterbuzz/anneal.cljs b/samples/twitterbuzz/src/twitterbuzz/anneal.cljs
index f879973..b1d3a31 100644
--- a/samples/twitterbuzz/src/twitterbuzz/anneal.cljs
+++ b/samples/twitterbuzz/src/twitterbuzz/anneal.cljs
@@ -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)
diff --git a/samples/twitterbuzz/src/twitterbuzz/layout.cljs b/samples/twitterbuzz/src/twitterbuzz/layout.cljs
index 199ccc3..3e8f4d2 100644
--- a/samples/twitterbuzz/src/twitterbuzz/layout.cljs
+++ b/samples/twitterbuzz/src/twitterbuzz/layout.cljs
@@ -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)))))
diff --git a/samples/twitterbuzz/src/twitterbuzz/showgraph.cljs b/samples/twitterbuzz/src/twitterbuzz/showgraph.cljs
index 880ba05..9a03d2b 100644
--- a/samples/twitterbuzz/src/twitterbuzz/showgraph.cljs
+++ b/samples/twitterbuzz/src/twitterbuzz/showgraph.cljs
@@ -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
diff --git a/src/clj/cljs/analyzer.clj b/src/clj/cljs/analyzer.clj
index ed50de9..f379d8d 100644
--- a/src/clj/cljs/analyzer.clj
+++ b/src/clj/cljs/analyzer.clj
@@ -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
diff --git a/src/cljs/cljs/core.cljs b/src/cljs/cljs/core.cljs
index d6422d3..01d3fba 100644
--- a/src/cljs/cljs/core.cljs
+++ b/src/cljs/cljs/core.cljs
@@ -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)))
-- 
1.7.4.1

