Skip to content

Instantly share code, notes, and snippets.

@bcoe
Created Sep 27, 2019
Embed
What would you like to do?
example.md

if:

  let threw = true;
  try {
    module.load(filename);
    threw = false;
  } catch (err) {
    rekeySourceMap(Module._cache[filename], err);
    throw err;
  } finally {
    if (threw) {
      delete Module._cache[filename];
      if (parent !== undefined) {
        delete relativeResolveCache[relResolveCacheIdentifier];
      }
    }
  }

then

internal/modules/cjs/loader.js:717
   throw err;
   ^
{ toString: [Function: toString] }

if

  let threw = true;
 try {
   module.load(filename);
   threw = false;
 } finally {
   if (threw) {
     delete Module._cache[filename];
     if (parent !== undefined) {
       delete relativeResolveCache[relResolveCacheIdentifier];
     }
   }
 }

then

/usr/local/google/home/bencoe/oss/node/test/fixtures/throws_error7.js:1
throw {
^
{ toString: [Function: toString] }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment