substack/node-browserify — pull request #257 by parshap (2012-12-21 05:13:21+00:00)
Title: Expose filename when syntax error occurs

When a syntax error occurs the bundle object emits a `syntaxError` event with an object that includes some info such as the line number, but it does tell you which file the syntax error occurred in. The change is pretty minor and basically sets `err.file` to the filename before the event is emitted.

I am not sure if this the right approach. I saw that there is a `wrap.errors` object, but it doesn't seem that the `wrap` object is exposed through the bundle and even if it was it doesn't look like all errors are added to that `wrap.errors` object as my `bundle.ok` is `true` even after a syntax error is emitted.