Commit 89b6d9c
committed
Break eager cycle for "deprecate" function
There is a module cycle involving `@ember/debug/index` and `@ember/debug/lib/deprecate`, and it's somewhat intentional since both are sharing mutable state with the other that's intended to allow users to replace the implementations.
The cycle wouldn't be a big deal except for the fact that index **eagerly** consumes the `deprecate` function from `lib/deprecate`, which means that if you get unlucky in the evaluation order it just explodes.
There's no need to eagerly consume it. This PR makes the consumption lazy.
In general `export function` is resilient to cycles in a way that `export let` is not. There are a bunch more places in `@ember/debug` that are using `export let` when they should probably be using `export function` instead, especially because these function are supposed to *always* be present (even in prod they are no-ops, not missing).1 parent 2b7474f commit 89b6d9c
1 file changed
+7
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| |||
75 | 75 | | |
76 | 76 | | |
77 | 77 | | |
78 | | - | |
| 78 | + | |
79 | 79 | | |
80 | 80 | | |
81 | 81 | | |
| |||
86 | 86 | | |
87 | 87 | | |
88 | 88 | | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
89 | 93 | | |
90 | 94 | | |
91 | 95 | | |
| |||
98 | 102 | | |
99 | 103 | | |
100 | 104 | | |
101 | | - | |
| 105 | + | |
102 | 106 | | |
103 | 107 | | |
104 | 108 | | |
| |||
314 | 318 | | |
315 | 319 | | |
316 | 320 | | |
317 | | - | |
318 | | - | |
319 | 321 | | |
320 | 322 | | |
321 | 323 | | |
| |||
353 | 355 | | |
354 | 356 | | |
355 | 357 | | |
356 | | - | |
357 | 358 | | |
358 | 359 | | |
359 | 360 | | |
| |||
0 commit comments