Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Rewrite errors for Cljs:

    Error -> js/Error
    Error. -> js/Error.
  • Loading branch information...
commit da936f891caa32bd83f6b70faac8e4e8b53a4643 1 parent 49a287e
Kevin Lynagh authored
Showing with 9 additions and 1 deletion.
  1. +1 −1  project.clj
  2. +8 −0 src/cljx/rules.clj
2  project.clj
View
@@ -1,4 +1,4 @@
-(defproject com.keminglabs/cljx "0.1.0"
+(defproject com.keminglabs/cljx "0.1.1"
:description "Static Clojure code rewriting"
:url "http://github.com/lynaghk/cljx"
8 src/cljx/rules.clj
View
@@ -22,6 +22,13 @@
)
#(== % x)]))
+(def js-error
+ (let [x (lvar)]
+ [#(conde
+ ((== % 'Error) (== x 'js/Error))
+ ((== % 'Error.) (== x 'js/Error.)))
+ #(== % x)]))
+
(def remove-defmacro
(compile-rule '[(defmacro . ?_) :cljx.core/exclude]))
@@ -31,6 +38,7 @@
(def cljs-rules [cljs-protocols
+ js-error
(remove-marked :clj)
remove-defmacro
remove-comment])
Please sign in to comment.
Something went wrong with that request. Please try again.