Skip to content

Commit 8189925

Browse files
author
Acconut
committed
Removed slow unnecessary stack access
#439
1 parent 0aac74a commit 8189925

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/protocol/sequences/Sequence.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ function Sequence(callback) {
1212
this._ended = false;
1313

1414
// Experimental: Long stack trace support
15-
this._callSite = (new Error).stack.replace(/.+\n/, '');
15+
this._callSite = new Error;
1616
}
1717

1818
Sequence.determinePacket = function(byte) {
@@ -41,7 +41,7 @@ Sequence.prototype._addLongStackTrace = function(err) {
4141
return;
4242
}
4343

44-
err.stack += delimiter + this._callSite;
44+
err.stack += delimiter + this._callSite.stack.replace(/.+\n/, '');
4545
};
4646

4747
Sequence.prototype.end = function(err) {

0 commit comments

Comments
 (0)