summaryrefslogtreecommitdiff
path: root/runtime/js
diff options
context:
space:
mode:
authorDeveloping <pawanakhil.dasari@gmail.com>2021-02-05 03:48:32 +0530
committerGitHub <noreply@github.com>2021-02-04 23:18:32 +0100
commit923214c53725651792f6d55c5401bf6b475622ea (patch)
tree56fe084e911c12673aa52ce127f17bafba9175d9 /runtime/js
parentb77fcbc518428429e39f5ba94e41fcd0418ee7a0 (diff)
chore: use strict mode for internal runtime, core, and op_crates js (#9391)
Diffstat (limited to 'runtime/js')
-rw-r--r--runtime/js/00_bootstrap_namespace.js1
-rw-r--r--runtime/js/01_build.js1
-rw-r--r--runtime/js/01_colors.js1
-rw-r--r--runtime/js/01_errors.js1
-rw-r--r--runtime/js/01_internals.js1
-rw-r--r--runtime/js/01_version.js1
-rw-r--r--runtime/js/01_web_util.js1
-rw-r--r--runtime/js/02_console.js1
-rw-r--r--runtime/js/06_util.js1
-rw-r--r--runtime/js/10_dispatch_minimal.js1
-rw-r--r--runtime/js/11_timers.js1
-rw-r--r--runtime/js/11_workers.js1
-rw-r--r--runtime/js/12_io.js1
-rw-r--r--runtime/js/13_buffer.js1
-rw-r--r--runtime/js/30_files.js1
-rw-r--r--runtime/js/30_fs.js1
-rw-r--r--runtime/js/30_metrics.js1
-rw-r--r--runtime/js/30_net.js1
-rw-r--r--runtime/js/30_os.js1
-rw-r--r--runtime/js/40_compiler_api.js1
-rw-r--r--runtime/js/40_diagnostics.js1
-rw-r--r--runtime/js/40_error_stack.js1
-rw-r--r--runtime/js/40_fs_events.js1
-rw-r--r--runtime/js/40_net_unstable.js1
-rw-r--r--runtime/js/40_performance.js1
-rw-r--r--runtime/js/40_permissions.js1
-rw-r--r--runtime/js/40_plugins.js1
-rw-r--r--runtime/js/40_process.js1
-rw-r--r--runtime/js/40_read_file.js1
-rw-r--r--runtime/js/40_signals.js1
-rw-r--r--runtime/js/40_testing.js1
-rw-r--r--runtime/js/40_tls.js1
-rw-r--r--runtime/js/40_tty.js1
-rw-r--r--runtime/js/40_write_file.js1
-rw-r--r--runtime/js/41_prompt.js1
-rw-r--r--runtime/js/90_deno_ns.js1
-rw-r--r--runtime/js/99_main.js1
37 files changed, 37 insertions, 0 deletions
diff --git a/runtime/js/00_bootstrap_namespace.js b/runtime/js/00_bootstrap_namespace.js
index 935d059c5..d10360974 100644
--- a/runtime/js/00_bootstrap_namespace.js
+++ b/runtime/js/00_bootstrap_namespace.js
@@ -5,5 +5,6 @@
// the files.
// This namespace is removed during runtime bootstrapping process.
+"use strict";
globalThis.__bootstrap = globalThis.__bootstrap || {};
diff --git a/runtime/js/01_build.js b/runtime/js/01_build.js
index 73fbe70e9..3663d2878 100644
--- a/runtime/js/01_build.js
+++ b/runtime/js/01_build.js
@@ -1,4 +1,5 @@
// Copyright 2018-2021 the Deno authors. All rights reserved. MIT license.
+"use strict";
((window) => {
const build = {
diff --git a/runtime/js/01_colors.js b/runtime/js/01_colors.js
index 7d6320fd3..62a2b711f 100644
--- a/runtime/js/01_colors.js
+++ b/runtime/js/01_colors.js
@@ -1,4 +1,5 @@
// Copyright 2018-2021 the Deno authors. All rights reserved. MIT license.
+"use strict";
((window) => {
function code(open, close) {
diff --git a/runtime/js/01_errors.js b/runtime/js/01_errors.js
index 063572231..a46a0a149 100644
--- a/runtime/js/01_errors.js
+++ b/runtime/js/01_errors.js
@@ -1,4 +1,5 @@
// Copyright 2018-2021 the Deno authors. All rights reserved. MIT license.
+"use strict";
((window) => {
class NotFound extends Error {
diff --git a/runtime/js/01_internals.js b/runtime/js/01_internals.js
index a8c54ec48..4843bf3da 100644
--- a/runtime/js/01_internals.js
+++ b/runtime/js/01_internals.js
@@ -1,4 +1,5 @@
// Copyright 2018-2021 the Deno authors. All rights reserved. MIT license.
+"use strict";
((window) => {
const internalSymbol = Symbol("Deno.internal");
diff --git a/runtime/js/01_version.js b/runtime/js/01_version.js
index 639db45c4..80264f954 100644
--- a/runtime/js/01_version.js
+++ b/runtime/js/01_version.js
@@ -1,4 +1,5 @@
// Copyright 2018-2021 the Deno authors. All rights reserved. MIT license.
+"use strict";
((window) => {
const version = {
diff --git a/runtime/js/01_web_util.js b/runtime/js/01_web_util.js
index 763385e29..ea8ea4873 100644
--- a/runtime/js/01_web_util.js
+++ b/runtime/js/01_web_util.js
@@ -1,4 +1,5 @@
// Copyright 2018-2021 the Deno authors. All rights reserved. MIT license.
+"use strict";
((window) => {
const illegalConstructorKey = Symbol("illegalConstructorKey");
diff --git a/runtime/js/02_console.js b/runtime/js/02_console.js
index 595bf5006..fb659e342 100644
--- a/runtime/js/02_console.js
+++ b/runtime/js/02_console.js
@@ -1,4 +1,5 @@
// Copyright 2018-2021 the Deno authors. All rights reserved. MIT license.
+"use strict";
((window) => {
const core = window.Deno.core;
diff --git a/runtime/js/06_util.js b/runtime/js/06_util.js
index fb4178d21..7ceb41102 100644
--- a/runtime/js/06_util.js
+++ b/runtime/js/06_util.js
@@ -1,4 +1,5 @@
// Copyright 2018-2021 the Deno authors. All rights reserved. MIT license.
+"use strict";
((window) => {
const { build } = window.__bootstrap.build;
diff --git a/runtime/js/10_dispatch_minimal.js b/runtime/js/10_dispatch_minimal.js
index bfb410a98..4d6af6fc3 100644
--- a/runtime/js/10_dispatch_minimal.js
+++ b/runtime/js/10_dispatch_minimal.js
@@ -1,4 +1,5 @@
// Copyright 2018-2021 the Deno authors. All rights reserved. MIT license.
+"use strict";
((window) => {
const core = window.Deno.core;
diff --git a/runtime/js/11_timers.js b/runtime/js/11_timers.js
index 4db73afb6..4c693aa4a 100644
--- a/runtime/js/11_timers.js
+++ b/runtime/js/11_timers.js
@@ -1,4 +1,5 @@
// Copyright 2018-2021 the Deno authors. All rights reserved. MIT license.
+"use strict";
((window) => {
const assert = window.__bootstrap.util.assert;
diff --git a/runtime/js/11_workers.js b/runtime/js/11_workers.js
index c78eee833..6797307d9 100644
--- a/runtime/js/11_workers.js
+++ b/runtime/js/11_workers.js
@@ -1,4 +1,5 @@
// Copyright 2018-2021 the Deno authors. All rights reserved. MIT license.
+"use strict";
((window) => {
const core = window.Deno.core;
diff --git a/runtime/js/12_io.js b/runtime/js/12_io.js
index 68b4a7eda..3818069c1 100644
--- a/runtime/js/12_io.js
+++ b/runtime/js/12_io.js
@@ -3,6 +3,7 @@
// Interfaces 100% copied from Go.
// Documentation liberally lifted from them too.
// Thank you! We love Go! <3
+"use strict";
((window) => {
const DEFAULT_BUFFER_SIZE = 32 * 1024;
diff --git a/runtime/js/13_buffer.js b/runtime/js/13_buffer.js
index 59997254b..fcb656c0f 100644
--- a/runtime/js/13_buffer.js
+++ b/runtime/js/13_buffer.js
@@ -3,6 +3,7 @@
// This code has been ported almost directly from Go's src/bytes/buffer.go
// Copyright 2009 The Go Authors. All rights reserved. BSD license.
// https://github.com/golang/go/blob/master/LICENSE
+"use strict";
((window) => {
const { assert } = window.__bootstrap.util;
diff --git a/runtime/js/30_files.js b/runtime/js/30_files.js
index 33d929aff..f9898c5d8 100644
--- a/runtime/js/30_files.js
+++ b/runtime/js/30_files.js
@@ -1,4 +1,5 @@
// Copyright 2018-2021 the Deno authors. All rights reserved. MIT license.
+"use strict";
((window) => {
const core = window.Deno.core;
diff --git a/runtime/js/30_fs.js b/runtime/js/30_fs.js
index f2a6cf8cb..f150c38b6 100644
--- a/runtime/js/30_fs.js
+++ b/runtime/js/30_fs.js
@@ -1,4 +1,5 @@
// Copyright 2018-2021 the Deno authors. All rights reserved. MIT license.
+"use strict";
((window) => {
const core = window.Deno.core;
diff --git a/runtime/js/30_metrics.js b/runtime/js/30_metrics.js
index e9e6603a7..30fa7cf80 100644
--- a/runtime/js/30_metrics.js
+++ b/runtime/js/30_metrics.js
@@ -1,4 +1,5 @@
// Copyright 2018-2021 the Deno authors. All rights reserved. MIT license.
+"use strict";
((window) => {
const core = window.Deno.core;
diff --git a/runtime/js/30_net.js b/runtime/js/30_net.js
index 7a2ac6c18..9081d0ef1 100644
--- a/runtime/js/30_net.js
+++ b/runtime/js/30_net.js
@@ -1,4 +1,5 @@
// Copyright 2018-2021 the Deno authors. All rights reserved. MIT license.
+"use strict";
((window) => {
const core = window.Deno.core;
diff --git a/runtime/js/30_os.js b/runtime/js/30_os.js
index 5a3c990b0..236131432 100644
--- a/runtime/js/30_os.js
+++ b/runtime/js/30_os.js
@@ -1,4 +1,5 @@
// Copyright 2018-2021 the Deno authors. All rights reserved. MIT license.
+"use strict";
((window) => {
const core = window.Deno.core;
diff --git a/runtime/js/40_compiler_api.js b/runtime/js/40_compiler_api.js
index 0d3600101..cce12f2f8 100644
--- a/runtime/js/40_compiler_api.js
+++ b/runtime/js/40_compiler_api.js
@@ -4,6 +4,7 @@
// This file contains the runtime APIs which will dispatch work to the internal
// compiler within Deno.
+"use strict";
((window) => {
const core = window.Deno.core;
const util = window.__bootstrap.util;
diff --git a/runtime/js/40_diagnostics.js b/runtime/js/40_diagnostics.js
index 04389e25c..f4ab67689 100644
--- a/runtime/js/40_diagnostics.js
+++ b/runtime/js/40_diagnostics.js
@@ -3,6 +3,7 @@
// Diagnostic provides an abstraction for advice/errors received from a
// compiler, which is strongly influenced by the format of TypeScript
// diagnostics.
+"use strict";
((window) => {
const DiagnosticCategory = {
diff --git a/runtime/js/40_error_stack.js b/runtime/js/40_error_stack.js
index 05c823cec..9bc6567a0 100644
--- a/runtime/js/40_error_stack.js
+++ b/runtime/js/40_error_stack.js
@@ -1,4 +1,5 @@
// Copyright 2018-2021 the Deno authors. All rights reserved. MIT license.
+"use strict";
((window) => {
const core = window.Deno.core;
diff --git a/runtime/js/40_fs_events.js b/runtime/js/40_fs_events.js
index ae769c84d..c48d410f1 100644
--- a/runtime/js/40_fs_events.js
+++ b/runtime/js/40_fs_events.js
@@ -1,4 +1,5 @@
// Copyright 2018-2021 the Deno authors. All rights reserved. MIT license.
+"use strict";
((window) => {
const core = window.Deno.core;
diff --git a/runtime/js/40_net_unstable.js b/runtime/js/40_net_unstable.js
index cff5f4dea..ca265bfaa 100644
--- a/runtime/js/40_net_unstable.js
+++ b/runtime/js/40_net_unstable.js
@@ -1,4 +1,5 @@
// Copyright 2018-2021 the Deno authors. All rights reserved. MIT license.
+"use strict";
((window) => {
const net = window.__bootstrap.net;
diff --git a/runtime/js/40_performance.js b/runtime/js/40_performance.js
index f8f9ad769..24c35b5c0 100644
--- a/runtime/js/40_performance.js
+++ b/runtime/js/40_performance.js
@@ -1,4 +1,5 @@
// Copyright 2018-2021 the Deno authors. All rights reserved. MIT license.
+"use strict";
((window) => {
const { opNow } = window.__bootstrap.timers;
diff --git a/runtime/js/40_permissions.js b/runtime/js/40_permissions.js
index b41c780aa..2b4acb595 100644
--- a/runtime/js/40_permissions.js
+++ b/runtime/js/40_permissions.js
@@ -1,4 +1,5 @@
// Copyright 2018-2021 the Deno authors. All rights reserved. MIT license.
+"use strict";
((window) => {
const core = window.Deno.core;
diff --git a/runtime/js/40_plugins.js b/runtime/js/40_plugins.js
index 51a37c9dc..fd037b81f 100644
--- a/runtime/js/40_plugins.js
+++ b/runtime/js/40_plugins.js
@@ -1,4 +1,5 @@
// Copyright 2018-2021 the Deno authors. All rights reserved. MIT license.
+"use strict";
((window) => {
const core = window.Deno.core;
diff --git a/runtime/js/40_process.js b/runtime/js/40_process.js
index 1ba32ff67..01f554b36 100644
--- a/runtime/js/40_process.js
+++ b/runtime/js/40_process.js
@@ -1,4 +1,5 @@
// Copyright 2018-2021 the Deno authors. All rights reserved. MIT license.
+"use strict";
((window) => {
const core = window.Deno.core;
diff --git a/runtime/js/40_read_file.js b/runtime/js/40_read_file.js
index 95fcfa2b9..63b05b877 100644
--- a/runtime/js/40_read_file.js
+++ b/runtime/js/40_read_file.js
@@ -1,4 +1,5 @@
// Copyright 2018-2021 the Deno authors. All rights reserved. MIT license.
+"use strict";
((window) => {
const { open, openSync } = window.__bootstrap.files;
diff --git a/runtime/js/40_signals.js b/runtime/js/40_signals.js
index d90c54767..2a70986f8 100644
--- a/runtime/js/40_signals.js
+++ b/runtime/js/40_signals.js
@@ -1,4 +1,5 @@
// Copyright 2018-2021 the Deno authors. All rights reserved. MIT license.
+"use strict";
((window) => {
const core = window.Deno.core;
diff --git a/runtime/js/40_testing.js b/runtime/js/40_testing.js
index f4f55e9a1..15545fc49 100644
--- a/runtime/js/40_testing.js
+++ b/runtime/js/40_testing.js
@@ -1,4 +1,5 @@
// Copyright 2018-2021 the Deno authors. All rights reserved. MIT license.
+"use strict";
((window) => {
const core = window.Deno.core;
diff --git a/runtime/js/40_tls.js b/runtime/js/40_tls.js
index a3893a298..e9f683376 100644
--- a/runtime/js/40_tls.js
+++ b/runtime/js/40_tls.js
@@ -1,4 +1,5 @@
// Copyright 2018-2021 the Deno authors. All rights reserved. MIT license.
+"use strict";
((window) => {
const core = window.Deno.core;
diff --git a/runtime/js/40_tty.js b/runtime/js/40_tty.js
index e090121d9..2e98a4f5a 100644
--- a/runtime/js/40_tty.js
+++ b/runtime/js/40_tty.js
@@ -1,4 +1,5 @@
// Copyright 2018-2021 the Deno authors. All rights reserved. MIT license.
+"use strict";
((window) => {
const core = window.Deno.core;
diff --git a/runtime/js/40_write_file.js b/runtime/js/40_write_file.js
index 79b8e6806..5964dec5f 100644
--- a/runtime/js/40_write_file.js
+++ b/runtime/js/40_write_file.js
@@ -1,4 +1,5 @@
// Copyright 2018-2021 the Deno authors. All rights reserved. MIT license.
+"use strict";
((window) => {
const { stat, statSync, chmod, chmodSync } = window.__bootstrap.fs;
const { open, openSync } = window.__bootstrap.files;
diff --git a/runtime/js/41_prompt.js b/runtime/js/41_prompt.js
index cafd0f31e..d74a937aa 100644
--- a/runtime/js/41_prompt.js
+++ b/runtime/js/41_prompt.js
@@ -1,4 +1,5 @@
// Copyright 2018-2021 the Deno authors. All rights reserved. MIT license.
+"use strict";
((window) => {
const { stdin } = window.__bootstrap.files;
const { isatty } = window.__bootstrap.tty;
diff --git a/runtime/js/90_deno_ns.js b/runtime/js/90_deno_ns.js
index bafa1a1b5..84c084062 100644
--- a/runtime/js/90_deno_ns.js
+++ b/runtime/js/90_deno_ns.js
@@ -1,4 +1,5 @@
// Copyright 2018-2021 the Deno authors. All rights reserved. MIT license.
+"use strict";
((window) => {
const __bootstrap = window.__bootstrap;
diff --git a/runtime/js/99_main.js b/runtime/js/99_main.js
index c6cc99dd2..485080812 100644
--- a/runtime/js/99_main.js
+++ b/runtime/js/99_main.js
@@ -2,6 +2,7 @@
// Removes the `__proto__` for security reasons. This intentionally makes
// Deno non compliant with ECMA-262 Annex B.2.2.1
//
+"use strict";
delete Object.prototype.__proto__;
((window) => {