mirror of
https://github.com/denoland/deno.git
synced 2024-11-21 15:04:11 -05:00
chore: remove some dead code around DENO_FUTURE env var (#25418)
These codepaths were not used anymore.
This commit is contained in:
parent
31ecc09b5a
commit
5ee671311a
7 changed files with 11 additions and 62 deletions
|
@ -138,7 +138,6 @@ struct SharedWorkerState {
|
||||||
maybe_inspector_server: Option<Arc<InspectorServer>>,
|
maybe_inspector_server: Option<Arc<InspectorServer>>,
|
||||||
maybe_lockfile: Option<Arc<CliLockfile>>,
|
maybe_lockfile: Option<Arc<CliLockfile>>,
|
||||||
feature_checker: Arc<FeatureChecker>,
|
feature_checker: Arc<FeatureChecker>,
|
||||||
enable_future_features: bool,
|
|
||||||
code_cache: Option<Arc<dyn code_cache::CodeCache>>,
|
code_cache: Option<Arc<dyn code_cache::CodeCache>>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -453,8 +452,6 @@ impl CliMainWorkerFactory {
|
||||||
maybe_inspector_server,
|
maybe_inspector_server,
|
||||||
maybe_lockfile,
|
maybe_lockfile,
|
||||||
feature_checker,
|
feature_checker,
|
||||||
// TODO(2.0): remove?
|
|
||||||
enable_future_features: true,
|
|
||||||
code_cache,
|
code_cache,
|
||||||
}),
|
}),
|
||||||
}
|
}
|
||||||
|
@ -591,7 +588,6 @@ impl CliMainWorkerFactory {
|
||||||
argv0: shared.options.argv0.clone(),
|
argv0: shared.options.argv0.clone(),
|
||||||
node_debug: shared.options.node_debug.clone(),
|
node_debug: shared.options.node_debug.clone(),
|
||||||
node_ipc_fd: shared.options.node_ipc,
|
node_ipc_fd: shared.options.node_ipc,
|
||||||
future: shared.enable_future_features,
|
|
||||||
mode,
|
mode,
|
||||||
serve_port: shared.options.serve_port,
|
serve_port: shared.options.serve_port,
|
||||||
serve_host: shared.options.serve_host.clone(),
|
serve_host: shared.options.serve_host.clone(),
|
||||||
|
@ -787,7 +783,6 @@ fn create_web_worker_callback(
|
||||||
argv0: shared.options.argv0.clone(),
|
argv0: shared.options.argv0.clone(),
|
||||||
node_debug: shared.options.node_debug.clone(),
|
node_debug: shared.options.node_debug.clone(),
|
||||||
node_ipc_fd: None,
|
node_ipc_fd: None,
|
||||||
future: shared.enable_future_features,
|
|
||||||
mode: WorkerExecutionMode::Worker,
|
mode: WorkerExecutionMode::Worker,
|
||||||
serve_port: shared.options.serve_port,
|
serve_port: shared.options.serve_port,
|
||||||
serve_host: shared.options.serve_host.clone(),
|
serve_host: shared.options.serve_host.clone(),
|
||||||
|
|
|
@ -576,12 +576,11 @@ function bootstrapMainRuntime(runtimeOptions, warmup = false) {
|
||||||
6: hasNodeModulesDir,
|
6: hasNodeModulesDir,
|
||||||
7: argv0,
|
7: argv0,
|
||||||
8: nodeDebug,
|
8: nodeDebug,
|
||||||
9: future,
|
9: mode,
|
||||||
10: mode,
|
10: servePort,
|
||||||
11: servePort,
|
11: serveHost,
|
||||||
12: serveHost,
|
12: serveIsMain,
|
||||||
13: serveIsMain,
|
13: serveWorkerCount,
|
||||||
14: serveWorkerCount,
|
|
||||||
} = runtimeOptions;
|
} = runtimeOptions;
|
||||||
|
|
||||||
if (mode === executionModes.serve) {
|
if (mode === executionModes.serve) {
|
||||||
|
@ -668,7 +667,7 @@ function bootstrapMainRuntime(runtimeOptions, warmup = false) {
|
||||||
// TODO(iuioiua): remove in Deno v2. This allows us to dynamically delete
|
// TODO(iuioiua): remove in Deno v2. This allows us to dynamically delete
|
||||||
// class properties within constructors for classes that are not defined
|
// class properties within constructors for classes that are not defined
|
||||||
// within the Deno namespace.
|
// within the Deno namespace.
|
||||||
internals.future = future;
|
internals.future = true;
|
||||||
|
|
||||||
removeImportedOps();
|
removeImportedOps();
|
||||||
|
|
||||||
|
@ -798,7 +797,7 @@ function bootstrapMainRuntime(runtimeOptions, warmup = false) {
|
||||||
nodeDebug,
|
nodeDebug,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
if (future) {
|
if (internals.future) {
|
||||||
delete globalThis.window;
|
delete globalThis.window;
|
||||||
delete Deno.Buffer;
|
delete Deno.Buffer;
|
||||||
delete Deno.File;
|
delete Deno.File;
|
||||||
|
@ -835,13 +834,12 @@ function bootstrapWorkerRuntime(
|
||||||
6: hasNodeModulesDir,
|
6: hasNodeModulesDir,
|
||||||
7: argv0,
|
7: argv0,
|
||||||
8: nodeDebug,
|
8: nodeDebug,
|
||||||
9: future,
|
|
||||||
} = runtimeOptions;
|
} = runtimeOptions;
|
||||||
|
|
||||||
// TODO(iuioiua): remove in Deno v2. This allows us to dynamically delete
|
// TODO(iuioiua): remove in Deno v2. This allows us to dynamically delete
|
||||||
// class properties within constructors for classes that are not defined
|
// class properties within constructors for classes that are not defined
|
||||||
// within the Deno namespace.
|
// within the Deno namespace.
|
||||||
internals.future = future;
|
internals.future = true;
|
||||||
|
|
||||||
performance.setTimeOrigin(DateNow());
|
performance.setTimeOrigin(DateNow());
|
||||||
globalThis_ = globalThis;
|
globalThis_ = globalThis;
|
||||||
|
@ -964,7 +962,7 @@ function bootstrapWorkerRuntime(
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
if (future) {
|
if (internals.future) {
|
||||||
delete Deno.Buffer;
|
delete Deno.Buffer;
|
||||||
delete Deno.File;
|
delete Deno.File;
|
||||||
delete Deno.FsFile.prototype.rid;
|
delete Deno.FsFile.prototype.rid;
|
||||||
|
|
|
@ -44,7 +44,6 @@ pub use worker_bootstrap::WorkerExecutionMode;
|
||||||
pub use worker_bootstrap::WorkerLogLevel;
|
pub use worker_bootstrap::WorkerLogLevel;
|
||||||
|
|
||||||
mod shared;
|
mod shared;
|
||||||
pub use shared::import_assertion_callback;
|
|
||||||
pub use shared::runtime;
|
pub use shared::runtime;
|
||||||
|
|
||||||
pub struct UnstableGranularFlag {
|
pub struct UnstableGranularFlag {
|
||||||
|
|
|
@ -116,26 +116,3 @@ pub fn maybe_transpile_source(
|
||||||
|
|
||||||
Ok((source_text.into(), maybe_source_map))
|
Ok((source_text.into(), maybe_source_map))
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn import_assertion_callback(
|
|
||||||
args: deno_core::ImportAssertionsSupportCustomCallbackArgs,
|
|
||||||
) {
|
|
||||||
let mut msg = deno_terminal::colors::yellow("⚠️ Import assertions are deprecated. Use `with` keyword, instead of 'assert' keyword.").to_string();
|
|
||||||
if let Some(specifier) = args.maybe_specifier {
|
|
||||||
if let Some(source_line) = args.maybe_source_line {
|
|
||||||
msg.push_str("\n\n");
|
|
||||||
msg.push_str(&source_line);
|
|
||||||
msg.push_str("\n\n");
|
|
||||||
}
|
|
||||||
msg.push_str(&format!(
|
|
||||||
" at {}:{}:{}\n",
|
|
||||||
specifier,
|
|
||||||
args.maybe_line_number.unwrap(),
|
|
||||||
args.column_number
|
|
||||||
));
|
|
||||||
#[allow(clippy::print_stderr)]
|
|
||||||
{
|
|
||||||
eprintln!("{}", msg);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
|
@ -545,13 +545,6 @@ impl WebWorker {
|
||||||
options.bootstrap.enable_op_summary_metrics,
|
options.bootstrap.enable_op_summary_metrics,
|
||||||
options.strace_ops,
|
options.strace_ops,
|
||||||
);
|
);
|
||||||
let import_assertions_support = if options.bootstrap.future {
|
|
||||||
deno_core::ImportAssertionsSupport::Error
|
|
||||||
} else {
|
|
||||||
deno_core::ImportAssertionsSupport::CustomCallback(Box::new(
|
|
||||||
crate::shared::import_assertion_callback,
|
|
||||||
))
|
|
||||||
};
|
|
||||||
|
|
||||||
let mut js_runtime = JsRuntime::new(RuntimeOptions {
|
let mut js_runtime = JsRuntime::new(RuntimeOptions {
|
||||||
module_loader: Some(options.module_loader.clone()),
|
module_loader: Some(options.module_loader.clone()),
|
||||||
|
@ -572,7 +565,7 @@ impl WebWorker {
|
||||||
validate_import_attributes_cb: Some(Box::new(
|
validate_import_attributes_cb: Some(Box::new(
|
||||||
validate_import_attributes_callback,
|
validate_import_attributes_callback,
|
||||||
)),
|
)),
|
||||||
import_assertions_support,
|
import_assertions_support: deno_core::ImportAssertionsSupport::Error,
|
||||||
..Default::default()
|
..Default::default()
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -477,14 +477,6 @@ impl MainWorker {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
let import_assertions_support = if options.bootstrap.future {
|
|
||||||
deno_core::ImportAssertionsSupport::Error
|
|
||||||
} else {
|
|
||||||
deno_core::ImportAssertionsSupport::CustomCallback(Box::new(
|
|
||||||
crate::shared::import_assertion_callback,
|
|
||||||
))
|
|
||||||
};
|
|
||||||
|
|
||||||
let mut js_runtime = JsRuntime::new(RuntimeOptions {
|
let mut js_runtime = JsRuntime::new(RuntimeOptions {
|
||||||
module_loader: Some(options.module_loader.clone()),
|
module_loader: Some(options.module_loader.clone()),
|
||||||
startup_snapshot: options.startup_snapshot,
|
startup_snapshot: options.startup_snapshot,
|
||||||
|
@ -510,7 +502,7 @@ impl MainWorker {
|
||||||
validate_import_attributes_cb: Some(Box::new(
|
validate_import_attributes_cb: Some(Box::new(
|
||||||
validate_import_attributes_callback,
|
validate_import_attributes_callback,
|
||||||
)),
|
)),
|
||||||
import_assertions_support,
|
import_assertions_support: deno_core::ImportAssertionsSupport::Error,
|
||||||
eval_context_code_cache_cbs: options.v8_code_cache.map(|cache| {
|
eval_context_code_cache_cbs: options.v8_code_cache.map(|cache| {
|
||||||
let cache_clone = cache.clone();
|
let cache_clone = cache.clone();
|
||||||
(
|
(
|
||||||
|
|
|
@ -116,7 +116,6 @@ pub struct BootstrapOptions {
|
||||||
pub argv0: Option<String>,
|
pub argv0: Option<String>,
|
||||||
pub node_debug: Option<String>,
|
pub node_debug: Option<String>,
|
||||||
pub node_ipc_fd: Option<i64>,
|
pub node_ipc_fd: Option<i64>,
|
||||||
pub future: bool,
|
|
||||||
pub mode: WorkerExecutionMode,
|
pub mode: WorkerExecutionMode,
|
||||||
// Used by `deno serve`
|
// Used by `deno serve`
|
||||||
pub serve_port: Option<u16>,
|
pub serve_port: Option<u16>,
|
||||||
|
@ -153,7 +152,6 @@ impl Default for BootstrapOptions {
|
||||||
argv0: None,
|
argv0: None,
|
||||||
node_debug: None,
|
node_debug: None,
|
||||||
node_ipc_fd: None,
|
node_ipc_fd: None,
|
||||||
future: false,
|
|
||||||
mode: WorkerExecutionMode::None,
|
mode: WorkerExecutionMode::None,
|
||||||
serve_port: Default::default(),
|
serve_port: Default::default(),
|
||||||
serve_host: Default::default(),
|
serve_host: Default::default(),
|
||||||
|
@ -190,8 +188,6 @@ struct BootstrapV8<'a>(
|
||||||
Option<&'a str>,
|
Option<&'a str>,
|
||||||
// node_debug
|
// node_debug
|
||||||
Option<&'a str>,
|
Option<&'a str>,
|
||||||
// future
|
|
||||||
bool,
|
|
||||||
// mode
|
// mode
|
||||||
i32,
|
i32,
|
||||||
// serve port
|
// serve port
|
||||||
|
@ -224,7 +220,6 @@ impl BootstrapOptions {
|
||||||
self.has_node_modules_dir,
|
self.has_node_modules_dir,
|
||||||
self.argv0.as_deref(),
|
self.argv0.as_deref(),
|
||||||
self.node_debug.as_deref(),
|
self.node_debug.as_deref(),
|
||||||
self.future,
|
|
||||||
self.mode.discriminant() as _,
|
self.mode.discriminant() as _,
|
||||||
self.serve_port.unwrap_or_default(),
|
self.serve_port.unwrap_or_default(),
|
||||||
self.serve_host.as_deref(),
|
self.serve_host.as_deref(),
|
||||||
|
|
Loading…
Reference in a new issue