We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
lastIndex
1 parent c742e7f commit f4072d2Copy full SHA for f4072d2
packages/runtime/src/components/Diagnostic.ce.vue
@@ -13,6 +13,7 @@ interface Link {
13
function calcLink(text: string) {
14
let curIndex = 0
15
let match
16
+ fileRE.lastIndex = 0
17
const links: Link[] = []
18
while ((match = fileRE.exec(text))) {
19
const { 0: file, index } = match
@@ -44,9 +45,9 @@ const checkerColorMap: Record<string, string> = {
44
45
46
const fileRE = /(?:[a-zA-Z]:\\|\/).*(:\d+:\d+)?/g
47
const codeFrameRE = /^(?:>?\s+\d+\s+\|.*|\s+\|\s*\^.*)\r?\n/gm
-codeFrameRE.lastIndex = 0
48
49
const hasFrame = computed(() => {
50
+ codeFrameRE.lastIndex = 0
51
return diagnostic.frame && codeFrameRE.test(diagnostic.frame)
52
})
53
0 commit comments