From 9fb9048c737bbc5eb4dfa42a506bfc978316ac10 Mon Sep 17 00:00:00 2001 From: Yoshiya Hinosawa Date: Sun, 17 Feb 2019 10:07:44 +0900 Subject: remove dead code (#1796) --- js/deno.ts | 3 --- js/util.ts | 23 ----------------------- 2 files changed, 26 deletions(-) (limited to 'js') diff --git a/js/deno.ts b/js/deno.ts index 2e69a5bbd..6d6e57a41 100644 --- a/js/deno.ts +++ b/js/deno.ts @@ -64,6 +64,3 @@ export { Console, stringifyArgs } from "./console"; // TODO Don't expose DomIterableMixin. /** @internal */ export { DomIterableMixin } from "./mixins/dom_iterable"; -// TODO Don't expose deferred. -/** @internal */ -export { deferred } from "./util"; diff --git a/js/util.ts b/js/util.ts index 542356da0..6f8c72f50 100644 --- a/js/util.ts +++ b/js/util.ts @@ -107,29 +107,6 @@ export function containsOnlyASCII(str: string): boolean { return /^[\x00-\x7F]*$/.test(str); } -export interface Deferred { - promise: Promise; - resolve: Function; - reject: Function; -} - -/** Create a wrapper around a promise that could be resolved externally. - * TODO Do not expose this from "deno" namespace. - */ -export function deferred(): Deferred { - let resolve: Function | undefined; - let reject: Function | undefined; - const promise = new Promise((res, rej) => { - resolve = res; - reject = rej; - }); - return { - promise, - resolve: resolve!, - reject: reject! - }; -} - // tslint:disable-next-line:variable-name const TypedArrayConstructor = Object.getPrototypeOf(Uint8Array); export function isTypedArray(x: unknown): x is TypedArray { -- cgit v1.2.3