[Pkg-javascript-commits] [node-source-map-support] 04/06: New upstream version 0.4.5+ds

Julien Puydt julien.puydt at laposte.net
Tue Oct 18 14:12:55 UTC 2016


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

jpuydt-guest pushed a commit to branch master
in repository node-source-map-support.

commit e48b04e11bdba492359f81a02c7e78aa077211a9
Author: Julien Puydt <julien.puydt at laposte.net>
Date:   Tue Oct 18 15:59:59 2016 +0200

    New upstream version 0.4.5+ds
---
 package.json          |  2 +-
 source-map-support.js |  4 ++++
 test.js               | 15 +++++++++++++++
 3 files changed, 20 insertions(+), 1 deletion(-)

diff --git a/package.json b/package.json
index e595ad6..53abcf4 100644
--- a/package.json
+++ b/package.json
@@ -1,7 +1,7 @@
 {
   "name": "source-map-support",
   "description": "Fixes stack traces for files with source maps",
-  "version": "0.4.4",
+  "version": "0.4.5",
   "main": "./source-map-support.js",
   "scripts": {
     "build": "node build.js",
diff --git a/source-map-support.js b/source-map-support.js
index fe21a9a..13cdf0c 100644
--- a/source-map-support.js
+++ b/source-map-support.js
@@ -270,6 +270,10 @@ function CallSiteToString() {
   var isMethodCall = !(this.isToplevel() || isConstructor);
   if (isMethodCall) {
     var typeName = this.getTypeName();
+    // Fixes shim to be backward compatable with Node v0 to v4
+    if (typeName === "[object Object]") {
+      typeName = "null";
+    }
     var methodName = this.getMethodName();
     if (functionName) {
       if (typeName && functionName.indexOf(typeName) != 0) {
diff --git a/test.js b/test.js
index 1179f5e..583dedd 100644
--- a/test.js
+++ b/test.js
@@ -259,6 +259,21 @@ it('throw with empty source map', function() {
   ]);
 });
 
+it('throw in Timeout with empty source map', function(done) {
+  compareStdout(done, createEmptySourceMap(), [
+    'require("./source-map-support").install();',
+    'setTimeout(function () {',
+    '    throw new Error("this is the error")',
+    '})'
+  ], [
+    /\/.generated.js:3$/,
+    '    throw new Error("this is the error")',
+    /^          \^$/,
+    'Error: this is the error',
+    /^    at ((null)|(Timeout))\._onTimeout \((?:.*\/)?.generated.js:3:11\)$/
+  ]);
+});
+
 it('throw with source map with gap', function() {
   compareStackTrace(createSourceMapWithGap(), [
     'throw new Error("test");'

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



More information about the Pkg-javascript-commits mailing list