mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-12 04:50:18 +00:00
Fix Chrome tests with strict null checking enabled
Enabled strict null checking for Chrome tests and fixed some issues with the existing tests. The example code at https://developer.chrome.com/extensions/examples/api/bookmarks/basic/popup.js would use an uninitialized 'span' variable if bookmarkNode.title was empty. Since I have no idea what it was supposed to do in that case, I just moved the declaration of span up a block.
This commit is contained in:
@@ -26,6 +26,7 @@ function bookmarksExample() {
|
||||
return list;
|
||||
}
|
||||
function dumpNode(bookmarkNode, query) {
|
||||
var span = $('<span>');
|
||||
if (bookmarkNode.title) {
|
||||
if (query && !bookmarkNode.children) {
|
||||
if (String(bookmarkNode.title).indexOf(query) == -1) {
|
||||
@@ -42,7 +43,6 @@ function bookmarksExample() {
|
||||
anchor.click(function () {
|
||||
chrome.tabs.create({ url: bookmarkNode.url });
|
||||
});
|
||||
var span = $('<span>');
|
||||
var options = bookmarkNode.children ?
|
||||
$('<span>[<a href="#" id="addlink">Add</a>]</span>') :
|
||||
$('<span>[<a id="editlink" href="#">Edit</a> <a id="deletelink" ' +
|
||||
@@ -146,7 +146,7 @@ function pageRedder() {
|
||||
function printPage() {
|
||||
chrome.browserAction.onClicked.addListener(function (tab) {
|
||||
var action_url = "javascript:window.print();";
|
||||
chrome.tabs.update(tab.id, { url: action_url });
|
||||
chrome.tabs.update(tab.id!, { url: action_url });
|
||||
});
|
||||
}
|
||||
|
||||
@@ -173,10 +173,10 @@ function catBlock () {
|
||||
|
||||
// contrived settings example
|
||||
function proxySettings() {
|
||||
chrome.proxy.settings.get({ incognito: false }, (details) => {
|
||||
chrome.proxy.settings.get({ incognito: true }, (details) => {
|
||||
var val = details.value;
|
||||
var level: string = details.levelOfControl;
|
||||
var incognito: boolean = details.incognitoSpecific;
|
||||
var incognito: boolean = details.incognitoSpecific!;
|
||||
});
|
||||
|
||||
// bare minimum set call
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
"module": "commonjs",
|
||||
"target": "es6",
|
||||
"noImplicitAny": false,
|
||||
"strictNullChecks": false,
|
||||
"strictNullChecks": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
|
||||
Reference in New Issue
Block a user