Permalink
Browse files

revert Brandon Bloom's patch for CLJS-401

  • Loading branch information...
1 parent 32a97d4 commit 3acacf73dce7b3961b2ea38f593df5df66eec3ff David Nolen committed Nov 2, 2012
Showing with 8 additions and 13 deletions.
  1. +1 −1 src/clj/cljs/closure.clj
  2. +5 −10 src/clj/cljs/compiler.clj
  3. +1 −1 src/clj/cljs/repl.clj
  4. +1 −1 test/cljs/test_runner.cljs
View
@@ -331,7 +331,7 @@
(with-out-str
(binding [ana/*cljs-ns* 'cljs.user]
(doseq [form forms]
- (comp/emit-top-level (ana/analyze (ana/empty-env) form)))))))
+ (comp/emit (ana/analyze (ana/empty-env) form)))))))
(defn output-directory [opts]
(or (:output-dir opts) "out"))
View
@@ -107,6 +107,9 @@
(print s)))))
nil)
+(defn ^String emit-str [expr]
+ (with-out-str (emit expr)))
+
(defn emitln [& xs]
(apply emits xs)
;; Prints column-aligned line number comments; good test of *position*.
@@ -119,16 +122,8 @@
[(inc line) 0])))
nil)
-(defn emit-top-level [{:keys [op] :as ast}]
- (if (= op :ns)
- (emit ast)
- (do
- (emitln "(function(){")
- (emit ast)
- (emitln "})();"))))
-
(defn ^String emit-str [expr]
- (with-out-str (emit-top-level expr)))
+ (with-out-str (emit expr)))
(defn emit-provide [sym]
(when-not (or (nil? *emitted-provides*) (contains? @*emitted-provides* sym))
@@ -788,7 +783,7 @@
(if (seq forms)
(let [env (ana/empty-env)
ast (ana/analyze env (first forms))]
- (do (emit-top-level ast)
+ (do (emit ast)
(if (= (:op ast) :ns)
(recur (rest forms) (:name ast) (merge (:uses ast) (:requires ast)))
(recur (rest forms) ns-name deps))))
View
@@ -166,7 +166,7 @@
(binding [ana/*cljs-ns* 'cljs.user
*cljs-verbose* verbose
ana/*cljs-warn-on-undeclared* warn-on-undeclared]
- (let [env {:context :return :locals {}}
+ (let [env {:context :expr :locals {}}
special-fns (merge default-special-fns special-fns)
is-special-fn? (set (keys special-fns))]
(-setup repl-env)
@@ -21,7 +21,7 @@
(macro-test/test-macros)
(letfn-test/test-letfn)
(ns-shadow-test/test-shadow)
-(top-level/test)
+;(top-level/test)
(println "Tests completed without exception")

0 comments on commit 3acacf7

Please sign in to comment.