diff --git a/packages/base64/test/bench-main.js b/packages/base64/test/bench-main.js index 4424c66a1b..ab9b3e7671 100644 --- a/packages/base64/test/bench-main.js +++ b/packages/base64/test/bench-main.js @@ -16,6 +16,7 @@ async function main() { const log = (typeof console !== 'undefined' && console.log) || print; /** @type {typeof Date.now} */ const now = await (async () => { + await null; try { const { performance } = await import('perf_hooks'); if (performance.now) { diff --git a/packages/captp/test/export-hook.test.js b/packages/captp/test/export-hook.test.js index 541e44708e..38ec2c6912 100644 --- a/packages/captp/test/export-hook.test.js +++ b/packages/captp/test/export-hook.test.js @@ -21,6 +21,7 @@ test('exportHook', async t => { ); // Prime the pump. + await null; t.deepEqual(await E(bs).echo(), [], 'echoed'); t.is(exports.length, 1, 'loopback metaprotocol'); exports.splice(0); diff --git a/packages/captp/test/gc.test.js b/packages/captp/test/gc.test.js index af3eb3622c..4ce5f6ab76 100644 --- a/packages/captp/test/gc.test.js +++ b/packages/captp/test/gc.test.js @@ -11,6 +11,7 @@ const isolated = async (t, makeFar) => { method: () => 'local', }); const far = makeFar(local); + await null; t.is(await E(far).method(), 'local'); }; diff --git a/packages/captp/test/trap.test.js b/packages/captp/test/trap.test.js index fc478182e3..45866584b7 100644 --- a/packages/captp/test/trap.test.js +++ b/packages/captp/test/trap.test.js @@ -43,6 +43,7 @@ const makeWorkerTests = isHost => async t => { const bs = getBootstrap(); // console.error('have bs', bs); + await null; if (Trap) { await runTrapTests(t, Trap, bs, true); } else { diff --git a/packages/captp/test/traplib.js b/packages/captp/test/traplib.js index 41fdf09029..2f4bc3aacc 100644 --- a/packages/captp/test/traplib.js +++ b/packages/captp/test/traplib.js @@ -27,6 +27,7 @@ export const runTrapTests = async (t, Trap, bs, unwrapsPromises) => { // Demonstrate async compatibility of traps. const pn = E(E(bs).getTraps(3)).getN(); t.is(Promise.resolve(pn), pn); + await null; t.is(await pn, 3); // Demonstrate Trap cannot be used on a promise. diff --git a/packages/check-bundle/lite.js b/packages/check-bundle/lite.js index b8c54f2e60..11d7ac9c2d 100644 --- a/packages/check-bundle/lite.js +++ b/packages/check-bundle/lite.js @@ -59,6 +59,7 @@ export const checkBundle = async ( X`checkBundle cannot hash non-bundle, moduleFormat must be a string, got ${typeof moduleFormat}`, ); + await null; if (moduleFormat === 'endoZipBase64') { const { endoZipBase64, endoZipBase64Sha512 } = bundle; assert.typeof( diff --git a/packages/cli/src/client.js b/packages/cli/src/client.js index 2846913eec..da944090c7 100644 --- a/packages/cli/src/client.js +++ b/packages/cli/src/client.js @@ -13,6 +13,7 @@ export const provideEndoClient = async ( cancelled, bootstrap, ) => { + await null; try { // It is okay to fail to connect because the daemon is not running. return await makeEndoClient(name, sockPath, cancelled, bootstrap); diff --git a/packages/cli/src/commands/accept.js b/packages/cli/src/commands/accept.js index e3391f3d6c..5b73a0a451 100644 --- a/packages/cli/src/commands/accept.js +++ b/packages/cli/src/commands/accept.js @@ -13,6 +13,7 @@ const fromAsync = async iterable => { export const accept = async ({ guestName, agentNames }) => { process.stdin.setEncoding('utf-8'); + await null; const invitationLocator = (await fromAsync(process.stdin)).join('').trim(); return withEndoAgent(agentNames, { os, process }, async ({ agent }) => { await E(agent).accept(invitationLocator.trim(), guestName); diff --git a/packages/cli/src/commands/list.js b/packages/cli/src/commands/list.js index 1138a8f741..c8075dddf4 100644 --- a/packages/cli/src/commands/list.js +++ b/packages/cli/src/commands/list.js @@ -40,6 +40,7 @@ export const list = async ({ directory, follow, json, verbose }) => const directoryPath = parsePetNamePath(directory); agent = E(agent).lookup(...directoryPath); } + await null; if (follow) { const topic = await E(agent).followNameChanges(); const iterator = makeRefIterator(topic); diff --git a/packages/cli/src/commands/log.js b/packages/cli/src/commands/log.js index 83efe283f3..3cf55eaaea 100644 --- a/packages/cli/src/commands/log.js +++ b/packages/cli/src/commands/log.js @@ -39,6 +39,7 @@ export const log = async ({ follow, ping }) => const logPath = path.join(statePath, 'endo.log'); + await null; do { // Scope cancellation and propagate. const { promise: followCancelled, reject: cancelFollower } = diff --git a/packages/cli/src/commands/make.js b/packages/cli/src/commands/make.js index b22bdc19e6..226dd6c1ca 100644 --- a/packages/cli/src/commands/make.js +++ b/packages/cli/src/commands/make.js @@ -46,6 +46,7 @@ export const makeCommand = async ({ let bundleReaderRef; /** @type {string | undefined} */ let temporaryBundleName; + await null; if (filePath !== undefined) { if (bundleName === undefined) { // TODO alternately, make a temporary session-scoped GC pet store @@ -62,6 +63,7 @@ export const makeCommand = async ({ await withEndoAgent(agentNames, { os, process }, async ({ agent }) => { // Prepare a bundle, with the given name. + await null; if (bundleReaderRef !== undefined) { await E(agent).storeBlob(bundleReaderRef, bundleName); } diff --git a/packages/cli/src/commands/run.js b/packages/cli/src/commands/run.js index 4b528d4226..0d79674071 100644 --- a/packages/cli/src/commands/run.js +++ b/packages/cli/src/commands/run.js @@ -55,6 +55,7 @@ export const run = async ({ powersP = E(agent).provideGuest(powersName); } + await null; if (importPath !== undefined) { if (bundleName !== undefined) { console.error( diff --git a/packages/cli/src/commands/store.js b/packages/cli/src/commands/store.js index c42cad028e..7c70a04232 100644 --- a/packages/cli/src/commands/store.js +++ b/packages/cli/src/commands/store.js @@ -76,6 +76,7 @@ export const store = async ({ const parsedName = parsePetNamePath(name); await withEndoAgent(agentNames, { os, process }, async ({ agent }) => { + await null; if (storeText !== undefined) { await E(agent).storeValue(storeText, parsedName); } else if (storeJson !== undefined) { diff --git a/packages/cli/src/context.js b/packages/cli/src/context.js index 8c0f2863f4..4a23bc0b2e 100644 --- a/packages/cli/src/context.js +++ b/packages/cli/src/context.js @@ -11,6 +11,7 @@ export const withInterrupt = async callback => { cancelled.catch(() => {}); process.once('SIGINT', () => cancel(Error('SIGINT'))); + await null; try { await callback({ cancel, cancelled }); cancel(Error('normal termination')); diff --git a/packages/common/test/apply-labeling-error.test.js b/packages/common/test/apply-labeling-error.test.js index 9af308764a..7679072270 100644 --- a/packages/common/test/apply-labeling-error.test.js +++ b/packages/common/test/apply-labeling-error.test.js @@ -12,6 +12,7 @@ test('test applyLabelingError', async t => { applyLabelingError(x => x * 2, [8], 'foo'), 16, ); + await null; t.is(await applyLabelingError(async x => x * 2, [8], 'foo'), 16); t.throws(() => applyLabelingError(x => Fail`${x}`, ['e']), { message: '"e"', diff --git a/packages/compartment-mapper/src/archive-lite.js b/packages/compartment-mapper/src/archive-lite.js index 000790718d..f48f62e0c3 100644 --- a/packages/compartment-mapper/src/archive-lite.js +++ b/packages/compartment-mapper/src/archive-lite.js @@ -226,6 +226,7 @@ const renameSources = (sources, compartmentRenames) => { * @param {Sources} sources */ const addSourcesToArchive = async (archive, sources) => { + await null; for (const compartment of keys(sources).sort()) { const modules = sources[compartment]; const compartmentLocation = resolveLocation(`${compartment}/`, 'file:///'); diff --git a/packages/compartment-mapper/src/import-archive-lite.js b/packages/compartment-mapper/src/import-archive-lite.js index 01de9ff02c..c66819b71e 100644 --- a/packages/compartment-mapper/src/import-archive-lite.js +++ b/packages/compartment-mapper/src/import-archive-lite.js @@ -107,6 +107,7 @@ const makeArchiveImportHookMaker = ( const importHook = async moduleSpecifier => { // per-module: const module = modules[moduleSpecifier]; + await null; if (module === undefined) { if (exitModuleImportHook) { // At this point in archive importing, if a module is not found and @@ -354,6 +355,7 @@ export const parseArchive = async ( // Archive integrity checks: ensure every module is pre-loaded so its hash // gets checked, and ensure that every file in the archive is used, and // therefore checked. + await null; if (computeSha512 !== undefined) { const makeImportHook = makeArchiveImportHookMaker( get, diff --git a/packages/compartment-mapper/src/import-hook.js b/packages/compartment-mapper/src/import-hook.js index 5d73be530d..bf5e0e3248 100644 --- a/packages/compartment-mapper/src/import-hook.js +++ b/packages/compartment-mapper/src/import-hook.js @@ -217,6 +217,7 @@ export const makeImportHookMaker = ( // third-party dependency. // The `moduleMapHook` captures all third-party dependencies, unless // we allow importing any exit. + await null; if (moduleSpecifier !== '.' && !moduleSpecifier.startsWith('./')) { if (exitModuleImportHook) { const record = await exitModuleImportHook(moduleSpecifier); diff --git a/packages/compartment-mapper/src/link.js b/packages/compartment-mapper/src/link.js index d1bd8646ac..0046963a45 100644 --- a/packages/compartment-mapper/src/link.js +++ b/packages/compartment-mapper/src/link.js @@ -98,6 +98,7 @@ const makeExtensionParser = ( let sourceMap; + await null; if (has(moduleTransforms, language)) { try { ({ diff --git a/packages/compartment-mapper/src/node-modules.js b/packages/compartment-mapper/src/node-modules.js index 5509d3cd35..faa2a5168c 100644 --- a/packages/compartment-mapper/src/node-modules.js +++ b/packages/compartment-mapper/src/node-modules.js @@ -152,6 +152,7 @@ const readDescriptorWithMemo = async (memo, maybeRead, packageLocation) => { * } | undefined>} */ const findPackage = async (readDescriptor, canonical, directory, name) => { + await null; for (;;) { // eslint-disable-next-line no-await-in-loop const packageLocation = await canonical( diff --git a/packages/compartment-mapper/src/node-powers.js b/packages/compartment-mapper/src/node-powers.js index 1ea242cdb6..0f315fe9c3 100644 --- a/packages/compartment-mapper/src/node-powers.js +++ b/packages/compartment-mapper/src/node-powers.js @@ -104,6 +104,7 @@ const makeReadPowersSloppy = ({ fs, url = undefined, crypto = undefined }) => { * @param {string} location */ const canonical = async location => { + await null; try { if (location.endsWith('/')) { const realPath = await fs.promises.realpath( @@ -157,6 +158,7 @@ const makeWritePowersSloppy = ({ fs, url = undefined }) => { * @param {Uint8Array} data */ const write = async (location, data) => { + await null; try { return await fs.promises.writeFile(fileURLToPath(location), data); } catch (error) { diff --git a/packages/compartment-mapper/src/search.js b/packages/compartment-mapper/src/search.js index 098516cd96..6ccff28c47 100644 --- a/packages/compartment-mapper/src/search.js +++ b/packages/compartment-mapper/src/search.js @@ -34,6 +34,7 @@ const resolveLocation = (rel, abs) => new URL(rel, abs).toString(); */ export const searchDescriptor = async (location, readDescriptor) => { let directory = resolveLocation('./', location); + await null; for (;;) { const packageDescriptorLocation = resolveLocation( 'package.json', diff --git a/packages/compartment-mapper/test/policy.test.js b/packages/compartment-mapper/test/policy.test.js index 7884ab9d43..72f1e87572 100644 --- a/packages/compartment-mapper/test/policy.test.js +++ b/packages/compartment-mapper/test/policy.test.js @@ -5,6 +5,7 @@ import { moduleify, scaffold, sanitizePaths } from './scaffold.js'; function combineAssertions(...assertionFunctions) { return async (...args) => { + await null; for (const assertion of assertionFunctions) { // eslint-disable-next-line no-await-in-loop await assertion(...args); diff --git a/packages/compartment-mapper/test/scaffold.js b/packages/compartment-mapper/test/scaffold.js index bc4fe9dd9f..0f00fa0f49 100644 --- a/packages/compartment-mapper/test/scaffold.js +++ b/packages/compartment-mapper/test/scaffold.js @@ -62,6 +62,7 @@ const builtinLocation = new URL( // application package. export async function setup() { + await null; if (modules === undefined) { const utility = await loadLocation(readPowers, builtinLocation); const { namespace } = await utility.import({ globals }); @@ -100,6 +101,7 @@ export function scaffold( return testFunc(title, async t => { const compartmentInstrumentation = compartmentInstrumentationFactory(); let namespace; + await null; try { namespace = await implementation( t, diff --git a/packages/compartment-mapper/test/stack.test.js b/packages/compartment-mapper/test/stack.test.js index 6e98d4aef2..07e65cebe7 100644 --- a/packages/compartment-mapper/test/stack.test.js +++ b/packages/compartment-mapper/test/stack.test.js @@ -42,6 +42,7 @@ test('archive stack trace source', async t => { // have a fully qualified file URL in the stack trace. test('disk stack trace source', async t => { let error; + await null; try { await importLocation(readPowers, fixtureLocation); } catch (_error) { diff --git a/packages/daemon/index.js b/packages/daemon/index.js index 8158e4be55..f6adadb885 100644 --- a/packages/daemon/index.js +++ b/packages/daemon/index.js @@ -144,6 +144,7 @@ const enoentOk = error => { }; export const clean = async (config = defaultConfig) => { + await null; if (process.platform !== 'win32') { await removePath(config.sockPath).catch(enoentOk); } diff --git a/packages/daemon/src/daemon-node-powers.js b/packages/daemon/src/daemon-node-powers.js index 389a920df5..2ae0951e92 100644 --- a/packages/daemon/src/daemon-node-powers.js +++ b/packages/daemon/src/daemon-node-powers.js @@ -367,6 +367,7 @@ export const makeDaemonicPersistencePowers = ( return filePowers.readFileText(storagePath); }; const json = async () => { + await null; return JSON.parse(await text()); }; return harden({ diff --git a/packages/daemon/src/serve-private-port-http.js b/packages/daemon/src/serve-private-port-http.js index f7ebb20a1a..f95d0a4aaf 100644 --- a/packages/daemon/src/serve-private-port-http.js +++ b/packages/daemon/src/serve-private-port-http.js @@ -18,6 +18,7 @@ export const servePrivatePortHttp = ( const connectionClosedPromises = new Set(); const respond = async request => { + await null; if (request.method === 'GET') { if (request.url === '/') { return { diff --git a/packages/daemon/src/web-server-node-powers.js b/packages/daemon/src/web-server-node-powers.js index 98e04cfcc9..3be9961431 100644 --- a/packages/daemon/src/web-server-node-powers.js +++ b/packages/daemon/src/web-server-node-powers.js @@ -83,6 +83,7 @@ export const makeHttpPowers = ({ http, ws }) => { return; } + await null; try { await sendResponse(req, res); } catch (_error) { diff --git a/packages/daemon/src/web-server-node.js b/packages/daemon/src/web-server-node.js index dea9b4cec3..3e9ffcd0d3 100644 --- a/packages/daemon/src/web-server-node.js +++ b/packages/daemon/src/web-server-node.js @@ -138,6 +138,7 @@ export const make = async (_powers, context) => { E.sendOnly(webletBootstrap).ping(); // eslint-disable-next-line no-use-before-define + await null; E(webletBootstrap) .makeBundle( await E(/** @type {any} */ (webletBundle)).json(), diff --git a/packages/daemon/test/context-consumer.js b/packages/daemon/test/context-consumer.js index 916084b371..6d7bb1819d 100644 --- a/packages/daemon/test/context-consumer.js +++ b/packages/daemon/test/context-consumer.js @@ -11,6 +11,7 @@ export const ContextConsumerInterface = M.interface( export const make = async (_powers, context) => { return makeExo('Context consumer', ContextConsumerInterface, { async awaitCancellation() { + await null; try { await E(context).whenCancelled(); } catch { diff --git a/packages/eventual-send/test/e.test.js b/packages/eventual-send/test/e.test.js index a0f1c05c31..6e66977e13 100644 --- a/packages/eventual-send/test/e.test.js +++ b/packages/eventual-send/test/e.test.js @@ -50,6 +50,7 @@ test('E method calls', async t => { }; const d = E(x).double(6); t.is(typeof d.then, 'function', 'return is a thenable'); + await null; t.is(await d, 12, 'method call works'); const methodProxy = E(x); t.assert(Object.isFrozen(methodProxy)); @@ -156,6 +157,7 @@ test('E shortcuts', async t => { return `${greeting}, ${this.name}!`; }, }; + await null; t.is(await E(x).hello('Hello'), 'Hello, buddy!', 'method call works'); t.is( await E(await E.get(await E.get(x).y).fn)(4), @@ -183,6 +185,7 @@ test('E.get', async t => { return `${greeting}, ${this.name}!`; }, }; + await null; t.assert(Object.isFrozen(await E.get(x).output), 'get output is frozen'); t.assert( Object.isFrozen(await E(E.get(x).testFrozen)({ arg: 123 })), diff --git a/packages/eventual-send/test/eventual-send.test.js b/packages/eventual-send/test/eventual-send.test.js index 65088e247a..20046e1355 100644 --- a/packages/eventual-send/test/eventual-send.test.js +++ b/packages/eventual-send/test/eventual-send.test.js @@ -169,6 +169,7 @@ test('new HandledPromise expected errors', async t => { // Full handler succeeds. let fullObj; + await null; t.is( await new HandledPromise((_, _2, rwp) => (fullObj = rwp(handler))), fullObj, @@ -281,6 +282,7 @@ test('new HandledPromise(executor, undefined)', async t => { }, 200); }); + await null; t.is( await HandledPromise.applyMethod(handledP, 'hello', ['World', '!']), 'Hello, World!', @@ -308,6 +310,7 @@ test('handled promises are promises', t => { }); test('eventual send expected errors', async t => { + await null; t.is( await HandledPromise.get(true, 'toString'), true.toString, diff --git a/packages/eventual-send/test/thenable.test.js b/packages/eventual-send/test/thenable.test.js index 2d52914b19..6ab02917ce 100644 --- a/packages/eventual-send/test/thenable.test.js +++ b/packages/eventual-send/test/thenable.test.js @@ -37,6 +37,7 @@ const verifyThenAttack = async (t, resolve) => { t.not(p, p2, 'an own "then" should cause coercion'); t.is(getHappened, false, `getter not called too early`); t.is(callHappened, false, `then not called too early`); + await null; t.is(await p2, 'done', `p2 is resolved`); t.is(getHappened, true, `getter not called too early`); t.is(callHappened, true, `then not called too early`); diff --git a/packages/exo/test/exo-only-throwables.test.js b/packages/exo/test/exo-only-throwables.test.js index 95fea0017a..f1d8119eaa 100644 --- a/packages/exo/test/exo-only-throwables.test.js +++ b/packages/exo/test/exo-only-throwables.test.js @@ -41,6 +41,7 @@ test('exo only throwables', async t => { t.true(isPassable(caught)); t.log('throw caught', caught); + await null; try { await thrower.reject(e); } catch (thrown) { diff --git a/packages/exo/test/legacy-guard-tolerance.test.js b/packages/exo/test/legacy-guard-tolerance.test.js index ec15546b58..2cc5936ee5 100644 --- a/packages/exo/test/legacy-guard-tolerance.test.js +++ b/packages/exo/test/legacy-guard-tolerance.test.js @@ -118,6 +118,7 @@ test('legacy guard tolerance', async t => { mg1: meth, mg2: meth, }); + await null; t.deepEqual(await f1.mg1(77, 88), [77, 88]); await t.throwsAsync(async () => f1.mg1(77, laag), { message: diff --git a/packages/far/test/e.test.js b/packages/far/test/e.test.js index f3c617a8f2..cd8293ffcb 100644 --- a/packages/far/test/e.test.js +++ b/packages/far/test/e.test.js @@ -47,6 +47,7 @@ test('E method calls', async t => { }; const d = E(x).double(6); t.is(typeof d.then, 'function', 'return is a thenable'); + await null; t.is(await d, 12, 'method call works'); }); @@ -178,6 +179,7 @@ test('E shortcuts', async t => { return `${greeting}, ${this.name}!`; }, }; + await null; t.is(await E(x).hello('Hello'), 'Hello, buddy!', 'method call works'); t.is( await E(await E.get(await E.get(x).y).fn)(4), @@ -200,6 +202,7 @@ test('E.get', async t => { return `${greeting}, ${this.name}!`; }, }; + await null; t.is( await E(await E.get(await E.get(x).y).fn)(4), 8, diff --git a/packages/import-bundle/src/index.js b/packages/import-bundle/src/index.js index 487f18a8af..02dfa1611e 100644 --- a/packages/import-bundle/src/index.js +++ b/packages/import-bundle/src/index.js @@ -54,6 +54,7 @@ export async function importBundle(bundle, options = {}, powers = {}) { } const { moduleFormat } = bundle; + await null; if (moduleFormat === 'endoZipBase64') { const { endoZipBase64 } = bundle; const bytes = decodeBase64(endoZipBase64); diff --git a/packages/import-bundle/test/import-bundle.test.js b/packages/import-bundle/test/import-bundle.test.js index 7599bf7f2e..84fc65ed2d 100644 --- a/packages/import-bundle/test/import-bundle.test.js +++ b/packages/import-bundle/test/import-bundle.test.js @@ -59,6 +59,7 @@ test('test import', async t => { // bundleSource (in 'getExport' mode) uses rollup() in a way that uses // Math.random, which is disabled under SES console.log(`TODO: skipping test that needs Math.random`); + await null; // eslint-disable-next-line no-constant-condition if (false) { const b1getExport = await bundleSource( diff --git a/packages/lp32/test/lp32.test.js b/packages/lp32/test/lp32.test.js index b3ba3d8ada..6b0c087d69 100644 --- a/packages/lp32/test/lp32.test.js +++ b/packages/lp32/test/lp32.test.js @@ -178,6 +178,7 @@ test('round-trip varying messages', async t => { const producer = (async () => { /** @type {import('@endo/stream').Writer} */ const w = makeLp32Writer(output); + await null; for (let i = 0; i < array.length; i += 1) { // eslint-disable-next-line no-await-in-loop await w.next(encoder.encode(array[i])); diff --git a/packages/netstring/test/netstring.test.js b/packages/netstring/test/netstring.test.js index 4a3309ee9f..ca12c4d019 100644 --- a/packages/netstring/test/netstring.test.js +++ b/packages/netstring/test/netstring.test.js @@ -212,6 +212,7 @@ test('concurrent chunked writes', async t => { }); test('writer closes anywhere within chunk', async t => { + await null; for (let count = 0; count < 4; count += 1) { const pipe = makePipe(); const writer = makeNetstringWriter(pipe[1], { chunked: true }); @@ -245,6 +246,7 @@ const varyingMessages = async (t, opts) => { const producer = (async () => { /** @type {import('@endo/stream').Writer} */ const w = makeNetstringWriter(output, opts); + await null; for (let i = 0; i < array.length; i += 1) { // eslint-disable-next-line no-await-in-loop await w.next(encoder.encode(array[i])); diff --git a/packages/ses/src/module-load.js b/packages/ses/src/module-load.js index 1f9af99fba..7d4ea1d750 100644 --- a/packages/ses/src/module-load.js +++ b/packages/ses/src/module-load.js @@ -36,6 +36,7 @@ const noop = () => {}; async function asyncTrampoline(generatorFunc, args, errorWrapper) { const iterator = generatorFunc(...args); let result = generatorNext(iterator); + await null; while (!result.done) { try { // eslint-disable-next-line no-await-in-loop @@ -349,6 +350,7 @@ function asyncJobQueue() { * @returns {Promise>} */ const drainQueue = async () => { + await null; for (const job of pendingJobs) { // eslint-disable-next-line no-await-in-loop await job; diff --git a/packages/ses/test/anticipate-async-iterator-helpers-shimmed.test.js b/packages/ses/test/anticipate-async-iterator-helpers-shimmed.test.js index d98c0b5d0f..2fd787db4d 100644 --- a/packages/ses/test/anticipate-async-iterator-helpers-shimmed.test.js +++ b/packages/ses/test/anticipate-async-iterator-helpers-shimmed.test.js @@ -7,6 +7,7 @@ import './lockdown-safe.js'; import test from 'ava'; test('shimmed async-iterator helpers', async t => { + await null; t.deepEqual( await (async function* g(i) { // eslint-disable-next-line no-plusplus diff --git a/packages/ses/test/error/aggregate-error.test.js b/packages/ses/test/error/aggregate-error.test.js index 5c0b0b2466..209a81cae7 100644 --- a/packages/ses/test/error/aggregate-error.test.js +++ b/packages/ses/test/error/aggregate-error.test.js @@ -40,6 +40,7 @@ test('Promise.any aggregate error', async t => { const e2 = Error('e2', { cause: e1 }); const u3 = URIError('u3', { cause: e1 }); + await null; try { await Promise.any([Promise.reject(e2), Promise.reject(u3)]); } catch (a4) { diff --git a/packages/ses/test/import-gauntlet.test.js b/packages/ses/test/import-gauntlet.test.js index 776b2a3b2b..0135fd546e 100644 --- a/packages/ses/test/import-gauntlet.test.js +++ b/packages/ses/test/import-gauntlet.test.js @@ -394,6 +394,7 @@ test('importHook returning a ModuleInstance with a precompiled functor', async t { resolveHook: resolveNode, importHook: async moduleSpecifier => { + await null; if (moduleSpecifier === './precompiled.js') { const baseRecord = await importHook(moduleSpecifier); return { diff --git a/packages/ses/test/import-stack-traces.test.js b/packages/ses/test/import-stack-traces.test.js index 466af54cb6..d0e900a4ce 100644 --- a/packages/ses/test/import-stack-traces.test.js +++ b/packages/ses/test/import-stack-traces.test.js @@ -25,6 +25,7 @@ test('preserve file names in stack traces', async t => { ); let error; + await null; try { await compartment.import('./main.js'); } catch (_error) { diff --git a/packages/ses/test/import.test.js b/packages/ses/test/import.test.js index 7f623e9913..6967983088 100644 --- a/packages/ses/test/import.test.js +++ b/packages/ses/test/import.test.js @@ -440,6 +440,7 @@ test('module alias', async t => { const importHook = async specifier => { const candidates = [specifier, `${specifier}.js`, `${specifier}/index.js`]; + await null; for (const candidate of candidates) { // eslint-disable-next-line no-await-in-loop const record = await wrappedImportHook(candidate).catch(_ => undefined); @@ -499,6 +500,7 @@ test('import reflexive module alias', async t => { const importHook = async specifier => { const candidates = [specifier, `${specifier}.js`, `${specifier}/index.js`]; + await null; for (const candidate of candidates) { // eslint-disable-next-line no-await-in-loop const record = await wrappedImportHook(candidate).catch(_ => undefined); diff --git a/packages/ses/test/tame-domains-after-lockdown.test.js b/packages/ses/test/tame-domains-after-lockdown.test.js index c7506e3a1e..3c28c579e2 100644 --- a/packages/ses/test/tame-domains-after-lockdown.test.js +++ b/packages/ses/test/tame-domains-after-lockdown.test.js @@ -4,6 +4,7 @@ import test from 'ava'; lockdown({ domainTaming: 'safe' }); test('import domains after lockdown', async t => { + await null; try { await import('domain'); t.fail('importing domain should throw'); diff --git a/packages/static-module-record/test/static-module-record.test.js b/packages/static-module-record/test/static-module-record.test.js index 3ade9f7fa3..36fa8e41ad 100644 --- a/packages/static-module-record/test/static-module-record.test.js +++ b/packages/static-module-record/test/static-module-record.test.js @@ -423,6 +423,7 @@ export default async function F(arg) { return arg; } t.is(F.name, 'F', 'F function name'); const ret = F('foo'); t.truthy(ret instanceof Promise, 'F is async'); + await null; t.is(await ret, 'foo', 'F returns correctly'); }); @@ -437,6 +438,7 @@ export default async function (arg) { return arg; } t.is(F.name, 'default', 'default function name'); const ret = F('foo'); t.truthy(ret instanceof Promise, 'F is async'); + await null; t.is(await ret, 'foo', 'F returns correctly'); }); diff --git a/packages/stream-node/test/stream-node.test.js b/packages/stream-node/test/stream-node.test.js index f5e716f3c1..c6ff744ae3 100644 --- a/packages/stream-node/test/stream-node.test.js +++ b/packages/stream-node/test/stream-node.test.js @@ -37,6 +37,7 @@ test('stream to and from Node.js reader/writer', async (/** @type {import('ava') const makeProducer = async () => { let chunkLength = 1; + await null; for (let i = 0; i < scratch.byteLength; ) { const j = i + chunkLength; t.log('->', i, j); @@ -101,6 +102,7 @@ test('stream write error (EPIPE due to exit)', async (/** @type {import('ava').E const makeProducer = async () => { let chunkLength = 1; + await null; for (let i = 0; i < scratch.byteLength; ) { const j = i + chunkLength; t.log('->', i, j); @@ -154,6 +156,7 @@ test('stream writer abort', async (/** @type {import('ava').ExecutionContext} */ }); const makeProducer = async () => { + await null; try { await writer.throw(Error('Abort')); } catch (error) { diff --git a/packages/stream/index.js b/packages/stream/index.js index 1c2de21662..9c76bfe9a7 100644 --- a/packages/stream/index.js +++ b/packages/stream/index.js @@ -155,6 +155,7 @@ export const prime = (generator, primer) => { const primed = harden({ /** @param {TWrite} value */ async next(value) { + await null; if (result === undefined) { result = await first; if (result.done) { @@ -165,6 +166,7 @@ export const prime = (generator, primer) => { }, /** @param {TReturn} value */ async return(value) { + await null; if (result === undefined) { result = await first; if (result.done) { @@ -175,6 +177,7 @@ export const prime = (generator, primer) => { }, /** @param {Error} error */ async throw(error) { + await null; if (result === undefined) { result = await first; if (result.done) { diff --git a/packages/stream/test/map.test.js b/packages/stream/test/map.test.js index 5cf75c1eed..76524d1f8f 100644 --- a/packages/stream/test/map.test.js +++ b/packages/stream/test/map.test.js @@ -19,6 +19,7 @@ test('map reader', async (/** @type {import('ava').Assertions} */ t) => { const order = ['', 'Hello, World!', '\x00', '😇 ']; const makeProducer = async () => { + await null; for (const value of order) { // eslint-disable-next-line no-await-in-loop const { done, value: actual } = await produceTo.next(value); @@ -31,6 +32,7 @@ test('map reader', async (/** @type {import('ava').Assertions} */ t) => { }; const makeConsumer = async () => { + await null; for (const expected of order) { // eslint-disable-next-line no-await-in-loop const { done, value: actual } = await consumeFrom.next(undefined); @@ -60,6 +62,7 @@ test('transcoding stream terminated with cause', async (/** @type {import('ava') }; const makeConsumer = async () => { + await null; try { for await (const _ of consumeFrom) { t.fail(); diff --git a/packages/stream/test/prime.test.js b/packages/stream/test/prime.test.js index b3a18b7432..2011a01adb 100644 --- a/packages/stream/test/prime.test.js +++ b/packages/stream/test/prime.test.js @@ -32,6 +32,7 @@ test('prime empty throw in', async (/** @type {import('ava').ExecutionContext} * } const iterator = prime(empty()); + await null; try { await iterator.throw(Error('Abort')); t.fail(); @@ -63,6 +64,7 @@ test('prime single throw', async (/** @type {import('ava').ExecutionContext} */ } const iterator = prime(empty()); + await null; try { await iterator.next(0); t.fail('reached beyond end of generator'); @@ -86,6 +88,7 @@ test('prime throw case', async (/** @type {import('ava').ExecutionContext} */ t) } const iterator = prime(temperamental()); + await null; try { await iterator.next(); t.fail(); diff --git a/packages/stream/test/pump.test.js b/packages/stream/test/pump.test.js index 2693e2d23c..8a25ba301d 100644 --- a/packages/stream/test/pump.test.js +++ b/packages/stream/test/pump.test.js @@ -304,6 +304,7 @@ test('pump iterator protocol target return throws', async (/** @type {import('av }, }; + await null; try { await pump(target, source, 'A'); t.fail(); diff --git a/packages/stream/test/stream.test.js b/packages/stream/test/stream.test.js index c4edacdab1..59bd0836f0 100644 --- a/packages/stream/test/stream.test.js +++ b/packages/stream/test/stream.test.js @@ -9,6 +9,7 @@ test('stream', async (/** @type {import('ava').Assertions} */ t) => { const order = [10, 20, 30]; const makeProducer = async () => { + await null; for (const expected of order) { // eslint-disable-next-line no-await-in-loop const { done, value: actual } = await produceTo.next(expected); @@ -21,6 +22,7 @@ test('stream', async (/** @type {import('ava').Assertions} */ t) => { }; const makeConsumer = async () => { + await null; for (const expected of order) { // eslint-disable-next-line no-await-in-loop const { done, value: actual } = await consumeFrom.next(expected); @@ -43,6 +45,7 @@ test('stream terminated with cause', async (/** @type {import('ava').Assertions} }; const makeConsumer = async () => { + await null; try { for await (const _ of consumeFrom) { t.fail();