Namespaced imports

This commit is contained in:
dcodeIO
2017-12-27 22:38:32 +01:00
parent eccac129ad
commit 7795d48d98
13 changed files with 157 additions and 74 deletions

View File

@ -420,9 +420,10 @@ export class Parser extends DiagnosticEmitter {
if (!initializer)
return null;
} else {
if (hasModifier(ModifierKind.CONST, parentModifiers))
this.error(DiagnosticCode._const_declarations_must_be_initialized, identifier.range);
else if (!type) // neither type nor initializer
if (hasModifier(ModifierKind.CONST, parentModifiers)) {
if (!hasModifier(ModifierKind.DECLARE, parentModifiers))
this.error(DiagnosticCode._const_declarations_must_be_initialized, identifier.range);
} else if (!type) // neither type nor initializer
this.error(DiagnosticCode.Type_expected, tn.range(tn.pos)); // recoverable
}
return Node.createVariableDeclaration(identifier, type, initializer, parentModifiers, parentDecorators, Range.join(identifier.range, tn.range()));