@noma.to/qwik-testing-library 1.3.0 → 1.3.2
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/README.md +12 -2
- package/lib/index.qwik.cjs +0 -4
- package/lib/index.qwik.mjs +0 -4
- package/lib/lib/qwik-testing-library.qwik.cjs +1 -5
- package/lib/lib/qwik-testing-library.qwik.mjs +2 -6
- package/lib/lib/qwikloader.qwik.cjs +1 -1
- package/lib/lib/qwikloader.qwik.mjs +1 -1
- package/lib-types/lib/qwik-testing-library.d.ts +1 -2
- package/package.json +9 -9
- package/lib/lib/mock.qwik.cjs +0 -14
- package/lib/lib/mock.qwik.mjs +0 -14
- package/lib/node_modules/.pnpm/@jridgewell_sourcemap-codec@1.5.0/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.qwik.cjs +0 -89
- package/lib/node_modules/.pnpm/@jridgewell_sourcemap-codec@1.5.0/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.qwik.mjs +0 -89
- package/lib/node_modules/.pnpm/@vitest_expect@2.1.8/node_modules/@vitest/expect/dist/index.qwik.cjs +0 -2051
- package/lib/node_modules/.pnpm/@vitest_expect@2.1.8/node_modules/@vitest/expect/dist/index.qwik.mjs +0 -2051
- package/lib/node_modules/.pnpm/@vitest_pretty-format@2.1.8/node_modules/@vitest/pretty-format/dist/index.qwik.cjs +0 -1208
- package/lib/node_modules/.pnpm/@vitest_pretty-format@2.1.8/node_modules/@vitest/pretty-format/dist/index.qwik.mjs +0 -1208
- package/lib/node_modules/.pnpm/@vitest_runner@2.1.8/node_modules/@vitest/runner/dist/chunk-tasks.qwik.cjs +0 -44
- package/lib/node_modules/.pnpm/@vitest_runner@2.1.8/node_modules/@vitest/runner/dist/chunk-tasks.qwik.mjs +0 -44
- package/lib/node_modules/.pnpm/@vitest_runner@2.1.8/node_modules/@vitest/runner/dist/index.qwik.cjs +0 -671
- package/lib/node_modules/.pnpm/@vitest_runner@2.1.8/node_modules/@vitest/runner/dist/index.qwik.mjs +0 -671
- package/lib/node_modules/.pnpm/@vitest_snapshot@2.1.8/node_modules/@vitest/snapshot/dist/index.qwik.cjs +0 -2044
- package/lib/node_modules/.pnpm/@vitest_snapshot@2.1.8/node_modules/@vitest/snapshot/dist/index.qwik.mjs +0 -2044
- package/lib/node_modules/.pnpm/@vitest_spy@2.1.8/node_modules/@vitest/spy/dist/index.qwik.cjs +0 -148
- package/lib/node_modules/.pnpm/@vitest_spy@2.1.8/node_modules/@vitest/spy/dist/index.qwik.mjs +0 -148
- package/lib/node_modules/.pnpm/@vitest_utils@2.1.8/node_modules/@vitest/utils/dist/chunk-_commonjsHelpers.qwik.cjs +0 -162
- package/lib/node_modules/.pnpm/@vitest_utils@2.1.8/node_modules/@vitest/utils/dist/chunk-_commonjsHelpers.qwik.mjs +0 -162
- package/lib/node_modules/.pnpm/@vitest_utils@2.1.8/node_modules/@vitest/utils/dist/diff.qwik.cjs +0 -1739
- package/lib/node_modules/.pnpm/@vitest_utils@2.1.8/node_modules/@vitest/utils/dist/diff.qwik.mjs +0 -1739
- package/lib/node_modules/.pnpm/@vitest_utils@2.1.8/node_modules/@vitest/utils/dist/error.qwik.cjs +0 -137
- package/lib/node_modules/.pnpm/@vitest_utils@2.1.8/node_modules/@vitest/utils/dist/error.qwik.mjs +0 -137
- package/lib/node_modules/.pnpm/@vitest_utils@2.1.8/node_modules/@vitest/utils/dist/helpers.qwik.cjs +0 -150
- package/lib/node_modules/.pnpm/@vitest_utils@2.1.8/node_modules/@vitest/utils/dist/helpers.qwik.mjs +0 -150
- package/lib/node_modules/.pnpm/@vitest_utils@2.1.8/node_modules/@vitest/utils/dist/index.qwik.cjs +0 -472
- package/lib/node_modules/.pnpm/@vitest_utils@2.1.8/node_modules/@vitest/utils/dist/index.qwik.mjs +0 -472
- package/lib/node_modules/.pnpm/@vitest_utils@2.1.8/node_modules/@vitest/utils/dist/source-map.qwik.cjs +0 -216
- package/lib/node_modules/.pnpm/@vitest_utils@2.1.8/node_modules/@vitest/utils/dist/source-map.qwik.mjs +0 -216
- package/lib/node_modules/.pnpm/chai@5.1.2/node_modules/chai/chai.qwik.cjs +0 -3937
- package/lib/node_modules/.pnpm/chai@5.1.2/node_modules/chai/chai.qwik.mjs +0 -3937
- package/lib/node_modules/.pnpm/loupe@3.1.2/node_modules/loupe/lib/arguments.qwik.cjs +0 -9
- package/lib/node_modules/.pnpm/loupe@3.1.2/node_modules/loupe/lib/arguments.qwik.mjs +0 -10
- package/lib/node_modules/.pnpm/loupe@3.1.2/node_modules/loupe/lib/array.qwik.cjs +0 -16
- package/lib/node_modules/.pnpm/loupe@3.1.2/node_modules/loupe/lib/array.qwik.mjs +0 -17
- package/lib/node_modules/.pnpm/loupe@3.1.2/node_modules/loupe/lib/bigint.qwik.cjs +0 -9
- package/lib/node_modules/.pnpm/loupe@3.1.2/node_modules/loupe/lib/bigint.qwik.mjs +0 -10
- package/lib/node_modules/.pnpm/loupe@3.1.2/node_modules/loupe/lib/class.qwik.cjs +0 -16
- package/lib/node_modules/.pnpm/loupe@3.1.2/node_modules/loupe/lib/class.qwik.mjs +0 -17
- package/lib/node_modules/.pnpm/loupe@3.1.2/node_modules/loupe/lib/date.qwik.cjs +0 -12
- package/lib/node_modules/.pnpm/loupe@3.1.2/node_modules/loupe/lib/date.qwik.mjs +0 -13
- package/lib/node_modules/.pnpm/loupe@3.1.2/node_modules/loupe/lib/error.qwik.cjs +0 -36
- package/lib/node_modules/.pnpm/loupe@3.1.2/node_modules/loupe/lib/error.qwik.mjs +0 -37
- package/lib/node_modules/.pnpm/loupe@3.1.2/node_modules/loupe/lib/function.qwik.cjs +0 -11
- package/lib/node_modules/.pnpm/loupe@3.1.2/node_modules/loupe/lib/function.qwik.mjs +0 -12
- package/lib/node_modules/.pnpm/loupe@3.1.2/node_modules/loupe/lib/helpers.qwik.cjs +0 -160
- package/lib/node_modules/.pnpm/loupe@3.1.2/node_modules/loupe/lib/helpers.qwik.mjs +0 -160
- package/lib/node_modules/.pnpm/loupe@3.1.2/node_modules/loupe/lib/html.qwik.cjs +0 -36
- package/lib/node_modules/.pnpm/loupe@3.1.2/node_modules/loupe/lib/html.qwik.mjs +0 -36
- package/lib/node_modules/.pnpm/loupe@3.1.2/node_modules/loupe/lib/index.qwik.cjs +0 -130
- package/lib/node_modules/.pnpm/loupe@3.1.2/node_modules/loupe/lib/index.qwik.mjs +0 -130
- package/lib/node_modules/.pnpm/loupe@3.1.2/node_modules/loupe/lib/map.qwik.cjs +0 -25
- package/lib/node_modules/.pnpm/loupe@3.1.2/node_modules/loupe/lib/map.qwik.mjs +0 -26
- package/lib/node_modules/.pnpm/loupe@3.1.2/node_modules/loupe/lib/number.qwik.cjs +0 -19
- package/lib/node_modules/.pnpm/loupe@3.1.2/node_modules/loupe/lib/number.qwik.mjs +0 -20
- package/lib/node_modules/.pnpm/loupe@3.1.2/node_modules/loupe/lib/object.qwik.cjs +0 -24
- package/lib/node_modules/.pnpm/loupe@3.1.2/node_modules/loupe/lib/object.qwik.mjs +0 -25
- package/lib/node_modules/.pnpm/loupe@3.1.2/node_modules/loupe/lib/promise.qwik.cjs +0 -17
- package/lib/node_modules/.pnpm/loupe@3.1.2/node_modules/loupe/lib/promise.qwik.mjs +0 -18
- package/lib/node_modules/.pnpm/loupe@3.1.2/node_modules/loupe/lib/regexp.qwik.cjs +0 -9
- package/lib/node_modules/.pnpm/loupe@3.1.2/node_modules/loupe/lib/regexp.qwik.mjs +0 -10
- package/lib/node_modules/.pnpm/loupe@3.1.2/node_modules/loupe/lib/set.qwik.cjs +0 -16
- package/lib/node_modules/.pnpm/loupe@3.1.2/node_modules/loupe/lib/set.qwik.mjs +0 -17
- package/lib/node_modules/.pnpm/loupe@3.1.2/node_modules/loupe/lib/string.qwik.cjs +0 -23
- package/lib/node_modules/.pnpm/loupe@3.1.2/node_modules/loupe/lib/string.qwik.mjs +0 -24
- package/lib/node_modules/.pnpm/loupe@3.1.2/node_modules/loupe/lib/symbol.qwik.cjs +0 -8
- package/lib/node_modules/.pnpm/loupe@3.1.2/node_modules/loupe/lib/symbol.qwik.mjs +0 -9
- package/lib/node_modules/.pnpm/loupe@3.1.2/node_modules/loupe/lib/typedarray.qwik.cjs +0 -34
- package/lib/node_modules/.pnpm/loupe@3.1.2/node_modules/loupe/lib/typedarray.qwik.mjs +0 -35
- package/lib/node_modules/.pnpm/magic-string@0.30.17/node_modules/magic-string/dist/magic-string.es.qwik.cjs +0 -979
- package/lib/node_modules/.pnpm/magic-string@0.30.17/node_modules/magic-string/dist/magic-string.es.qwik.mjs +0 -979
- package/lib/node_modules/.pnpm/pathe@1.1.2/node_modules/pathe/dist/shared/pathe.ff20891b.qwik.cjs +0 -101
- package/lib/node_modules/.pnpm/pathe@1.1.2/node_modules/pathe/dist/shared/pathe.ff20891b.qwik.mjs +0 -101
- package/lib/node_modules/.pnpm/tinyrainbow@1.2.0/node_modules/tinyrainbow/dist/browser.qwik.cjs +0 -7
- package/lib/node_modules/.pnpm/tinyrainbow@1.2.0/node_modules/tinyrainbow/dist/browser.qwik.mjs +0 -8
- package/lib/node_modules/.pnpm/tinyrainbow@1.2.0/node_modules/tinyrainbow/dist/chunk-BVHSVHOK.qwik.cjs +0 -80
- package/lib/node_modules/.pnpm/tinyrainbow@1.2.0/node_modules/tinyrainbow/dist/chunk-BVHSVHOK.qwik.mjs +0 -80
- package/lib/node_modules/.pnpm/tinyspy@3.0.2/node_modules/tinyspy/dist/index.qwik.cjs +0 -104
- package/lib/node_modules/.pnpm/tinyspy@3.0.2/node_modules/tinyspy/dist/index.qwik.mjs +0 -104
- package/lib/node_modules/.pnpm/vitest@2.1.8_@types_node@22.10.3_@vitest_ui@2.1.8_jsdom@26.0.0/node_modules/vitest/dist/chunks/_commonjsHelpers.BFTU3MAI.qwik.cjs +0 -8
- package/lib/node_modules/.pnpm/vitest@2.1.8_@types_node@22.10.3_@vitest_ui@2.1.8_jsdom@26.0.0/node_modules/vitest/dist/chunks/_commonjsHelpers.BFTU3MAI.qwik.mjs +0 -8
- package/lib/node_modules/.pnpm/vitest@2.1.8_@types_node@22.10.3_@vitest_ui@2.1.8_jsdom@26.0.0/node_modules/vitest/dist/chunks/date.W2xKR2qe.qwik.cjs +0 -56
- package/lib/node_modules/.pnpm/vitest@2.1.8_@types_node@22.10.3_@vitest_ui@2.1.8_jsdom@26.0.0/node_modules/vitest/dist/chunks/date.W2xKR2qe.qwik.mjs +0 -56
- package/lib/node_modules/.pnpm/vitest@2.1.8_@types_node@22.10.3_@vitest_ui@2.1.8_jsdom@26.0.0/node_modules/vitest/dist/chunks/utils.C8RiOc4B.qwik.cjs +0 -66
- package/lib/node_modules/.pnpm/vitest@2.1.8_@types_node@22.10.3_@vitest_ui@2.1.8_jsdom@26.0.0/node_modules/vitest/dist/chunks/utils.C8RiOc4B.qwik.mjs +0 -66
- package/lib/node_modules/.pnpm/vitest@2.1.8_@types_node@22.10.3_@vitest_ui@2.1.8_jsdom@26.0.0/node_modules/vitest/dist/chunks/vi.DgezovHB.qwik.cjs +0 -2749
- package/lib/node_modules/.pnpm/vitest@2.1.8_@types_node@22.10.3_@vitest_ui@2.1.8_jsdom@26.0.0/node_modules/vitest/dist/chunks/vi.DgezovHB.qwik.mjs +0 -2749
- package/lib-types/lib/mock.d.ts +0 -34
package/lib/node_modules/.pnpm/@vitest_utils@2.1.8/node_modules/@vitest/utils/dist/index.qwik.mjs
DELETED
|
@@ -1,472 +0,0 @@
|
|
|
1
|
-
import "../../../../../tinyrainbow@1.2.0/node_modules/tinyrainbow/dist/browser.qwik.mjs";
|
|
2
|
-
import "../../../../../loupe@3.1.2/node_modules/loupe/lib/index.qwik.mjs";
|
|
3
|
-
var jsTokens_1;
|
|
4
|
-
var hasRequiredJsTokens;
|
|
5
|
-
function requireJsTokens() {
|
|
6
|
-
if (hasRequiredJsTokens) return jsTokens_1;
|
|
7
|
-
hasRequiredJsTokens = 1;
|
|
8
|
-
var Identifier, JSXIdentifier, JSXPunctuator, JSXString, JSXText, KeywordsWithExpressionAfter, KeywordsWithNoLineTerminatorAfter, LineTerminatorSequence, MultiLineComment, Newline, NumericLiteral, Punctuator, RegularExpressionLiteral, SingleLineComment, StringLiteral, Template, TokensNotPrecedingObjectLiteral, TokensPrecedingExpression, WhiteSpace;
|
|
9
|
-
RegularExpressionLiteral = /\/(?![*\/])(?:\[(?:(?![\]\\]).|\\.)*\]|(?![\/\\]).|\\.)*(\/[$_\u200C\u200D\p{ID_Continue}]*|\\)?/yu;
|
|
10
|
-
Punctuator = /--|\+\+|=>|\.{3}|\??\.(?!\d)|(?:&&|\|\||\?\?|[+\-%&|^]|\*{1,2}|<{1,2}|>{1,3}|!=?|={1,2}|\/(?![\/*]))=?|[?~,:;[\](){}]/y;
|
|
11
|
-
Identifier = /(\x23?)(?=[$_\p{ID_Start}\\])(?:[$_\u200C\u200D\p{ID_Continue}]|\\u[\da-fA-F]{4}|\\u\{[\da-fA-F]+\})+/yu;
|
|
12
|
-
StringLiteral = /(['"])(?:(?!\1)[^\\\n\r]|\\(?:\r\n|[^]))*(\1)?/y;
|
|
13
|
-
NumericLiteral = /(?:0[xX][\da-fA-F](?:_?[\da-fA-F])*|0[oO][0-7](?:_?[0-7])*|0[bB][01](?:_?[01])*)n?|0n|[1-9](?:_?\d)*n|(?:(?:0(?!\d)|0\d*[89]\d*|[1-9](?:_?\d)*)(?:\.(?:\d(?:_?\d)*)?)?|\.\d(?:_?\d)*)(?:[eE][+-]?\d(?:_?\d)*)?|0[0-7]+/y;
|
|
14
|
-
Template = /[`}](?:[^`\\$]|\\[^]|\$(?!\{))*(`|\$\{)?/y;
|
|
15
|
-
WhiteSpace = /[\t\v\f\ufeff\p{Zs}]+/yu;
|
|
16
|
-
LineTerminatorSequence = /\r?\n|[\r\u2028\u2029]/y;
|
|
17
|
-
MultiLineComment = /\/\*(?:[^*]|\*(?!\/))*(\*\/)?/y;
|
|
18
|
-
SingleLineComment = /\/\/.*/y;
|
|
19
|
-
JSXPunctuator = /[<>.:={}]|\/(?![\/*])/y;
|
|
20
|
-
JSXIdentifier = /[$_\p{ID_Start}][$_\u200C\u200D\p{ID_Continue}-]*/yu;
|
|
21
|
-
JSXString = /(['"])(?:(?!\1)[^])*(\1)?/y;
|
|
22
|
-
JSXText = /[^<>{}]+/y;
|
|
23
|
-
TokensPrecedingExpression = /^(?:[\/+-]|\.{3}|\?(?:InterpolationIn(?:JSX|Template)|NoLineTerminatorHere|NonExpressionParenEnd|UnaryIncDec))?$|[{}([,;<>=*%&|^!~?:]$/;
|
|
24
|
-
TokensNotPrecedingObjectLiteral = /^(?:=>|[;\]){}]|else|\?(?:NoLineTerminatorHere|NonExpressionParenEnd))?$/;
|
|
25
|
-
KeywordsWithExpressionAfter = /^(?:await|case|default|delete|do|else|instanceof|new|return|throw|typeof|void|yield)$/;
|
|
26
|
-
KeywordsWithNoLineTerminatorAfter = /^(?:return|throw|yield)$/;
|
|
27
|
-
Newline = RegExp(LineTerminatorSequence.source);
|
|
28
|
-
jsTokens_1 = function* (input, { jsx = false } = {}) {
|
|
29
|
-
var braces, firstCodePoint, isExpression, lastIndex, lastSignificantToken, length, match, mode, nextLastIndex, nextLastSignificantToken, parenNesting, postfixIncDec, punctuator, stack;
|
|
30
|
-
({ length } = input);
|
|
31
|
-
lastIndex = 0;
|
|
32
|
-
lastSignificantToken = "";
|
|
33
|
-
stack = [
|
|
34
|
-
{ tag: "JS" }
|
|
35
|
-
];
|
|
36
|
-
braces = [];
|
|
37
|
-
parenNesting = 0;
|
|
38
|
-
postfixIncDec = false;
|
|
39
|
-
while (lastIndex < length) {
|
|
40
|
-
mode = stack[stack.length - 1];
|
|
41
|
-
switch (mode.tag) {
|
|
42
|
-
case "JS":
|
|
43
|
-
case "JSNonExpressionParen":
|
|
44
|
-
case "InterpolationInTemplate":
|
|
45
|
-
case "InterpolationInJSX":
|
|
46
|
-
if (input[lastIndex] === "/" && (TokensPrecedingExpression.test(lastSignificantToken) || KeywordsWithExpressionAfter.test(lastSignificantToken))) {
|
|
47
|
-
RegularExpressionLiteral.lastIndex = lastIndex;
|
|
48
|
-
if (match = RegularExpressionLiteral.exec(input)) {
|
|
49
|
-
lastIndex = RegularExpressionLiteral.lastIndex;
|
|
50
|
-
lastSignificantToken = match[0];
|
|
51
|
-
postfixIncDec = true;
|
|
52
|
-
yield {
|
|
53
|
-
type: "RegularExpressionLiteral",
|
|
54
|
-
value: match[0],
|
|
55
|
-
closed: match[1] !== void 0 && match[1] !== "\\"
|
|
56
|
-
};
|
|
57
|
-
continue;
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
Punctuator.lastIndex = lastIndex;
|
|
61
|
-
if (match = Punctuator.exec(input)) {
|
|
62
|
-
punctuator = match[0];
|
|
63
|
-
nextLastIndex = Punctuator.lastIndex;
|
|
64
|
-
nextLastSignificantToken = punctuator;
|
|
65
|
-
switch (punctuator) {
|
|
66
|
-
case "(":
|
|
67
|
-
if (lastSignificantToken === "?NonExpressionParenKeyword") {
|
|
68
|
-
stack.push({
|
|
69
|
-
tag: "JSNonExpressionParen",
|
|
70
|
-
nesting: parenNesting
|
|
71
|
-
});
|
|
72
|
-
}
|
|
73
|
-
parenNesting++;
|
|
74
|
-
postfixIncDec = false;
|
|
75
|
-
break;
|
|
76
|
-
case ")":
|
|
77
|
-
parenNesting--;
|
|
78
|
-
postfixIncDec = true;
|
|
79
|
-
if (mode.tag === "JSNonExpressionParen" && parenNesting === mode.nesting) {
|
|
80
|
-
stack.pop();
|
|
81
|
-
nextLastSignificantToken = "?NonExpressionParenEnd";
|
|
82
|
-
postfixIncDec = false;
|
|
83
|
-
}
|
|
84
|
-
break;
|
|
85
|
-
case "{":
|
|
86
|
-
Punctuator.lastIndex = 0;
|
|
87
|
-
isExpression = !TokensNotPrecedingObjectLiteral.test(lastSignificantToken) && (TokensPrecedingExpression.test(lastSignificantToken) || KeywordsWithExpressionAfter.test(lastSignificantToken));
|
|
88
|
-
braces.push(isExpression);
|
|
89
|
-
postfixIncDec = false;
|
|
90
|
-
break;
|
|
91
|
-
case "}":
|
|
92
|
-
switch (mode.tag) {
|
|
93
|
-
case "InterpolationInTemplate":
|
|
94
|
-
if (braces.length === mode.nesting) {
|
|
95
|
-
Template.lastIndex = lastIndex;
|
|
96
|
-
match = Template.exec(input);
|
|
97
|
-
lastIndex = Template.lastIndex;
|
|
98
|
-
lastSignificantToken = match[0];
|
|
99
|
-
if (match[1] === "${") {
|
|
100
|
-
lastSignificantToken = "?InterpolationInTemplate";
|
|
101
|
-
postfixIncDec = false;
|
|
102
|
-
yield {
|
|
103
|
-
type: "TemplateMiddle",
|
|
104
|
-
value: match[0]
|
|
105
|
-
};
|
|
106
|
-
} else {
|
|
107
|
-
stack.pop();
|
|
108
|
-
postfixIncDec = true;
|
|
109
|
-
yield {
|
|
110
|
-
type: "TemplateTail",
|
|
111
|
-
value: match[0],
|
|
112
|
-
closed: match[1] === "`"
|
|
113
|
-
};
|
|
114
|
-
}
|
|
115
|
-
continue;
|
|
116
|
-
}
|
|
117
|
-
break;
|
|
118
|
-
case "InterpolationInJSX":
|
|
119
|
-
if (braces.length === mode.nesting) {
|
|
120
|
-
stack.pop();
|
|
121
|
-
lastIndex += 1;
|
|
122
|
-
lastSignificantToken = "}";
|
|
123
|
-
yield {
|
|
124
|
-
type: "JSXPunctuator",
|
|
125
|
-
value: "}"
|
|
126
|
-
};
|
|
127
|
-
continue;
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
postfixIncDec = braces.pop();
|
|
131
|
-
nextLastSignificantToken = postfixIncDec ? "?ExpressionBraceEnd" : "}";
|
|
132
|
-
break;
|
|
133
|
-
case "]":
|
|
134
|
-
postfixIncDec = true;
|
|
135
|
-
break;
|
|
136
|
-
case "++":
|
|
137
|
-
case "--":
|
|
138
|
-
nextLastSignificantToken = postfixIncDec ? "?PostfixIncDec" : "?UnaryIncDec";
|
|
139
|
-
break;
|
|
140
|
-
case "<":
|
|
141
|
-
if (jsx && (TokensPrecedingExpression.test(lastSignificantToken) || KeywordsWithExpressionAfter.test(lastSignificantToken))) {
|
|
142
|
-
stack.push({ tag: "JSXTag" });
|
|
143
|
-
lastIndex += 1;
|
|
144
|
-
lastSignificantToken = "<";
|
|
145
|
-
yield {
|
|
146
|
-
type: "JSXPunctuator",
|
|
147
|
-
value: punctuator
|
|
148
|
-
};
|
|
149
|
-
continue;
|
|
150
|
-
}
|
|
151
|
-
postfixIncDec = false;
|
|
152
|
-
break;
|
|
153
|
-
default:
|
|
154
|
-
postfixIncDec = false;
|
|
155
|
-
}
|
|
156
|
-
lastIndex = nextLastIndex;
|
|
157
|
-
lastSignificantToken = nextLastSignificantToken;
|
|
158
|
-
yield {
|
|
159
|
-
type: "Punctuator",
|
|
160
|
-
value: punctuator
|
|
161
|
-
};
|
|
162
|
-
continue;
|
|
163
|
-
}
|
|
164
|
-
Identifier.lastIndex = lastIndex;
|
|
165
|
-
if (match = Identifier.exec(input)) {
|
|
166
|
-
lastIndex = Identifier.lastIndex;
|
|
167
|
-
nextLastSignificantToken = match[0];
|
|
168
|
-
switch (match[0]) {
|
|
169
|
-
case "for":
|
|
170
|
-
case "if":
|
|
171
|
-
case "while":
|
|
172
|
-
case "with":
|
|
173
|
-
if (lastSignificantToken !== "." && lastSignificantToken !== "?.") {
|
|
174
|
-
nextLastSignificantToken = "?NonExpressionParenKeyword";
|
|
175
|
-
}
|
|
176
|
-
}
|
|
177
|
-
lastSignificantToken = nextLastSignificantToken;
|
|
178
|
-
postfixIncDec = !KeywordsWithExpressionAfter.test(match[0]);
|
|
179
|
-
yield {
|
|
180
|
-
type: match[1] === "#" ? "PrivateIdentifier" : "IdentifierName",
|
|
181
|
-
value: match[0]
|
|
182
|
-
};
|
|
183
|
-
continue;
|
|
184
|
-
}
|
|
185
|
-
StringLiteral.lastIndex = lastIndex;
|
|
186
|
-
if (match = StringLiteral.exec(input)) {
|
|
187
|
-
lastIndex = StringLiteral.lastIndex;
|
|
188
|
-
lastSignificantToken = match[0];
|
|
189
|
-
postfixIncDec = true;
|
|
190
|
-
yield {
|
|
191
|
-
type: "StringLiteral",
|
|
192
|
-
value: match[0],
|
|
193
|
-
closed: match[2] !== void 0
|
|
194
|
-
};
|
|
195
|
-
continue;
|
|
196
|
-
}
|
|
197
|
-
NumericLiteral.lastIndex = lastIndex;
|
|
198
|
-
if (match = NumericLiteral.exec(input)) {
|
|
199
|
-
lastIndex = NumericLiteral.lastIndex;
|
|
200
|
-
lastSignificantToken = match[0];
|
|
201
|
-
postfixIncDec = true;
|
|
202
|
-
yield {
|
|
203
|
-
type: "NumericLiteral",
|
|
204
|
-
value: match[0]
|
|
205
|
-
};
|
|
206
|
-
continue;
|
|
207
|
-
}
|
|
208
|
-
Template.lastIndex = lastIndex;
|
|
209
|
-
if (match = Template.exec(input)) {
|
|
210
|
-
lastIndex = Template.lastIndex;
|
|
211
|
-
lastSignificantToken = match[0];
|
|
212
|
-
if (match[1] === "${") {
|
|
213
|
-
lastSignificantToken = "?InterpolationInTemplate";
|
|
214
|
-
stack.push({
|
|
215
|
-
tag: "InterpolationInTemplate",
|
|
216
|
-
nesting: braces.length
|
|
217
|
-
});
|
|
218
|
-
postfixIncDec = false;
|
|
219
|
-
yield {
|
|
220
|
-
type: "TemplateHead",
|
|
221
|
-
value: match[0]
|
|
222
|
-
};
|
|
223
|
-
} else {
|
|
224
|
-
postfixIncDec = true;
|
|
225
|
-
yield {
|
|
226
|
-
type: "NoSubstitutionTemplate",
|
|
227
|
-
value: match[0],
|
|
228
|
-
closed: match[1] === "`"
|
|
229
|
-
};
|
|
230
|
-
}
|
|
231
|
-
continue;
|
|
232
|
-
}
|
|
233
|
-
break;
|
|
234
|
-
case "JSXTag":
|
|
235
|
-
case "JSXTagEnd":
|
|
236
|
-
JSXPunctuator.lastIndex = lastIndex;
|
|
237
|
-
if (match = JSXPunctuator.exec(input)) {
|
|
238
|
-
lastIndex = JSXPunctuator.lastIndex;
|
|
239
|
-
nextLastSignificantToken = match[0];
|
|
240
|
-
switch (match[0]) {
|
|
241
|
-
case "<":
|
|
242
|
-
stack.push({ tag: "JSXTag" });
|
|
243
|
-
break;
|
|
244
|
-
case ">":
|
|
245
|
-
stack.pop();
|
|
246
|
-
if (lastSignificantToken === "/" || mode.tag === "JSXTagEnd") {
|
|
247
|
-
nextLastSignificantToken = "?JSX";
|
|
248
|
-
postfixIncDec = true;
|
|
249
|
-
} else {
|
|
250
|
-
stack.push({ tag: "JSXChildren" });
|
|
251
|
-
}
|
|
252
|
-
break;
|
|
253
|
-
case "{":
|
|
254
|
-
stack.push({
|
|
255
|
-
tag: "InterpolationInJSX",
|
|
256
|
-
nesting: braces.length
|
|
257
|
-
});
|
|
258
|
-
nextLastSignificantToken = "?InterpolationInJSX";
|
|
259
|
-
postfixIncDec = false;
|
|
260
|
-
break;
|
|
261
|
-
case "/":
|
|
262
|
-
if (lastSignificantToken === "<") {
|
|
263
|
-
stack.pop();
|
|
264
|
-
if (stack[stack.length - 1].tag === "JSXChildren") {
|
|
265
|
-
stack.pop();
|
|
266
|
-
}
|
|
267
|
-
stack.push({ tag: "JSXTagEnd" });
|
|
268
|
-
}
|
|
269
|
-
}
|
|
270
|
-
lastSignificantToken = nextLastSignificantToken;
|
|
271
|
-
yield {
|
|
272
|
-
type: "JSXPunctuator",
|
|
273
|
-
value: match[0]
|
|
274
|
-
};
|
|
275
|
-
continue;
|
|
276
|
-
}
|
|
277
|
-
JSXIdentifier.lastIndex = lastIndex;
|
|
278
|
-
if (match = JSXIdentifier.exec(input)) {
|
|
279
|
-
lastIndex = JSXIdentifier.lastIndex;
|
|
280
|
-
lastSignificantToken = match[0];
|
|
281
|
-
yield {
|
|
282
|
-
type: "JSXIdentifier",
|
|
283
|
-
value: match[0]
|
|
284
|
-
};
|
|
285
|
-
continue;
|
|
286
|
-
}
|
|
287
|
-
JSXString.lastIndex = lastIndex;
|
|
288
|
-
if (match = JSXString.exec(input)) {
|
|
289
|
-
lastIndex = JSXString.lastIndex;
|
|
290
|
-
lastSignificantToken = match[0];
|
|
291
|
-
yield {
|
|
292
|
-
type: "JSXString",
|
|
293
|
-
value: match[0],
|
|
294
|
-
closed: match[2] !== void 0
|
|
295
|
-
};
|
|
296
|
-
continue;
|
|
297
|
-
}
|
|
298
|
-
break;
|
|
299
|
-
case "JSXChildren":
|
|
300
|
-
JSXText.lastIndex = lastIndex;
|
|
301
|
-
if (match = JSXText.exec(input)) {
|
|
302
|
-
lastIndex = JSXText.lastIndex;
|
|
303
|
-
lastSignificantToken = match[0];
|
|
304
|
-
yield {
|
|
305
|
-
type: "JSXText",
|
|
306
|
-
value: match[0]
|
|
307
|
-
};
|
|
308
|
-
continue;
|
|
309
|
-
}
|
|
310
|
-
switch (input[lastIndex]) {
|
|
311
|
-
case "<":
|
|
312
|
-
stack.push({ tag: "JSXTag" });
|
|
313
|
-
lastIndex++;
|
|
314
|
-
lastSignificantToken = "<";
|
|
315
|
-
yield {
|
|
316
|
-
type: "JSXPunctuator",
|
|
317
|
-
value: "<"
|
|
318
|
-
};
|
|
319
|
-
continue;
|
|
320
|
-
case "{":
|
|
321
|
-
stack.push({
|
|
322
|
-
tag: "InterpolationInJSX",
|
|
323
|
-
nesting: braces.length
|
|
324
|
-
});
|
|
325
|
-
lastIndex++;
|
|
326
|
-
lastSignificantToken = "?InterpolationInJSX";
|
|
327
|
-
postfixIncDec = false;
|
|
328
|
-
yield {
|
|
329
|
-
type: "JSXPunctuator",
|
|
330
|
-
value: "{"
|
|
331
|
-
};
|
|
332
|
-
continue;
|
|
333
|
-
}
|
|
334
|
-
}
|
|
335
|
-
WhiteSpace.lastIndex = lastIndex;
|
|
336
|
-
if (match = WhiteSpace.exec(input)) {
|
|
337
|
-
lastIndex = WhiteSpace.lastIndex;
|
|
338
|
-
yield {
|
|
339
|
-
type: "WhiteSpace",
|
|
340
|
-
value: match[0]
|
|
341
|
-
};
|
|
342
|
-
continue;
|
|
343
|
-
}
|
|
344
|
-
LineTerminatorSequence.lastIndex = lastIndex;
|
|
345
|
-
if (match = LineTerminatorSequence.exec(input)) {
|
|
346
|
-
lastIndex = LineTerminatorSequence.lastIndex;
|
|
347
|
-
postfixIncDec = false;
|
|
348
|
-
if (KeywordsWithNoLineTerminatorAfter.test(lastSignificantToken)) {
|
|
349
|
-
lastSignificantToken = "?NoLineTerminatorHere";
|
|
350
|
-
}
|
|
351
|
-
yield {
|
|
352
|
-
type: "LineTerminatorSequence",
|
|
353
|
-
value: match[0]
|
|
354
|
-
};
|
|
355
|
-
continue;
|
|
356
|
-
}
|
|
357
|
-
MultiLineComment.lastIndex = lastIndex;
|
|
358
|
-
if (match = MultiLineComment.exec(input)) {
|
|
359
|
-
lastIndex = MultiLineComment.lastIndex;
|
|
360
|
-
if (Newline.test(match[0])) {
|
|
361
|
-
postfixIncDec = false;
|
|
362
|
-
if (KeywordsWithNoLineTerminatorAfter.test(lastSignificantToken)) {
|
|
363
|
-
lastSignificantToken = "?NoLineTerminatorHere";
|
|
364
|
-
}
|
|
365
|
-
}
|
|
366
|
-
yield {
|
|
367
|
-
type: "MultiLineComment",
|
|
368
|
-
value: match[0],
|
|
369
|
-
closed: match[1] !== void 0
|
|
370
|
-
};
|
|
371
|
-
continue;
|
|
372
|
-
}
|
|
373
|
-
SingleLineComment.lastIndex = lastIndex;
|
|
374
|
-
if (match = SingleLineComment.exec(input)) {
|
|
375
|
-
lastIndex = SingleLineComment.lastIndex;
|
|
376
|
-
postfixIncDec = false;
|
|
377
|
-
yield {
|
|
378
|
-
type: "SingleLineComment",
|
|
379
|
-
value: match[0]
|
|
380
|
-
};
|
|
381
|
-
continue;
|
|
382
|
-
}
|
|
383
|
-
firstCodePoint = String.fromCodePoint(input.codePointAt(lastIndex));
|
|
384
|
-
lastIndex += firstCodePoint.length;
|
|
385
|
-
lastSignificantToken = firstCodePoint;
|
|
386
|
-
postfixIncDec = false;
|
|
387
|
-
yield {
|
|
388
|
-
type: mode.tag.startsWith("JSX") ? "JSXInvalid" : "Invalid",
|
|
389
|
-
value: firstCodePoint
|
|
390
|
-
};
|
|
391
|
-
}
|
|
392
|
-
return void 0;
|
|
393
|
-
};
|
|
394
|
-
return jsTokens_1;
|
|
395
|
-
}
|
|
396
|
-
requireJsTokens();
|
|
397
|
-
var reservedWords = {
|
|
398
|
-
keyword: [
|
|
399
|
-
"break",
|
|
400
|
-
"case",
|
|
401
|
-
"catch",
|
|
402
|
-
"continue",
|
|
403
|
-
"debugger",
|
|
404
|
-
"default",
|
|
405
|
-
"do",
|
|
406
|
-
"else",
|
|
407
|
-
"finally",
|
|
408
|
-
"for",
|
|
409
|
-
"function",
|
|
410
|
-
"if",
|
|
411
|
-
"return",
|
|
412
|
-
"switch",
|
|
413
|
-
"throw",
|
|
414
|
-
"try",
|
|
415
|
-
"var",
|
|
416
|
-
"const",
|
|
417
|
-
"while",
|
|
418
|
-
"with",
|
|
419
|
-
"new",
|
|
420
|
-
"this",
|
|
421
|
-
"super",
|
|
422
|
-
"class",
|
|
423
|
-
"extends",
|
|
424
|
-
"export",
|
|
425
|
-
"import",
|
|
426
|
-
"null",
|
|
427
|
-
"true",
|
|
428
|
-
"false",
|
|
429
|
-
"in",
|
|
430
|
-
"instanceof",
|
|
431
|
-
"typeof",
|
|
432
|
-
"void",
|
|
433
|
-
"delete"
|
|
434
|
-
],
|
|
435
|
-
strict: [
|
|
436
|
-
"implements",
|
|
437
|
-
"interface",
|
|
438
|
-
"let",
|
|
439
|
-
"package",
|
|
440
|
-
"private",
|
|
441
|
-
"protected",
|
|
442
|
-
"public",
|
|
443
|
-
"static",
|
|
444
|
-
"yield"
|
|
445
|
-
]
|
|
446
|
-
};
|
|
447
|
-
new Set(reservedWords.keyword);
|
|
448
|
-
new Set(reservedWords.strict);
|
|
449
|
-
const SAFE_TIMERS_SYMBOL = Symbol("vitest:SAFE_TIMERS");
|
|
450
|
-
function getSafeTimers() {
|
|
451
|
-
const {
|
|
452
|
-
setTimeout: safeSetTimeout,
|
|
453
|
-
setInterval: safeSetInterval,
|
|
454
|
-
clearInterval: safeClearInterval,
|
|
455
|
-
clearTimeout: safeClearTimeout,
|
|
456
|
-
setImmediate: safeSetImmediate,
|
|
457
|
-
clearImmediate: safeClearImmediate
|
|
458
|
-
} = globalThis[SAFE_TIMERS_SYMBOL] || globalThis;
|
|
459
|
-
const { nextTick: safeNextTick } = globalThis[SAFE_TIMERS_SYMBOL] || globalThis.process || { nextTick: (cb) => cb() };
|
|
460
|
-
return {
|
|
461
|
-
nextTick: safeNextTick,
|
|
462
|
-
setTimeout: safeSetTimeout,
|
|
463
|
-
setInterval: safeSetInterval,
|
|
464
|
-
clearInterval: safeClearInterval,
|
|
465
|
-
clearTimeout: safeClearTimeout,
|
|
466
|
-
setImmediate: safeSetImmediate,
|
|
467
|
-
clearImmediate: safeClearImmediate
|
|
468
|
-
};
|
|
469
|
-
}
|
|
470
|
-
export {
|
|
471
|
-
getSafeTimers
|
|
472
|
-
};
|
|
@@ -1,216 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
|
|
4
|
-
const intToChar = new Uint8Array(64);
|
|
5
|
-
const charToInt = new Uint8Array(128);
|
|
6
|
-
for (let i = 0; i < chars.length; i++) {
|
|
7
|
-
const c = chars.charCodeAt(i);
|
|
8
|
-
intToChar[i] = c;
|
|
9
|
-
charToInt[c] = i;
|
|
10
|
-
}
|
|
11
|
-
var UrlType;
|
|
12
|
-
(function(UrlType2) {
|
|
13
|
-
UrlType2[UrlType2["Empty"] = 1] = "Empty";
|
|
14
|
-
UrlType2[UrlType2["Hash"] = 2] = "Hash";
|
|
15
|
-
UrlType2[UrlType2["Query"] = 3] = "Query";
|
|
16
|
-
UrlType2[UrlType2["RelativePath"] = 4] = "RelativePath";
|
|
17
|
-
UrlType2[UrlType2["AbsolutePath"] = 5] = "AbsolutePath";
|
|
18
|
-
UrlType2[UrlType2["SchemeRelative"] = 6] = "SchemeRelative";
|
|
19
|
-
UrlType2[UrlType2["Absolute"] = 7] = "Absolute";
|
|
20
|
-
})(UrlType || (UrlType = {}));
|
|
21
|
-
const _DRIVE_LETTER_START_RE = /^[A-Za-z]:\//;
|
|
22
|
-
function normalizeWindowsPath(input = "") {
|
|
23
|
-
if (!input) {
|
|
24
|
-
return input;
|
|
25
|
-
}
|
|
26
|
-
return input.replace(/\\/g, "/").replace(_DRIVE_LETTER_START_RE, (r) => r.toUpperCase());
|
|
27
|
-
}
|
|
28
|
-
const _IS_ABSOLUTE_RE = /^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Za-z]:[/\\]/;
|
|
29
|
-
function cwd() {
|
|
30
|
-
if (typeof process !== "undefined" && typeof process.cwd === "function") {
|
|
31
|
-
return process.cwd().replace(/\\/g, "/");
|
|
32
|
-
}
|
|
33
|
-
return "/";
|
|
34
|
-
}
|
|
35
|
-
const resolve = function(...arguments_) {
|
|
36
|
-
arguments_ = arguments_.map((argument) => normalizeWindowsPath(argument));
|
|
37
|
-
let resolvedPath = "";
|
|
38
|
-
let resolvedAbsolute = false;
|
|
39
|
-
for (let index = arguments_.length - 1; index >= -1 && !resolvedAbsolute; index--) {
|
|
40
|
-
const path = index >= 0 ? arguments_[index] : cwd();
|
|
41
|
-
if (!path || path.length === 0) {
|
|
42
|
-
continue;
|
|
43
|
-
}
|
|
44
|
-
resolvedPath = `${path}/${resolvedPath}`;
|
|
45
|
-
resolvedAbsolute = isAbsolute(path);
|
|
46
|
-
}
|
|
47
|
-
resolvedPath = normalizeString(resolvedPath, !resolvedAbsolute);
|
|
48
|
-
if (resolvedAbsolute && !isAbsolute(resolvedPath)) {
|
|
49
|
-
return `/${resolvedPath}`;
|
|
50
|
-
}
|
|
51
|
-
return resolvedPath.length > 0 ? resolvedPath : ".";
|
|
52
|
-
};
|
|
53
|
-
function normalizeString(path, allowAboveRoot) {
|
|
54
|
-
let res = "";
|
|
55
|
-
let lastSegmentLength = 0;
|
|
56
|
-
let lastSlash = -1;
|
|
57
|
-
let dots = 0;
|
|
58
|
-
let char = null;
|
|
59
|
-
for (let index = 0; index <= path.length; ++index) {
|
|
60
|
-
if (index < path.length) {
|
|
61
|
-
char = path[index];
|
|
62
|
-
} else if (char === "/") {
|
|
63
|
-
break;
|
|
64
|
-
} else {
|
|
65
|
-
char = "/";
|
|
66
|
-
}
|
|
67
|
-
if (char === "/") {
|
|
68
|
-
if (lastSlash === index - 1 || dots === 1) ;
|
|
69
|
-
else if (dots === 2) {
|
|
70
|
-
if (res.length < 2 || lastSegmentLength !== 2 || res[res.length - 1] !== "." || res[res.length - 2] !== ".") {
|
|
71
|
-
if (res.length > 2) {
|
|
72
|
-
const lastSlashIndex = res.lastIndexOf("/");
|
|
73
|
-
if (lastSlashIndex === -1) {
|
|
74
|
-
res = "";
|
|
75
|
-
lastSegmentLength = 0;
|
|
76
|
-
} else {
|
|
77
|
-
res = res.slice(0, lastSlashIndex);
|
|
78
|
-
lastSegmentLength = res.length - 1 - res.lastIndexOf("/");
|
|
79
|
-
}
|
|
80
|
-
lastSlash = index;
|
|
81
|
-
dots = 0;
|
|
82
|
-
continue;
|
|
83
|
-
} else if (res.length > 0) {
|
|
84
|
-
res = "";
|
|
85
|
-
lastSegmentLength = 0;
|
|
86
|
-
lastSlash = index;
|
|
87
|
-
dots = 0;
|
|
88
|
-
continue;
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
if (allowAboveRoot) {
|
|
92
|
-
res += res.length > 0 ? "/.." : "..";
|
|
93
|
-
lastSegmentLength = 2;
|
|
94
|
-
}
|
|
95
|
-
} else {
|
|
96
|
-
if (res.length > 0) {
|
|
97
|
-
res += `/${path.slice(lastSlash + 1, index)}`;
|
|
98
|
-
} else {
|
|
99
|
-
res = path.slice(lastSlash + 1, index);
|
|
100
|
-
}
|
|
101
|
-
lastSegmentLength = index - lastSlash - 1;
|
|
102
|
-
}
|
|
103
|
-
lastSlash = index;
|
|
104
|
-
dots = 0;
|
|
105
|
-
} else if (char === "." && dots !== -1) {
|
|
106
|
-
++dots;
|
|
107
|
-
} else {
|
|
108
|
-
dots = -1;
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
return res;
|
|
112
|
-
}
|
|
113
|
-
const isAbsolute = function(p) {
|
|
114
|
-
return _IS_ABSOLUTE_RE.test(p);
|
|
115
|
-
};
|
|
116
|
-
const CHROME_IE_STACK_REGEXP = /^\s*at .*(?:\S:\d+|\(native\))/m;
|
|
117
|
-
const SAFARI_NATIVE_CODE_REGEXP = /^(?:eval@)?(?:\[native code\])?$/;
|
|
118
|
-
function extractLocation(urlLike) {
|
|
119
|
-
if (!urlLike.includes(":")) {
|
|
120
|
-
return [urlLike];
|
|
121
|
-
}
|
|
122
|
-
const regExp = /(.+?)(?::(\d+))?(?::(\d+))?$/;
|
|
123
|
-
const parts = regExp.exec(urlLike.replace(/^\(|\)$/g, ""));
|
|
124
|
-
if (!parts) {
|
|
125
|
-
return [urlLike];
|
|
126
|
-
}
|
|
127
|
-
let url = parts[1];
|
|
128
|
-
if (url.startsWith("async ")) {
|
|
129
|
-
url = url.slice(6);
|
|
130
|
-
}
|
|
131
|
-
if (url.startsWith("http:") || url.startsWith("https:")) {
|
|
132
|
-
const urlObj = new URL(url);
|
|
133
|
-
url = urlObj.pathname;
|
|
134
|
-
}
|
|
135
|
-
if (url.startsWith("/@fs/")) {
|
|
136
|
-
const isWindows = /^\/@fs\/[a-zA-Z]:\//.test(url);
|
|
137
|
-
url = url.slice(isWindows ? 5 : 4);
|
|
138
|
-
}
|
|
139
|
-
return [url, parts[2] || void 0, parts[3] || void 0];
|
|
140
|
-
}
|
|
141
|
-
function parseSingleFFOrSafariStack(raw) {
|
|
142
|
-
let line = raw.trim();
|
|
143
|
-
if (SAFARI_NATIVE_CODE_REGEXP.test(line)) {
|
|
144
|
-
return null;
|
|
145
|
-
}
|
|
146
|
-
if (line.includes(" > eval")) {
|
|
147
|
-
line = line.replace(
|
|
148
|
-
/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,
|
|
149
|
-
":$1"
|
|
150
|
-
);
|
|
151
|
-
}
|
|
152
|
-
if (!line.includes("@") && !line.includes(":")) {
|
|
153
|
-
return null;
|
|
154
|
-
}
|
|
155
|
-
const functionNameRegex = /((.*".+"[^@]*)?[^@]*)(@)/;
|
|
156
|
-
const matches = line.match(functionNameRegex);
|
|
157
|
-
const functionName = matches && matches[1] ? matches[1] : void 0;
|
|
158
|
-
const [url, lineNumber, columnNumber] = extractLocation(
|
|
159
|
-
line.replace(functionNameRegex, "")
|
|
160
|
-
);
|
|
161
|
-
if (!url || !lineNumber || !columnNumber) {
|
|
162
|
-
return null;
|
|
163
|
-
}
|
|
164
|
-
return {
|
|
165
|
-
file: url,
|
|
166
|
-
method: functionName || "",
|
|
167
|
-
line: Number.parseInt(lineNumber),
|
|
168
|
-
column: Number.parseInt(columnNumber)
|
|
169
|
-
};
|
|
170
|
-
}
|
|
171
|
-
function parseSingleStack(raw) {
|
|
172
|
-
const line = raw.trim();
|
|
173
|
-
if (!CHROME_IE_STACK_REGEXP.test(line)) {
|
|
174
|
-
return parseSingleFFOrSafariStack(line);
|
|
175
|
-
}
|
|
176
|
-
return parseSingleV8Stack(line);
|
|
177
|
-
}
|
|
178
|
-
function parseSingleV8Stack(raw) {
|
|
179
|
-
let line = raw.trim();
|
|
180
|
-
if (!CHROME_IE_STACK_REGEXP.test(line)) {
|
|
181
|
-
return null;
|
|
182
|
-
}
|
|
183
|
-
if (line.includes("(eval ")) {
|
|
184
|
-
line = line.replace(/eval code/g, "eval").replace(/(\(eval at [^()]*)|(,.*$)/g, "");
|
|
185
|
-
}
|
|
186
|
-
let sanitizedLine = line.replace(/^\s+/, "").replace(/\(eval code/g, "(").replace(/^.*?\s+/, "");
|
|
187
|
-
const location = sanitizedLine.match(/ (\(.+\)$)/);
|
|
188
|
-
sanitizedLine = location ? sanitizedLine.replace(location[0], "") : sanitizedLine;
|
|
189
|
-
const [url, lineNumber, columnNumber] = extractLocation(
|
|
190
|
-
location ? location[1] : sanitizedLine
|
|
191
|
-
);
|
|
192
|
-
let method = location && sanitizedLine || "";
|
|
193
|
-
let file = url && ["eval", "<anonymous>"].includes(url) ? void 0 : url;
|
|
194
|
-
if (!file || !lineNumber || !columnNumber) {
|
|
195
|
-
return null;
|
|
196
|
-
}
|
|
197
|
-
if (method.startsWith("async ")) {
|
|
198
|
-
method = method.slice(6);
|
|
199
|
-
}
|
|
200
|
-
if (file.startsWith("file://")) {
|
|
201
|
-
file = file.slice(7);
|
|
202
|
-
}
|
|
203
|
-
file = resolve(file);
|
|
204
|
-
if (method) {
|
|
205
|
-
method = method.replace(/__vite_ssr_import_\d+__\./g, "");
|
|
206
|
-
}
|
|
207
|
-
return {
|
|
208
|
-
method,
|
|
209
|
-
file,
|
|
210
|
-
line: Number.parseInt(lineNumber),
|
|
211
|
-
column: Number.parseInt(columnNumber)
|
|
212
|
-
};
|
|
213
|
-
}
|
|
214
|
-
exports.parseSingleFFOrSafariStack = parseSingleFFOrSafariStack;
|
|
215
|
-
exports.parseSingleStack = parseSingleStack;
|
|
216
|
-
exports.parseSingleV8Stack = parseSingleV8Stack;
|