From 4598f49db1675a74a833bcf6e635e4d3a45db541 Mon Sep 17 00:00:00 2001
From: Andy
Date: Wed, 1 Aug 2018 16:50:36 -0700
Subject: [PATCH] Fix new --strictNullChecks errors from updated lib.dom
(#27786)
---
types/d3-dispatch/d3-dispatch-tests.ts | 8 ++++----
types/deku/deku-tests.ts | 8 ++++----
types/downloadjs/downloadjs-tests.ts | 2 +-
.../i18next-browser-languagedetector-tests.ts | 2 +-
types/jquery.notify/jquery.notify-tests.ts | 2 +-
types/jsdom/jsdom-tests.ts | 10 +++++-----
types/mark.js/mark.js-tests.ts | 2 +-
types/marko/marko-tests.ts | 6 +++---
types/mithril/test/test-api.ts | 14 +++++++-------
types/mithril/test/test-class-component.ts | 2 +-
types/mithril/test/test-factory-component.ts | 2 +-
types/mithril/test/test-misc.ts | 6 +++---
types/mithril/test/test-route.ts | 2 +-
types/redom/redom-tests.ts | 8 ++++----
types/webtorrent/webtorrent-tests.ts | 2 +-
types/yandex-maps/yandex-maps-tests.ts | 2 +-
16 files changed, 39 insertions(+), 39 deletions(-)
diff --git a/types/d3-dispatch/d3-dispatch-tests.ts b/types/d3-dispatch/d3-dispatch-tests.ts
index 4e8d2cfb31..b4f44ad4d2 100644
--- a/types/d3-dispatch/d3-dispatch-tests.ts
+++ b/types/d3-dispatch/d3-dispatch-tests.ts
@@ -47,12 +47,12 @@ undef = dispatch.on('unknown') as undefined;
dispatch.on('bar', dispatch.on('bar')!);
dispatch.call('foo');
-dispatch.call('foo', document.body);
-dispatch.call('foo', document.body, { a: 3, b: 'test' }, 1);
+dispatch.call('foo', document.body!);
+dispatch.call('foo', document.body!, { a: 3, b: 'test' }, 1);
dispatch.apply('bar');
-dispatch.apply('bar', document.body);
-dispatch.apply('bar', document.body, [{ a: 3, b: 'test' }, 1]);
+dispatch.apply('bar', document.body!);
+dispatch.apply('bar', document.body!, [{ a: 3, b: 'test' }, 1]);
dispatch.on('bar', null);
diff --git a/types/deku/deku-tests.ts b/types/deku/deku-tests.ts
index d123c7b8f7..d0467adead 100644
--- a/types/deku/deku-tests.ts
+++ b/types/deku/deku-tests.ts
@@ -24,7 +24,7 @@
})
}
- let render = createApp(document.body)
+ let render = createApp(document.body!)
function main(state: any){
let vnode = view(state, (action: any) => main({ count: 0 }))
@@ -43,7 +43,7 @@
return element('div', { class: `size-${ props.size }` })
}
- const render = createApp(document.body)
+ const render = createApp(document.body!)
render(element(App, { size: 'small' }))
@@ -82,11 +82,11 @@
(function (){
const { createApp, element } = deku
- let render: Function = createApp(document.body)
+ let render: Function = createApp(document.body!)
render(element('div'))
- render = createApp(document.body, (action: any) => {
+ render = createApp(document.body!, (action: any) => {
render(element('div'))
})
diff --git a/types/downloadjs/downloadjs-tests.ts b/types/downloadjs/downloadjs-tests.ts
index 00bb5395ef..da110af46d 100644
--- a/types/downloadjs/downloadjs-tests.ts
+++ b/types/downloadjs/downloadjs-tests.ts
@@ -7,6 +7,6 @@ download(new Blob(['hello world']), 'dlTextBlob.txt', 'text/plain');
download('/robots.txt');
-download(document.documentElement.outerHTML, 'dlHTML.html', 'text/html');
+download(document.documentElement!.outerHTML, 'dlHTML.html', 'text/html');
download(new Blob(['hello world'.bold()]), 'dlHtmlBlob.html', 'text/html');
download('/diff6.png');
diff --git a/types/i18next-browser-languagedetector/i18next-browser-languagedetector-tests.ts b/types/i18next-browser-languagedetector/i18next-browser-languagedetector-tests.ts
index eadfcea369..174a871b9f 100644
--- a/types/i18next-browser-languagedetector/i18next-browser-languagedetector-tests.ts
+++ b/types/i18next-browser-languagedetector/i18next-browser-languagedetector-tests.ts
@@ -19,7 +19,7 @@ const options: LngDetector.DetectorOptions = {
cookieDomain: "myDomain",
// optional htmlTag with lang attribute, the default is:
- htmlTag: document.documentElement
+ htmlTag: document.documentElement!
};
i18next.use(LngDetector).init({
diff --git a/types/jquery.notify/jquery.notify-tests.ts b/types/jquery.notify/jquery.notify-tests.ts
index 1af31996a1..1d872e92fa 100644
--- a/types/jquery.notify/jquery.notify-tests.ts
+++ b/types/jquery.notify/jquery.notify-tests.ts
@@ -1,4 +1,4 @@
-let $container: JQueryNotifyWidget = $("").appendTo(document.body).notify();
+let $container: JQueryNotifyWidget = $("").appendTo(document.body!).notify();
let notification: JQueryNotifyInstance = $container.notify(
"create",
diff --git a/types/jsdom/jsdom-tests.ts b/types/jsdom/jsdom-tests.ts
index c672580a63..24b136e5ad 100644
--- a/types/jsdom/jsdom-tests.ts
+++ b/types/jsdom/jsdom-tests.ts
@@ -17,7 +17,7 @@ function test_executing_scripts1() {
hello`);
// The script will not be executed, by default:
- dom.window.document.body.children.length === 1;
+ dom.window.document.body!.children.length === 1;
}
function test_executing_scripts2() {
@@ -26,14 +26,14 @@ function test_executing_scripts2() {
`, { runScripts: 'dangerously' });
// The script will be executed and modify the DOM:
- dom.window.document.body.children.length === 2;
+ dom.window.document.body!.children.length === 2;
}
function test_executing_scripts3() {
const window = (new JSDOM(``, { runScripts: 'outside-only' })).window;
window.eval(`document.body.innerHTML = "
";`);
- window.document.body.children.length === 1;
+ window.document.body!.children.length === 1;
}
function test_virtualConsole() {
@@ -74,7 +74,7 @@ function test_serialize() {
dom.serialize() === '