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

Commit 96e1c30

Browse files
author
bors-servo
authored
Auto merge of #414 - taki-jaro:property_descriptor, r=jdm`
Added RootKind and GCMethods implementation for PropertyDescriptor It is needed for [servo issue 15012](servo/servo#15012). <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/rust-mozjs/414) <!-- Reviewable:end -->
2 parents 94c4715 + 1bff572 commit 96e1c30

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.6.0"
5+
version = "0.6.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
@@ -316,6 +316,11 @@ impl RootKind for Value {
316316
fn rootKind() -> jsapi::RootKind { jsapi::RootKind::Value }
317317
}
318318

319+
impl RootKind for PropertyDescriptor {
320+
#[inline(always)]
321+
fn rootKind() -> jsapi::RootKind { jsapi::RootKind::Traceable }
322+
}
323+
319324
// Creates a C string literal `$str`.
320325
macro_rules! c_str {
321326
($str:expr) => {
@@ -972,6 +977,11 @@ impl GCMethods for Value {
972977
}
973978
}
974979

980+
impl GCMethods for PropertyDescriptor {
981+
unsafe fn initial() -> PropertyDescriptor { PropertyDescriptor::default() }
982+
unsafe fn post_barrier(_ : *mut PropertyDescriptor, _ : PropertyDescriptor, _ :PropertyDescriptor) {}
983+
}
984+
975985
impl<T: GCMethods + Copy> Heap<T> {
976986
/// This creates a `Box`-wrapped Heap value. Setting a value inside Heap
977987
/// object triggers a barrier, referring to the Heap object location,

0 commit comments

Comments
 (0)