-
-
Notifications
You must be signed in to change notification settings - Fork 74
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix an error when using default for generic (#222)
- Loading branch information
Showing
11 changed files
with
7,407 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2,975 changes: 2,975 additions & 0 deletions
2,975
test/fixtures/ast/vue3.3-generic-6-with-default/ast.json
Large diffs are not rendered by default.
Oops, something went wrong.
6 changes: 6 additions & 0 deletions
6
test/fixtures/ast/vue3.3-generic-6-with-default/parser-options.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"sourceType": "module", | ||
"parser": { | ||
"ts": "@typescript-eslint/parser" | ||
} | ||
} |
21 changes: 21 additions & 0 deletions
21
test/fixtures/ast/vue3.3-generic-6-with-default/source.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<script setup lang="ts" generic=" | ||
T // Comments | ||
extends /* = */ Foo = number, | ||
// Comments | ||
U /* extends */ | ||
extends | ||
Record< | ||
/* = */ | ||
string, // = | ||
T | ||
> | ||
= Record<string, number> | ||
"> | ||
type Foo = number | string | ||
const p = defineProps<{foo:T, bar: U}>() | ||
const foo = p.foo | ||
console.log(foo) | ||
</script> | ||
<template> | ||
{{foo}} | ||
</template> |
123 changes: 123 additions & 0 deletions
123
test/fixtures/ast/vue3.3-generic-6-with-default/token-ranges.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,123 @@ | ||
[ | ||
"<script setup lang=\"ts\" generic=\"\n T // Comments\n extends /* = */ Foo = number,\n // Comments\n U /* extends */\n extends\n Record<\n /* = */\n string, // =\n T\n >\n = Record<string, number>\n\">", | ||
"type", | ||
"Foo", | ||
"=", | ||
"number", | ||
"|", | ||
"string", | ||
"const", | ||
"p", | ||
"=", | ||
"defineProps", | ||
"<", | ||
"{", | ||
"foo", | ||
":", | ||
"T", | ||
",", | ||
"bar", | ||
":", | ||
"U", | ||
"}", | ||
">", | ||
"(", | ||
")", | ||
"const", | ||
"foo", | ||
"=", | ||
"p", | ||
".", | ||
"foo", | ||
"console", | ||
".", | ||
"log", | ||
"(", | ||
"foo", | ||
")", | ||
"</script>", | ||
"<script", | ||
"setup", | ||
"lang", | ||
"=", | ||
"\"ts\"", | ||
"generic", | ||
"=", | ||
"\"", | ||
"T", | ||
"extends", | ||
"Foo", | ||
"=", | ||
"number", | ||
",", | ||
"U", | ||
"extends", | ||
"Record", | ||
"<", | ||
"string", | ||
",", | ||
"T", | ||
">", | ||
"=", | ||
"Record", | ||
"<", | ||
"string", | ||
",", | ||
"number", | ||
">", | ||
"\"", | ||
">", | ||
"\n", | ||
"type", | ||
" ", | ||
"Foo", | ||
" ", | ||
"=", | ||
" ", | ||
"number", | ||
" ", | ||
"|", | ||
" ", | ||
"string", | ||
"\n", | ||
"const", | ||
" ", | ||
"p", | ||
" ", | ||
"=", | ||
" ", | ||
"defineProps<{foo:T,", | ||
" ", | ||
"bar:", | ||
" ", | ||
"U}>()", | ||
"\n", | ||
"const", | ||
" ", | ||
"foo", | ||
" ", | ||
"=", | ||
" ", | ||
"p.foo", | ||
"\n", | ||
"console.log(foo)", | ||
"\n", | ||
"</script", | ||
">", | ||
"\n", | ||
"<template", | ||
">", | ||
"\n", | ||
"{{", | ||
"foo", | ||
"}}", | ||
"\n", | ||
"</template", | ||
">", | ||
"// Comments", | ||
"/* = */", | ||
"// Comments", | ||
"/* extends */", | ||
"/* = */", | ||
"// =" | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
[ | ||
{ | ||
"type": "VElement", | ||
"text": "<template>\n{{foo}}\n</template>", | ||
"children": [ | ||
{ | ||
"type": "VStartTag", | ||
"text": "<template>", | ||
"children": [] | ||
}, | ||
{ | ||
"type": "VText", | ||
"text": "\n", | ||
"children": [] | ||
}, | ||
{ | ||
"type": "VExpressionContainer", | ||
"text": "{{foo}}", | ||
"children": [ | ||
{ | ||
"type": "Identifier", | ||
"text": "foo", | ||
"children": [] | ||
} | ||
] | ||
}, | ||
{ | ||
"type": "VText", | ||
"text": "\n", | ||
"children": [] | ||
}, | ||
{ | ||
"type": "VEndTag", | ||
"text": "</template>", | ||
"children": [] | ||
} | ||
] | ||
} | ||
] |
Oops, something went wrong.