Commit 386c3ef
committed
Address remaining AI-reviewer concerns on PR #166
- `Console.cpp`: clear any pending N-API exception after the
best-effort stack capture. N-API operations like `Object::Get` can
leave a pending JS exception on `env` independently of throwing a
C++ exception (e.g., a property accessor that throws). Without
clearing, returning to the polyfill's wrapper function would surface
the pending exception and `console.*` would itself throw on the JS
side -- defeating the "side-effect free" contract.
- `Console.h`: document the lifetime of `CallbackT`'s `const
char*` message (valid only for the duration of the callback; copy
to retain). Strengthen the `CaptureCurrentJsStack` doc to
explicitly state capture is best-effort, may return empty even from
a valid JS context, and hosts must check before using.
- `Readme.md`: note that the helper is best-effort and may return
empty.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>1 parent baadc77 commit 386c3ef
3 files changed
Lines changed: 22 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
20 | 27 | | |
21 | 28 | | |
22 | 29 | | |
| |||
29 | 36 | | |
30 | 37 | | |
31 | 38 | | |
32 | | - | |
33 | | - | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
34 | 43 | | |
35 | 44 | | |
36 | 45 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
| 17 | + | |
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
165 | 165 | | |
166 | 166 | | |
167 | 167 | | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
168 | 178 | | |
169 | 179 | | |
170 | 180 | | |
0 commit comments