Created
October 3, 2014 06:52
-
-
Save njif/20a8b422594e08e630bc to your computer and use it in GitHub Desktop.
exception.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // handlebars/exception.js | |
| var __module5__ = (function() { | |
| "use strict"; | |
| var __exports__; | |
| var errorProps = ['description', 'fileName', 'lineNumber', 'message', 'name', 'number', 'stack']; | |
| function Exception(message, node) { | |
| var line; | |
| if (node && node.firstLine) { | |
| line = node.firstLine; | |
| message += ' - ' + line + ':' + node.firstColumn; | |
| } | |
| var tmp = Error.prototype.constructor.call(this, message); | |
| // Unfortunately errors are not enumerable in Chrome (at least), so `for prop in tmp` doesn't work. | |
| for (var idx = 0; idx < errorProps.length; idx++) { | |
| this[errorProps[idx]] = tmp[errorProps[idx]]; | |
| } | |
| if (line) { | |
| this.lineNumber = line; | |
| this.column = node.firstColumn; | |
| } | |
| } | |
| Exception.prototype = new Error(); | |
| __exports__ = Exception; | |
| return __exports__; | |
| })(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment