mirror of https://github.com/sveltejs/svelte
fix handling of reserved keywords when parsing (#4390)
parent
2195832ecc
commit
f5f489984f
@ -1 +0,0 @@
|
||||
<div class={class}></div>
|
@ -1,37 +0,0 @@
|
||||
{
|
||||
"html": {
|
||||
"start": 0,
|
||||
"end": 25,
|
||||
"type": "Fragment",
|
||||
"children": [
|
||||
{
|
||||
"start": 0,
|
||||
"end": 25,
|
||||
"type": "Element",
|
||||
"name": "div",
|
||||
"attributes": [
|
||||
{
|
||||
"start": 5,
|
||||
"end": 18,
|
||||
"type": "Attribute",
|
||||
"name": "class",
|
||||
"value": [
|
||||
{
|
||||
"start": 11,
|
||||
"end": 18,
|
||||
"type": "MustacheTag",
|
||||
"expression": {
|
||||
"type": "Identifier",
|
||||
"start": 12,
|
||||
"end": 17,
|
||||
"name": "class"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"children": []
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
@ -1 +0,0 @@
|
||||
{yield}
|
@ -1,20 +0,0 @@
|
||||
{
|
||||
"html": {
|
||||
"start": 0,
|
||||
"end": 7,
|
||||
"type": "Fragment",
|
||||
"children": [
|
||||
{
|
||||
"start": 0,
|
||||
"end": 7,
|
||||
"type": "MustacheTag",
|
||||
"expression": {
|
||||
"type": "Identifier",
|
||||
"start": 1,
|
||||
"end": 6,
|
||||
"name": "yield"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
@ -0,0 +1,5 @@
|
||||
export default {
|
||||
html: `
|
||||
<p>bar</p>
|
||||
`
|
||||
};
|
@ -0,0 +1,7 @@
|
||||
<script>
|
||||
const foo = [{ in: 'bar' }];
|
||||
</script>
|
||||
|
||||
{#each foo as { in: bar }}
|
||||
<p>{bar}</p>
|
||||
{/each}
|
@ -0,0 +1,15 @@
|
||||
[{
|
||||
"code": "unexpected-reserved-word",
|
||||
"message": "'case' is a reserved word in JavaScript and cannot be used here",
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 18,
|
||||
"character": 18
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 18,
|
||||
"character": 18
|
||||
},
|
||||
"pos": 18
|
||||
}]
|
@ -0,0 +1,3 @@
|
||||
{#each cases as { case }}
|
||||
{case.title}
|
||||
{/each}
|
Loading…
Reference in new issue