Skip to content

Commit

Permalink
Fix typo—:annon → :anon.
Browse files Browse the repository at this point in the history
  • Loading branch information
technomancy committed Oct 9, 2011
1 parent 2116d89 commit 0c424a5
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 15 deletions.
10 changes: 5 additions & 5 deletions src/clj_stacktrace/core.clj
Expand Up @@ -39,7 +39,7 @@
class-name
clojure-fn-subs))

(defn- clojure-annon-fn?
(defn- clojure-anon-fn?
"Returns true if the bytecode class name implies an anonymous inner fn."
[class-name]
(utils/re-match? #"\$.*\$" class-name))
Expand All @@ -56,7 +56,7 @@
:clojure true, to inidcate a Clojure elem.
:ns String representing the namespace of the function.
:fn String representing the name of the enclosing var for the function.
:annon-fn true iff the function is an anonymous inner fn."
:anon-fn true iff the function is an anonymous inner fn."
[elem]
(let [class-name (.getClassName elem)
file (.getFileName elem)
Expand All @@ -65,9 +65,9 @@
(if (clojure-code? class-name file)
(assoc parsed
:clojure true
:ns (clojure-ns class-name)
:fn (clojure-fn class-name)
:annon-fn (clojure-annon-fn? class-name))
:ns (clojure-ns class-name)
:fn (clojure-fn class-name)
:anon-fn (clojure-anon-fn? class-name))
(assoc parsed
:java true
:class class-name
Expand Down
2 changes: 1 addition & 1 deletion src/clj_stacktrace/repl.clj
Expand Up @@ -39,7 +39,7 @@
"(Unknown Source)"))

(defn clojure-method-str [parsed]
(str (:ns parsed) "/" (:fn parsed) (if (:annon-fn parsed) "[fn]")))
(str (:ns parsed) "/" (:fn parsed) (if (:anon-fn parsed) "[fn]")))

(defn java-method-str [parsed]
(str (:class parsed) "." (:method parsed)))
Expand Down
18 changes: 9 additions & 9 deletions test/clj_stacktrace/core_test.clj
Expand Up @@ -6,39 +6,39 @@
(def cases
[["foo.bar$biz__123" "invoke" "bar.clj" 456
{:clojure true :ns "foo.bar" :fn "biz"
:file "bar.clj" :line 456 :annon-fn false}]
:file "bar.clj" :line 456 :anon-fn false}]

["foo.bar$biz_bat__123" "invoke" "bar.clj" 456
{:clojure true :ns "foo.bar" :fn "biz-bat"
:file "bar.clj" :line 456 :annon-fn false}]
:file "bar.clj" :line 456 :anon-fn false}]

["foo.bar$biz_bat_QMARK___448" "invoke" "bar.clj" 456
{:clojure true :ns "foo.bar" :fn "biz-bat?"
:file "bar.clj" :line 456 :annon-fn false}]
:file "bar.clj" :line 456 :anon-fn false}]

["foo.bar$biz_bat_QMARK___448$fn__456" "invoke" "bar.clj" 456
{:clojure true :ns "foo.bar" :fn "biz-bat?"
:file "bar.clj" :line 456 :annon-fn true}]
:file "bar.clj" :line 456 :anon-fn true}]

["foo.bar$repl$fn__5629.invoke" "invoke" "bar.clj" 456
{:clojure true :ns "foo.bar" :fn "repl"
:file "bar.clj" :line 456 :annon-fn true}]
:file "bar.clj" :line 456 :anon-fn true}]

["foo.bar$repl$read_eval_print__5624" "invoke" "bar.clj" 456
{:clojure true :ns "foo.bar" :fn "repl"
:file "bar.clj" :line 456 :annon-fn true}]
:file "bar.clj" :line 456 :anon-fn true}]

["foo.bar$biz__123$fn__456" "invoke" "bar.clj" 789
{:clojure true :ns "foo.bar" :fn "biz"
:file "bar.clj" :line 789 :annon-fn true}]
:file "bar.clj" :line 789 :anon-fn true}]

["foo.bar_bat$biz__123" "invoke" "bar.clj" 456
{:clojure true :ns "foo.bar-bat" :fn "biz"
:file "bar.clj" :line 456 :annon-fn false}]
:file "bar.clj" :line 456 :anon-fn false}]

["user$eval__345" "invoke" nil -1
{:clojure true :ns "user" :fn "eval"
:file nil :line nil :annon-fn false}]
:file nil :line nil :anon-fn false}]

["clojure.lang.Var" "invoke" "Var.java" 123
{:java true :class "clojure.lang.Var" :method "invoke"
Expand Down

0 comments on commit 0c424a5

Please sign in to comment.