Skip to content
Prev Previous commit
Next Next commit
Fail if import example cannot be extracted
  • Loading branch information
ctavan committed Jan 29, 2021
commit ae0a8ee9221d4308dda92aa0f5b1a9c04a81ea53
2 changes: 1 addition & 1 deletion lib/internal/modules/esm/module_job.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ function extractExample(file, lineNumber) {
return `\n\nimport ${defaultImport} from '${node.node.source.value}';\n` +
`const {${destructuringAssignment}} = ${defaultImport};\n`;
} while (node === undefined || node.node.loc.start.line <= lineNumber);
return '';
assert.fail('Could not find erroneous import statement');
}

/* A ModuleJob tracks the loading of a single Module, and the ModuleJobs of
Expand Down