1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-11-25 15:29:32 -05:00

feat: remove deprecated methods from namespace with DENO_FUTURE=1 (#23075)

This change removes deprecated methods from the `Deno.*` namespace when
the `DENO_FUTURE=1` environment variable is used.

Note: this does not address deprecated class properties and methods.
E.g. `Deno.Conn.rid`.
This commit is contained in:
Asher Gomez 2024-03-27 02:56:52 +11:00 committed by GitHub
parent 3b61104e2a
commit 89aa6d5cf6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 79 additions and 0 deletions

View file

@ -1,3 +1,4 @@
// deno-lint-ignore-file no-deprecated-deno-api
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
// Remove Intl.v8BreakIterator because it is a non-standard API. // Remove Intl.v8BreakIterator because it is a non-standard API.
@ -779,6 +780,32 @@ function bootstrapMainRuntime(runtimeOptions, warmup = false) {
} }
if (future) { if (future) {
delete globalThis.window; delete globalThis.window;
delete Deno.Buffer;
delete Deno.close;
delete Deno.copy;
delete Deno.File;
delete Deno.fstat;
delete Deno.fstatSync;
delete Deno.ftruncate;
delete Deno.ftruncateSync;
delete Deno.flock;
delete Deno.flockSync;
delete Deno.funlock;
delete Deno.funlockSync;
delete Deno.iter;
delete Deno.iterSync;
delete Deno.metrics;
delete Deno.readAll;
delete Deno.readAllSync;
delete Deno.read;
delete Deno.readSync;
delete Deno.seek;
delete Deno.seekSync;
delete Deno.shutdown;
delete Deno.writeAll;
delete Deno.writeAllSync;
delete Deno.write;
delete Deno.writeSync;
} }
} else { } else {
// Warmup // Warmup

View file

@ -1 +1,27 @@
console.log("window is", globalThis.window); console.log("window is", globalThis.window);
console.log("Deno.Buffer is", Deno.Buffer);
console.log("Deno.close is", Deno.close);
console.log("Deno.copy is", Deno.copy);
console.log("Deno.File is", Deno.File);
console.log("Deno.fstat is", Deno.fstat);
console.log("Deno.fstatSync is", Deno.fstatSync);
console.log("Deno.ftruncate is", Deno.ftruncate);
console.log("Deno.ftruncateSync is", Deno.ftruncateSync);
console.log("Deno.flock is", Deno.flock);
console.log("Deno.flockSync is", Deno.flockSync);
console.log("Deno.funlock is", Deno.funlock);
console.log("Deno.funlockSync is", Deno.funlockSync);
console.log("Deno.iter is", Deno.iter);
console.log("Deno.iterSync is", Deno.iterSync);
console.log("Deno.metrics is", Deno.metrics);
console.log("Deno.readAll is", Deno.readAll);
console.log("Deno.readAllSync is", Deno.readAllSync);
console.log("Deno.read is", Deno.read);
console.log("Deno.readSync is", Deno.readSync);
console.log("Deno.seek is", Deno.seek);
console.log("Deno.seekSync is", Deno.seekSync);
console.log("Deno.shutdown is", Deno.shutdown);
console.log("Deno.writeAll is", Deno.writeAll);
console.log("Deno.writeAllSync is", Deno.writeAllSync);
console.log("Deno.write is", Deno.write);
console.log("Deno.writeSync is", Deno.writeSync);

View file

@ -1 +1,27 @@
window is undefined window is undefined
Deno.Buffer is undefined
Deno.close is undefined
Deno.copy is undefined
Deno.File is undefined
Deno.fstat is undefined
Deno.fstatSync is undefined
Deno.ftruncate is undefined
Deno.ftruncateSync is undefined
Deno.flock is undefined
Deno.flockSync is undefined
Deno.funlock is undefined
Deno.funlockSync is undefined
Deno.iter is undefined
Deno.iterSync is undefined
Deno.metrics is undefined
Deno.readAll is undefined
Deno.readAllSync is undefined
Deno.read is undefined
Deno.readSync is undefined
Deno.seek is undefined
Deno.seekSync is undefined
Deno.shutdown is undefined
Deno.writeAll is undefined
Deno.writeAllSync is undefined
Deno.write is undefined
Deno.writeSync is undefined