From 29c9a5c90d88eba5da88ea41e681e7dd7ec170b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartek=20Iwa=C5=84czuk?= Date: Thu, 16 Mar 2023 13:36:53 -0400 Subject: refactor: reorder op initialization (#18228) To be able to preserve "Deno.core.ops" we need to ensure that ops are registered in the same order in various places, otherwise we will get mismatch in external references ordering. Prerequisite for https://github.com/denoland/deno/pull/18080 --- cli/build.rs | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'cli') diff --git a/cli/build.rs b/cli/build.rs index c3fa9fb48..fdf57809a 100644 --- a/cli/build.rs +++ b/cli/build.rs @@ -308,11 +308,12 @@ mod ts { } fn create_cli_snapshot(snapshot_path: PathBuf) { + // NOTE(bartlomieju): ordering is important here, keep it in sync with + // `runtime/worker.rs`, `runtime/web_worker.rs` and `runtime/build.rs`! let mut extensions: Vec = vec![ deno_webidl::init(), deno_console::init(), deno_url::init_ops(), - deno_tls::init_ops(), deno_web::init_ops::( deno_web::BlobStore::default(), Default::default(), @@ -327,18 +328,19 @@ fn create_cli_snapshot(snapshot_path: PathBuf) { deno_broadcast_channel::InMemoryBroadcastChannel::default(), false, // No --unstable. ), - deno_io::init_ops(Default::default()), - deno_fs::init_ops::(false), - deno_node::init_ops::(None), // No --unstable. - deno_node::init_polyfill_ops(), deno_ffi::init_ops::(false), deno_net::init_ops::( None, false, // No --unstable. None, ), + deno_tls::init_ops(), deno_napi::init_ops::(), deno_http::init_ops(), + deno_io::init_ops(Default::default()), + deno_fs::init_ops::(false), deno_flash::init_ops::(false), // No --unstable + deno_node::init_ops::(None), // No --unstable. + deno_node::init_polyfill_ops(), ]; let mut esm_files = include_js_files!( -- cgit v1.2.3