mirror of https://github.com/sveltejs/svelte
fix: ignore expressions in top level script/style tag attributes (#9498)
Related to sveltejs/language-tools#2204 / sveltejs/language-tools#2039pull/9512/head
parent
2ea17648f2
commit
9a97d5c547
@ -0,0 +1,5 @@
|
||||
---
|
||||
'svelte': patch
|
||||
---
|
||||
|
||||
fix: ignore expressions in top level script/style tag attributes
|
@ -0,0 +1,5 @@
|
||||
<script generics="T extends { yes: boolean }">
|
||||
let name = 'world';
|
||||
</script>
|
||||
|
||||
<h1>Hello {name}!</h1>
|
@ -0,0 +1,150 @@
|
||||
{
|
||||
"html": {
|
||||
"start": 79,
|
||||
"end": 101,
|
||||
"type": "Fragment",
|
||||
"children": [
|
||||
{
|
||||
"start": 77,
|
||||
"end": 79,
|
||||
"type": "Text",
|
||||
"raw": "\n\n",
|
||||
"data": "\n\n"
|
||||
},
|
||||
{
|
||||
"start": 79,
|
||||
"end": 101,
|
||||
"type": "Element",
|
||||
"name": "h1",
|
||||
"attributes": [],
|
||||
"children": [
|
||||
{
|
||||
"start": 83,
|
||||
"end": 89,
|
||||
"type": "Text",
|
||||
"raw": "Hello ",
|
||||
"data": "Hello "
|
||||
},
|
||||
{
|
||||
"start": 89,
|
||||
"end": 95,
|
||||
"type": "MustacheTag",
|
||||
"expression": {
|
||||
"type": "Identifier",
|
||||
"start": 90,
|
||||
"end": 94,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 5,
|
||||
"column": 11
|
||||
},
|
||||
"end": {
|
||||
"line": 5,
|
||||
"column": 15
|
||||
}
|
||||
},
|
||||
"name": "name"
|
||||
}
|
||||
},
|
||||
{
|
||||
"start": 95,
|
||||
"end": 96,
|
||||
"type": "Text",
|
||||
"raw": "!",
|
||||
"data": "!"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"instance": {
|
||||
"type": "Script",
|
||||
"start": 0,
|
||||
"end": 77,
|
||||
"context": "default",
|
||||
"content": {
|
||||
"type": "Program",
|
||||
"start": 46,
|
||||
"end": 68,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 3,
|
||||
"column": 0
|
||||
}
|
||||
},
|
||||
"body": [
|
||||
{
|
||||
"type": "VariableDeclaration",
|
||||
"start": 48,
|
||||
"end": 67,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 2,
|
||||
"column": 1
|
||||
},
|
||||
"end": {
|
||||
"line": 2,
|
||||
"column": 20
|
||||
}
|
||||
},
|
||||
"declarations": [
|
||||
{
|
||||
"type": "VariableDeclarator",
|
||||
"start": 52,
|
||||
"end": 66,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 2,
|
||||
"column": 5
|
||||
},
|
||||
"end": {
|
||||
"line": 2,
|
||||
"column": 19
|
||||
}
|
||||
},
|
||||
"id": {
|
||||
"type": "Identifier",
|
||||
"start": 52,
|
||||
"end": 56,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 2,
|
||||
"column": 5
|
||||
},
|
||||
"end": {
|
||||
"line": 2,
|
||||
"column": 9
|
||||
}
|
||||
},
|
||||
"name": "name"
|
||||
},
|
||||
"init": {
|
||||
"type": "Literal",
|
||||
"start": 59,
|
||||
"end": 66,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 2,
|
||||
"column": 12
|
||||
},
|
||||
"end": {
|
||||
"line": 2,
|
||||
"column": 19
|
||||
}
|
||||
},
|
||||
"value": "world",
|
||||
"raw": "'world'"
|
||||
}
|
||||
}
|
||||
],
|
||||
"kind": "let"
|
||||
}
|
||||
],
|
||||
"sourceType": "module"
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in new issue