Commit 303a9a3
worker: make MessagePort constructor non-callable
Refactor the C++ code for creating `MessagePort`s to skip calling the
constructor and instead directly instantiating the `InstanceTemplate`,
and always throw an error from the `MessagePort` constructor.
This aligns behaviour with the web, and creating single `MessagePort`s
does not make sense anyway.
PR-URL: #28032
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>1 parent c67642a commit 303a9a3Copy full SHA for 303a9a3
File tree
Expand file treeCollapse file tree
6 files changed
+52
-30
lines changedOpen diff view settings
Filter options
- doc/api
- src
- test/parallel
Expand file treeCollapse file tree
6 files changed
+52
-30
lines changedOpen diff view settings
Collapse file
+8Lines changed: 8 additions & 0 deletions
- Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
703 | 703 | |
704 | 704 | |
705 | 705 | |
| 706 | + |
| 707 | + |
| 708 | + |
| 709 | + |
| 710 | + |
| 711 | + |
| 712 | + |
| 713 | + |
706 | 714 | |
707 | 715 | |
708 | 716 | |
|
Collapse file
+3-1Lines changed: 3 additions & 1 deletion
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
54 | 54 | |
55 | 55 | |
56 | 56 | |
57 | | - |
| 57 | + |
| 58 | + |
58 | 59 | |
59 | 60 | |
60 | 61 | |
| ||
99 | 100 | |
100 | 101 | |
101 | 102 | |
| 103 | + |
102 | 104 | |
103 | 105 | |
104 | 106 | |
|
Collapse file
+12-20Lines changed: 12 additions & 20 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
529 | 529 | |
530 | 530 | |
531 | 531 | |
| 532 | + |
| 533 | + |
| 534 | + |
532 | 535 | |
533 | | - |
534 | | - |
535 | | - |
536 | | - |
537 | | - |
538 | | - |
539 | | - |
540 | | - |
541 | | - |
| 536 | + |
542 | 537 | |
543 | 538 | |
544 | 539 | |
545 | 540 | |
546 | 541 | |
547 | 542 | |
548 | 543 | |
549 | | - |
550 | | - |
551 | | - |
| 544 | + |
552 | 545 | |
553 | 546 | |
554 | 547 | |
555 | 548 | |
556 | | - |
| 549 | + |
557 | 550 | |
558 | | - |
| 551 | + |
559 | 552 | |
560 | 553 | |
561 | 554 | |
| ||
830 | 823 | |
831 | 824 | |
832 | 825 | |
833 | | - |
834 | | - |
| 826 | + |
835 | 827 | |
836 | 828 | |
837 | 829 | |
838 | 830 | |
839 | | - |
| 831 | + |
840 | 832 | |
841 | 833 | |
842 | 834 | |
| ||
859 | 851 | |
860 | 852 | |
861 | 853 | |
862 | | - |
| 854 | + |
863 | 855 | |
864 | 856 | |
865 | 857 | |
| ||
902 | 894 | |
903 | 895 | |
904 | 896 | |
905 | | - |
906 | | - |
| 897 | + |
| 898 | + |
907 | 899 | |
908 | 900 | |
909 | 901 | |
|
Collapse file
+2-2Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
211 | 211 | |
212 | 212 | |
213 | 213 | |
214 | | - |
215 | | - |
| 214 | + |
| 215 | + |
216 | 216 | |
217 | 217 | |
218 | 218 | |
|
Collapse file
test/parallel/test-worker-message-port-constructor.js
Copy file name to clipboard+27Lines changed: 27 additions & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
| 1 | + |
| 2 | + |
| 3 | + |
| 4 | + |
| 5 | + |
| 6 | + |
| 7 | + |
| 8 | + |
| 9 | + |
| 10 | + |
| 11 | + |
| 12 | + |
| 13 | + |
| 14 | + |
| 15 | + |
| 16 | + |
| 17 | + |
| 18 | + |
| 19 | + |
| 20 | + |
| 21 | + |
| 22 | + |
| 23 | + |
| 24 | + |
| 25 | + |
| 26 | + |
| 27 | + |
Collapse file
test/parallel/test-worker-message-port-move.js
Copy file name to clipboardExpand all lines: test/parallel/test-worker-message-port-move.js-7Lines changed: 0 additions & 7 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
53 | 53 | |
54 | 54 | |
55 | 55 | |
56 | | - |
57 | | - |
58 | | - |
59 | | - |
60 | | - |
61 | | - |
62 | | - |
63 | 56 | |
64 | 57 | |
65 | 58 | |
|
0 commit comments