Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Support (try (catch :default)) in CLJS exception handling #39

Closed
wants to merge 1 commit into from

2 participants

@travis

Bump CLJS version to one that supports :default. This should be
backwards compatible with the old version, but the tests don't run
without bumping the dependency.

@travis travis Support (try (catch :default)) in CLJS exception handling
Bump CLJS version to one that supports :default. This should be
backwards compatible with the old version, but the tests don't run
without bumping the dependency.
56b51c9
@swannodette
Collaborator

This is a great patch, but we cannot merge a pull request. Please submit a patch to JIRA thanks!

@travis

yep, noticed that in the contributing guide, sorry about that - patches are attached to all three tickets I filed this week end - lemme know if you need anything else!

@swannodette swannodette closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Dec 7, 2013
  1. @travis

    Support (try (catch :default)) in CLJS exception handling

    travis authored
    Bump CLJS version to one that supports :default. This should be
    backwards compatible with the old version, but the tests don't run
    without bumping the dependency.
This page is out of date. Refresh to see the latest.
View
2  project.clj
@@ -5,7 +5,7 @@
:url "http://www.eclipse.org/legal/epl-v10.html"}
:parent [org.clojure/pom.contrib "0.1.2"]
:dependencies [[org.clojure/clojure "1.5.1"]
- [org.clojure/clojurescript "0.0-1978"]]
+ [org.clojure/clojurescript "0.0-2080"]]
:global-vars {*warn-on-reflection* true}
:source-paths ["src/main/clojure"]
:test-paths ["src/test/clojure"]
View
3  src/main/clojure/cljs/core/async/impl/ioc_helpers.cljs
@@ -102,7 +102,8 @@
(and exception
catch-block
- (instance? catch-exception exception))
+ (or (= :default catch-exception)
+ (instance? catch-exception exception)))
(ioc/aset-all! state
STATE-IDX
catch-block
View
6 src/test/cljs/cljs/core/async/runner_tests.cljs
@@ -162,6 +162,12 @@
(assert false)
(catch js/Error ex 42))))
+ (is= 42
+ (runner
+ (try
+ (assert false)
+ (catch :default ex 42))))
+
(let [a (atom false)
v (runner
(try
Something went wrong with that request. Please try again.