◐ Shell
clean mode source ↗

module: report unfinished TLA in ambiguous modules · nodejs/node@249d82b

Original file line numberDiff line numberDiff line change

@@ -252,6 +252,18 @@ describe('Module syntax detection', { concurrency: !process.env.TEST_PARALLEL },

252252

strictEqual(signal, null);

253253

});

254254
255+

it('reports unfinished top-level `await`', async () => {

256+

const { stdout, stderr, code, signal } = await spawnPromisified(process.execPath, [

257+

'--no-warnings',

258+

fixtures.path('es-modules/tla/unresolved.js'),

259+

]);

260+
261+

strictEqual(stderr, '');

262+

strictEqual(stdout, '');

263+

strictEqual(code, 13);

264+

strictEqual(signal, null);

265+

});

266+
255267

it('permits top-level `await` above import/export syntax', async () => {

256268

const { stdout, stderr, code, signal } = await spawnPromisified(process.execPath, [

257269

'--eval',