File tree Expand file tree Collapse file tree 4 files changed +28
-8
lines changed
Expand file tree Collapse file tree 4 files changed +28
-8
lines changed Original file line number Diff line number Diff line change @@ -97,17 +97,14 @@ export class TSHelper {
9797 public static isTupleReturnFunction ( type : ts . Type , checker : ts . TypeChecker ) : boolean {
9898 return type . symbol
9999 && ( ( type . symbol . flags & ts . SymbolFlags . Function ) !== 0 )
100- && this . hasCustomDecorator ( type , checker , "!TupleReturn" ) ;
100+ && this . hasCustomDecorator ( type , checker , "!TupleReturn" ) ;
101101 }
102102
103103 public static hasCustomDecorator ( type : ts . Type , checker : ts . TypeChecker , decorator : string ) : boolean {
104- if ( type . symbol ) {
105- const comment = type . symbol . getDocumentationComment ( checker ) ;
106- const decorators =
107- comment . filter ( ( _ ) => _ . kind === "text" ) . map ( ( _ ) => _ . text . trim ( ) ) . filter ( ( _ ) => _ [ 0 ] === "!" ) ;
108- return decorators . indexOf ( decorator ) > - 1 ;
109- }
110- return false ;
104+ const comment = type . symbol . getDocumentationComment ( checker ) ;
105+ const decorators =
106+ comment . filter ( ( _ ) => _ . kind === "text" ) . map ( ( _ ) => _ . text . trim ( ) ) . filter ( ( _ ) => _ [ 0 ] === "!" ) ;
107+ return decorators . indexOf ( decorator ) > - 1 ;
111108 }
112109
113110 // Search up until finding a node satisfying the callback
Original file line number Diff line number Diff line change 1+ local test1 = 10
2+
3+ local test2 = 10
Original file line number Diff line number Diff line change 1+ const test1 = < number > 10 ;
2+ const test2 = 10 as number ;
Original file line number Diff line number Diff line change 1+ import { Expect , Test , TestCase } from "alsatian" ;
2+ import * as util from "../src/util"
3+
4+ export class EnumTests {
5+ @Test ( "Unsuported enum" )
6+ public unsuportedEnum ( ) {
7+ // Transpile & Assert
8+ Expect ( ( ) => {
9+ let lua = util . transpileString (
10+ `enum TestEnum {
11+ val1 = "test",
12+ val2 = "ok",
13+ val3 = "bye"
14+ }`
15+ ) ;
16+ } ) . toThrowError ( Error , "Only numeric initializers allowed for enums." ) ;
17+ }
18+ }
You can’t perform that action at this time.
0 commit comments