diff options
author | kpdecker <kpdecker@gmail.com> | 2015-04-14 01:14:18 -0500 |
---|---|---|
committer | kpdecker <kpdecker@gmail.com> | 2015-04-14 01:14:18 -0500 |
commit | a009a97a2e88c86984137ece113b454246114377 (patch) | |
tree | 57ed58a3b05aeb05dfc62b88fb949fb71a02499f | |
parent | 54e743a09a0e7524edd9e76c029eff53a90f9cba (diff) | |
download | handlebars.js-a009a97a2e88c86984137ece113b454246114377.zip handlebars.js-a009a97a2e88c86984137ece113b454246114377.tar.gz handlebars.js-a009a97a2e88c86984137ece113b454246114377.tar.bz2 |
Use captureStackTrace for error handler
Provides more stable error stack reporting when running under v8 environments.
-rw-r--r-- | lib/handlebars/exception.js | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/handlebars/exception.js b/lib/handlebars/exception.js index 3fde1c1..053aea8 100644 --- a/lib/handlebars/exception.js +++ b/lib/handlebars/exception.js @@ -19,6 +19,10 @@ function Exception(message, node) { this[errorProps[idx]] = tmp[errorProps[idx]]; } + if (Error.captureStackTrace) { + Error.captureStackTrace(this, Exception); + } + if (loc) { this.lineNumber = line; this.column = column; |