Skip to content

Commit

Permalink
feat(api): added Todo placeholder type
Browse files Browse the repository at this point in the history
  • Loading branch information
xavierm02 committed Dec 5, 2023
1 parent 80aa8db commit 55640b7
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 0 deletions.
1 change: 1 addition & 0 deletions crates/jstz_api/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ pub mod encoding;
pub mod http;
pub mod idl;
pub mod stream;
pub mod todo;
pub mod url;
pub mod urlpattern;
pub use console::{ConsoleApi, LogRecord, LOG_PREFIX};
Expand Down
40 changes: 40 additions & 0 deletions crates/jstz_api/src/todo.rs
Original file line number Diff line number Diff line change
@@ -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<Self> {
todo!()
}
}

0 comments on commit 55640b7

Please sign in to comment.