Skip to content

[v19.x] src: bootstrap Web [Exposed=*] APIs in the shadow realm

The first commit splits the Web APIs bootstrapping and can be helpful to be backported to reduce conflicts, regardless of whether or not the last two commits are backported.

lib: distinguish webidl interfaces with the extended property "Exposed" PR-URL: https://github.com/nodejs/node/pull/46809 Refs: https://github.com/nodejs/node/issues/42528 Reviewed-By: Matteo Collina matteo.collina@gmail.com Reviewed-By: James M Snell jasnell@gmail.com Reviewed-By: Colin Ihrig cjihrig@gmail.com Reviewed-By: Joyee Cheung joyeec9h3@gmail.com

src: bootstrap Web [Exposed=*] APIs in the shadow realm This is the initial work to bootstrap Web interfaces that are defined with extended attributes [Exposed=*].

The ShadowRealm instances are garbage-collected once it is unreachable. However, V8 can not infer the reference cycles between the per-realm strong persistent function handles and the realm's context handle. To allow the context to be gc-ed once it is not reachable, the per-realm persistent handles are attached to the context's global object and the persistent handles are set as weak.

PR-URL: https://github.com/nodejs/node/pull/46809 Refs: https://github.com/nodejs/node/issues/42528 Reviewed-By: Matteo Collina matteo.collina@gmail.com Reviewed-By: James M Snell jasnell@gmail.com Reviewed-By: Colin Ihrig cjihrig@gmail.com Reviewed-By: Joyee Cheung joyeec9h3@gmail.com

test: move test-shadow-realm-gc.js to known_issues There is actually a leak. The test doesn't exercise the right path to create a substantial enough object graph (e.g. accessing something that results in the loading of a binding). This does something more complicated in the test and moves it to known_issues until we find a fix.

PR-URL: https://github.com/nodejs/node/pull/47355 Refs: https://github.com/nodejs/node/issues/47353 Reviewed-By: Colin Ihrig cjihrig@gmail.com Reviewed-By: Chengzhong Wu legendecas@gmail.com Reviewed-By: Yagiz Nizipli yagiz@nizipli.com

Merge request reports

Loading