diff options
author | Yoshiya Hinosawa <stibium121@gmail.com> | 2018-08-26 16:57:16 +0900 |
---|---|---|
committer | Ryan Dahl <ry@tinyclouds.org> | 2018-08-26 11:03:41 -0400 |
commit | 17d6d6b336e48ab53ae1efa546df7c7b045152da (patch) | |
tree | 013b5fe136c93f7526e10b4b30d7fbab5ba910f8 /js/globals.ts | |
parent | 3a5cf9ca8b6a4dae204139faff3f3bbad1f78b54 (diff) |
refactor: add and use libdeno.setGlobalErrorHandler instead of window.onerror
Diffstat (limited to 'js/globals.ts')
-rw-r--r-- | js/globals.ts | 26 |
1 files changed, 0 insertions, 26 deletions
diff --git a/js/globals.ts b/js/globals.ts index 80e00ea15..0364aaf98 100644 --- a/js/globals.ts +++ b/js/globals.ts @@ -1,7 +1,6 @@ // Copyright 2018 the Deno authors. All rights reserved. MIT license. import { Console } from "./console"; -import { exit } from "./os"; import * as timers from "./timers"; import { TextDecoder, TextEncoder } from "./text_encoding"; import * as fetch_ from "./fetch"; @@ -12,13 +11,6 @@ declare global { interface Window { console: Console; define: Readonly<unknown>; - onerror?: ( - message: string, - source: string, - lineno: number, - colno: number, - error: Error - ) => void; } const clearTimeout: typeof timers.clearTimer; @@ -43,30 +35,12 @@ window.window = window; window.libdeno = null; -// import "./url"; - window.setTimeout = timers.setTimeout; window.setInterval = timers.setInterval; window.clearTimeout = timers.clearTimer; window.clearInterval = timers.clearTimer; window.console = new Console(libdeno.print); -// Uncaught exceptions are sent to window.onerror by the privileged binding. -window.onerror = ( - message: string, - source: string, - lineno: number, - colno: number, - error: Error -) => { - // TODO Currently there is a bug in v8_source_maps.ts that causes a - // segfault if it is used within window.onerror. To workaround we - // uninstall the Error.prepareStackTrace handler. Users will get unmapped - // stack traces on uncaught exceptions until this issue is fixed. - //Error.prepareStackTrace = null; - console.log(error.stack); - exit(1); -}; window.TextEncoder = TextEncoder; window.TextDecoder = TextDecoder; |