Skip to content

Instantly share code, notes, and snippets.

@boutell
Created November 1, 2016 23:24
Show Gist options
  • Save boutell/8f312128d068240cc334fdd77985bce9 to your computer and use it in GitHub Desktop.
Save boutell/8f312128d068240cc334fdd77985bce9 to your computer and use it in GitHub Desktop.
// test1.js
var from = './test2.js';
try {
require(from);
} catch (e) {
console.log(e);
}
// test2.js
bad syntax o noes
// Output
[SyntaxError: Unexpected identifier]
// How do I get the line number and filename in this situation?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment