From 6307cb4d3600e7a613e5763147e411f9eb338e00 Mon Sep 17 00:00:00 2001 From: Xavier MONTILLET Date: Mon, 4 Dec 2023 16:26:34 +0100 Subject: [PATCH] Added `Todo` placeholder type --- jstz_api/src/lib.rs | 1 + jstz_api/src/todo.rs | 40 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 41 insertions(+) create mode 100644 jstz_api/src/todo.rs diff --git a/jstz_api/src/lib.rs b/jstz_api/src/lib.rs index 1a2a2263e..a3a914a6f 100644 --- a/jstz_api/src/lib.rs +++ b/jstz_api/src/lib.rs @@ -4,6 +4,7 @@ mod kv; pub mod encoding; pub mod http; pub mod idl; +mod todo; pub mod url; pub mod urlpattern; pub use console::ConsoleApi; diff --git a/jstz_api/src/todo.rs b/jstz_api/src/todo.rs new file mode 100644 index 000000000..37d487585 --- /dev/null +++ b/jstz_api/src/todo.rs @@ -0,0 +1,40 @@ +use boa_engine::value::TryFromJs; +use boa_gc::{custom_trace, Finalize, Trace}; +use jstz_core::value::IntoJs; + +/// A placeholder for types that have yet to be defined +#[derive(Debug)] +pub enum Todo { + Todo, +} + +impl Finalize for Todo { + fn finalize(&self) { + todo!() + } +} + +#[allow(unused_variables)] +unsafe impl Trace for Todo { + custom_trace!(this, todo!()); +} + +#[allow(unused_variables)] +impl IntoJs for Todo { + fn into_js( + self, + context: &mut boa_engine::prelude::Context<'_>, + ) -> boa_engine::prelude::JsValue { + todo!() + } +} + +#[allow(unused_variables)] +impl TryFromJs for Todo { + fn try_from_js( + value: &boa_engine::prelude::JsValue, + context: &mut boa_engine::prelude::Context<'_>, + ) -> boa_engine::prelude::JsResult { + todo!() + } +}