Permalink
Browse files

all tests pass with stack filter

  • Loading branch information...
1 parent 2118851 commit febedc00ceef6c1c0f840495d2221bd1c6d69823 @substack committed May 16, 2012
Showing with 3 additions and 2 deletions.
  1. +3 −2 index.js
View
5 index.js
@@ -115,13 +115,14 @@ Fritter.prototype.defineContext = function () {
caught.push(err);
self.emit('error', err, {
stack : self.stack.filter(function (s, ix) {
- var before = self.stack[ix - 1];
+ var before = self.stack[ix + 1];
if (!before) return true;
if (!s) return true;
var bn = self.nameOf(before);
var sn = self.nameOf(s);
- if (bn && sn && bn === sn) {
+ if (before.type === 'CallExpression'
+ && bn && sn && bn === sn) {
return false;
}
return true;

0 comments on commit febedc0

Please sign in to comment.