day8 / re-frame-debux

A fork of debux for tracing re-frame code (for eventual consumption by re-frame-10x)
Eclipse Public License 1.0
43 stars 7 forks source link

Handle tricky cond-> cases #15

Closed danielcompton closed 4 years ago

danielcompton commented 6 years ago

This code isn't traced properly, skips are still left in at the end of the inspection/tracing.

(-> 5
  (cond-> false
    true))
ghost commented 5 years ago

I think we are running into this problem with our code: TypeError: debux.common.macro_specs.skip_outer is undefined. Could you please have another look at this?

/cc @urzae

urzae commented 5 years ago

The code we are using:

(reg-event-db
 ::my-event
 (fn-traced [db _]
   ...
   (-> db
       (assoc :key1 val1)
       (cond->
         (not-empty errors) (assoc :errors errors)))))

Stacktrace:

TypeError: debux.common.macro_specs.skip_outer is undefined      events.cljs:246:1
    result__45551__auto__ events.cljs:246
    result__45551__auto__ events.cljs:246
    result__45551__auto__ events.cljs:246
    <anonymous> events.cljs:246
    new_context std_interceptors.cljc:115
    _db_handler_before std_interceptors.cljc:111
    invoke_interceptor_fn interceptor.cljc:68
    invoke_interceptors interceptor.cljc:106
    execute interceptor.cljc:199
    handle events.cljc:65
    1 router.cljc:179
    _process_1st_event_in_queue router.cljc:84
    1 router.cljc:198
    _run_queue router.cljc:86
    vec__44923 router.cljc:146
    3 router.cljc:169
    _fsm_trigger router.cljc:80
    1 router.cljc:187
    onmessage nexttick.js:211

Line 246 is the line of (fn-traced [db _].

danielcompton commented 5 years ago

Thanks for the reproduction. I don't have any time budget to work on this at the moment, but PRs would be welcomed 😄.

stumitchell commented 4 years ago

This should be fixed now in master will release soon