summaryrefslogtreecommitdiff
path: root/cli
diff options
context:
space:
mode:
Diffstat (limited to 'cli')
-rw-r--r--cli/rt/01_web_util.js38
-rw-r--r--cli/rt/02_console.js14
-rw-r--r--cli/rt/06_util.js5
-rw-r--r--cli/tsc/00_bootstrap_namespace.js9
-rw-r--r--cli/tsc/01_errors.js154
-rw-r--r--cli/tsc/99_main_compiler.js23
6 files changed, 10 insertions, 233 deletions
diff --git a/cli/rt/01_web_util.js b/cli/rt/01_web_util.js
index ee8992eb2..4a3df65ce 100644
--- a/cli/rt/01_web_util.js
+++ b/cli/rt/01_web_util.js
@@ -3,10 +3,6 @@
((window) => {
const illegalConstructorKey = Symbol("illegalConstructorKey");
- function isInvalidDate(x) {
- return isNaN(x.getTime());
- }
-
function requiredArguments(
name,
length,
@@ -20,25 +16,6 @@
}
}
- function immutableDefine(
- o,
- p,
- value,
- ) {
- Object.defineProperty(o, p, {
- value,
- configurable: false,
- writable: false,
- });
- }
-
- function hasOwnProperty(obj, v) {
- if (obj == null) {
- return false;
- }
- return Object.prototype.hasOwnProperty.call(obj, v);
- }
-
const objectCloneMemo = new WeakMap();
function cloneArrayBuffer(
@@ -136,24 +113,9 @@
}
}
- /** A helper function which ensures accessors are enumerable, as they normally
- * are not. */
- function defineEnumerableProps(
- Ctor,
- props,
- ) {
- for (const prop of props) {
- Reflect.defineProperty(Ctor.prototype, prop, { enumerable: true });
- }
- }
-
window.__bootstrap.webUtil = {
illegalConstructorKey,
- isInvalidDate,
requiredArguments,
- immutableDefine,
- hasOwnProperty,
cloneValue,
- defineEnumerableProps,
};
})(this);
diff --git a/cli/rt/02_console.js b/cli/rt/02_console.js
index ab91ffc09..43638efed 100644
--- a/cli/rt/02_console.js
+++ b/cli/rt/02_console.js
@@ -14,10 +14,16 @@
bold,
} = window.__bootstrap.colors;
- const {
- isInvalidDate,
- hasOwnProperty,
- } = window.__bootstrap.webUtil;
+ function isInvalidDate(x) {
+ return isNaN(x.getTime());
+ }
+
+ function hasOwnProperty(obj, v) {
+ if (obj == null) {
+ return false;
+ }
+ return Object.prototype.hasOwnProperty.call(obj, v);
+ }
// Copyright Joyent, Inc. and other Node contributors. MIT license.
// Forked from Node's lib/internal/cli_table.js
diff --git a/cli/rt/06_util.js b/cli/rt/06_util.js
index 011fa6de5..f4804c519 100644
--- a/cli/rt/06_util.js
+++ b/cli/rt/06_util.js
@@ -46,10 +46,6 @@
return promise;
}
- function notImplemented() {
- throw new Error("not implemented");
- }
-
function immutableDefine(
o,
p,
@@ -139,7 +135,6 @@
window.__bootstrap.util = {
log,
setLogDebug,
- notImplemented,
createResolvable,
assert,
AssertionError,
diff --git a/cli/tsc/00_bootstrap_namespace.js b/cli/tsc/00_bootstrap_namespace.js
deleted file mode 100644
index bccbc09c1..000000000
--- a/cli/tsc/00_bootstrap_namespace.js
+++ /dev/null
@@ -1,9 +0,0 @@
-// Copyright 2018-2020 the Deno authors. All rights reserved. MIT license.
-
-// The only purpose of this file is to set up "globalThis.__bootstrap" namespace,
-// that is used by scripts in this directory to reference exports between
-// the files.
-
-// This namespace is removed during runtime bootstrapping process.
-
-globalThis.__bootstrap = {};
diff --git a/cli/tsc/01_errors.js b/cli/tsc/01_errors.js
deleted file mode 100644
index fb2bb78c2..000000000
--- a/cli/tsc/01_errors.js
+++ /dev/null
@@ -1,154 +0,0 @@
-// Copyright 2018-2020 the Deno authors. All rights reserved. MIT license.
-
-((window) => {
- class NotFound extends Error {
- constructor(msg) {
- super(msg);
- this.name = "NotFound";
- }
- }
-
- class PermissionDenied extends Error {
- constructor(msg) {
- super(msg);
- this.name = "PermissionDenied";
- }
- }
-
- class ConnectionRefused extends Error {
- constructor(msg) {
- super(msg);
- this.name = "ConnectionRefused";
- }
- }
-
- class ConnectionReset extends Error {
- constructor(msg) {
- super(msg);
- this.name = "ConnectionReset";
- }
- }
-
- class ConnectionAborted extends Error {
- constructor(msg) {
- super(msg);
- this.name = "ConnectionAborted";
- }
- }
-
- class NotConnected extends Error {
- constructor(msg) {
- super(msg);
- this.name = "NotConnected";
- }
- }
-
- class AddrInUse extends Error {
- constructor(msg) {
- super(msg);
- this.name = "AddrInUse";
- }
- }
-
- class AddrNotAvailable extends Error {
- constructor(msg) {
- super(msg);
- this.name = "AddrNotAvailable";
- }
- }
-
- class BrokenPipe extends Error {
- constructor(msg) {
- super(msg);
- this.name = "BrokenPipe";
- }
- }
-
- class AlreadyExists extends Error {
- constructor(msg) {
- super(msg);
- this.name = "AlreadyExists";
- }
- }
-
- class InvalidData extends Error {
- constructor(msg) {
- super(msg);
- this.name = "InvalidData";
- }
- }
-
- class TimedOut extends Error {
- constructor(msg) {
- super(msg);
- this.name = "TimedOut";
- }
- }
-
- class Interrupted extends Error {
- constructor(msg) {
- super(msg);
- this.name = "Interrupted";
- }
- }
-
- class WriteZero extends Error {
- constructor(msg) {
- super(msg);
- this.name = "WriteZero";
- }
- }
-
- class UnexpectedEof extends Error {
- constructor(msg) {
- super(msg);
- this.name = "UnexpectedEof";
- }
- }
-
- class BadResource extends Error {
- constructor(msg) {
- super(msg);
- this.name = "BadResource";
- }
- }
-
- class Http extends Error {
- constructor(msg) {
- super(msg);
- this.name = "Http";
- }
- }
-
- class Busy extends Error {
- constructor(msg) {
- super(msg);
- this.name = "Busy";
- }
- }
-
- const errors = {
- NotFound,
- PermissionDenied,
- ConnectionRefused,
- ConnectionReset,
- ConnectionAborted,
- NotConnected,
- AddrInUse,
- AddrNotAvailable,
- BrokenPipe,
- AlreadyExists,
- InvalidData,
- TimedOut,
- Interrupted,
- WriteZero,
- UnexpectedEof,
- BadResource,
- Http,
- Busy,
- };
-
- window.__bootstrap.errors = {
- errors,
- };
-})(this);
diff --git a/cli/tsc/99_main_compiler.js b/cli/tsc/99_main_compiler.js
index d06912b1f..a6989381d 100644
--- a/cli/tsc/99_main_compiler.js
+++ b/cli/tsc/99_main_compiler.js
@@ -18,7 +18,6 @@ delete Object.prototype.__proto__;
((window) => {
const core = window.Deno.core;
- const errors = window.__bootstrap.errors.errors;
let logDebug = false;
let logSource = "JS";
@@ -1345,28 +1344,6 @@ delete Object.prototype.__proto__;
throw new Error("Worker runtime already bootstrapped");
}
hasBootstrapped = true;
- core.registerErrorClass("NotFound", errors.NotFound);
- core.registerErrorClass("PermissionDenied", errors.PermissionDenied);
- core.registerErrorClass("ConnectionRefused", errors.ConnectionRefused);
- core.registerErrorClass("ConnectionReset", errors.ConnectionReset);
- core.registerErrorClass("ConnectionAborted", errors.ConnectionAborted);
- core.registerErrorClass("NotConnected", errors.NotConnected);
- core.registerErrorClass("AddrInUse", errors.AddrInUse);
- core.registerErrorClass("AddrNotAvailable", errors.AddrNotAvailable);
- core.registerErrorClass("BrokenPipe", errors.BrokenPipe);
- core.registerErrorClass("AlreadyExists", errors.AlreadyExists);
- core.registerErrorClass("InvalidData", errors.InvalidData);
- core.registerErrorClass("TimedOut", errors.TimedOut);
- core.registerErrorClass("Interrupted", errors.Interrupted);
- core.registerErrorClass("WriteZero", errors.WriteZero);
- core.registerErrorClass("UnexpectedEof", errors.UnexpectedEof);
- core.registerErrorClass("BadResource", errors.BadResource);
- core.registerErrorClass("Http", errors.Http);
- core.registerErrorClass("URIError", URIError);
- core.registerErrorClass("TypeError", TypeError);
- core.registerErrorClass("Other", Error);
- core.registerErrorClass("Busy", errors.Busy);
- delete globalThis.__bootstrap;
runtimeStart("TS");
}