Commit 840c375
committed
Grabbing and saving the references to global `setTimeout` and `rAF`
implementations at a certain point in time can be problematic, espcially
in tests. Tests might call something like `jasmine.clock().install();`
and `jasmine.clock().uninstall();`. If the install happens before we
grab the implementation and then the uninstall happens after, our
scheduling function will be broken because it would have saved a reference to
the jasmine `setTimeout` implementation, which would have since been
cleaned up and will throw an error when attempting to access `delayedFunctionScheduler`.
There are other scenarios that may apply, not even just for tests, when
patches are applied and removed to the globals.
PR Close #55124
1 parent e18a0ed commit 840c375
File tree
16 files changed
+87
-64
lines changed- packages/core
- src
- change_detection/scheduling
- util
- zone
- test
- bundling
- animations-standalone
- animations
- cyclic_import
- defer
- forms_reactive
- forms_template_driven
- hello_world
- hydration
- router
- standalone_bootstrap
- todo
- zone
16 files changed
+87
-64
lines changedLines changed: 3 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
| 15 | + | |
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
26 | | - | |
27 | 26 | | |
28 | 27 | | |
29 | 28 | | |
| |||
56 | 55 | | |
57 | 56 | | |
58 | 57 | | |
59 | | - | |
| 58 | + | |
60 | 59 | | |
61 | 60 | | |
62 | 61 | | |
63 | 62 | | |
64 | | - | |
| 63 | + | |
65 | 64 | | |
66 | 65 | | |
67 | 66 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
37 | | - | |
| 37 | + | |
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
| |||
60 | 60 | | |
61 | 61 | | |
62 | 62 | | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | | - | |
77 | | - | |
78 | | - | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
79 | 78 | | |
80 | | - | |
81 | | - | |
82 | | - | |
| 79 | + | |
| 80 | + | |
83 | 81 | | |
84 | 82 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
| 12 | + | |
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| |||
165 | 165 | | |
166 | 166 | | |
167 | 167 | | |
168 | | - | |
| 168 | + | |
169 | 169 | | |
170 | 170 | | |
171 | 171 | | |
| |||
Lines changed: 3 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
899 | 899 | | |
900 | 900 | | |
901 | 901 | | |
902 | | - | |
903 | | - | |
904 | | - | |
905 | 902 | | |
906 | 903 | | |
907 | 904 | | |
| |||
1346 | 1343 | | |
1347 | 1344 | | |
1348 | 1345 | | |
| 1346 | + | |
| 1347 | + | |
| 1348 | + | |
1349 | 1349 | | |
1350 | 1350 | | |
1351 | 1351 | | |
| |||
Lines changed: 3 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
962 | 962 | | |
963 | 963 | | |
964 | 964 | | |
965 | | - | |
966 | | - | |
967 | | - | |
968 | 965 | | |
969 | 966 | | |
970 | 967 | | |
| |||
1415 | 1412 | | |
1416 | 1413 | | |
1417 | 1414 | | |
| 1415 | + | |
| 1416 | + | |
| 1417 | + | |
1418 | 1418 | | |
1419 | 1419 | | |
1420 | 1420 | | |
| |||
Lines changed: 3 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
734 | 734 | | |
735 | 735 | | |
736 | 736 | | |
737 | | - | |
738 | | - | |
739 | | - | |
740 | 737 | | |
741 | 738 | | |
742 | 739 | | |
| |||
1124 | 1121 | | |
1125 | 1122 | | |
1126 | 1123 | | |
| 1124 | + | |
| 1125 | + | |
| 1126 | + | |
1127 | 1127 | | |
1128 | 1128 | | |
1129 | 1129 | | |
| |||
Lines changed: 3 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
836 | 836 | | |
837 | 837 | | |
838 | 838 | | |
839 | | - | |
840 | | - | |
841 | | - | |
842 | 839 | | |
843 | 840 | | |
844 | 841 | | |
| |||
2288 | 2285 | | |
2289 | 2286 | | |
2290 | 2287 | | |
| 2288 | + | |
| 2289 | + | |
| 2290 | + | |
2291 | 2291 | | |
2292 | 2292 | | |
2293 | 2293 | | |
| |||
Lines changed: 3 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1022 | 1022 | | |
1023 | 1023 | | |
1024 | 1024 | | |
1025 | | - | |
1026 | | - | |
1027 | | - | |
1028 | 1025 | | |
1029 | 1026 | | |
1030 | 1027 | | |
| |||
1631 | 1628 | | |
1632 | 1629 | | |
1633 | 1630 | | |
| 1631 | + | |
| 1632 | + | |
| 1633 | + | |
1634 | 1634 | | |
1635 | 1635 | | |
1636 | 1636 | | |
| |||
Lines changed: 3 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
992 | 992 | | |
993 | 993 | | |
994 | 994 | | |
995 | | - | |
996 | | - | |
997 | | - | |
998 | 995 | | |
999 | 996 | | |
1000 | 997 | | |
| |||
1616 | 1613 | | |
1617 | 1614 | | |
1618 | 1615 | | |
| 1616 | + | |
| 1617 | + | |
| 1618 | + | |
1619 | 1619 | | |
1620 | 1620 | | |
1621 | 1621 | | |
| |||
Lines changed: 3 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
578 | 578 | | |
579 | 579 | | |
580 | 580 | | |
581 | | - | |
582 | | - | |
583 | | - | |
584 | 581 | | |
585 | 582 | | |
586 | 583 | | |
| |||
893 | 890 | | |
894 | 891 | | |
895 | 892 | | |
| 893 | + | |
| 894 | + | |
| 895 | + | |
896 | 896 | | |
897 | 897 | | |
898 | 898 | | |
| |||
0 commit comments