[Pkg-javascript-commits] [node-tap] 06/06: Use stack-utils instead of patch

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


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

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

commit 97addcad8b0d5fa046330af8302525a6c73c9669
Author: Bastien ROUCARIÈS <roucaries.bastien at gmail.com>
Date:   Thu Sep 7 11:27:28 2017 +0200

    Use stack-utils instead of patch
---
 debian/changelog                        |   1 +
 debian/control                          |   2 +
 debian/install                          |   1 -
 debian/patches/module-stack-utils.patch | 292 --------------------------------
 debian/patches/series                   |   1 -
 5 files changed, 3 insertions(+), 294 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index 3f67997..2a98209 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -3,6 +3,7 @@ node-tap (8.0.0-6) unstable; urgency=medium
   * Team upload
   * Use module node-clean-yaml-object instad of patch
   * Use node-tap-mocha-reporter instead of patch
+  * Use node-stack-utils instead of patch
 
  -- Bastien Roucariès <rouca at debian.org>  Thu, 07 Sep 2017 11:11:55 +0200
 
diff --git a/debian/control b/debian/control
index 827e77b..21c9ff9 100644
--- a/debian/control
+++ b/debian/control
@@ -21,6 +21,7 @@ Build-Depends:
  , node-escape-string-regexp <!nocheck> <!nodoc>
  , node-strip-ansi  <!nocheck> <!nodoc>
  , node-signal-exit (>= 3.0.0) <!nocheck> <!nodoc>
+ , node-stack-utils (>= 0.4) <!nocheck> <!nodoc>
  , node-tap-parser (>= 2.2.0) <!nocheck> <!nodoc>
  , node-tap-mocha-reporter (>= 2.0.0) <!nocheck> <!nodoc>
  , node-tmatch (>= 3.0.0) <!nocheck> <!nodoc>
@@ -48,6 +49,7 @@ Depends:
  , node-escape-string-regexp
  , node-strip-ansi
  , node-signal-exit (>= 3.0.0)
+ , node-stack-utils (>= 0.4)
  , node-tap-parser (>= 2.2.0)
  , node-tap-mocha-reporter (>= 2.0.0)
  , node-tmatch (>= 3.0.0)
