@@ -1531,10 +1531,12 @@ export class Compiler extends DiagnosticEmitter {
15311531
15321532 // Just prepended allocation is dropped when returning non-'this'
15331533 if ( flow . is ( FlowFlags . MAY_RETURN_NONTHIS ) ) {
1534- this . pedantic (
1535- DiagnosticCode . Explicitly_returning_constructor_drops_this_allocation ,
1536- instance . identifierNode . range
1537- ) ;
1534+ if ( this . options . pedantic ) {
1535+ this . pedantic (
1536+ DiagnosticCode . Explicitly_returning_constructor_drops_this_allocation ,
1537+ instance . identifierNode . range
1538+ ) ;
1539+ }
15381540 }
15391541 }
15401542
@@ -2107,8 +2109,9 @@ export class Compiler extends DiagnosticEmitter {
21072109 case NodeKind . TYPEDECLARATION : {
21082110 // TODO: integrate inner type declaration into flow
21092111 this . error (
2110- DiagnosticCode . Not_implemented ,
2111- statement . range
2112+ DiagnosticCode . Not_implemented_0 ,
2113+ statement . range ,
2114+ "Inner type alias"
21122115 ) ;
21132116 stmt = module . unreachable ( ) ;
21142117 break ;
@@ -2182,8 +2185,9 @@ export class Compiler extends DiagnosticEmitter {
21822185 var labelNode = statement . label ;
21832186 if ( labelNode ) {
21842187 this . error (
2185- DiagnosticCode . Not_implemented ,
2186- labelNode . range
2188+ DiagnosticCode . Not_implemented_0 ,
2189+ labelNode . range ,
2190+ "Break label"
21872191 ) ;
21882192 return module . unreachable ( ) ;
21892193 }
@@ -2216,8 +2220,9 @@ export class Compiler extends DiagnosticEmitter {
22162220 var label = statement . label ;
22172221 if ( label ) {
22182222 this . error (
2219- DiagnosticCode . Not_implemented ,
2220- label . range
2223+ DiagnosticCode . Not_implemented_0 ,
2224+ label . range ,
2225+ "Continue label"
22212226 ) ;
22222227 return module . unreachable ( ) ;
22232228 }
@@ -2581,8 +2586,9 @@ export class Compiler extends DiagnosticEmitter {
25812586 statement : ForOfStatement
25822587 ) : ExpressionRef {
25832588 this . error (
2584- DiagnosticCode . Not_implemented ,
2585- statement . range
2589+ DiagnosticCode . Not_implemented_0 ,
2590+ statement . range ,
2591+ "Iterators"
25862592 ) ;
25872593 return this . module . unreachable ( ) ;
25882594 }
@@ -2915,8 +2921,9 @@ export class Compiler extends DiagnosticEmitter {
29152921 // TODO: can't yet support something like: try { return ... } finally { ... }
29162922 // worthwhile to investigate lowering returns to block results (here)?
29172923 this . error (
2918- DiagnosticCode . Not_implemented ,
2919- statement . range
2924+ DiagnosticCode . Not_implemented_0 ,
2925+ statement . range ,
2926+ "Exceptions"
29202927 ) ;
29212928 return this . module . unreachable ( ) ;
29222929 }
@@ -3453,10 +3460,7 @@ export class Compiler extends DiagnosticEmitter {
34533460 break ;
34543461 }
34553462 default : {
3456- this . error (
3457- DiagnosticCode . Not_implemented ,
3458- expression . range
3459- ) ;
3463+ assert ( false ) ;
34603464 expr = this . module . unreachable ( ) ;
34613465 }
34623466 }
@@ -3782,8 +3786,9 @@ export class Compiler extends DiagnosticEmitter {
37823786 // }
37833787 // }
37843788 this . error (
3785- DiagnosticCode . Not_implemented ,
3786- expression . range
3789+ DiagnosticCode . Not_implemented_0 ,
3790+ expression . range ,
3791+ "Const assertion"
37873792 ) ;
37883793 return this . module . unreachable ( ) ;
37893794 }
@@ -4312,8 +4317,9 @@ export class Compiler extends DiagnosticEmitter {
43124317 case TypeKind . ANYREF : {
43134318 // TODO: ref.eq
43144319 this . error (
4315- DiagnosticCode . Not_implemented ,
4316- expression . range
4320+ DiagnosticCode . Not_implemented_0 ,
4321+ expression . range ,
4322+ "ref.eq instruction"
43174323 ) ;
43184324 expr = module . unreachable ( ) ;
43194325 break ;
@@ -4412,8 +4418,9 @@ export class Compiler extends DiagnosticEmitter {
44124418 case TypeKind . ANYREF : {
44134419 // TODO: !ref.eq
44144420 this . error (
4415- DiagnosticCode . Not_implemented ,
4416- expression . range
4421+ DiagnosticCode . Not_implemented_0 ,
4422+ expression . range ,
4423+ "ref.eq instruction"
44174424 ) ;
44184425 expr = module . unreachable ( ) ;
44194426 break ;
@@ -5950,10 +5957,7 @@ export class Compiler extends DiagnosticEmitter {
59505957 break ;
59515958 }
59525959 default : {
5953- this . error (
5954- DiagnosticCode . Not_implemented ,
5955- expression . range
5956- ) ;
5960+ assert ( false ) ;
59575961 return this . module . unreachable ( ) ;
59585962 }
59595963 }
@@ -6154,10 +6158,7 @@ export class Compiler extends DiagnosticEmitter {
61546158 }
61556159 }
61566160 }
6157- this . error (
6158- DiagnosticCode . Not_implemented ,
6159- valueExpression . range
6160- ) ;
6161+ assert ( false ) ;
61616162 return module . unreachable ( ) ;
61626163 }
61636164
@@ -6627,10 +6628,7 @@ export class Compiler extends DiagnosticEmitter {
66276628 false
66286629 ) ) ;
66296630 }
6630- this . error (
6631- DiagnosticCode . Not_implemented ,
6632- expression . expression . range
6633- ) ;
6631+ assert ( false ) ;
66346632 return this . module . unreachable ( ) ;
66356633 }
66366634
@@ -6659,8 +6657,9 @@ export class Compiler extends DiagnosticEmitter {
66596657 var hasRest = signature . hasRest ;
66606658 if ( hasRest ) {
66616659 this . error (
6662- DiagnosticCode . Not_implemented ,
6663- reportNode . range
6660+ DiagnosticCode . Not_implemented_0 ,
6661+ reportNode . range ,
6662+ "Rest parameters"
66646663 ) ;
66656664 return false ;
66666665 }
@@ -8148,8 +8147,9 @@ export class Compiler extends DiagnosticEmitter {
81488147 if ( target . parent != flow . parentFunction ) {
81498148 // TODO: closures
81508149 this . error (
8151- DiagnosticCode . Not_implemented ,
8152- expression . range
8150+ DiagnosticCode . Not_implemented_0 ,
8151+ expression . range ,
8152+ "Closures"
81538153 ) ;
81548154 return module . unreachable ( ) ;
81558155 }
@@ -8212,10 +8212,7 @@ export class Compiler extends DiagnosticEmitter {
82128212 return module . i32 ( index ) ;
82138213 }
82148214 }
8215- this . error (
8216- DiagnosticCode . Not_implemented ,
8217- expression . range
8218- ) ;
8215+ assert ( false ) ;
82198216 return this . module . unreachable ( ) ;
82208217 }
82218218
@@ -8465,13 +8462,17 @@ export class Compiler extends DiagnosticEmitter {
84658462 assert ( ! implicitlyNegate ) ;
84668463 return this . compileObjectLiteral ( < ObjectLiteralExpression > expression , contextualType ) ;
84678464 }
8468- // case LiteralKind.REGEXP:
8465+ case LiteralKind . REGEXP : {
8466+ this . error (
8467+ DiagnosticCode . Not_implemented_0 ,
8468+ expression . range ,
8469+ "Regular expressions"
8470+ ) ;
8471+ this . currentType = contextualType ;
8472+ return module . unreachable ( ) ;
8473+ }
84698474 }
8470- this . error (
8471- DiagnosticCode . Not_implemented ,
8472- expression . range
8473- ) ;
8474- this . currentType = contextualType ;
8475+ assert ( false ) ;
84758476 return module . unreachable ( ) ;
84768477 }
84778478
@@ -9318,10 +9319,7 @@ export class Compiler extends DiagnosticEmitter {
93189319 return module . unreachable ( ) ;
93199320 }
93209321 }
9321- this . error (
9322- DiagnosticCode . Not_implemented ,
9323- expression . range
9324- ) ;
9322+ assert ( false ) ;
93259323 return module . unreachable ( ) ;
93269324 }
93279325
0 commit comments