fix(compiler): Update types for TypeScript nullability support

This commit is contained in:
Miško Hevery
2017-03-24 09:59:58 -07:00
committed by Hans
parent d8b73e4223
commit 09d9f5fe54
118 changed files with 2086 additions and 1859 deletions

View File

@ -36,13 +36,13 @@ export function main(): void {
const visitor = new RecurseVisitor();
const container = new i18n.Container(
[
new i18n.Text('', null),
new i18n.Placeholder('', '', null),
new i18n.IcuPlaceholder(null, '', null),
new i18n.Text('', null !),
new i18n.Placeholder('', '', null !),
new i18n.IcuPlaceholder(null !, '', null !),
],
null);
const tag = new i18n.TagPlaceholder('', {}, '', '', [container], false, null);
const icu = new i18n.Icu('', '', {tag}, null);
null !);
const tag = new i18n.TagPlaceholder('', {}, '', '', [container], false, null !);
const icu = new i18n.Icu('', '', {tag}, null !);
icu.visit(visitor);
expect(visitor.textCount).toEqual(1);

View File

@ -117,7 +117,7 @@ export function main(): void {
</translationbundle>`;
// Invalid messages should not cause the parser to throw
let i18nNodesByMsgId: {[id: string]: i18n.Node[]};
let i18nNodesByMsgId: {[id: string]: i18n.Node[]} = undefined !;
expect(() => {
i18nNodesByMsgId = serializer.load(XTB, 'url').i18nNodesByMsgId;
}).not.toThrow();