diff options
author | Bartek IwaĆczuk <biwanczuk@gmail.com> | 2023-10-12 17:55:50 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-10-12 15:55:50 +0000 |
commit | c464cd7073c761780b3170a48542c387560e3f26 (patch) | |
tree | 881a26d05423f9c696c8f35ce8bd2d72d562b1ea /ext/broadcast_channel/lib.rs | |
parent | 5dd010a4fbeb0602891ea537b98216b8ad7d27a7 (diff) |
refactor: FeatureChecker integration in ext/ crates (#20797)
Towards https://github.com/denoland/deno/issues/20779.
Diffstat (limited to 'ext/broadcast_channel/lib.rs')
-rw-r--r-- | ext/broadcast_channel/lib.rs | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/ext/broadcast_channel/lib.rs b/ext/broadcast_channel/lib.rs index 49cc78415..6079a8310 100644 --- a/ext/broadcast_channel/lib.rs +++ b/ext/broadcast_channel/lib.rs @@ -17,6 +17,8 @@ use deno_core::OpState; use deno_core::Resource; use deno_core::ResourceId; +pub const UNSTABLE_FEATURE_NAME: &str = "broadcast-channel"; + #[async_trait] pub trait BroadcastChannel: Clone { type Resource: Resource; @@ -48,9 +50,12 @@ pub fn op_broadcast_subscribe<BC>( where BC: BroadcastChannel + 'static, { - state - .feature_checker - .check_legacy_unstable_or_exit("BroadcastChannel"); + // 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", + ); let bc = state.borrow::<BC>(); let resource = bc.subscribe()?; Ok(state.resource_table.add(resource)) |