Skip to content
This repository was archived by the owner on Nov 12, 2022. It is now read-only.

Commit 18ea0f8

Browse files
committed
Added RootKind and GCMethods implementation for PropertyDescriptor
1 parent 0ff4db7 commit 18ea0f8

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
name = "mozjs"
33
description = "Rust bindings to the Mozilla SpiderMonkey JavaScript engine."
44
repository = "https://github.com/servo/rust-mozjs"
5-
version = "0.5.0"
5+
version = "0.5.1"
66
authors = ["The Servo Project Developers"]
77
build = "build.rs"
88
license = "MPL-2.0"

src/rust.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -304,6 +304,11 @@ impl RootKind for Value {
304304
fn rootKind() -> jsapi::RootKind { jsapi::RootKind::Value }
305305
}
306306

307+
impl RootKind for PropertyDescriptor {
308+
#[inline(always)]
309+
fn rootKind() -> jsapi::RootKind { jsapi::RootKind::Traceable }
310+
}
311+
307312
// Creates a C string literal `$str`.
308313
macro_rules! c_str {
309314
($str:expr) => {
@@ -836,6 +841,11 @@ impl GCMethods for Value {
836841
}
837842
}
838843

844+
impl GCMethods for PropertyDescriptor {
845+
unsafe fn initial() -> PropertyDescriptor { PropertyDescriptor::default() }
846+
unsafe fn post_barrier(_ : *mut PropertyDescriptor, _ : PropertyDescriptor, _ :PropertyDescriptor) {}
847+
}
848+
839849
impl<T: GCMethods + Copy> Heap<T> {
840850
/// This creates a `Box`-wrapped Heap value. Setting a value inside Heap
841851
/// object triggers a barrier, referring to the Heap object location,

0 commit comments

Comments
 (0)