From 695979e6601386bbe342ad5f989aa893815d41c5 Mon Sep 17 00:00:00 2001 From: Eric Wendelin Date: Mon, 20 Feb 2012 09:59:20 -0700 Subject: [PATCH] Preventing lack of arguments from breaking IE9, as reported by @lpena --- stacktrace.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stacktrace.js b/stacktrace.js index 4d0384d..495ee8f 100644 --- a/stacktrace.js +++ b/stacktrace.js @@ -223,7 +223,7 @@ printStackTrace.implementation.prototype = { // Safari, IE, and others other: function(curr) { var ANON = '{anonymous}', fnRE = /function\s*([\w\-$]+)?\s*\(/i, stack = [], fn, args, maxStackSize = 10; - while (curr && stack.length < maxStackSize) { + while (curr && curr['arguments'] && stack.length < maxStackSize) { fn = fnRE.test(curr.toString()) ? RegExp.$1 || ANON : ANON; args = Array.prototype.slice.call(curr['arguments'] || []); stack[stack.length] = fn + '(' + this.stringifyArguments(args) + ')';