@@ -656,7 +656,7 @@ module.exports = function(ast, extra) {
656
656
function deeplyCopy ( ) {
657
657
result . type = "TS" + SyntaxKind [ node . kind ] ;
658
658
Object . keys ( node ) . filter ( function ( key ) {
659
- return ! ( / ^ (?: k i n d | p a r e n t | p o s | e n d | f l a g s ) $ / . test ( key ) ) ;
659
+ return ! ( / ^ (?: k i n d | p a r e n t | p o s | e n d | f l a g s | m o d i f i e r F l a g s C a c h e ) $ / . test ( key ) ) ;
660
660
} ) . forEach ( function ( key ) {
661
661
if ( key === "type" ) {
662
662
result . typeAnnotation = convertTypeAnnotation ( node . type ) ;
@@ -1059,7 +1059,7 @@ module.exports = function(ast, extra) {
1059
1059
key : convertChild ( node . name ) ,
1060
1060
value : convertChild ( node . initializer ) ,
1061
1061
computed : ( node . name . kind === SyntaxKind . ComputedPropertyName ) ,
1062
- static : Boolean ( node . flags & ts . NodeFlags . Static ) ,
1062
+ static : Boolean ( ts . getModifierFlags ( node ) & ts . ModifierFlags . Static ) ,
1063
1063
accessibility : getTSNodeAccessibility ( node ) ,
1064
1064
decorators : ( node . decorators ) ? node . decorators . map ( function ( d ) {
1065
1065
return convertChild ( d . expression ) ;
@@ -1142,7 +1142,7 @@ module.exports = function(ast, extra) {
1142
1142
key : convertChild ( node . name ) ,
1143
1143
value : method ,
1144
1144
computed : isMethodNameComputed ,
1145
- static : Boolean ( node . flags & ts . NodeFlags . Static ) ,
1145
+ static : Boolean ( ts . getModifierFlags ( node ) & ts . ModifierFlags . Static ) ,
1146
1146
kind : "method" ,
1147
1147
accessibility : getTSNodeAccessibility ( node ) ,
1148
1148
decorators : ( node . decorators ) ? node . decorators . map ( function ( d ) {
@@ -1164,7 +1164,7 @@ module.exports = function(ast, extra) {
1164
1164
// TypeScript uses this even for static methods named "constructor"
1165
1165
case SyntaxKind . Constructor :
1166
1166
1167
- var constructorIsStatic = Boolean ( node . flags & ts . NodeFlags . Static ) ,
1167
+ var constructorIsStatic = Boolean ( ts . getModifierFlags ( node ) & ts . ModifierFlags . Static ) ,
1168
1168
firstConstructorToken = constructorIsStatic ? ts . findNextToken ( node . getFirstToken ( ) , ast ) : node . getFirstToken ( ) ,
1169
1169
constructorLoc = ast . getLineAndCharacterOfPosition ( node . parameters . pos - 1 ) ,
1170
1170
constructor = {
@@ -1417,8 +1417,8 @@ module.exports = function(ast, extra) {
1417
1417
1418
1418
// Patterns
1419
1419
1420
- // Note: TypeScript uses this for both spread and rest expressions
1421
- case SyntaxKind . SpreadElementExpression :
1420
+ case SyntaxKind . SpreadElement :
1421
+ case SyntaxKind . SpreadAssignment :
1422
1422
assign ( result , {
1423
1423
type : "SpreadElement" ,
1424
1424
argument : convertChild ( node . expression )
0 commit comments