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

Commit ef63e56

Browse files
authored
Auto merge of #540 - sagudev:master, r=jdm
Update mozjs to 87 servo/mozjs#275
2 parents fe104a2 + 33df0c3 commit ef63e56

File tree

4 files changed

+22
-24
lines changed

4 files changed

+22
-24
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,4 +58,4 @@ lazy_static = "1"
5858
libc = "0.2"
5959
log = "0.4"
6060
num-traits = "0.2"
61-
mozjs_sys = { git = "https://github.com/servo/mozjs", rev = "82da136c53d7ca7b0b7fe1c5622627036ef31899" }
61+
mozjs_sys = { git = "https://github.com/servo/mozjs", rev="95387f7235ae9ba950a8dbebb850f41709ff5b1d" }

src/glue.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -322,39 +322,39 @@ extern "C" {
322322
pub fn GetProxyHandlerFamily() -> *const c_void;
323323

324324
pub fn GetInt8ArrayLengthAndData(obj: *mut JSObject,
325-
length: *mut u32,
325+
length: *mut usize,
326326
isSharedMemory: *mut bool,
327327
data: *mut *mut i8);
328328
pub fn GetUint8ArrayLengthAndData(obj: *mut JSObject,
329-
length: *mut u32,
329+
length: *mut usize,
330330
isSharedMemory: *mut bool,
331331
data: *mut *mut u8);
332332
pub fn GetUint8ClampedArrayLengthAndData(obj: *mut JSObject,
333-
length: *mut u32,
333+
length: *mut usize,
334334
isSharedMemory: *mut bool,
335335
data: *mut *mut u8);
336336
pub fn GetInt16ArrayLengthAndData(obj: *mut JSObject,
337-
length: *mut u32,
337+
length: *mut usize,
338338
isSharedMemory: *mut bool,
339339
data: *mut *mut i16);
340340
pub fn GetUint16ArrayLengthAndData(obj: *mut JSObject,
341-
length: *mut u32,
341+
length: *mut usize,
342342
isSharedMemory: *mut bool,
343343
data: *mut *mut u16);
344344
pub fn GetInt32ArrayLengthAndData(obj: *mut JSObject,
345-
length: *mut u32,
345+
length: *mut usize,
346346
isSharedMemory: *mut bool,
347347
data: *mut *mut i32);
348348
pub fn GetUint32ArrayLengthAndData(obj: *mut JSObject,
349-
length: *mut u32,
349+
length: *mut usize,
350350
isSharedMemory: *mut bool,
351351
data: *mut *mut u32);
352352
pub fn GetFloat32ArrayLengthAndData(obj: *mut JSObject,
353-
length: *mut u32,
353+
length: *mut usize,
354354
isSharedMemory: *mut bool,
355355
data: *mut *mut f32);
356356
pub fn GetFloat64ArrayLengthAndData(obj: *mut JSObject,
357-
length: *mut u32,
357+
length: *mut usize,
358358
isSharedMemory: *mut bool,
359359
data: *mut *mut f64);
360360

src/jsglue.cpp

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -657,15 +657,13 @@ NewProxyObject(JSContext* aCx, const void* aHandler, JS::HandleValue aPriv,
657657

658658
JSObject*
659659
WrapperNew(JSContext* aCx, JS::HandleObject aObj, const void* aHandler,
660-
const JSClass* aClass, bool aSingleton)
660+
const JSClass* aClass)
661661
{
662662
js::WrapperOptions options;
663663
if (aClass) {
664664
options.setClass(aClass);
665665
}
666-
if (aSingleton) {
667-
return js::Wrapper::NewSingleton(aCx, aObj, (const js::Wrapper*)aHandler, options);
668-
}
666+
669667
return js::Wrapper::New(aCx, aObj, (const js::Wrapper*)aHandler, options);
670668
}
671669

@@ -682,7 +680,7 @@ GetWindowProxyClass()
682680
JSObject*
683681
NewWindowProxy(JSContext* aCx, JS::HandleObject aObj, const void* aHandler)
684682
{
685-
return WrapperNew(aCx, aObj, aHandler, &WindowProxyClass, true);
683+
return WrapperNew(aCx, aObj, aHandler, &WindowProxyClass);
686684
}
687685

688686
void
@@ -1010,7 +1008,7 @@ IsDebugBuild()
10101008

10111009
#define JS_DEFINE_DATA_AND_LENGTH_ACCESSOR(Type, type) \
10121010
void \
1013-
Get ## Type ## ArrayLengthAndData(JSObject* obj, uint32_t* length, \
1011+
Get ## Type ## ArrayLengthAndData(JSObject* obj, size_t* length, \
10141012
bool* isSharedMemory, type** data) \
10151013
{ \
10161014
js::Get ## Type ## ArrayLengthAndData(obj, length, isSharedMemory, \

src/typedarray.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -111,14 +111,14 @@ impl<T: TypedArrayElement, S: JSObjectStorage> ToJSValConvertible for TypedArray
111111
}
112112

