Skip to content

Commit

Permalink
fixes error cutoff issue #276
Browse files Browse the repository at this point in the history
  • Loading branch information
spion committed Aug 11, 2014
1 parent 0a23d44 commit 0d2885a
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/captured_trace.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ CapturedTrace.combine = function CapturedTrace$Combine(current, prev) {
//that nobody cares about
for (var i = 0, len = lines.length; i < len; ++i) {

if ((rignore.test(lines[i]) ||
if (((rignore.test(lines[i]) && rtraceline.test(lines[i])) ||
(i > 0 && !rtraceline.test(lines[i])) &&
lines[i] !== FROM_PREVIOUS_EVENT)
) {
Expand Down
18 changes: 18 additions & 0 deletions test/mocha/github-2xx-76.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
"use strict";


var Promise = require("../../js/debug/bluebird.js");
Promise.longStackTraces();
var assert = require("assert");

describe("github276 - stack trace cleaner", function(){
specify("message with newline and a$_b should not be removed", function(done){
Promise.resolve(1).then(function() {
throw new Error("Blah\n a$_b");
}).catch(function(e) {
var msg = e.stack.split('\n')[1]
assert(msg.indexOf('a$_b') >= 0, 'message should contain a$_b');
}).done(done, done);
});
});

0 comments on commit 0d2885a

Please sign in to comment.