Skip to content

Commit 1b1dd88

Browse files
JamesHenrysoda0289
authored andcommitted
WIP
1 parent c43bb60 commit 1b1dd88

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

lib/ast-converter.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -680,7 +680,7 @@ module.exports = function(ast, extra) {
680680
function deeplyCopy() {
681681
result.type = "TS" + SyntaxKind[node.kind];
682682
Object.keys(node).filter(function(key) {
683-
return !(/^(?:kind|parent|pos|end|flags)$/.test(key));
683+
return !(/^(?:kind|parent|pos|end|flags|modifierFlagsCache)$/.test(key));
684684
}).forEach(function(key) {
685685
if (key === "type") {
686686
result.typeAnnotation = (node.type) ? convertTypeAnnotation(node.type) : null;
@@ -1083,7 +1083,7 @@ module.exports = function(ast, extra) {
10831083
key: convertChild(node.name),
10841084
value: convertChild(node.initializer),
10851085
computed: (node.name.kind === SyntaxKind.ComputedPropertyName),
1086-
static: Boolean(node.flags & ts.NodeFlags.Static),
1086+
static: Boolean(ts.getModifierFlags(node) & ts.ModifierFlags.Static),
10871087
accessibility: getTSNodeAccessibility(node),
10881088
decorators: (node.decorators) ? node.decorators.map(function(d) {
10891089
return convertChild(d.expression);
@@ -1166,7 +1166,7 @@ module.exports = function(ast, extra) {
11661166
key: convertChild(node.name),
11671167
value: method,
11681168
computed: isMethodNameComputed,
1169-
static: Boolean(node.flags & ts.NodeFlags.Static),
1169+
static: Boolean(ts.getModifierFlags(node) & ts.ModifierFlags.Static),
11701170
kind: "method",
11711171
accessibility: getTSNodeAccessibility(node),
11721172
decorators: (node.decorators) ? node.decorators.map(function(d) {
@@ -1188,7 +1188,7 @@ module.exports = function(ast, extra) {
11881188
// TypeScript uses this even for static methods named "constructor"
11891189
case SyntaxKind.Constructor:
11901190

1191-
var constructorIsStatic = Boolean(node.flags & ts.NodeFlags.Static),
1191+
var constructorIsStatic = Boolean(ts.getModifierFlags(node) & ts.ModifierFlags.Static),
11921192
firstConstructorToken = constructorIsStatic ? ts.findNextToken(node.getFirstToken(), ast) : node.getFirstToken(),
11931193
constructorLoc = ast.getLineAndCharacterOfPosition(node.parameters.pos - 1),
11941194
constructor = {
@@ -1441,8 +1441,8 @@ module.exports = function(ast, extra) {
14411441

14421442
// Patterns
14431443

1444-
// Note: TypeScript uses this for both spread and rest expressions
1445-
case SyntaxKind.SpreadElementExpression:
1444+
case SyntaxKind.SpreadElement:
1445+
case SyntaxKind.SpreadAssignment:
14461446
assign(result, {
14471447
type: "SpreadElement",
14481448
argument: convertChild(node.expression)

0 commit comments

Comments
 (0)