[Pkg-javascript-commits] [node-stack-utils] 34/67: Handle parens in paths

Bastien Roucariès rouca at moszumanska.debian.org
Thu Sep 7 09:53:04 UTC 2017


This is an automated email from the git hooks/post-receive script.

rouca pushed a commit to branch master
in repository node-stack-utils.

commit 6c19114b8e4bfa71de0c8bdc2163ed84e16ae5f4
Author: isaacs <i at izs.me>
Date:   Sat Jan 28 00:00:21 2017 -0800

    Handle parens in paths
    
    Fix #23
    Close #24
---
 index.js     |  4 ++--
 test/test.js | 10 ++++++++++
 2 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/index.js b/index.js
index 4a7af3d..b297e1f 100644
--- a/index.js
+++ b/index.js
@@ -212,11 +212,11 @@ var re = new RegExp(
 		// (eval at <anonymous> (file.js:1:1),
 		// $4 = eval origin
 		// $5:$6:$7 are eval file/line/col, but not normally reported
-	'(?:eval at ([^ ]+) \\(([^\\)]+):(\\d+):(\\d+)\\), )?' +
+	'(?:eval at ([^ ]+) \\((.+?):(\\d+):(\\d+)\\), )?' +
 		// file:line:col
 		// $8:$9:$10
 		// $11 = 'native' if native
-	'(?:([^\\)]+):(\\d+):(\\d+)|(native))' +
+	'(?:(.+?):(\\d+):(\\d+)|(native))' +
 		// maybe close the paren, then end
 	'\\)?$'
 );
diff --git a/test/test.js b/test/test.js
index 74ed664..b0a962d 100644
--- a/test/test.js
+++ b/test/test.js
@@ -394,6 +394,16 @@ test('parseLine: handles native errors', t => {
 	});
 });
 
+test('parseLine: handles parens', t => {
+	var line = '    at X.<anonymous> (/USER/Db (Person)/x/y.js:14:11)';
+	t.same(StackUtils.parseLine(line), {
+		line: 14,
+		column: 11,
+		file: '/USER/Db (Person)/x/y.js',
+		function: 'X.<anonymous>'
+	});
+});
+
 function linuxStack1() {
 	return [
 		'Error: foo',

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/node-stack-utils.git



More information about the Pkg-javascript-commits mailing list