lib: make primordials Promise static methods safe#38843
lib: make primordials Promise static methods safe#38843aduh95 wants to merge 2 commits intonodejs:mainfrom
Conversation
|
Benchmark CI: https://ci.nodejs.org/view/Node.js%20benchmark/job/benchmark-node-micro-benchmarks/1035/ Results |
BridgeAR
left a comment
There was a problem hiding this comment.
I am against changing further code to use primordials as outlined here #30697 (comment).
Note that this change removes the |
|
I'm generally uncomfortable about reimplementing standard methods to avoid the fact that they call user-mutable things. |
|
Superseded by #43728. |
Promise static methods that iterate over the provided argument (
%Promise.all%,%Promise.any%, ...) look up thethenproperty over each promise to support promise subclassing. This PR is introducingSafePromiseAll,SafePromiseAny, etc. that take a array, safely iterate over it, and wrap each promise in aSafePromisewhose prototype is accessible from userland.