Commit 10c006a
committed
fix: single report under "throw" policy, pre-dispatch stackTrace (iOS parity)
Parity round with NativeScript/ios#409's claim-slot commit, closing the
review's cross-platform divergences:
- Single report per failure under uncaughtErrorPolicy: "throw": the full
report (cancelable event -> hook -> log) now runs at the decision
point BEFORE the native throw, for both the sync boundary and the
rejection drain, and the thrown com.tns.NativeScriptException is
marked reportedToJs (isolate-private brand carried to a Java field by
ReThrowToJava; set directly for the rejection looper throw) so
NativeScriptUncaughtExceptionHandler skips the post-mortem
re-report. Previously a "throw"-policy rejection fired
unhandledrejection AND a second post-mortem error event. The public
NativeScriptException.isReportedToJs() lets custom
Thread.UncaughtExceptionHandler implementations honor the same
contract.
- preventDefault() now beats the "throw" policy at the sync boundary
too: the event dispatches before the propagation decision, so a
prevented error is fully contained with the app alive (iOS behavior).
The deprecated discard flag disables the throw, matching iOS.
- error.stackTrace / reason.stackTrace (the combined legacy stack, a
NativeScript extension) are populated BEFORE the error /
unhandledrejection events dispatch - including the worker branch of
the rejection drain - so listeners see the same shape the hooks do;
pinned by new spec assertions mirroring the iOS ones.
- Docs: unified "throw" sequencing and the cross-platform catchability
note (Android sync at the method boundary; iOS sync only at
own-frame-reporting boundaries, deferred for block/method callbacks
and loop-originated errors; escapeException is the portable per-call
interception tool), plus the Android-only native-crash event
asymmetry and the interop feature-detection note.
Full suite green on an API 35 arm64 emulator: 604 specs, 0 failures.1 parent 029b155 commit 10c006a
7 files changed
Lines changed: 151 additions & 29 deletions
File tree
- docs
- test-app
- app/src/main
- assets/app/tests
- java/com/tns
- runtime/src/main
- cpp
- java/com/tns
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
120 | 120 | | |
121 | 121 | | |
122 | 122 | | |
| 123 | + | |
123 | 124 | | |
124 | 125 | | |
125 | 126 | | |
| |||
174 | 175 | | |
175 | 176 | | |
176 | 177 | | |
177 | | - | |
| 178 | + | |
178 | 179 | | |
179 | 180 | | |
180 | 181 | | |
| |||
189 | 190 | | |
190 | 191 | | |
191 | 192 | | |
192 | | - | |
193 | | - | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
194 | 196 | | |
195 | 197 | | |
196 | 198 | | |
| |||
220 | 222 | | |
221 | 223 | | |
222 | 224 | | |
223 | | - | |
| 225 | + | |
| 226 | + | |
224 | 227 | | |
| 228 | + | |
225 | 229 | | |
226 | 230 | | |
Lines changed: 4 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
73 | 73 | | |
74 | 74 | | |
75 | 75 | | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
76 | 80 | | |
77 | 81 | | |
78 | 82 | | |
| |||
Lines changed: 4 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
132 | 132 | | |
133 | 133 | | |
134 | 134 | | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
135 | 139 | | |
136 | 140 | | |
137 | 141 | | |
| |||
Lines changed: 6 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
27 | | - | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
28 | 33 | | |
29 | 34 | | |
30 | 35 | | |
| |||
Lines changed: 108 additions & 24 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
21 | 25 | | |
22 | 26 | | |
23 | 27 | | |
| |||
157 | 161 | | |
158 | 162 | | |
159 | 163 | | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
160 | 174 | | |
161 | 175 | | |
162 | 176 | | |
| |||
324 | 338 | | |
325 | 339 | | |
326 | 340 | | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
327 | 351 | | |
328 | 352 | | |
329 | 353 | | |
330 | 354 | | |
331 | 355 | | |
332 | | - | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
333 | 367 | | |
334 | | - | |
335 | | - | |
336 | 368 | | |
337 | 369 | | |
338 | 370 | | |
339 | | - | |
340 | 371 | | |
341 | | - | |
342 | | - | |
343 | | - | |
344 | | - | |
345 | | - | |
346 | | - | |
347 | | - | |
348 | 372 | | |
349 | 373 | | |
350 | 374 | | |
| |||
389 | 413 | | |
390 | 414 | | |
391 | 415 | | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
392 | 448 | | |
393 | 449 | | |
394 | 450 | | |
| |||
409 | 465 | | |
410 | 466 | | |
411 | 467 | | |
412 | | - | |
| 468 | + | |
413 | 469 | | |
414 | 470 | | |
415 | 471 | | |
| |||
421 | 477 | | |
422 | 478 | | |
423 | 479 | | |
424 | | - | |
425 | | - | |
426 | | - | |
427 | | - | |
428 | | - | |
429 | | - | |
430 | | - | |
431 | | - | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
432 | 484 | | |
433 | 485 | | |
434 | 486 | | |
| |||
440 | 492 | | |
441 | 493 | | |
442 | 494 | | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
443 | 506 | | |
444 | 507 | | |
445 | 508 | | |
446 | | - | |
447 | | - | |
448 | | - | |
449 | | - | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
450 | 512 | | |
| 513 | + | |
| 514 | + | |
451 | 515 | | |
452 | 516 | | |
453 | 517 | | |
454 | 518 | | |
455 | 519 | | |
456 | 520 | | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
457 | 531 | | |
458 | 532 | | |
459 | 533 | | |
| |||
637 | 711 | | |
638 | 712 | | |
639 | 713 | | |
| 714 | + | |
| 715 | + | |
| 716 | + | |
| 717 | + | |
| 718 | + | |
| 719 | + | |
| 720 | + | |
| 721 | + | |
| 722 | + | |
| 723 | + | |
640 | 724 | | |
641 | 725 | | |
642 | 726 | | |
| |||
Lines changed: 17 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
15 | 24 | | |
16 | 25 | | |
17 | 26 | | |
18 | 27 | | |
19 | 28 | | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
20 | 37 | | |
21 | 38 | | |
22 | 39 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1375 | 1375 | | |
1376 | 1376 | | |
1377 | 1377 | | |
| 1378 | + | |
| 1379 | + | |
| 1380 | + | |
| 1381 | + | |
1378 | 1382 | | |
1379 | 1383 | | |
1380 | 1384 | | |
| |||
0 commit comments