fix: validation should not fail on anonymous declarations (#13393)

* fix: validation should not fail on anonymous declarations

* feedback
css-migrate-blank
Dominic Gannaway 3 months ago committed by GitHub
parent 3d8f987569
commit 3ee8e0b14c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -0,0 +1,5 @@
---
'svelte': patch
---
fix: validation should not fail on anonymous declarations

@ -8,7 +8,7 @@ import { validate_identifier_name } from './shared/utils.js';
* @param {Context} context
*/
export function ClassDeclaration(node, context) {
if (context.state.analysis.runes) {
if (context.state.analysis.runes && node.id !== null) {
validate_identifier_name(context.state.scope.get(node.id.name));
}

@ -8,7 +8,7 @@ import { validate_identifier_name } from './shared/utils.js';
* @param {Context} context
*/
export function FunctionDeclaration(node, context) {
if (context.state.analysis.runes) {
if (context.state.analysis.runes && node.id !== null) {
validate_identifier_name(context.state.scope.get(node.id.name));
}

@ -0,0 +1,4 @@
<script>
import func from './function.svelte.js';
import klass from './class.svelte.js';
</script>
Loading…
Cancel
Save