Commit ec0ff70
committed
deps: cherry-pick 907d7bc from upstream V8
Original commit message:
[promise] Implement Swallowed Rejection Hook.
This extends the current Promise Rejection Hook with two new events
kPromiseRejectAfterResolved
kPromiseResolveAfterResolved
which are used to detect (and signal) misuse of the Promise constructor.
Specifically the common bug like
new Promise((res, rej) => {
res(1);
throw new Error("something")
});
where the error is silently swallowed by the Promise constructor without
the user ever noticing can be caught via this hook.
Doc: https://goo.gl/2stLUY
Bug: v8:7919
Cq-Include-Trybots: luci.chromium.try:linux_chromium_rel_ng
Change-Id: I890a7e766cdd1be88db94844fb744f72823dba33
Reviewed-on: https://chromium-review.googlesource.com/1126099
Reviewed-by: Maya Lekova <mslekova@chromium.org>
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Commit-Queue: Benedikt Meurer <bmeurer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#54309}
Refs: v8/v8@907d7bc
PR-URL: #21838
Refs: nodejs/promises-debugging#8
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Yang Guo <yangguo@chromium.org>
Reviewed-By: Benedikt Meurer <benedikt.meurer@gmail.com>1 parent c23e8b5 commit ec0ff70Copy full SHA for ec0ff70
File tree
Expand file treeCollapse file tree
9 files changed
+149
-45
lines changedOpen diff view settings
Filter options
- deps/v8
- include
- src
- builtins
- compiler
- runtime
- test/cctest
Expand file treeCollapse file tree
9 files changed
+149
-45
lines changedOpen diff view settings
Collapse file
+1-1Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
28 | 28 | |
29 | 29 | |
30 | 30 | |
31 | | - |
| 31 | + |
32 | 32 | |
33 | 33 | |
34 | 34 | |
|
Collapse file
+3-1Lines changed: 3 additions & 1 deletion
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
6394 | 6394 | |
6395 | 6395 | |
6396 | 6396 | |
6397 | | - |
| 6397 | + |
| 6398 | + |
| 6399 | + |
6398 | 6400 | |
6399 | 6401 | |
6400 | 6402 | |
|
Collapse file
deps/v8/src/builtins/builtins-promise-gen.cc
Copy file name to clipboardExpand all lines: deps/v8/src/builtins/builtins-promise-gen.cc+28-6Lines changed: 28 additions & 6 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
247 | 247 | |
248 | 248 | |
249 | 249 | |
| 250 | + |
| 251 | + |
250 | 252 | |
251 | 253 | |
252 | 254 | |
| ||
733 | 735 | |
734 | 736 | |
735 | 737 | |
| 738 | + |
| 739 | + |
| 740 | + |
| 741 | + |
736 | 742 | |
737 | | - |
738 | | - |
| 743 | + |
739 | 744 | |
740 | 745 | |
741 | | - |
| 746 | + |
| 747 | + |
742 | 748 | |
743 | 749 | |
744 | 750 | |
745 | 751 | |
746 | 752 | |
| 753 | + |
| 754 | + |
| 755 | + |
| 756 | + |
| 757 | + |
| 758 | + |
747 | 759 | |
748 | 760 | |
749 | 761 | |
| ||
755 | 767 | |
756 | 768 | |
757 | 769 | |
| 770 | + |
| 771 | + |
| 772 | + |
| 773 | + |
758 | 774 | |
759 | | - |
760 | | - |
| 775 | + |
761 | 776 | |
762 | 777 | |
763 | | - |
| 778 | + |
| 779 | + |
764 | 780 | |
765 | 781 | |
766 | 782 | |
767 | 783 | |
| 784 | + |
| 785 | + |
| 786 | + |
| 787 | + |
| 788 | + |
| 789 | + |
768 | 790 | |
769 | 791 | |
770 | 792 | |
|
Collapse file
deps/v8/src/builtins/builtins-promise-gen.h
Copy file name to clipboardExpand all lines: deps/v8/src/builtins/builtins-promise-gen.h+4-3Lines changed: 4 additions & 3 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
17 | 17 | |
18 | 18 | |
19 | 19 | |
20 | | - |
21 | | - |
22 | | - |
| 20 | + |
23 | 21 | |
24 | 22 | |
| 23 | + |
| 24 | + |
| 25 | + |
25 | 26 | |
26 | 27 | |
27 | 28 | |
|
Collapse file
deps/v8/src/compiler/js-call-reducer.cc
Copy file name to clipboardExpand all lines: deps/v8/src/compiler/js-call-reducer.cc+4Lines changed: 4 additions & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
5345 | 5345 | |
5346 | 5346 | |
5347 | 5347 | |
| 5348 | + |
| 5349 | + |
| 5350 | + |
| 5351 | + |
5348 | 5352 | |
5349 | 5353 | |
5350 | 5354 | |
|
Collapse file
+1-2Lines changed: 1 addition & 2 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
3875 | 3875 | |
3876 | 3876 | |
3877 | 3877 | |
3878 | | - |
3879 | 3878 | |
3880 | 3879 | |
3881 | | - |
| 3880 | + |
3882 | 3881 | |
3883 | 3882 | |
3884 | 3883 | |
|
Collapse file
deps/v8/src/runtime/runtime-promise.cc
Copy file name to clipboardExpand all lines: deps/v8/src/runtime/runtime-promise.cc+20Lines changed: 20 additions & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
38 | 38 | |
39 | 39 | |
40 | 40 | |
| 41 | + |
| 42 | + |
| 43 | + |
| 44 | + |
| 45 | + |
| 46 | + |
| 47 | + |
| 48 | + |
| 49 | + |
| 50 | + |
| 51 | + |
| 52 | + |
| 53 | + |
| 54 | + |
| 55 | + |
| 56 | + |
| 57 | + |
| 58 | + |
| 59 | + |
| 60 | + |
41 | 61 | |
42 | 62 | |
43 | 63 | |
|
Collapse file
deps/v8/src/runtime/runtime.h
Copy file name to clipboardExpand all lines: deps/v8/src/runtime/runtime.h+3-1Lines changed: 3 additions & 1 deletion
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
433 | 433 | |
434 | 434 | |
435 | 435 | |
436 | | - |
| 436 | + |
| 437 | + |
| 438 | + |
437 | 439 | |
438 | 440 | |
439 | 441 | |
|
Collapse file
deps/v8/test/cctest/test-api.cc
Copy file name to clipboardExpand all lines: deps/v8/test/cctest/test-api.cc+85-31Lines changed: 85 additions & 31 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
17625 | 17625 | |
17626 | 17626 | |
17627 | 17627 | |
| 17628 | + |
| 17629 | + |
17628 | 17630 | |
17629 | 17631 | |
17630 | 17632 | |
| ||
17634 | 17636 | |
17635 | 17637 | |
17636 | 17638 | |
17637 | | - |
| 17639 | + |
17638 | 17640 | |
17639 | | - |
17640 | | - |
17641 | | - |
17642 | | - |
17643 | | - |
17644 | | - |
17645 | | - |
17646 | | - |
17647 | | - |
17648 | | - |
17649 | | - |
17650 | | - |
17651 | | - |
17652 | | - |
17653 | | - |
17654 | | - |
17655 | | - |
17656 | | - |
17657 | | - |
17658 | | - |
17659 | | - |
17660 | | - |
17661 | | - |
17662 | | - |
17663 | | - |
| 17641 | + |
| 17642 | + |
| 17643 | + |
| 17644 | + |
| 17645 | + |
| 17646 | + |
| 17647 | + |
| 17648 | + |
| 17649 | + |
| 17650 | + |
| 17651 | + |
| 17652 | + |
| 17653 | + |
| 17654 | + |
| 17655 | + |
| 17656 | + |
| 17657 | + |
| 17658 | + |
| 17659 | + |
| 17660 | + |
| 17661 | + |
| 17662 | + |
| 17663 | + |
| 17664 | + |
| 17665 | + |
| 17666 | + |
| 17667 | + |
| 17668 | + |
| 17669 | + |
| 17670 | + |
17664 | 17671 | |
| 17672 | + |
| 17673 | + |
| 17674 | + |
| 17675 | + |
| 17676 | + |
| 17677 | + |
| 17678 | + |
| 17679 | + |
| 17680 | + |
| 17681 | + |
| 17682 | + |
| 17683 | + |
| 17684 | + |
| 17685 | + |
| 17686 | + |
| 17687 | + |
17665 | 17688 | |
17666 | | - |
17667 | | - |
17668 | | - |
17669 | | - |
17670 | | - |
17671 | 17689 | |
17672 | 17690 | |
17673 | 17691 | |
| ||
17690 | 17708 | |
17691 | 17709 | |
17692 | 17710 | |
| 17711 | + |
| 17712 | + |
17693 | 17713 | |
17694 | 17714 | |
17695 | 17715 | |
| ||
17915 | 17935 | |
17916 | 17936 | |
17917 | 17937 | |
| 17938 | + |
| 17939 | + |
| 17940 | + |
| 17941 | + |
| 17942 | + |
| 17943 | + |
| 17944 | + |
| 17945 | + |
| 17946 | + |
| 17947 | + |
| 17948 | + |
| 17949 | + |
| 17950 | + |
| 17951 | + |
| 17952 | + |
| 17953 | + |
| 17954 | + |
| 17955 | + |
| 17956 | + |
| 17957 | + |
| 17958 | + |
| 17959 | + |
| 17960 | + |
| 17961 | + |
| 17962 | + |
| 17963 | + |
| 17964 | + |
| 17965 | + |
| 17966 | + |
| 17967 | + |
| 17968 | + |
| 17969 | + |
| 17970 | + |
| 17971 | + |
17918 | 17972 | |
17919 | 17973 | |
17920 | 17974 | |
|
0 commit comments