Use alternate TextEncoder/TextDecoder implementation (#1281)

This is faster and smaller.
This commit is contained in:
Kitson Kelly 2018-12-07 05:01:15 +11:00 committed by Ryan Dahl
parent 60c008d23b
commit 6cc89b9e27
9 changed files with 366 additions and 42 deletions

View file

@ -29,8 +29,6 @@ import { libdeno } from "./libdeno";
declare global {
const console: consoleTypes.Console;
const setTimeout: typeof timers.setTimeout;
// tslint:disable-next-line:variable-name
const TextEncoder: typeof textEncoding.TextEncoder;
}
// A reference to the global object.
@ -69,7 +67,7 @@ export type Headers = domTypes.Headers;
window.FormData = formData.FormData as domTypes.FormDataConstructor;
export type FormData = domTypes.FormData;
// While these are classes, they have their global instance types created in
// other type definitions, therefore we do not have to include them here.
window.TextEncoder = textEncoding.TextEncoder;
export type TextEncoder = textEncoding.TextEncoder;
window.TextDecoder = textEncoding.TextDecoder;
export type TextDecoder = textEncoding.TextDecoder;