mirror of
https://github.com/denoland/deno.git
synced 2025-07-23 05:05:08 +00:00
better error message for missing module (#3402)
This commit is contained in:
parent
bca23e6433
commit
658ec2aaf9
10 changed files with 81 additions and 47 deletions
|
@ -171,7 +171,8 @@ class SourceFile {
|
|||
|
||||
/** Cache the source file to be able to be retrieved by `moduleSpecifier` and
|
||||
* `containingFile`. */
|
||||
cache(moduleSpecifier: string, containingFile: string): void {
|
||||
cache(moduleSpecifier: string, containingFile?: string): void {
|
||||
containingFile = containingFile || "";
|
||||
let innerCache = SourceFile._specifierCache.get(containingFile);
|
||||
if (!innerCache) {
|
||||
innerCache = new Map();
|
||||
|
@ -269,7 +270,7 @@ function fetchAsset(name: string): string {
|
|||
/** Ops to Rust to resolve and fetch modules meta data. */
|
||||
function fetchSourceFiles(
|
||||
specifiers: string[],
|
||||
referrer: string
|
||||
referrer?: string
|
||||
): Promise<SourceFileJson[]> {
|
||||
util.log("compiler::fetchSourceFiles", { specifiers, referrer });
|
||||
return sendAsync(dispatch.OP_FETCH_SOURCE_FILES, {
|
||||
|
@ -286,7 +287,7 @@ function fetchSourceFiles(
|
|||
* that should be actually resolved. */
|
||||
async function processImports(
|
||||
specifiers: Array<[string, string]>,
|
||||
referrer = ""
|
||||
referrer?: string
|
||||
): Promise<SourceFileJson[]> {
|
||||
if (!specifiers.length) {
|
||||
return [];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue