2024年Clojure调查!(a>中分享你的想法!

欢迎!有关如何使用该网站的更多信息,请参阅关于页面

0投票
core.async

ClojureScript 1.10.520,在Clojure中无法重现。在core.async 1.3.610和1.1.582中重现,在1.0.567中不重现。

看起来与https://clojure.atlassian.net/browse/ASYNC-198?focusedCommentId=12026相同。

代码

(ns app.main
  (:require [clojure.core.async :as a]))

(a/go
  (try
    (prn :ret
         (try
           (throw (ex-info "expected" {}))

           (catch js/Error e
             (prn :catch1)
             (throw e))

           (finally
             (prn :finally))))

    (catch js/Error _e
      (prn :catch2))))

预期结果

:catch1
:finally
:catch2

实际结果

:catch1
:finally
:ret #error {:message "expected", :data {}}

1 个答案

0投票

一行重现
clojure -Srepro -Sdeps '{:deps {org.clojure/clojurescript {:mvn/version "1.10.520"} org.clojure/core.async {:mvn/version "1.3.610"}}}' -m cljs.main -re node -e "(require '[clojure.core.async :refer [go]]) (go (try (try (throw (ex-info \"err\" {:ex 42})) (catch js/Error e (throw e)) (finally (prn :finally))) (catch js/Error e (prn :catch2))))"

我测试了{clj,cljs} x {with-go,without-go},只有在cljsgo一起时才有效。

感谢您的报告,跟踪此处https://clojure.atlassian.net/browse/ASYNC-232
...