-
-
Notifications
You must be signed in to change notification settings - Fork 4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: improve script
lang
attribute detection (#10046)
closes #10038
- Loading branch information
Showing
4 changed files
with
150 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'svelte': patch | ||
--- | ||
|
||
fix: improve script `lang` attribute detection |
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
4 changes: 4 additions & 0 deletions
4
packages/svelte/tests/parser-modern/samples/comment-before-script/input.svelte
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,4 @@ | ||
<!--should not error out--> | ||
<script lang="ts"> | ||
let count: number; | ||
</script> |
132 changes: 132 additions & 0 deletions
132
packages/svelte/tests/parser-modern/samples/comment-before-script/output.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,132 @@ | ||
{ | ||
"css": null, | ||
"js": [], | ||
"start": 0, | ||
"end": 27, | ||
"type": "Root", | ||
"fragment": { | ||
"type": "Fragment", | ||
"nodes": [ | ||
{ | ||
"type": "Comment", | ||
"start": 0, | ||
"end": 27, | ||
"data": "should not error out", | ||
"ignores": [] | ||
}, | ||
{ | ||
"type": "Text", | ||
"start": 27, | ||
"end": 28, | ||
"raw": "\n", | ||
"data": "\n" | ||
} | ||
], | ||
"transparent": false | ||
}, | ||
"options": null, | ||
"instance": { | ||
"type": "Script", | ||
"start": 28, | ||
"end": 76, | ||
"context": "default", | ||
"content": { | ||
"type": "Program", | ||
"start": 46, | ||
"end": 67, | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 0 | ||
}, | ||
"end": { | ||
"line": 4, | ||
"column": 0 | ||
} | ||
}, | ||
"body": [ | ||
{ | ||
"type": "VariableDeclaration", | ||
"start": 48, | ||
"end": 66, | ||
"loc": { | ||
"start": { | ||
"line": 3, | ||
"column": 1 | ||
}, | ||
"end": { | ||
"line": 3, | ||
"column": 19 | ||
} | ||
}, | ||
"declarations": [ | ||
{ | ||
"type": "VariableDeclarator", | ||
"start": 52, | ||
"end": 65, | ||
"loc": { | ||
"start": { | ||
"line": 3, | ||
"column": 5 | ||
}, | ||
"end": { | ||
"line": 3, | ||
"column": 18 | ||
} | ||
}, | ||
"id": { | ||
"type": "Identifier", | ||
"start": 52, | ||
"end": 18, | ||
"loc": { | ||
"start": { | ||
"line": 3, | ||
"column": 5 | ||
}, | ||
"end": { | ||
"line": 3, | ||
"column": 18 | ||
} | ||
}, | ||
"name": "count", | ||
"typeAnnotation": { | ||
"type": "TSTypeAnnotation", | ||
"start": 57, | ||
"end": 65, | ||
"loc": { | ||
"start": { | ||
"line": 3, | ||
"column": 10 | ||
}, | ||
"end": { | ||
"line": 3, | ||
"column": 18 | ||
} | ||
}, | ||
"typeAnnotation": { | ||
"type": "TSNumberKeyword", | ||
"start": 59, | ||
"end": 65, | ||
"loc": { | ||
"start": { | ||
"line": 3, | ||
"column": 12 | ||
}, | ||
"end": { | ||
"line": 3, | ||
"column": 18 | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"init": null | ||
} | ||
], | ||
"kind": "let" | ||
} | ||
], | ||
"sourceType": "module" | ||
} | ||
} | ||
} |
d56223b
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
svelte-5-preview – ./sites/svelte-5-preview
svelte-octane.vercel.app
svelte-5-preview.vercel.app
svelte-5-preview-git-main-svelte.vercel.app
svelte-5-preview-svelte.vercel.app