Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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

This reverts commit b2df2c2.
  • Loading branch information...
commit e2444f6c981a96eea96c392e646dc4797e78fdda 1 parent fc306c3
Jonas Enlund authored February 04, 2013 swannodette committed February 04, 2013
6  samples/twitterbuzz/src/twitterbuzz/anneal.cljs
@@ -9,13 +9,13 @@
9 9
 (ns twitterbuzz.anneal)
10 10
 
11 11
 (defn exp [x]
12  
-  (.exp js/Math x))
  12
+  (js/Math.exp x))
13 13
 
14 14
 (defn abs [x]
15  
-  (.abs js/Math x))
  15
+  (js/Math.abs x))
16 16
 
17 17
 (defn random []
18  
-  (.random js/Math))
  18
+  (js/Math.random))
19 19
 
20 20
 (defn standard-prob [e e1 temp]
21 21
   (if (< e1 e)
2  samples/twitterbuzz/src/twitterbuzz/layout.cljs
@@ -18,7 +18,7 @@
18 18
   (* x x))
19 19
 
20 20
 (defn sqrt [x]
21  
-  (.sqrt js/Math x))
  21
+  (js/Math.sqrt x))
22 22
 
23 23
 (defn dist [{x1 :x y1 :y} {x2 :x y2 :y}]
24 24
   (sqrt (+ (sqr (- x2 x1)) (sqr (- y2 y1)))))
2  samples/twitterbuzz/src/twitterbuzz/showgraph.cljs
@@ -45,7 +45,7 @@
45 45
   (+ (* unit-arg (- canvas-size avatar-size)) (/ avatar-size 2)))
46 46
 
47 47
 (defn log [& args]
48  
-  (.log js/console (apply pr-str args)))
  48
+  (js/console.log (apply pr-str args)))
49 49
 
50 50
 (def avatar-hover
51 51
   (doto
4  src/clj/cljs/analyzer.clj
@@ -151,9 +151,7 @@
151 151
   ([env sym] (resolve-var env sym nil))
152 152
   ([env sym confirm]
153 153
      (if (= (namespace sym) "js")
154  
-       (do (when (some #{\.} (-> sym name str))
155  
-             (warning env (str "Invalid js form " sym)))
156  
-           {:name sym :ns 'js})
  154
+       {:name sym :ns 'js}
157 155
        (let [s (str sym)
158 156
              lb (-> env :locals sym)]
159 157
          (cond
6  src/cljs/cljs/core.cljs
@@ -1800,7 +1800,7 @@ reduces them without incurring seq initialization"
1800 1800
     ([this coll not-found]
1801 1801
        (get coll (.toString this) not-found))))
1802 1802
 
1803  
-(set! (.-apply (.-prototype js/String))
  1803
+(set! js/String.prototype.apply
1804 1804
       (fn
1805 1805
         [s args]
1806 1806
         (if (< (count args) 2)
@@ -6026,7 +6026,7 @@ reduces them without incurring seq initialization"
6026 6026
   (-count [rng]
6027 6027
     (if-not (-seq rng)
6028 6028
       0
6029  
-      (.ceil js/Math (/ (- end start) step))))
  6029
+      (js/Math.ceil (/ (- end start) step))))
6030 6030
 
6031 6031
   IIndexed
6032 6032
   (-nth [rng n]
@@ -6050,7 +6050,7 @@ reduces them without incurring seq initialization"
6050 6050
   "Returns a lazy seq of nums from start (inclusive) to end
6051 6051
    (exclusive), by step, where start defaults to 0, step to 1,
6052 6052
    and end to infinity."
6053  
-  ([] (range 0 (.-MAX_VALUE js/Number) 1))
  6053
+  ([] (range 0 js/Number.MAX_VALUE 1))
6054 6054
   ([end] (range 0 end 1))
6055 6055
   ([start end] (range start end 1))
6056 6056
   ([start end step] (Range. nil start end step nil)))

0 notes on commit e2444f6

Please sign in to comment.
Something went wrong with that request. Please try again.