[Pkg-javascript-commits] [node-stack-utils] 38/67: simplify callsite wrapper and documentation

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 16bd9393d64be0c382465dd18e6538e1a935dd57
Author: Ben McCurdy <bpmccurdy at gmail.com>
Date:   Tue Jan 3 20:22:06 2017 -0800

    simplify callsite wrapper and documentation
---
 index.js  | 6 ++----
 readme.md | 2 +-
 2 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/index.js b/index.js
index dcaea0b..ed4fa0b 100644
--- a/index.js
+++ b/index.js
@@ -121,10 +121,8 @@ StackUtils.prototype.capture = function (limit, fn) {
 	var wrapCallSite = this._wrapCallSite;
 
 	Error.prepareStackTrace = function (obj, site) {
-		if (typeof wrapCallSite === 'function') {
-			return site.map(function (callSite) {
-				return wrapCallSite(callSite);
-			});
+		if (wrapCallSite) {
+			return site.map(wrapCallSite);
 		}
 		return site;
 	};
diff --git a/readme.md b/readme.md
index d119c25..2223735 100644
--- a/readme.md
+++ b/readme.md
@@ -51,7 +51,7 @@ The path to the current working directory. File names in the stack trace will be
 
 Type: `function(CallSite)`
 
-A function that will wrap the CallSite processed by the `StackUtils.capture()` function. The CallSite gets passed as a parameter to this function, and the function should return a new object wrapping the CallSite. Providing a CallSite wrapper enables the use of StackUtils with a source mapping module.
+A mapping function for manipulating CallSites before processing. The first argument is a CallSite instance, and the function should return a modified CallSite. This is useful for providing source map support.
 
 
 ### StackUtils.nodeInternals()

-- 
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