diff --git a/debian/install b/debian/install
index 78183fd..c45c60d 100644
--- a/debian/install
+++ b/debian/install
@@ -1,5 +1,4 @@
 package.json usr/lib/nodejs/tap/
 bin/* usr/lib/nodejs/tap/bin/
 lib usr/lib/nodejs/tap/
-node_modules usr/lib/nodejs/tap/
 debian/tap usr/bin/
\ No newline at end of file
diff --git a/debian/patches/module-stack-utils.patch b/debian/patches/module-stack-utils.patch
deleted file mode 100644
index 669581f..0000000
--- a/debian/patches/module-stack-utils.patch
+++ /dev/null
@@ -1,292 +0,0 @@
-Description: bundle module stack-utils
- See copyright for more information
-Last-Update: 2016-11-11
-Forwarded: not-needed
-Author: Jérémy Lal <kapouer at melix.org>
---- /dev/null
-+++ b/node_modules/stack-utils.js
-@@ -0,0 +1,284 @@
-+module.exports = StackUtils;
-+
-+function StackUtils(opts) {
-+	if (!(this instanceof StackUtils)) {
-+		throw new Error('StackUtils constructor must be called with new');
-+	}
-+	opts = opts || {};
-+	this._cwd = (opts.cwd || process.cwd()).replace(/\\/g, '/');
-+	this._internals = opts.internals || [];
-+}
-+
-+module.exports.nodeInternals = nodeInternals;
-+
-+function nodeInternals() {
-+	return [
-+		/\(native\)$/,
-+		/\(domain.js:\d+:\d+\)$/,
-+		/\(events.js:\d+:\d+\)$/,
-+		/\(node.js:\d+:\d+\)$/,
-+		/\(timers.js:\d+:\d+\)$/,
-+		/\(module.js:\d+:\d+\)$/,
-+		/\(internal\/[\w_-]+\.js:\d+:\d+\)$/,
-+		/\s*at node\.js:\d+:\d+?$/,
-+		/\/\.node-spawn-wrap-\w+-\w+\/node:\d+:\d+\)?$/
-+	];
-+}
-+
-+StackUtils.prototype.clean = function (stack) {
-+	if (!Array.isArray(stack)) {
-+		stack = stack.split('\n');
-+	}
-+
-+	if (!(/^\s*at /.test(stack[0])) &&
-+		(/^\s*at /.test(stack[1]))) {
-+		stack = stack.slice(1);
-+	}
-+
-+	var outdent = false;
-+	var lastNonAtLine = null;
-+	var result = [];
-+
-+	stack.forEach(function (st) {
-+		st = st.replace(/\\/g, '/');
-+		var isInternal = this._internals.some(function (internal) {
-+			return internal.test(st);
-+		});
-+
-+		if (isInternal) {
-+			return null;
-+		}
-+
-+		var isAtLine = /^\s*at /.test(st);
-+
-+		if (outdent) {
-+			st = st.replace(/\s+$/, '').replace(/^(\s+)at /, '$1');
-+		} else {
-+			st = st.trim();
-+			if (isAtLine) {
-+				st = st.substring(3);
-+			}
-+		}
-+
-+		st = st.replace(this._cwd + '/', '');
-+
-+		if (st) {
-+			if (isAtLine) {
-+				if (lastNonAtLine) {
-+					result.push(lastNonAtLine);
-+					lastNonAtLine = null;
-+				}
-+				result.push(st);
-+			} else {
-+				outdent = true;
-+				lastNonAtLine = st;
-+			}
-+		}
-+	}, this);
-+
-+	stack = result.join('\n').trim();
-+
-+	if (stack) {
-+		return stack + '\n';
-+	}
-+	return '';
-+};
-+
-+StackUtils.prototype.captureString = function (limit, fn) {
-+	if (typeof limit === 'function') {
-+		fn = limit;
-+		limit = Infinity;
-+	}
-+	if (!fn) {
-+		fn = this.captureString;
-+	}
-+
-+	var limitBefore = Error.stackTraceLimit;
-+	if (limit) {
-+		Error.stackTraceLimit = limit;
-+	}
-+
-+	var obj = {};
-+
-+	Error.captureStackTrace(obj, fn);
-+	var stack = obj.stack;
-+	Error.stackTraceLimit = limitBefore;
-+
-+	return this.clean(stack);
-+};
-+
-+StackUtils.prototype.capture = function (limit, fn) {
-+	if (typeof limit === 'function') {
-+		fn = limit;
-+		limit = Infinity;
-+	}
-+	if (!fn) {
-+		fn = this.capture;
-+	}
-+	var prepBefore = Error.prepareStackTrace;
-+	var limitBefore = Error.stackTraceLimit;
-+
-+	Error.prepareStackTrace = function (obj, site) {
-+		return site;
-+	};
-+
-+	if (limit) {
-+		Error.stackTraceLimit = limit;
-+	}
-+
-+	var obj = {};
-+	Error.captureStackTrace(obj, fn);
-+	var stack = obj.stack;
-+	Error.prepareStackTrace = prepBefore;
-+	Error.stackTraceLimit = limitBefore;
-+
-+	return stack;
-+};
-+
-+StackUtils.prototype.at = function at(fn) {
-+	if (!fn) {
-+		fn = at;
-+	}
-+
-+	var site = this.capture(1, fn)[0];
-+
-+	if (!site) {
-+		return {};
-+	}
-+
-+	var res = {
-+		line: site.getLineNumber(),
-+		column: site.getColumnNumber()
-+	};
-+
-+	this._setFile(res, site.getFileName());
-+
-+	if (site.isConstructor()) {
-+		res.constructor = true;
-+	}
-+
-+	if (site.isEval()) {
-+		res.evalOrigin = site.getEvalOrigin();
-+	}
-+
-+	if (site.isNative()) {
-+		res.native = true;
-+	}
-+
-+	var typename = null;
-+	try {
-+		typename = site.getTypeName();
-+	} catch (er) {}
-+
-+	if (typename &&
-+		typename !== 'Object' &&
-+		typename !== '[object Object]') {
-+		res.type = typename;
-+	}
-+
-+	var fname = site.getFunctionName();
-+	if (fname) {
-+		res.function = fname;
-+	}
-+
-+	var meth = site.getMethodName();
-+	if (meth && fname !== meth) {
-+		res.method = meth;
-+	}
-+
-+	return res;
-+};
-+
-+StackUtils.prototype._setFile = function (result, filename) {
-+	if (filename) {
-+		filename = filename.replace(/\\/g, '/');
-+		if ((filename.indexOf(this._cwd + '/') === 0)) {
-+			filename = filename.substr(this._cwd.length + 1);
-+		}
-+		result.file = filename;
-+	}
-+};
-+
-+var re = new RegExp(
-+	'^' +
-+		// Sometimes we strip out the '    at' because it's noisy
-+	'(?:\\s*at )?' +
-+		// $1 = ctor if 'new'
-+	'(?:(new) )?' +
-+		// Object.method [as foo] (, maybe
-+		// $2 = function name
-+		// $3 = method name
-+	'(?:([^\\(\\[]*)(?: \\[as ([^\\]]+)\\])? \\()?' +
-+		// (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+)\\), )?' +
-+		// file:line:col
-+		// $8:$9:$10
-+		// $11 = 'native' if native
-+	'(?:([^\\)]+):(\\d+):(\\d+)|(native))' +
-+		// maybe close the paren, then end
-+	'\\)?$'
-+);
-+
-+StackUtils.prototype.parseLine = function parseLine(line) {
-+	var match = line && line.match(re);
-+	if (!match) {
-+		return null;
-+	}
-+
-+	var ctor = match[1] === 'new';
-+	var fname = match[2];
-+	var meth = match[3];
-+	var evalOrigin = match[4];
-+	var evalFile = match[5];
-+	var evalLine = Number(match[6]);
-+	var evalCol = Number(match[7]);
-+	var file = match[8];
-+	var lnum = match[9];
-+	var col = match[10];
-+	var native = match[11] === 'native';
-+
-+	var res = {};
-+
-+	if (lnum) {
-+		res.line = Number(lnum);
-+	}
-+
-+	if (col) {
-+		res.column = Number(col);
-+	}
-+
-+	this._setFile(res, file);
-+
-+	if (ctor) {
-+		res.constructor = true;
-+	}
-+
-+	if (evalOrigin) {
-+		res.evalOrigin = evalOrigin;
-+		res.evalLine = evalLine;
-+		res.evalColumn = evalCol;
-+		res.evalFile = evalFile && evalFile.replace(/\\/g, '/');
-+	}
-+
-+	if (native) {
-+		res.native = true;
-+	}
-+
-+	if (fname) {
-+		res.function = fname;
-+	}
-+
-+	if (meth && fname !== meth) {
-+		res.method = meth;
-+	}
-+
-+	return res;
-+};
-+
-+var bound = new StackUtils();
-+
-+Object.keys(StackUtils.prototype).forEach(function (key) {
-+	StackUtils[key] = bound[key].bind(bound);
-+});
diff --git a/debian/patches/series b/debian/patches/series
index f9b3945..6f9d4b9 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,4 +1,3 @@
-module-stack-utils.patch
 nodejs_rename.patch
 use_available_modules.patch
 tests.patch

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



More information about the Pkg-javascript-commits mailing list