Skip to content

Commit

Permalink
Add support for Trace, Finalize and JsData for Convert<> (#3970)
Browse files Browse the repository at this point in the history
  • Loading branch information
hansl authored Sep 9, 2024
1 parent 4c5df56 commit 4778780
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions core/engine/src/value/conversions/convert.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@
//! if necessary).

use boa_engine::JsNativeError;
use boa_gc::{Finalize, Trace};

use crate::value::TryFromJs;
use crate::{Context, JsResult, JsString, JsValue};
use crate::{Context, JsData, JsResult, JsString, JsValue};

/// A wrapper type that allows converting a `JsValue` to a specific type.
/// This is useful when you want to convert a `JsValue` to a Rust type.
Expand Down Expand Up @@ -42,7 +43,7 @@ use crate::{Context, JsResult, JsString, JsValue};
/// assert_eq!(conv5, true);
/// assert_eq!(conv_nan, false);
/// ```
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
#[derive(Debug, Clone, PartialEq, Eq, Trace, Finalize, JsData)]
pub struct Convert<T: TryFromJs>(pub T);

impl<T: TryFromJs> From<T> for Convert<T> {
Expand Down

0 comments on commit 4778780

Please sign in to comment.