mirror of
https://github.com/denoland/deno.git
synced 2024-11-21 15:04:11 -05:00
chore: cleanup remaining internals.future
code (#25624)
This commit is contained in:
parent
a666c8c9f9
commit
e4ea9be874
11 changed files with 1 additions and 64 deletions
|
@ -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 });
|
||||
}
|
||||
|
|
|
@ -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),
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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"),
|
||||
|
|
|
@ -18,4 +18,3 @@ globalThis.performance = performance;
|
|||
globalThis.setImmediate = setImmediate;
|
||||
globalThis.setInterval = setInterval;
|
||||
globalThis.setTimeout = setTimeout;
|
||||
delete globalThis.window;
|
||||
|
|
|
@ -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"
|
||||
}
|
||||
]
|
||||
}
|
|
@ -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();
|
|
@ -1,2 +0,0 @@
|
|||
window is undefined
|
||||
Deno.FsFile constructor is illegal
|
|
@ -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();
|
1
tests/testdata/run/delete_window.js
vendored
1
tests/testdata/run/delete_window.js
vendored
|
@ -1 +0,0 @@
|
|||
console.log(delete globalThis.window);
|
|
@ -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,
|
||||
|
|
Loading…
Reference in a new issue