Skip to content

Commit 90a476c

Browse files
mag123caduh95
authored andcommitted
esm: fix linting errors after rebase
Remove unused ArrayPrototypeSome import and fix assert usage.
1 parent e2efe89 commit 90a476c

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

lib/internal/modules/esm/module_job.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,8 @@ const findCommonJSGlobalLikeNotDefinedError = (errorMessage) =>
8080
*/
8181
const explainCommonJSGlobalLikeNotDefinedError = (e, url, hasTopLevelAwait) => {
8282
const notDefinedGlobalLike = e?.name === 'ReferenceError' && findCommonJSGlobalLikeNotDefinedError(e.message);
83-
if (notDefinedGlobalLike) {
8483

84+
if (notDefinedGlobalLike) {
8585
if (hasTopLevelAwait) {
8686
let advice;
8787
switch (notDefinedGlobalLike) {

test/es-module/test-esm-detect-ambiguous.mjs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -443,8 +443,8 @@ describe('cjs & esm ambiguous syntax case', () => {
443443
/ReferenceError: Cannot determine intended module format because both 'require' and top-level await are present\. If the code is intended to be CommonJS, wrap await in an async function\. If the code is intended to be an ES module, replace require\(\) with import\./
444444
);
445445

446-
strictEqual(code, 1);
447-
strictEqual(signal, null);
446+
assert.strictEqual(code, 1);
447+
assert.strictEqual(signal, null);
448448
});
449449

450450
it('should throw an ambiguous syntax error when using top-level await with exports', async () => {
@@ -456,7 +456,7 @@ describe('cjs & esm ambiguous syntax case', () => {
456456
]
457457
);
458458

459-
match(
459+
assert.match(
460460
stderr,
461461
/ReferenceError: Cannot determine intended module format because both 'exports' and top-level await are present\. If the code is intended to be CommonJS, wrap await in an async function\. If the code is intended to be an ES module, use export instead of module\.exports\/exports\./
462462
);
@@ -474,13 +474,13 @@ describe('cjs & esm ambiguous syntax case', () => {
474474
]
475475
);
476476

477-
match(
477+
assert.match(
478478
stderr,
479479
/ReferenceError: Cannot determine intended module format because both '__filename' and top-level await are present\. If the code is intended to be CommonJS, wrap await in an async function\. If the code is intended to be an ES module, use import\.meta\.filename instead\./
480480
);
481481

482-
strictEqual(code, 1);
483-
strictEqual(signal, null);
482+
assert.strictEqual(code, 1);
483+
assert.strictEqual(signal, null);
484484
});
485485

486486
it('should throw an ambiguous syntax error when using top-level await with __dirname', async () => {
@@ -492,7 +492,7 @@ describe('cjs & esm ambiguous syntax case', () => {
492492
]
493493
);
494494

495-
match(
495+
assert.match(
496496
stderr,
497497
/ReferenceError: Cannot determine intended module format because both '__dirname' and top-level await are present\. If the code is intended to be CommonJS, wrap await in an async function\. If the code is intended to be an ES module, use import\.meta\.dirname instead\./
498498
);

0 commit comments

Comments
 (0)