Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

add save/restore of Error.stackTraceLimit to `10`

Fixes #8.
Fixes #9.

Squashed commit of the following:

commit fe6e23d
Author: Lee Cookson <leecookson@gmail.com>
Date:   Wed Jul 10 23:55:05 2013 -0400

    Undid spaces github editor removed

commit ff1c34f
Author: Lee Cookson <leecookson@gmail.com>
Date:   Wed Jul 10 23:53:36 2013 -0400

    Fixed typo

commit 5538c39
Author: Lee Cookson <leecookson@gmail.com>
Date:   Wed Jul 10 23:49:40 2013 -0400

    Add save/restore of Error.stackTraceLimit
  • Loading branch information...
commit 2be6de5d41a94f5b934019f2d8c3ea315fc7f62d 1 parent e39b2cb
@TooTallNate authored
Showing with 4 additions and 0 deletions.
  1. +4 −0 bindings.js
View
4 bindings.js
@@ -100,9 +100,12 @@ module.exports = exports = bindings
exports.getFileName = function getFileName () {
var origPST = Error.prepareStackTrace
+ , origSTL = Error.stackTraceLimit
, dummy = {}
, fileName
+ Error.stackTraceLimit = 10
+
Error.prepareStackTrace = function (e, st) {
for (var i=0, l=st.length; i<l; i++) {
fileName = st[i].getFileName()
@@ -118,6 +121,7 @@ exports.getFileName = function getFileName () {
// cleanup
Error.prepareStackTrace = origPST
+ Error.stackTraceLimit = origSTL
return fileName
}
Please sign in to comment.
Something went wrong with that request. Please try again.