-
Notifications
You must be signed in to change notification settings - Fork 29.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
lib: implement safe alternatives to Promise
static methods
#43728
lib: implement safe alternatives to Promise
static methods
#43728
Conversation
Review requested:
|
Promise
static methods
Promise
static methodsPromise
static methods
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is an improvement so LGTM.
Will leave another comment on the concept
Actually I see this is already scoped to discussing primordials in modules so I guess that's fine and no need to re-hash the "they make contributions harder, introduce perf regressions, confuse new contributors" etc discussions. I just want to add that tamper-proofedness requires formal proof to be meaningful IMO (which afaik we haven't done), turning off known side channels (namely the JIT and concurrent GC) etc. |
Landed in 3fb5784 |
PR-URL: #43728 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Stephen Belanger <admin@stephenbelanger.com> Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
PR-URL: #43728 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Stephen Belanger <admin@stephenbelanger.com> Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
PR-URL: nodejs#43759 Refs: nodejs#43728 Reviewed-By: Feng Yu <F3n67u@outlook.com>
PR-URL: nodejs/node#43728 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Stephen Belanger <admin@stephenbelanger.com> Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
PR-URL: nodejs/node#43759 Refs: nodejs/node#43728 Reviewed-By: Feng Yu <F3n67u@outlook.com>
…led on incompatible receiver error Prerendering does not work when using Node.js versions that contain the following commit nodejs/node#43728 due to `loadesm` is now using `SafePromiseAll` which is not handled properly by zone.js. With this chage we introduce a workaround until it's fix upstream.
…led on incompatible receiver error Prerendering does not work when using Node.js versions that contain the following commit nodejs/node#43728 due to `loadesm` is now using `SafePromiseAll` which is not handled properly by zone.js. With this chage we introduce a workaround until it's fix upstream.
…led on incompatible receiver error Prerendering does not work when using Node.js versions that contain the following commit nodejs/node#43728 due to `loadesm` is now using `SafePromiseAll` which is not handled properly by zone.js.
…led on incompatible receiver error Prerendering does not work when using Node.js versions that contain the following commit nodejs/node#43728 due to `loadesm` is now using `SafePromiseAll` which is not handled properly by zone.js.
…led on incompatible receiver error Prerendering does not work when using Node.js versions that contain the following commit nodejs/node#43728 due to `loadesm` is now using `SafePromiseAll` which is not handled properly by zone.js.
…led on incompatible receiver error Prerendering does not work when using Node.js versions that contain the following commit nodejs/node#43728 due to `loadesm` is now using `SafePromiseAll` which is not handled properly by zone.js. (cherry picked from commit b7dbc25)
Alternative to #38843, but restricted to the changes related to the ESM implementation since it's easier to get consensus regarding whether we want tamperproofness on that part of the code base. /cc @nodejs/modules @nodejs/loaders
Promise static methods that iterate over the provided argument (
%Promise.all%
,%Promise.any%
, ...) look up thethen
property over each promise to support promise subclassing. This PR is introducingSafePromiseAll
,SafePromiseAny
, etc. that take an array, safely iterate over it, and wrap each promise in aSafePromise
(whose prototype is not accessible from userland) and wrap the resultingSafePromise
in a classicPromise
to make the operation transparent from userland.