@dcloudio/uni-stacktracey 3.0.0-4060520250512001 → 3.0.0-4070520250711001
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/uni-stacktracey.cjs.js +17 -10
- package/dist/uni-stacktracey.es.js +17 -11
- package/package.json +1 -1
|
@@ -2477,12 +2477,12 @@ function _factoryBSM(aSourceMap, aSourceMapURL) {
|
|
|
2477
2477
|
*/
|
|
2478
2478
|
var SourceMapConsumer = sourceMapConsumer.SourceMapConsumer;
|
|
2479
2479
|
|
|
2480
|
-
const splitRE = /\r?\n/;
|
|
2480
|
+
const splitRE$1 = /\r?\n/;
|
|
2481
2481
|
const range = 2;
|
|
2482
2482
|
function posToNumber(source, pos) {
|
|
2483
2483
|
if (typeof pos === 'number')
|
|
2484
2484
|
return pos;
|
|
2485
|
-
const lines = source.split(splitRE);
|
|
2485
|
+
const lines = source.split(splitRE$1);
|
|
2486
2486
|
const { line, column } = pos;
|
|
2487
2487
|
let start = 0;
|
|
2488
2488
|
for (let i = 0; i < line - 1; i++) {
|
|
@@ -2493,7 +2493,7 @@ function posToNumber(source, pos) {
|
|
|
2493
2493
|
function generateCodeFrame(source, start = 0, end) {
|
|
2494
2494
|
start = posToNumber(source, start);
|
|
2495
2495
|
end = end || start;
|
|
2496
|
-
const lines = source.split(splitRE);
|
|
2496
|
+
const lines = source.split(splitRE$1);
|
|
2497
2497
|
let count = 0;
|
|
2498
2498
|
const res = [];
|
|
2499
2499
|
for (let i = 0; i < lines.length; i++) {
|
|
@@ -2671,7 +2671,7 @@ function stacktracey(stacktrace, opts) {
|
|
|
2671
2671
|
file: source,
|
|
2672
2672
|
line: sourceLine,
|
|
2673
2673
|
column: sourceColumn,
|
|
2674
|
-
fileShort: sourcePath,
|
|
2674
|
+
fileShort: sourcePath || source,
|
|
2675
2675
|
fileRelative: source,
|
|
2676
2676
|
fileName,
|
|
2677
2677
|
thirdParty: isThirdParty(sourcePath),
|
|
@@ -2899,8 +2899,9 @@ function uniStracktraceyPreset(opts) {
|
|
|
2899
2899
|
lineOffset,
|
|
2900
2900
|
};
|
|
2901
2901
|
}
|
|
2902
|
+
const splitRE = /\r?\n/;
|
|
2902
2903
|
function utsStracktraceyPreset(opts) {
|
|
2903
|
-
const { inputRoot, outputRoot, sourceMapRoot } = opts;
|
|
2904
|
+
const { inputRoot = '', outputRoot = '', sourceMapRoot = '' } = opts;
|
|
2904
2905
|
let errStack = [];
|
|
2905
2906
|
return {
|
|
2906
2907
|
parseSourceMapUrl(file, fileName, fileRelative) {
|
|
@@ -2911,11 +2912,11 @@ function utsStracktraceyPreset(opts) {
|
|
|
2911
2912
|
return Promise.resolve(getSourceMapContent(this.parseSourceMapUrl(file, fileName, fileRelative)));
|
|
2912
2913
|
},
|
|
2913
2914
|
parseStacktrace(str) {
|
|
2914
|
-
const lines = (str || '').split(
|
|
2915
|
+
const lines = (str || '').split(splitRE);
|
|
2915
2916
|
const entries = lines
|
|
2916
2917
|
.map((line, index) => {
|
|
2917
2918
|
line = line.trim();
|
|
2918
|
-
const matches = line.match(/\s*(.+\.kt):([0-9]+):([0-9]+)
|
|
2919
|
+
const matches = line.match(/\s*(.+\.(kt|swift|ets)):([0-9]+):([0-9]+):?\s*(.*)/);
|
|
2919
2920
|
if (matches) {
|
|
2920
2921
|
errStack.push('%StacktraceyItem%');
|
|
2921
2922
|
}
|
|
@@ -2923,6 +2924,11 @@ function utsStracktraceyPreset(opts) {
|
|
|
2923
2924
|
errStack.push(line);
|
|
2924
2925
|
return;
|
|
2925
2926
|
}
|
|
2927
|
+
if (matches[2] === 'ets') {
|
|
2928
|
+
matches[1] =
|
|
2929
|
+
(matches[0].match(/File:\s+(.*):(\d+):(\d+)/) || [])[1] ||
|
|
2930
|
+
matches[1];
|
|
2931
|
+
}
|
|
2926
2932
|
const fileName = matches[1].replace(/^.*(\\|\/|\:)/, '');
|
|
2927
2933
|
return {
|
|
2928
2934
|
beforeParse: line,
|
|
@@ -2930,11 +2936,11 @@ function utsStracktraceyPreset(opts) {
|
|
|
2930
2936
|
index: false,
|
|
2931
2937
|
native: false,
|
|
2932
2938
|
file: nixSlashes(matches[1]),
|
|
2933
|
-
line: parseInt(matches[
|
|
2934
|
-
column: parseInt(matches[
|
|
2939
|
+
line: parseInt(matches[3]),
|
|
2940
|
+
column: parseInt(matches[4]),
|
|
2935
2941
|
fileName,
|
|
2936
2942
|
fileShort: line,
|
|
2937
|
-
errMsg: matches[
|
|
2943
|
+
errMsg: matches[5] || '',
|
|
2938
2944
|
calleeShort: '',
|
|
2939
2945
|
fileRelative: '',
|
|
2940
2946
|
thirdParty: false,
|
|
@@ -2970,6 +2976,7 @@ exports.generateCodeFrameSourceMapConsumer = generateCodeFrameSourceMapConsumer;
|
|
|
2970
2976
|
exports.generateCodeFrameWithKotlinStacktrace = generateCodeFrameWithKotlinStacktrace;
|
|
2971
2977
|
exports.generateCodeFrameWithSourceMapPath = generateCodeFrameWithSourceMapPath;
|
|
2972
2978
|
exports.generateCodeFrameWithSwiftStacktrace = generateCodeFrameWithSwiftStacktrace;
|
|
2979
|
+
exports.splitRE = splitRE;
|
|
2973
2980
|
exports.stacktracey = stacktracey;
|
|
2974
2981
|
exports.uniStracktraceyPreset = uniStracktraceyPreset;
|
|
2975
2982
|
exports.utsStracktraceyPreset = utsStracktraceyPreset;
|
|
@@ -2462,12 +2462,12 @@ function _factoryBSM(aSourceMap, aSourceMapURL) {
|
|
|
2462
2462
|
*/
|
|
2463
2463
|
var SourceMapConsumer = sourceMapConsumer.SourceMapConsumer;
|
|
2464
2464
|
|
|
2465
|
-
const splitRE = /\r?\n/;
|
|
2465
|
+
const splitRE$1 = /\r?\n/;
|
|
2466
2466
|
const range = 2;
|
|
2467
2467
|
function posToNumber(source, pos) {
|
|
2468
2468
|
if (typeof pos === 'number')
|
|
2469
2469
|
return pos;
|
|
2470
|
-
const lines = source.split(splitRE);
|
|
2470
|
+
const lines = source.split(splitRE$1);
|
|
2471
2471
|
const { line, column } = pos;
|
|
2472
2472
|
let start = 0;
|
|
2473
2473
|
for (let i = 0; i < line - 1; i++) {
|
|
@@ -2478,7 +2478,7 @@ function posToNumber(source, pos) {
|
|
|
2478
2478
|
function generateCodeFrame(source, start = 0, end) {
|
|
2479
2479
|
start = posToNumber(source, start);
|
|
2480
2480
|
end = end || start;
|
|
2481
|
-
const lines = source.split(splitRE);
|
|
2481
|
+
const lines = source.split(splitRE$1);
|
|
2482
2482
|
let count = 0;
|
|
2483
2483
|
const res = [];
|
|
2484
2484
|
for (let i = 0; i < lines.length; i++) {
|
|
@@ -2666,7 +2666,7 @@ function stacktracey(stacktrace, opts) {
|
|
|
2666
2666
|
file: source,
|
|
2667
2667
|
line: sourceLine,
|
|
2668
2668
|
column: sourceColumn,
|
|
2669
|
-
fileShort: sourcePath,
|
|
2669
|
+
fileShort: sourcePath || source,
|
|
2670
2670
|
fileRelative: source,
|
|
2671
2671
|
fileName,
|
|
2672
2672
|
thirdParty: isThirdParty(sourcePath),
|
|
@@ -2894,8 +2894,9 @@ function uniStracktraceyPreset(opts) {
|
|
|
2894
2894
|
lineOffset,
|
|
2895
2895
|
};
|
|
2896
2896
|
}
|
|
2897
|
+
const splitRE = /\r?\n/;
|
|
2897
2898
|
function utsStracktraceyPreset(opts) {
|
|
2898
|
-
const { inputRoot, outputRoot, sourceMapRoot } = opts;
|
|
2899
|
+
const { inputRoot = '', outputRoot = '', sourceMapRoot = '' } = opts;
|
|
2899
2900
|
let errStack = [];
|
|
2900
2901
|
return {
|
|
2901
2902
|
parseSourceMapUrl(file, fileName, fileRelative) {
|
|
@@ -2906,11 +2907,11 @@ function utsStracktraceyPreset(opts) {
|
|
|
2906
2907
|
return Promise.resolve(getSourceMapContent(this.parseSourceMapUrl(file, fileName, fileRelative)));
|
|
2907
2908
|
},
|
|
2908
2909
|
parseStacktrace(str) {
|
|
2909
|
-
const lines = (str || '').split(
|
|
2910
|
+
const lines = (str || '').split(splitRE);
|
|
2910
2911
|
const entries = lines
|
|
2911
2912
|
.map((line, index) => {
|
|
2912
2913
|
line = line.trim();
|
|
2913
|
-
const matches = line.match(/\s*(.+\.kt):([0-9]+):([0-9]+)
|
|
2914
|
+
const matches = line.match(/\s*(.+\.(kt|swift|ets)):([0-9]+):([0-9]+):?\s*(.*)/);
|
|
2914
2915
|
if (matches) {
|
|
2915
2916
|
errStack.push('%StacktraceyItem%');
|
|
2916
2917
|
}
|
|
@@ -2918,6 +2919,11 @@ function utsStracktraceyPreset(opts) {
|
|
|
2918
2919
|
errStack.push(line);
|
|
2919
2920
|
return;
|
|
2920
2921
|
}
|
|
2922
|
+
if (matches[2] === 'ets') {
|
|
2923
|
+
matches[1] =
|
|
2924
|
+
(matches[0].match(/File:\s+(.*):(\d+):(\d+)/) || [])[1] ||
|
|
2925
|
+
matches[1];
|
|
2926
|
+
}
|
|
2921
2927
|
const fileName = matches[1].replace(/^.*(\\|\/|\:)/, '');
|
|
2922
2928
|
return {
|
|
2923
2929
|
beforeParse: line,
|
|
@@ -2925,11 +2931,11 @@ function utsStracktraceyPreset(opts) {
|
|
|
2925
2931
|
index: false,
|
|
2926
2932
|
native: false,
|
|
2927
2933
|
file: nixSlashes(matches[1]),
|
|
2928
|
-
line: parseInt(matches[
|
|
2929
|
-
column: parseInt(matches[
|
|
2934
|
+
line: parseInt(matches[3]),
|
|
2935
|
+
column: parseInt(matches[4]),
|
|
2930
2936
|
fileName,
|
|
2931
2937
|
fileShort: line,
|
|
2932
|
-
errMsg: matches[
|
|
2938
|
+
errMsg: matches[5] || '',
|
|
2933
2939
|
calleeShort: '',
|
|
2934
2940
|
fileRelative: '',
|
|
2935
2941
|
thirdParty: false,
|
|
@@ -2959,4 +2965,4 @@ ${_stack.errMsg}`;
|
|
|
2959
2965
|
};
|
|
2960
2966
|
}
|
|
2961
2967
|
|
|
2962
|
-
export { SourceMapConsumer, generateCodeFrame, generateCodeFrameSourceMapConsumer, generateCodeFrameWithKotlinStacktrace, generateCodeFrameWithSourceMapPath, generateCodeFrameWithSwiftStacktrace, stacktracey, uniStracktraceyPreset, utsStracktraceyPreset };
|
|
2968
|
+
export { SourceMapConsumer, generateCodeFrame, generateCodeFrameSourceMapConsumer, generateCodeFrameWithKotlinStacktrace, generateCodeFrameWithSourceMapPath, generateCodeFrameWithSwiftStacktrace, splitRE, stacktracey, uniStracktraceyPreset, utsStracktraceyPreset };
|
package/package.json
CHANGED