113113
pub enum CreateWith<'a, T: 'a> {
114-
Length(u32),
114+
Length(usize),
115115
Slice(&'a [T]),
116116
}
117117

118118
/// A typed array wrapper.
119119
pub struct TypedArray<T: TypedArrayElement, S: JSObjectStorage> {
120120
object: S,
121-
computed: Cell<Option<(*mut T::Element, u32)>>,
121+
computed: Cell<Option<(*mut T::Element, usize)>>,
122122
}
123123

124124
unsafe impl<T> CustomTrace for TypedArray<T, *mut JSObject> where T: TypedArrayElement {
@@ -148,7 +148,7 @@ impl<T: TypedArrayElement, S: JSObjectStorage> TypedArray<T, S> {
148148
}
149149
}
150150

151-
fn data(&self) -> (*mut T::Element, u32) {
151+
fn data(&self) -> (*mut T::Element, usize) {
152152
if let Some(data) = self.computed.get() {
153153
return data;
154154
}
@@ -224,7 +224,7 @@ impl<T: TypedArrayElementCreator + TypedArrayElement, S: JSObjectStorage> TypedA
224224
-> Result<(), ()> {
225225
let length = match with {
226226
CreateWith::Length(len) => len,
227-
CreateWith::Slice(slice) => slice.len() as u32,
227+
CreateWith::Slice(slice) => slice.len(),
228228
};
229229

230230
result.set(T::create_new(cx, length));
@@ -259,13 +259,13 @@ pub trait TypedArrayElement {
259259
/// Unwrap a typed array JS reflector for this element type.
260260
unsafe fn unwrap_array(obj: *mut JSObject) -> *mut JSObject;
261261
/// Retrieve the length and data of a typed array's buffer for this element type.
262-
unsafe fn length_and_data(obj: *mut JSObject) -> (*mut Self::Element, u32);
262+
unsafe fn length_and_data(obj: *mut JSObject) -> (*mut Self::Element, usize);
263263
}
264264

265265
/// Internal trait for creating new typed arrays.
266266
pub trait TypedArrayElementCreator: TypedArrayElement {
267267
/// Create a new typed array.
268-
unsafe fn create_new(cx: *mut JSContext, length: u32) -> *mut JSObject;
268+
unsafe fn create_new(cx: *mut JSContext, length: usize) -> *mut JSObject;
269269
/// Get the data.
270270
unsafe fn get_data(obj: *mut JSObject) -> *mut Self::Element;
271271
}
@@ -284,7 +284,7 @@ macro_rules! typed_array_element {
284284
$unwrap(obj)
285285
}
286286

287-
unsafe fn length_and_data(obj: *mut JSObject) -> (*mut Self::Element, u32) {
287+
unsafe fn length_and_data(obj: *mut JSObject) -> (*mut Self::Element, usize) {
288288
let mut len = 0;
289289
let mut shared = false;
290290
let mut data = ptr::null_mut();
@@ -304,7 +304,7 @@ macro_rules! typed_array_element {
304304
typed_array_element!($t, $element, $unwrap, $length_and_data);
305305

306306
impl TypedArrayElementCreator for $t {
307-
unsafe fn create_new(cx: *mut JSContext, length: u32) -> *mut JSObject {
307+
unsafe fn create_new(cx: *mut JSContext, length: usize) -> *mut JSObject {
308308
$create_new(cx, length)
309309
}
310310

0 commit comments

Comments
 (0)