From f078bc299c5db3c9d0c7c02016edf3fe417d201c Mon Sep 17 00:00:00 2001 From: Juan Monetta Date: Thu, 21 Dec 2023 15:58:59 -0300 Subject: [PATCH] Revert "Don't emit unnecessary form-id for expr and returns" This reverts commit 2908954d656698521eb442670d2fcccdd5d6d3bb. --- script/build | 1 + src/main/cljs/cljs/storm/tracer.cljs | 8 ++++---- src/main/clojure/cljs/compiler.cljc | 7 ++++--- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/script/build b/script/build index a1fedc8a7..b2da8cb3a 100755 --- a/script/build +++ b/script/build @@ -27,6 +27,7 @@ CLJS_SCRIPT_MVN_OPTS=${CLJS_SCRIPT_MVN_OPTS:-""} MAJOR="1" MINOR="11" REVISION="60" + PATCH="8" # Extract the version number from the string. # REVISION_REGEX="v[0-9]*\.[0-9]*-([0-9]*)-.*" diff --git a/src/main/cljs/cljs/storm/tracer.cljs b/src/main/cljs/cljs/storm/tracer.cljs index 53351200c..a020f7dad 100644 --- a/src/main/cljs/cljs/storm/tracer.cljs +++ b/src/main/cljs/cljs/storm/tracer.cljs @@ -14,16 +14,16 @@ (when trace-fn-call-fn (trace-fn-call-fn nil fn-ns fn-name fn-args form-id))) -(defn trace-expr [val coord] +(defn trace-expr [val coord form-id] #_(dbg "trace-expr" [val coord form-id]) (when trace-expr-fn - (trace-expr-fn nil val coord 0)) + (trace-expr-fn nil val coord form-id)) val) -(defn trace-fn-return [ret-val coord] +(defn trace-fn-return [ret-val coord form-id] #_(dbg "trace-fn-return" [ret-val coord form-id]) (when trace-fn-return-fn - (trace-fn-return-fn nil ret-val coord 0)) + (trace-fn-return-fn nil ret-val coord form-id)) ret-val) (defn trace-bind [val coord sym-name] diff --git a/src/main/clojure/cljs/compiler.cljc b/src/main/clojure/cljs/compiler.cljc index 7abb17bec..285c3cf88 100644 --- a/src/main/clojure/cljs/compiler.cljc +++ b/src/main/clojure/cljs/compiler.cljc @@ -508,7 +508,8 @@ (and (#{:statement :expr} (:context env#)) (:cljs.storm/coord env#)))) (let [coord# (str/join "," (or (:cljs.storm/coord env#) - (:cljs.storm/wrapping-fn-coord env#)))] + (:cljs.storm/wrapping-fn-coord env#))) + form-id# (:cljs.storm/form-id env#)] (case (:context env#) :return (if (:cljs.storm/skip-fn-trace? env#) @@ -523,7 +524,7 @@ ;; (could be let or loop) trace it like a expression "cljs.storm.tracer.trace_expr( ")) ~@body - (emits ",\"" coord# "\")" ))) + (emits ",\"" coord# "\"," form-id# ")" ))) (:expr :statement) (if (:cljs.storm/skip-expr-instrumentation? env#) (do ~@body) @@ -532,7 +533,7 @@ (do (emits "cljs.storm.tracer.trace_expr( ") ~@body - (emits ",\"" coord# "\")" ))) )) + (emits ",\"" coord# "\"," form-id# ")" ))) )) ;; if instrumentation isn't enable or we don't have a coord ;; just don't instrument anything