summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAsher Gomez <ashersaupingomez@gmail.com>2024-09-16 09:28:35 +1000
committerGitHub <noreply@github.com>2024-09-16 09:28:35 +1000
commite4ea9be87463ce1b13e826db80452b17a9762f32 (patch)
tree6f7aa2881fb8dbf08a0ebc99dfc2c85eb3a73d15
parenta666c8c9f92d87e7a3b4d4e06fdc027b3bf9663e (diff)
chore: cleanup remaining `internals.future` code (#25624)
-rw-r--r--runtime/js/40_fs_events.js8
-rw-r--r--runtime/js/98_global_scope_window.js1
-rw-r--r--runtime/js/99_main.js13
-rw-r--r--tests/integration/run_tests.rs5
-rw-r--r--tests/node_compat/polyfill_globals.js1
-rw-r--r--tests/specs/future/runtime_api/__test__.jsonc12
-rw-r--r--tests/specs/future/runtime_api/main.js15
-rw-r--r--tests/specs/future/runtime_api/main.out2
-rw-r--r--tests/specs/future/runtime_api/worker.js5
-rw-r--r--tests/testdata/run/delete_window.js1
-rwxr-xr-xtools/lint.js2
11 files changed, 1 insertions, 64 deletions
diff --git a/runtime/js/40_fs_events.js b/runtime/js/40_fs_events.js
index 2140f29eb..a1c40c5e5 100644
--- a/runtime/js/40_fs_events.js
+++ b/runtime/js/40_fs_events.js
@@ -11,7 +11,6 @@ const {
ObjectPrototypeIsPrototypeOf,
PromiseResolve,
SymbolAsyncIterator,
- ObjectDefineProperty,
} = primordials;
import { SymbolDispose } from "ext:deno_web/00_infra.js";
@@ -21,13 +20,6 @@ class FsWatcher {
#promise;
constructor(paths, options) {
- if (internals.future) {
- ObjectDefineProperty(this, "rid", {
- __proto__: null,
- enumerable: false,
- value: undefined,
- });
- }
const { recursive } = options;
this.#rid = op_fs_events_open({ recursive, paths });
}
diff --git a/runtime/js/98_global_scope_window.js b/runtime/js/98_global_scope_window.js
index 27a3d309a..098422f56 100644
--- a/runtime/js/98_global_scope_window.js
+++ b/runtime/js/98_global_scope_window.js
@@ -112,7 +112,6 @@ const mainRuntimeGlobalProperties = {
Location: location.locationConstructorDescriptor,
location: location.locationDescriptor,
Window: globalInterfaces.windowConstructorDescriptor,
- window: core.propGetterOnly(() => globalThis),
self: core.propGetterOnly(() => globalThis),
Navigator: core.propNonEnumerable(Navigator),
navigator: core.propGetterOnly(() => navigator),
diff --git a/runtime/js/99_main.js b/runtime/js/99_main.js
index aaf12a1c4..944a9f4a4 100644
--- a/runtime/js/99_main.js
+++ b/runtime/js/99_main.js
@@ -641,11 +641,6 @@ function bootstrapMainRuntime(runtimeOptions, warmup = false) {
});
}
- // TODO(iuioiua): remove in Deno v2. This allows us to dynamically delete
- // class properties within constructors for classes that are not defined
- // within the Deno namespace.
- internals.future = true;
-
removeImportedOps();
performance.setTimeOrigin(DateNow());
@@ -834,9 +829,6 @@ function bootstrapMainRuntime(runtimeOptions, warmup = false) {
nodeDebug,
});
}
- if (internals.future) {
- delete globalThis.window;
- }
} else {
// Warmup
}
@@ -865,11 +857,6 @@ function bootstrapWorkerRuntime(
7: nodeDebug,
} = runtimeOptions;
- // TODO(iuioiua): remove in Deno v2. This allows us to dynamically delete
- // class properties within constructors for classes that are not defined
- // within the Deno namespace.
- internals.future = true;
-
performance.setTimeOrigin(DateNow());
globalThis_ = globalThis;
diff --git a/tests/integration/run_tests.rs b/tests/integration/run_tests.rs
index 7140c2cfa..c10f0d1ea 100644
--- a/tests/integration/run_tests.rs
+++ b/tests/integration/run_tests.rs
@@ -3318,11 +3318,6 @@ itest!(import_attributes_type_check {
exit_code: 1,
});
-itest!(delete_window {
- args: "run run/delete_window.js",
- output_str: Some("true\n"),
-});
-
itest!(colors_without_global_this {
args: "run run/colors_without_globalThis.js",
output_str: Some("true\n"),
diff --git a/tests/node_compat/polyfill_globals.js b/tests/node_compat/polyfill_globals.js
index 79e1cc3f9..f22143d9b 100644
--- a/tests/node_compat/polyfill_globals.js
+++ b/tests/node_compat/polyfill_globals.js
@@ -18,4 +18,3 @@ globalThis.performance = performance;
globalThis.setImmediate = setImmediate;
globalThis.setInterval = setInterval;
globalThis.setTimeout = setTimeout;
-delete globalThis.window;
diff --git a/tests/specs/future/runtime_api/__test__.jsonc b/tests/specs/future/runtime_api/__test__.jsonc
deleted file mode 100644
index a52e4299d..000000000
--- a/tests/specs/future/runtime_api/__test__.jsonc
+++ /dev/null
@@ -1,12 +0,0 @@
-{
- "steps": [
- {
- "args": "run -A --unstable-fs --config ../../../config/deno.json main.js",
- "output": "main.out"
- },
- {
- "args": "run -A --unstable-fs --config ../../../config/deno.json worker.js",
- "output": "main.out"
- }
- ]
-}
diff --git a/tests/specs/future/runtime_api/main.js b/tests/specs/future/runtime_api/main.js
deleted file mode 100644
index 8ccbf0ba0..000000000
--- a/tests/specs/future/runtime_api/main.js
+++ /dev/null
@@ -1,15 +0,0 @@
-console.log("window is", globalThis.window);
-
-try {
- new Deno.FsFile(0);
-} catch (error) {
- if (
- error instanceof TypeError &&
- error.message ===
- "`Deno.FsFile` cannot be constructed, use `Deno.open()` or `Deno.openSync()` instead."
- ) {
- console.log("Deno.FsFile constructor is illegal");
- }
-}
-
-self.close();
diff --git a/tests/specs/future/runtime_api/main.out b/tests/specs/future/runtime_api/main.out
deleted file mode 100644
index 8fef1407d..000000000
--- a/tests/specs/future/runtime_api/main.out
+++ /dev/null
@@ -1,2 +0,0 @@
-window is undefined
-Deno.FsFile constructor is illegal
diff --git a/tests/specs/future/runtime_api/worker.js b/tests/specs/future/runtime_api/worker.js
deleted file mode 100644
index eac42fe56..000000000
--- a/tests/specs/future/runtime_api/worker.js
+++ /dev/null
@@ -1,5 +0,0 @@
-import { delay } from "@std/async/delay";
-
-const worker = new Worker(import.meta.resolve("./main.js"), { type: "module" });
-await delay(1_000);
-worker.terminate();
diff --git a/tests/testdata/run/delete_window.js b/tests/testdata/run/delete_window.js
deleted file mode 100644
index f2f16820d..000000000
--- a/tests/testdata/run/delete_window.js
+++ /dev/null
@@ -1 +0,0 @@
-console.log(delete globalThis.window);
diff --git a/tools/lint.js b/tools/lint.js
index 8fb57ee1c..54c0de034 100755
--- a/tools/lint.js
+++ b/tools/lint.js
@@ -220,7 +220,7 @@ async function ensureNoNewITests() {
"pm_tests.rs": 0,
"publish_tests.rs": 0,
"repl_tests.rs": 0,
- "run_tests.rs": 336,
+ "run_tests.rs": 335,
"shared_library_tests.rs": 0,
"task_tests.rs": 4,
"test_tests.rs": 74,