1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-12-22 23:34:47 -05:00

Better error for 'No such asset'

This commit is contained in:
Ryan Dahl 2018-08-08 20:02:17 -04:00
parent 070c5f85da
commit 7895964ee1

View file

@ -170,7 +170,7 @@ export function resolveModule(
// Assets are compiled into the runtime javascript bundle.
const moduleId = moduleSpecifier.split("/").pop();
const assetName = moduleId.includes(".") ? moduleId : `${moduleId}.d.ts`;
util.assert(assetName in assetSourceCode);
util.assert(assetName in assetSourceCode, `No such asset "${assetName}"`);
sourceCode = assetSourceCode[assetName];
filename = ASSETS + assetName;
} else {