Skip to content

Commit

Permalink
Implement trace for Class
Browse files Browse the repository at this point in the history
  • Loading branch information
DelSkayn committed Aug 16, 2023
1 parent 312661f commit 31864d3
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion core/src/class/trace.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
use std::marker::PhantomData;

use crate::{markers::Invariant, qjs, Ctx, Value};
use crate::{markers::Invariant, qjs, Class, Ctx, Value};

use super::JsClass;

/// A trait for classes for tracing references to quickjs objects.
///
Expand Down Expand Up @@ -66,6 +68,15 @@ impl<'js> Trace<'js> for Ctx<'js> {
}
}

impl<'js, T> Trace<'js> for Class<'js, T>
where
T: JsClass<'js>,
{
fn trace<'a>(&self, tracer: Tracer<'a, 'js>) {
self.0.trace(tracer)
}
}

macro_rules! trace_impls {

(primitive: $( $(#[$meta:meta])* $($type:ident)::+$(<$lt:lifetime>)?,)*) => {
Expand Down

0 comments on commit 31864d3

Please sign in to comment.