Skip to content

Commit

Permalink
squash! Update codebase to support TypeScript strict mode
Browse files Browse the repository at this point in the history
Account for code review comments
  • Loading branch information
Maximilien Mellen committed Feb 19, 2020
1 parent d538cf9 commit a907271
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 16 deletions.
10 changes: 2 additions & 8 deletions cli/js/console_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const customInspect = Deno.symbols.customInspect;
const {
Console,
stringifyArgs
// @ts-ignore
// @ts-ignore TypeScript (as of 3.7) does not support indexing namespaces by symbol
} = Deno[Deno.symbols.internal];

function stringify(...args: unknown[]): string {
Expand Down Expand Up @@ -301,13 +301,7 @@ test(function consoleTestWithVariousOrInvalidFormatSpecifier(): void {
});

test(function consoleTestCallToStringOnLabel(): void {
const methods = [
"count",
"countReset",
"time",
"timeLog",
"timeEnd"
] as const;
const methods = ["count", "countReset", "time", "timeLog", "timeEnd"];

for (const method of methods) {
let hasCalled = false;
Expand Down
2 changes: 1 addition & 1 deletion cli/js/error_stack_test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright 2018-2020 the Deno authors. All rights reserved. MIT license.
import { test, assert } from "./test_util.ts";

// @ts-ignore
// @ts-ignore TypeScript (as of 3.7) does not support indexing namespaces by symbol
const { setPrepareStackTrace } = Deno[Deno.symbols.internal];

interface CallSite {
Expand Down
6 changes: 3 additions & 3 deletions cli/js/event_target_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { test, assertEquals } from "./test_util.ts";
test(function addEventListenerTest(): void {
const document = new EventTarget();

// @ts-ignore
// @ts-ignore tests ignoring the type system for resilience
assertEquals(document.addEventListener("x", null, false), undefined);
// @ts-ignore
assertEquals(document.addEventListener("x", null, true), undefined);
Expand Down Expand Up @@ -39,15 +39,15 @@ test(function anEventTargetCanBeSubclassed(): void {
class NicerEventTarget extends EventTarget {
on(
type: string,
callback: (e: Event) => void,
callback: (e: Event) => void | null,
options?: __domTypes.AddEventListenerOptions
): void {
this.addEventListener(type, callback, options);
}

off(
type: string,
callback: (e: Event) => void,
callback: (e: Event) => void | null,
options?: __domTypes.EventListenerOptions
): void {
this.removeEventListener(type, callback, options);
Expand Down
2 changes: 1 addition & 1 deletion cli/js/headers_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import { test, assert, assertEquals } from "./test_util.ts";
const {
stringifyArgs
// @ts-ignore
// @ts-ignore TypeScript (as of 3.7) does not support indexing namespaces by symbol
} = Deno[Deno.symbols.internal];

// Logic heavily copied from web-platform-tests, make
Expand Down
2 changes: 1 addition & 1 deletion cli/js/internals_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { test, assert } from "./test_util.ts";
test(function internalsExists(): void {
const {
stringifyArgs
// @ts-ignore
// @ts-ignore TypeScript (as of 3.7) does not support indexing namespaces by symbol
} = Deno[Deno.symbols.internal];
assert(!!stringifyArgs);
});
2 changes: 1 addition & 1 deletion cli/js/mixins/dom_iterable_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ function setup() {
Base,
// This is using an internal API we don't want published as types, so having
// to cast to any to "trick" TypeScript
// @ts-ignore
// @ts-ignore TypeScript (as of 3.7) does not support indexing namespaces by symbol
DomIterable: Deno[Deno.symbols.internal].DomIterableMixin(Base, dataSymbol)
};
}
Expand Down
2 changes: 1 addition & 1 deletion std/util/deep_assign.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export function deepAssign(
target[key] = {};
}
assert(value);
deepAssign(target[key] as Record<string, unknown>, value!);
deepAssign(target[key] as Record<string, unknown>, value);
});
}
return target;
Expand Down

0 comments on commit a907271

Please sign in to comment.