Skip to content
Browse files

CLJS-676: source maps broken under incremental compilation

Use :cljs.compiler/compiled-cljs key in cljs.closure/optimize for
generating the source map. Use the destination path as the key as we do
for :cljs.closure/compiled-cljs.
  • Loading branch information...
1 parent d929ae9 commit 44c932a1b852818e0b364d0639083c394101f48f @swannodette swannodette committed Nov 18, 2013
Showing with 9 additions and 9 deletions.
  1. +1 −1 src/clj/cljs/closure.clj
  2. +8 −8 src/clj/cljs/compiler.clj
2 src/clj/cljs/closure.clj
@@ -748,7 +748,7 @@
(if-let [url (:url source)]
(let [path (.getPath ^URL url)]
- (if-let [compiled (get-in @env/*compiler* [::compiled-cljs path])]
+ (if-let [compiled (get-in @env/*compiler* [::comp/compiled-cljs path])]
(if-let [source-url (:source-url source)]
(assoc merged (.getPath ^URL source-url)
16 src/clj/cljs/compiler.clj
@@ -909,7 +909,7 @@
(sm/encode {(url-path src) (:source-map sm-data)}
{:lines (+ (:gen-line sm-data) 2)
:file (url-path dest)}))))
- (swap! env/*compiler* update-in [::compiled-cljs] assoc (.getAbsolutePath ^File src) ret)
+ (swap! env/*compiler* update-in [::compiled-cljs] assoc (.getAbsolutePath ^File dest) ret)
(defn compiled-by-version [^File f]
@@ -925,14 +925,14 @@
(or (not (.exists dest))
(> (.lastModified src) (.lastModified dest))
- (let [version' (compiled-by-version dest)
- version (clojurescript-version)]
- (and version (not= version version')))
- (and opts
+ (let [version' (compiled-by-version dest)
+ version (clojurescript-version)]
+ (and version (not= version version')))
+ (and opts
(:source-map opts)
- (if (= (:optimizations opts) :none)
- (not (.exists (io/file (str (.getPath dest) ".map"))))
- (not (get-in @env/*compiler* [::compiled-cljs (.getAbsolutePath src)]))))))))
+ (if (= (:optimizations opts) :none)
+ (not (.exists (io/file (str (.getPath dest) ".map"))))
+ (not (get-in @env/*compiler* [::compiled-cljs (.getAbsolutePath dest)]))))))))
(defn parse-ns
([src] (parse-ns src nil nil))

0 comments on commit 44c932a

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