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

Added RootKind and GCMethods implementation for PropertyDescriptor #414

Merged
merged 1 commit into from
Apr 6, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "mozjs"
description = "Rust bindings to the Mozilla SpiderMonkey JavaScript engine."
repository = "https://github.com/servo/rust-mozjs"
version = "0.6.0"
version = "0.6.1"
authors = ["The Servo Project Developers"]
build = "build.rs"
license = "MPL-2.0"
Expand Down
10 changes: 10 additions & 0 deletions src/rust.rs
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,11 @@ impl RootKind for Value {
fn rootKind() -> jsapi::RootKind { jsapi::RootKind::Value }
}

impl RootKind for PropertyDescriptor {
#[inline(always)]
fn rootKind() -> jsapi::RootKind { jsapi::RootKind::Traceable }
}

// Creates a C string literal `$str`.
macro_rules! c_str {
($str:expr) => {
Expand Down Expand Up @@ -975,6 +980,11 @@ impl GCMethods for Value {
}
}

impl GCMethods for PropertyDescriptor {
unsafe fn initial() -> PropertyDescriptor { PropertyDescriptor::default() }
unsafe fn post_barrier(_ : *mut PropertyDescriptor, _ : PropertyDescriptor, _ :PropertyDescriptor) {}
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: add a newline after this.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done


impl<T: GCMethods + Copy> Heap<T> {
/// This creates a `Box`-wrapped Heap value. Setting a value inside Heap
/// object triggers a barrier, referring to the Heap object location,
Expand Down