diff --git a/cli/worker.rs b/cli/worker.rs index 7000fd2040..64400af205 100644 --- a/cli/worker.rs +++ b/cli/worker.rs @@ -138,7 +138,6 @@ struct SharedWorkerState { maybe_inspector_server: Option>, maybe_lockfile: Option>, feature_checker: Arc, - enable_future_features: bool, code_cache: Option>, } @@ -453,8 +452,6 @@ impl CliMainWorkerFactory { maybe_inspector_server, maybe_lockfile, feature_checker, - // TODO(2.0): remove? - enable_future_features: true, code_cache, }), } @@ -591,7 +588,6 @@ impl CliMainWorkerFactory { argv0: shared.options.argv0.clone(), node_debug: shared.options.node_debug.clone(), node_ipc_fd: shared.options.node_ipc, - future: shared.enable_future_features, mode, serve_port: shared.options.serve_port, serve_host: shared.options.serve_host.clone(), @@ -787,7 +783,6 @@ fn create_web_worker_callback( argv0: shared.options.argv0.clone(), node_debug: shared.options.node_debug.clone(), node_ipc_fd: None, - future: shared.enable_future_features, mode: WorkerExecutionMode::Worker, serve_port: shared.options.serve_port, serve_host: shared.options.serve_host.clone(), diff --git a/runtime/js/99_main.js b/runtime/js/99_main.js index 1ffb4f6e3e..6dd75b415e 100644 --- a/runtime/js/99_main.js +++ b/runtime/js/99_main.js @@ -576,12 +576,11 @@ function bootstrapMainRuntime(runtimeOptions, warmup = false) { 6: hasNodeModulesDir, 7: argv0, 8: nodeDebug, - 9: future, - 10: mode, - 11: servePort, - 12: serveHost, - 13: serveIsMain, - 14: serveWorkerCount, + 9: mode, + 10: servePort, + 11: serveHost, + 12: serveIsMain, + 13: serveWorkerCount, } = runtimeOptions; 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 // class properties within constructors for classes that are not defined // within the Deno namespace. - internals.future = future; + internals.future = true; removeImportedOps(); @@ -798,7 +797,7 @@ function bootstrapMainRuntime(runtimeOptions, warmup = false) { nodeDebug, }); } - if (future) { + if (internals.future) { delete globalThis.window; delete Deno.Buffer; delete Deno.File; @@ -835,13 +834,12 @@ function bootstrapWorkerRuntime( 6: hasNodeModulesDir, 7: argv0, 8: nodeDebug, - 9: future, } = 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 = future; + internals.future = true; performance.setTimeOrigin(DateNow()); globalThis_ = globalThis; @@ -964,7 +962,7 @@ function bootstrapWorkerRuntime( }); } - if (future) { + if (internals.future) { delete Deno.Buffer; delete Deno.File; delete Deno.FsFile.prototype.rid; diff --git a/runtime/lib.rs b/runtime/lib.rs index daa55f773f..ed3f9fbc6a 100644 --- a/runtime/lib.rs +++ b/runtime/lib.rs @@ -44,7 +44,6 @@ pub use worker_bootstrap::WorkerExecutionMode; pub use worker_bootstrap::WorkerLogLevel; mod shared; -pub use shared::import_assertion_callback; pub use shared::runtime; pub struct UnstableGranularFlag { diff --git a/runtime/shared.rs b/runtime/shared.rs index c52521690c..1b2136c638 100644 --- a/runtime/shared.rs +++ b/runtime/shared.rs @@ -116,26 +116,3 @@ pub fn maybe_transpile_source( 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); - } - } -} diff --git a/runtime/web_worker.rs b/runtime/web_worker.rs index ad0ac5a3f2..e143288618 100644 --- a/runtime/web_worker.rs +++ b/runtime/web_worker.rs @@ -545,13 +545,6 @@ impl WebWorker { options.bootstrap.enable_op_summary_metrics, 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 { module_loader: Some(options.module_loader.clone()), @@ -572,7 +565,7 @@ impl WebWorker { validate_import_attributes_cb: Some(Box::new( validate_import_attributes_callback, )), - import_assertions_support, + import_assertions_support: deno_core::ImportAssertionsSupport::Error, ..Default::default() }); diff --git a/runtime/worker.rs b/runtime/worker.rs index c0d8391667..02749e7c18 100644 --- a/runtime/worker.rs +++ b/runtime/worker.rs @@ -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 { module_loader: Some(options.module_loader.clone()), startup_snapshot: options.startup_snapshot, @@ -510,7 +502,7 @@ impl MainWorker { validate_import_attributes_cb: Some(Box::new( 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| { let cache_clone = cache.clone(); ( diff --git a/runtime/worker_bootstrap.rs b/runtime/worker_bootstrap.rs index b6ede466e1..b137efae22 100644 --- a/runtime/worker_bootstrap.rs +++ b/runtime/worker_bootstrap.rs @@ -116,7 +116,6 @@ pub struct BootstrapOptions { pub argv0: Option, pub node_debug: Option, pub node_ipc_fd: Option, - pub future: bool, pub mode: WorkerExecutionMode, // Used by `deno serve` pub serve_port: Option, @@ -153,7 +152,6 @@ impl Default for BootstrapOptions { argv0: None, node_debug: None, node_ipc_fd: None, - future: false, mode: WorkerExecutionMode::None, serve_port: Default::default(), serve_host: Default::default(), @@ -190,8 +188,6 @@ struct BootstrapV8<'a>( Option<&'a str>, // node_debug Option<&'a str>, - // future - bool, // mode i32, // serve port @@ -224,7 +220,6 @@ impl BootstrapOptions { self.has_node_modules_dir, self.argv0.as_deref(), self.node_debug.as_deref(), - self.future, self.mode.discriminant() as _, self.serve_port.unwrap_or_default(), self.serve_host.as_deref(),