Commit 9dd4d41
committed
CLJS-2641: cljs.spec.alpha/fdef with s/* is broken
The problem was while `instrument` redefs the var, the original fn
internals still self references through the namespace, thus
triggering an infinite loop by calling into the instrumented version
again.
This change relies on the fact that `apply` will always bind the
original fn via `Function.prototype.call` when invoking. In the dispatch
helpers we now check if `this` is bound to a Function - if so we invoke
methods on that value instead as it will be the *original* fn.1 parent 728acc4 commit 9dd4d41
2 files changed
Lines changed: 22 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3016 | 3016 | | |
3017 | 3017 | | |
3018 | 3018 | | |
3019 | | - | |
| 3019 | + | |
| 3020 | + | |
| 3021 | + | |
| 3022 | + | |
3020 | 3023 | | |
3021 | 3024 | | |
3022 | | - | |
| 3025 | + | |
| 3026 | + | |
| 3027 | + | |
| 3028 | + | |
3023 | 3029 | | |
3024 | 3030 | | |
3025 | 3031 | | |
| |||
3058 | 3064 | | |
3059 | 3065 | | |
3060 | 3066 | | |
3061 | | - | |
3062 | | - | |
| 3067 | + | |
| 3068 | + | |
| 3069 | + | |
| 3070 | + | |
3063 | 3071 | | |
3064 | 3072 | | |
3065 | 3073 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
72 | 72 | | |
73 | 73 | | |
74 | 74 | | |
75 | | - | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
0 commit comments