Skip to content

Commit 402d24e

Browse files
release v1.0.12
1 parent d98d539 commit 402d24e

File tree

10 files changed

+1088
-1047
lines changed

10 files changed

+1088
-1047
lines changed

dist/index.js

Lines changed: 938 additions & 915 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/node_modules/semver/README.md

Lines changed: 55 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/node_modules/semver/functions/diff.js

Lines changed: 3 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/node_modules/semver/index.js

Lines changed: 45 additions & 63 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/node_modules/semver/package.json

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/node_modules/semver/preload.js

Lines changed: 2 additions & 46 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/sourcemap-register.js

Lines changed: 36 additions & 9 deletions
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 = /(?:\/\/[@#][ \t]+sourceMappingURL=([^\s'"]+?)[ \t]*$)|(?:\/\*[@#][ \t]+sourceMappingURL=([^\*]+?)[ \t]*(?:\*\/)[ \t]*$)/mg;
581+
var re = /(?:\/\/[@#][\s]*sourceMappingURL=([^\s'"]+)[\s]*$)|(?:\/\*[@#][\s]*sourceMappingURL=([^\s*'"]+)[\s]*(?:\*\/)[\s]*$)/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) {
654+
if (sourceMap && sourceMap.map && typeof sourceMap.map.originalPositionFor === 'function') {
655655
var originalPosition = sourceMap.map.originalPositionFor(position);
656656

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

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

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

792797
// Fix position in Node where some (internal) code is prepended.
793798
// See https://github.com/evanw/node-source-map-support/issues/36
794-
var headerLength = 62;
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;
795804
if (line === 1 && column > headerLength && !isInBrowser() && !frame.isEval()) {
796805
column -= headerLength;
797806
}
@@ -801,9 +810,15 @@ function wrapCallSite(frame) {
801810
line: line,
802811
column: column
803812
});
813+
state.curPosition = position;
804814
frame = cloneCallSite(frame);
805815
var originalFunctionName = frame.getFunctionName;
806-
frame.getFunctionName = function() { return position.name || originalFunctionName(); };
816+
frame.getFunctionName = function() {
817+
if (state.nextPosition == null) {
818+
return originalFunctionName();
819+
}
820+
return state.nextPosition.name || originalFunctionName();
821+
};
807822
frame.getFileName = function() { return position.source; };
808823
frame.getLineNumber = function() { return position.line; };
809824
frame.getColumnNumber = function() { return position.column + 1; };
@@ -825,16 +840,25 @@ function wrapCallSite(frame) {
825840
}
826841

827842
// This function is part of the V8 stack trace API, for more info see:
828-
// http://code.google.com/p/v8/wiki/JavaScriptStackTraceApi
843+
// https://v8.dev/docs/stack-trace-api
829844
function prepareStackTrace(error, stack) {
830845
if (emptyCacheBetweenOperations) {
831846
fileContentsCache = {};
832847
sourceMapCache = {};
833848
}
834849

835-
return error + stack.map(function(frame) {
836-
return '\n at ' + wrapCallSite(frame);
837-
}).join('');
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('');
838862
}
839863

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

9991023
retrieveFileHandlers = originalRetrieveFileHandlers.slice(0);
10001024
retrieveMapHandlers = originalRetrieveMapHandlers.slice(0);
1025+
1026+
retrieveSourceMap = handlerExec(retrieveMapHandlers);
1027+
retrieveFile = handlerExec(retrieveFileHandlers);
10011028
}
10021029

10031030

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
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.11",
4+
"version": "1.0.12",
55
"keywords": [
66
"github-action",
77
"npm",

0 commit comments

Comments
 (0)