Skip to content

Commit 6e6ed42

Browse files
committed
Reformatted JSVal Implementation
Reordered JSVal Implementation with C++
1 parent a12d2b8 commit 6e6ed42

File tree

3 files changed

+159
-253
lines changed

3 files changed

+159
-253
lines changed

mozjs/src/jsgc.rs

+3-4
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ use crate::jsapi::{jsid, JSFunction, JSObject, JSScript, JSString, JSTracer};
88
use crate::jsid::VoidId;
99
use std::cell::UnsafeCell;
1010
use std::ffi::c_void;
11-
use std::mem;
1211
use std::ptr;
1312

1413
/// A trait for JS types that can be registered as roots.
@@ -116,9 +115,9 @@ impl GCMethods for *mut JSFunction {
116115
}
117116
unsafe fn post_barrier(v: *mut *mut JSFunction, prev: *mut JSFunction, next: *mut JSFunction) {
118117
JS::HeapObjectWriteBarriers(
119-
mem::transmute(v),
120-
mem::transmute(prev),
121-
mem::transmute(next),
118+
v as *mut *mut JSObject,
119+
prev as *mut JSObject,
120+
next as *mut JSObject,
122121
);
123122
}
124123
}

mozjs/src/jsid.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66

77
use crate::jsapi::JS::Symbol;
88
use crate::jsapi::{jsid, JSString};
9-
use libc::c_void;
9+
10+
use std::ffi::c_void;
1011

1112
#[deprecated]
1213
pub const JSID_VOID: jsid = VoidId();

0 commit comments

Comments
 (0)