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 ` types expressions on property definitions
Original file line number Diff line number Diff line change @@ -56,13 +56,14 @@ const visitors = {
56
56
if ( node . exportKind === 'type' ) return b . empty ;
57
57
return node ;
58
58
} ,
59
- PropertyDefinition ( node ) {
59
+ PropertyDefinition ( node , { next } ) {
60
60
if ( node . accessor ) {
61
61
e . typescript_invalid_feature (
62
62
node ,
63
63
'accessor fields (related TSC proposal is not stage 4 yet)'
64
64
) ;
65
65
}
66
+ return next ( ) ;
66
67
} ,
67
68
TSAsExpression ( node , context ) {
68
69
return context . visit ( node . expression ) ;
@@ -97,7 +98,7 @@ const visitors = {
97
98
if ( ( node . readonly || node . accessibility ) && context . path . at ( - 2 ) ?. kind === 'constructor' ) {
98
99
e . typescript_invalid_feature ( node , 'accessibility modifiers on constructor parameters' ) ;
99
100
}
100
- return node . parameter ;
101
+ return context . visit ( node . parameter ) ;
101
102
} ,
102
103
FunctionExpression : remove_this_param ,
103
104
FunctionDeclaration : remove_this_param ,
Original file line number Diff line number Diff line change 1
1
import { flushSync } from 'svelte' ;
2
2
import { test } from '../../test' ;
3
3
4
+ // This test mainly checks that all types are properly ignored by the compiler
4
5
export default test ( {
5
6
html : '<button>clicks: 0</button>' ,
6
7
Original file line number Diff line number Diff line change 10
10
11
11
class Foo {
12
12
public name: string ;
13
+ x = ' x' as const ;
13
14
constructor (name : string ) {
14
15
this .name = name ;
15
16
}
You can’t perform that action at this time.
0 commit comments