Skip to content

Instantly share code, notes, and snippets.

@bcoe
Created September 27, 2019 23:51
Show Gist options
  • Save bcoe/f9a44117a88b041788d73837efc2f8bd to your computer and use it in GitHub Desktop.
Save bcoe/f9a44117a88b041788d73837efc2f8bd to your computer and use it in GitHub Desktop.
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