We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
error.stack
1 parent eac4362 commit fd44e08Copy full SHA for fd44e08
lib/assert/error.js
@@ -3,7 +3,11 @@ var inspect = require('../vows/console').inspect;
3
4
require('assert').AssertionError.prototype.toString = function () {
5
var that = this,
6
+ source;
7
+
8
+ if (this.stack) {
9
source = this.stack.match(/([a-zA-Z0-9._-]+\.js)(:\d+):\d+/);
10
+ }
11
12
function parse(str) {
13
return str.replace(/{actual}/g, inspect(that.actual)).
@@ -15,7 +19,7 @@ require('assert').AssertionError.prototype.toString = function () {
15
19
16
20
if (this.message) {
17
21
return stylize(parse(this.message), 'yellow') +
18
- stylize(' // ' + source[1] + source[2], 'grey');
22
+ (source) ? stylize(' // ' + source[1] + source[2], 'grey') : '';
23
} else {
24
return stylize([
25
this.expected,
0 commit comments