MCPcopy Create free account
hub / github.com/nodejs/node / evalInRealmAndWait

Function evalInRealmAndWait

test/fixtures/wpt/encoding/streams/realms.window.js:82–90  ·  view source on GitHub ↗
(realm, code)

Source from the content-addressed store, hash-verified

80// Same as evalInRealm() but returns a Promise which will resolve when the
81// function has actually.
82async function evalInRealmAndWait(realm, code) {
83 const resolve = id();
84 const waitOn = new Promise(r => {
85 realm[resolve] = r;
86 });
87 evalInRealm(realm, code);
88 evalInRealm(realm, `${resolve}();`);
89 await waitOn;
90}
91
92// The same as evalInRealmAndWait but returns the result of evaluating "code" as
93// an expression.

Callers 2

createRealmsFunction · 0.85
evalInRealmAndReturnFunction · 0.85

Calls 2

evalInRealmFunction · 0.85
idFunction · 0.50

Tested by

no test coverage detected