async_hooks: add an InactiveAsyncContextFrame class
This gives a class prototype for AsyncContextFrame that contains the required methods, so that when we swap the prototype, ActiveAsyncContextFrame methods are used instead. Previously, the methods were defined in AsyncContextFrame, so swapping the prototype didn't swap those static methods.
Also, make the ActiveAsyncContextFrame extend from Map.
Fixes: https://github.com/nodejs/node/issues/54503
CI: https://ci.nodejs.org/job/node-test-pull-request/61360/
Codecov Report
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 87.35%. Comparing base (
e70bd47) to head (d3608a0). Report is 345 commits behind head on main.
Additional details and impacted files
@@ Coverage Diff @@
## main #54510 +/- ##
==========================================
+ Coverage 87.34% 87.35% +0.01%
==========================================
Files 649 649
Lines 182524 182526 +2
Branches 35026 35033 +7
==========================================
+ Hits 159420 159453 +33
+ Misses 16373 16345 -28
+ Partials 6731 6728 -3
| Files with missing lines | Coverage Δ | |
|---|---|---|
| lib/internal/async_context_frame.js | 97.36% <100.00%> (+17.63%) |
:arrow_up: |
CI: https://ci.nodejs.org/job/node-test-pull-request/61392/
CI: https://ci.nodejs.org/job/node-test-pull-request/61450/
CI: https://ci.nodejs.org/job/node-test-pull-request/61511/
CI: https://ci.nodejs.org/job/node-test-pull-request/61515/
CI: https://ci.nodejs.org/job/node-test-pull-request/61568/
CI: https://ci.nodejs.org/job/node-test-pull-request/61572/
I'm not sure why the ARM tests fail after 30 seconds with this PR. I'm guessing it's nothing to do wtih this PR, though. But still, we should probably investigate.....
Seems to have some very strange git-related failures. https://ci.nodejs.org/job/node-test-binary-armv7l/RUN_SUBSET=js,nodes=ubuntu2204-armv7l/13225/console 🤔
CI: https://ci.nodejs.org/job/node-test-pull-request/61669/
CI: https://ci.nodejs.org/job/node-test-pull-request/61676/
CI: https://ci.nodejs.org/job/node-test-pull-request/61677/
CI: https://ci.nodejs.org/job/node-test-pull-request/61689/
CI: https://ci.nodejs.org/job/node-test-pull-request/61697/
CI: https://ci.nodejs.org/job/node-test-pull-request/61713/
CI: https://ci.nodejs.org/job/node-test-pull-request/61720/
Landed in ef6b9ffc8dfc7b2a395c864d2729a0ce1be9ef18