diff options
author | Bartek IwaĆczuk <biwanczuk@gmail.com> | 2020-09-25 14:04:51 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-09-25 14:04:51 +0200 |
commit | 83f53c6455bacbe62998ebc56199d0c2d7f1a870 (patch) | |
tree | a1d19e22fc81d017884dbe3442a33da3bdde196d /cli/tsc/06_util.js | |
parent | fd1c913985df2f835612e79c3bd2d6312b57a04b (diff) |
refactor: remove tsc/40_error_stack.js (#7673)
This commit removes cli/tsc/40_error_stack.js as it is not
needed in TSC host. All errors originating in TSC are terminal
and don't require source mapping hence we can rely on default
stack traces provided by deno_core.
Additionally tsc/06_util.js was removed and its code moved
to tsc/99_main_compiler.js
Diffstat (limited to 'cli/tsc/06_util.js')
-rw-r--r-- | cli/tsc/06_util.js | 59 |
1 files changed, 0 insertions, 59 deletions
diff --git a/cli/tsc/06_util.js b/cli/tsc/06_util.js deleted file mode 100644 index b6a582f9e..000000000 --- a/cli/tsc/06_util.js +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright 2018-2020 the Deno authors. All rights reserved. MIT license. - -((window) => { - const core = Deno.core; - let logDebug = false; - let logSource = "JS"; - - function setLogDebug(debug, source) { - logDebug = debug; - if (source) { - logSource = source; - } - } - - function log(...args) { - if (logDebug) { - const stringifiedArgs = args.map(JSON.stringify).join(" "); - core.print(`DEBUG ${logSource} - ${stringifiedArgs}\n`); - } - } - - class AssertionError extends Error { - constructor(msg) { - super(msg); - this.name = "AssertionError"; - } - } - - function assert(cond, msg = "Assertion failed.") { - if (!cond) { - throw new AssertionError(msg); - } - } - - function createResolvable() { - let resolve; - let reject; - const promise = new Promise((res, rej) => { - resolve = res; - reject = rej; - }); - promise.resolve = resolve; - promise.reject = reject; - return promise; - } - - function notImplemented() { - throw new Error("not implemented"); - } - - window.__bootstrap.util = { - log, - setLogDebug, - notImplemented, - createResolvable, - assert, - AssertionError, - }; -})(this); |