Skip to content

Commit 70d32c0

Browse files
committedMar 29, 2020
release v1.1.0
1 parent 519ace6 commit 70d32c0

File tree

5 files changed

+34
-51
lines changed

5 files changed

+34
-51
lines changed
 

‎dist/index.js

+22-12
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎dist/index.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎dist/sourcemap-register.js

+9-36
Original file line numberDiff line numberDiff line change
@@ -578,7 +578,7 @@ function retrieveSourceMapURL(source) {
578578

579579
// Get the URL of the source map
580580
fileData = retrieveFile(source);
581-
var re = /(?:\/\/[@#][\s]*sourceMappingURL=([^\s'"]+)[\s]*$)|(?:\/\*[@#][\s]*sourceMappingURL=([^\s*'"]+)[\s]*(?:\*\/)[\s]*$)/mg;
581+
var re = /(?:\/\/[@#][ \t]+sourceMappingURL=([^\s'"]+?)[ \t]*$)|(?:\/\*[@#][ \t]+sourceMappingURL=([^\*]+?)[ \t]*(?:\*\/)[ \t]*$)/mg;
582582
// Keep executing the search to find the *last* sourceMappingURL to avoid
583583
// picking up sourceMappingURLs from comments, strings, etc.
584584
var lastMatch, match;
@@ -651,7 +651,7 @@ function mapSourcePosition(position) {
651651
}
652652

653653
// Resolve the source URL relative to the URL of the source map
654-
if (sourceMap && sourceMap.map && typeof sourceMap.map.originalPositionFor === 'function') {
654+
if (sourceMap && sourceMap.map) {
655655
var originalPosition = sourceMap.map.originalPositionFor(position);
656656

657657
// Only return the original position if a matching line was found. If no
@@ -776,13 +776,8 @@ function cloneCallSite(frame) {
776776
return object;
777777
}
778778

779-
function wrapCallSite(frame, state) {
780-
// provides interface backward compatibility
781-
if (state === undefined) {
782-
state = { nextPosition: null, curPosition: null }
783-
}
779+
function wrapCallSite(frame) {
784780
if(frame.isNative()) {
785-
state.curPosition = null;
786781
return frame;
787782
}
788783

@@ -796,11 +791,7 @@ function wrapCallSite(frame, state) {
796791

797792
// Fix position in Node where some (internal) code is prepended.
798793
// See https://github.com/evanw/node-source-map-support/issues/36
799-
// Header removed in node at ^10.16 || >=11.11.0
800-
// v11 is not an LTS candidate, we can just test the one version with it.
801-
// Test node versions for: 10.16-19, 10.20+, 12-19, 20-99, 100+, or 11.11
802-
var noHeader = /^v(10\.1[6-9]|10\.[2-9][0-9]|10\.[0-9]{3,}|1[2-9]\d*|[2-9]\d|\d{3,}|11\.11)/;
803-
var headerLength = noHeader.test(process.version) ? 0 : 62;
794+
var headerLength = 62;
804795
if (line === 1 && column > headerLength && !isInBrowser() && !frame.isEval()) {
805796
column -= headerLength;
806797
}
@@ -810,15 +801,9 @@ function wrapCallSite(frame, state) {
810801
line: line,
811802
column: column
812803
});
813-
state.curPosition = position;
814804
frame = cloneCallSite(frame);
815805
var originalFunctionName = frame.getFunctionName;
816-
frame.getFunctionName = function() {
817-
if (state.nextPosition == null) {
818-
return originalFunctionName();
819-
}
820-
return state.nextPosition.name || originalFunctionName();
821-
};
806+
frame.getFunctionName = function() { return position.name || originalFunctionName(); };
822807
frame.getFileName = function() { return position.source; };
823808
frame.getLineNumber = function() { return position.line; };
824809
frame.getColumnNumber = function() { return position.column + 1; };
@@ -840,25 +825,16 @@ function wrapCallSite(frame, state) {
840825
}
841826

842827
// This function is part of the V8 stack trace API, for more info see:
843-
// https://v8.dev/docs/stack-trace-api
828+
// http://code.google.com/p/v8/wiki/JavaScriptStackTraceApi
844829
function prepareStackTrace(error, stack) {
845830
if (emptyCacheBetweenOperations) {
846831
fileContentsCache = {};
847832
sourceMapCache = {};
848833
}
849834

850-
var name = error.name || 'Error';
851-
var message = error.message || '';
852-
var errorString = name + ": " + message;
853-
854-
var state = { nextPosition: null, curPosition: null };
855-
var processedStack = [];
856-
for (var i = stack.length - 1; i >= 0; i--) {
857-
processedStack.push('\n at ' + wrapCallSite(stack[i], state));
858-
state.nextPosition = state.curPosition;
859-
}
860-
state.curPosition = state.nextPosition = null;
861-
return errorString + processedStack.reverse().join('');
835+
return error + stack.map(function(frame) {
836+
return '\n at ' + wrapCallSite(frame);
837+
}).join('');
862838
}
863839

864840
// Generate position and snippet of original source with pointer
@@ -1022,9 +998,6 @@ exports.resetRetrieveHandlers = function() {
1022998

1023999
retrieveFileHandlers = originalRetrieveFileHandlers.slice(0);
10241000
retrieveMapHandlers = originalRetrieveMapHandlers.slice(0);
1025-
1026-
retrieveSourceMap = handlerExec(retrieveMapHandlers);
1027-
retrieveFile = handlerExec(retrieveFileHandlers);
10281001
}
10291002

10301003

‎package-lock.json

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@jsdevtools/npm-publish",
33
"description": "Fast, easy publishing to NPM",
4-
"version": "1.0.13",
4+
"version": "1.1.0",
55
"keywords": [
66
"github-action",
77
"npm",

0 commit comments

Comments
 (0)
Failed to load comments.