File tree Expand file tree Collapse file tree 4 files changed +10
-2
lines changed
src/compiler/phases/1-parse
tests/runtime-runes/samples/typescript Expand file tree Collapse file tree 4 files changed +10
-2
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ ' svelte ' : patch
3+ ---
4+
5+ fix: ignore ` as ` type expressions on property definitions
Original file line number Diff line number Diff line change @@ -56,13 +56,14 @@ const visitors = {
5656 if ( node . exportKind === 'type' ) return b . empty ;
5757 return node ;
5858 } ,
59- PropertyDefinition ( node ) {
59+ PropertyDefinition ( node , { next } ) {
6060 if ( node . accessor ) {
6161 e . typescript_invalid_feature (
6262 node ,
6363 'accessor fields (related TSC proposal is not stage 4 yet)'
6464 ) ;
6565 }
66+ return next ( ) ;
6667 } ,
6768 TSAsExpression ( node , context ) {
6869 return context . visit ( node . expression ) ;
@@ -97,7 +98,7 @@ const visitors = {
9798 if ( ( node . readonly || node . accessibility ) && context . path . at ( - 2 ) ?. kind === 'constructor' ) {
9899 e . typescript_invalid_feature ( node , 'accessibility modifiers on constructor parameters' ) ;
99100 }
100- return node . parameter ;
101+ return context . visit ( node . parameter ) ;
101102 } ,
102103 FunctionExpression : remove_this_param ,
103104 FunctionDeclaration : remove_this_param ,
Original file line number Diff line number Diff line change 11import { flushSync } from 'svelte' ;
22import { test } from '../../test' ;
33
4+ // This test mainly checks that all types are properly ignored by the compiler
45export default test ( {
56 html : '<button>clicks: 0</button>' ,
67
Original file line number Diff line number Diff line change 1010
1111 class Foo {
1212 public name: string ;
13+ x = ' x' as const ;
1314 constructor (name : string ) {
1415 this .name = name ;
1516 }
You can’t perform that action at this time.
0 commit comments