node/lib/internal/bootstrap
Anna Henningsen 0d35eaa034
worker: allow passing JS wrapper objects via postMessage
Enable JS wrapper objects to be used as transferable or cloneable
objects in `postMessage()` calls, by having them extend a C++-backed
class.

This requires a few internal changes:
- This commit adds the possibility for transferred objects to
  read/write JS values at the end of the serialization/deserialization
  phases.
- This commit adds the possibility for transferred objects to list
  sub-transferables, e.g. typically the public JS wrapper class
  would list its C++ handle in there.
- This commit adds usage of `BaseObject` in a few more places, because
  now during deserialization weakly held objects can also be involved,
  in addition to `MessagePort`s.

PR-URL: https://github.com/nodejs/node/pull/33772
Backport-PR-URL: https://github.com/nodejs/node/pull/33965
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
2020-09-27 12:32:00 +02:00
..
switches lib: move initialization of APIs for changing process state 2020-02-06 02:49:36 +00:00
environment.js process: run RunBootstrapping in CreateEnvironment 2019-04-03 08:46:03 +08:00
loaders.js esm: unflag --experimental-modules 2020-05-13 17:52:54 +02:00
node.js worker: allow passing JS wrapper objects via postMessage 2020-09-27 12:32:00 +02:00
pre_execution.js lib: always initialize esm loader callbackMap 2020-09-23 22:34:07 +02:00