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

chore: upgrade deno_core (#25674)

No functional changes, just removes dead code.
This commit is contained in:
Bartek Iwańczuk 2024-09-17 02:13:34 +01:00 committed by GitHub
parent 01b5dfd9ea
commit aaf2bf4bfb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 15 additions and 44 deletions

12
Cargo.lock generated
View file

@ -1405,9 +1405,9 @@ dependencies = [
[[package]]
name = "deno_core"
version = "0.308.0"
version = "0.309.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "62fc8250fa9da059cc05b18328319a9048c73e4889ca929cc60877a8a1bfc4d4"
checksum = "eaecc78e8903d1b5d95c7fb01a14eb342b9e63484763a304fd30a8f48861f9df"
dependencies = [
"anyhow",
"bincode",
@ -1887,9 +1887,9 @@ dependencies = [
[[package]]
name = "deno_ops"
version = "0.184.0"
version = "0.185.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "24a465b7d691ad7cae41e8f51bd954b1e3ffd201b84dc30de2c16cf91034946e"
checksum = "2d817c00b3f30bef495c84080b5ed327ed68d6d2636b5ed8b730d00a06221dc1"
dependencies = [
"proc-macro-rules",
"proc-macro2",
@ -6257,9 +6257,9 @@ dependencies = [
[[package]]
name = "serde_v8"
version = "0.217.0"
version = "0.218.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "467c0a7bfc67cd918f1f7ab7a5ab70a9e744e466ff428cd728ff2c03bc77874c"
checksum = "134add6f9dc7a226912468f7c427a476583ab362e094f04ff3a9fa79f2df97c7"
dependencies = [
"num-bigint",
"serde",

View file

@ -45,7 +45,7 @@ repository = "https://github.com/denoland/deno"
[workspace.dependencies]
deno_ast = { version = "=0.42.0", features = ["transpiling"] }
deno_core = { version = "0.308.0" }
deno_core = { version = "0.309.0" }
deno_bench_util = { version = "0.162.0", path = "./bench_util" }
deno_lockfile = "=0.23.1"

View file

@ -726,7 +726,6 @@ impl CliFactory {
let cli_options = self.cli_options()?;
let mut checker = FeatureChecker::default();
checker.set_exit_cb(Box::new(crate::unstable_exit_cb));
checker.set_warn_cb(Box::new(crate::unstable_warn_cb));
let unstable_features = cli_options.unstable_features();
for granular_flag in crate::UNSTABLE_GRANULAR_FLAGS {
if unstable_features.contains(&granular_flag.name.to_string()) {

View file

@ -417,18 +417,6 @@ pub(crate) fn unstable_exit_cb(feature: &str, api_name: &str) {
std::process::exit(70);
}
// TODO(bartlomieju): remove when `--unstable` flag is removed.
#[allow(clippy::print_stderr)]
pub(crate) fn unstable_warn_cb(feature: &str, api_name: &str) {
eprintln!(
"⚠️ {}",
colors::yellow(format!(
"The `{}` API was used with `--unstable` flag. The `--unstable` flag is deprecated and will be removed in Deno 2.0. Use granular `--unstable-{}` instead.\nLearn more at: https://docs.deno.com/runtime/manual/tools/unstable_flags",
api_name, feature
))
);
}
pub fn main() {
setup_panic_hook();

View file

@ -50,12 +50,9 @@ pub fn op_broadcast_subscribe<BC>(
where
BC: BroadcastChannel + 'static,
{
// TODO(bartlomieju): replace with `state.feature_checker.check_or_exit`
// once we phase out `check_or_exit_with_legacy_fallback`
state.feature_checker.check_or_exit_with_legacy_fallback(
UNSTABLE_FEATURE_NAME,
"BroadcastChannel",
);
state
.feature_checker
.check_or_exit(UNSTABLE_FEATURE_NAME, "BroadcastChannel");
let bc = state.borrow::<BC>();
let resource = bc.subscribe()?;
Ok(state.resource_table.add(resource))

View file

@ -62,11 +62,9 @@ where
{
let cron_handler = {
let state = state.borrow();
// TODO(bartlomieju): replace with `state.feature_checker.check_or_exit`
// once we phase out `check_or_exit_with_legacy_fallback`
state
.feature_checker
.check_or_exit_with_legacy_fallback(UNSTABLE_FEATURE_NAME, "Deno.cron");
.check_or_exit(UNSTABLE_FEATURE_NAME, "Deno.cron");
state.borrow::<Rc<C>>().clone()
};

View file

@ -129,11 +129,9 @@ where
{
let handler = {
let state = state.borrow();
// TODO(bartlomieju): replace with `state.feature_checker.check_or_exit`
// once we phase out `check_or_exit_with_legacy_fallback`
state
.feature_checker
.check_or_exit_with_legacy_fallback(UNSTABLE_FEATURE_NAME, "Deno.openKv");
.check_or_exit(UNSTABLE_FEATURE_NAME, "Deno.openKv");
state.borrow::<Rc<DBH>>().clone()
};
let db = handler.open(state.clone(), path).await?;

View file

@ -88,11 +88,9 @@ impl NetPermissions for deno_permissions::PermissionsContainer {
/// Helper for checking unstable features. Used for sync ops.
fn check_unstable(state: &OpState, api_name: &str) {
// TODO(bartlomieju): replace with `state.feature_checker.check_or_exit`
// once we phase out `check_or_exit_with_legacy_fallback`
state
.feature_checker
.check_or_exit_with_legacy_fallback(UNSTABLE_FEATURE_NAME, api_name);
.check_or_exit(UNSTABLE_FEATURE_NAME, api_name);
}
pub fn get_declaration() -> PathBuf {

View file

@ -1063,12 +1063,9 @@ mod tests {
}
);
let mut feature_checker = deno_core::FeatureChecker::default();
feature_checker.enable_legacy_unstable();
let mut runtime = JsRuntime::new(RuntimeOptions {
extensions: vec![test_ext::init_ops()],
feature_checker: Some(Arc::new(feature_checker)),
feature_checker: Some(Arc::new(Default::default())),
..Default::default()
});

View file

@ -17,11 +17,7 @@ use deno_core::OpState;
/// Helper for checking unstable features. Used for sync ops.
pub fn check_unstable(state: &OpState, feature: &str, api_name: &str) {
// TODO(bartlomieju): replace with `state.feature_checker.check_or_exit`
// once we phase out `check_or_exit_with_legacy_fallback`
state
.feature_checker
.check_or_exit_with_legacy_fallback(feature, api_name);
state.feature_checker.check_or_exit(feature, api_name);
}
pub struct TestingFeaturesEnabled(pub bool);