diff --git a/__tests__/lib/flow_doctrine.js b/__tests__/lib/flow_doctrine.js index 00365694c..871acbd31 100644 --- a/__tests__/lib/flow_doctrine.js +++ b/__tests__/lib/flow_doctrine.js @@ -295,11 +295,15 @@ test('flowDoctrine', function() { type: 'VoidLiteral' }); + expect(toDoctrineType('this')).toEqual({ + type: 'NameExpression', + name: 'this' + }); + // TODO: remove all these types expect(types).toEqual([ 'IntersectionTypeAnnotation', 'EmptyTypeAnnotation', - 'ThisTypeAnnotation', 'TypeofTypeAnnotation' ]); }); diff --git a/src/flow_doctrine.js b/src/flow_doctrine.js index 031c4124e..25f18f756 100644 --- a/src/flow_doctrine.js +++ b/src/flow_doctrine.js @@ -152,6 +152,11 @@ function flowDoctrine(type: Object): DoctrineType { type: 'StringLiteralType', value: type.value }; + case 'ThisTypeAnnotation': + return { + type: 'NameExpression', + name: 'this' + }; default: return { type: 'AllLiteral'