(v, stack)
| 73 | */ |
| 74 | // TODO rename this to `state` throughout the codebase |
| 75 | export function source(v, stack) { |
| 76 | /** @type {Value} */ |
| 77 | var signal = { |
| 78 | f: 0, // TODO ideally we could skip this altogether, but it causes type errors |
| 79 | v, |
| 80 | reactions: null, |
| 81 | equals, |
| 82 | rv: 0, |
| 83 | wv: 0 |
| 84 | }; |
| 85 | |
| 86 | if (DEV && tracing_mode_flag) { |
| 87 | signal.created = stack ?? get_error('created at'); |
| 88 | signal.updated = null; |
| 89 | signal.set_during_effect = false; |
| 90 | signal.trace = null; |
| 91 | } |
| 92 | |
| 93 | return signal; |
| 94 | } |
| 95 | |
| 96 | /** |
| 97 | * @template V |
no test coverage detected