@@ -7,6 +7,7 @@ extern crate mozjs;
7
7
8
8
use mozjs:: jsapi:: CompartmentOptions ;
9
9
use mozjs:: jsapi:: JSAutoCompartment ;
10
+ use mozjs:: jsapi:: JSObject ;
10
11
use mozjs:: jsapi:: JS_NewGlobalObject ;
11
12
use mozjs:: jsapi:: OnNewGlobalHookOption ;
12
13
use mozjs:: jsapi:: Type ;
@@ -44,7 +45,7 @@ fn typedarray() {
44
45
typedarray ! ( in( cx) let view: ArrayBufferView = rval. to_object( ) ) ;
45
46
assert_eq ! ( view. unwrap( ) . get_array_type( ) , Type :: Uint8 ) ;
46
47
47
- rooted ! ( in( cx) let mut rval = ptr:: null_mut( ) ) ;
48
+ rooted ! ( in( cx) let mut rval = ptr:: null_mut:: < JSObject > ( ) ) ;
48
49
assert ! ( Uint32Array :: create( cx, CreateWith :: Slice ( & [ 1 , 3 , 5 ] ) , rval. handle_mut( ) ) . is_ok( ) ) ;
49
50
50
51
typedarray ! ( in( cx) let array: Uint32Array = rval. get( ) ) ;
@@ -54,11 +55,11 @@ fn typedarray() {
54
55
array. as_mut ( ) . unwrap ( ) . update ( & [ 2 , 4 , 6 ] ) ;
55
56
assert_eq ! ( array. unwrap( ) . as_slice( ) , & [ 2 , 4 , 6 ] [ ..] ) ;
56
57
57
- rooted ! ( in( cx) let rval = ptr:: null_mut( ) ) ;
58
+ rooted ! ( in( cx) let rval = ptr:: null_mut:: < JSObject > ( ) ) ;
58
59
typedarray ! ( in( cx) let array: Uint8Array = rval. get( ) ) ;
59
60
assert ! ( array. is_err( ) ) ;
60
61
61
- rooted ! ( in( cx) let mut rval = ptr:: null_mut( ) ) ;
62
+ rooted ! ( in( cx) let mut rval = ptr:: null_mut:: < JSObject > ( ) ) ;
62
63
assert ! ( Uint32Array :: create( cx, CreateWith :: Length ( 5 ) , rval. handle_mut( ) ) . is_ok( ) ) ;
63
64
64
65
typedarray ! ( in( cx) let array: Uint32Array = rval. get( ) ) ;
@@ -87,7 +88,7 @@ fn typedarray_update_panic() {
87
88
) ;
88
89
89
90
let _ac = JSAutoCompartment :: new ( cx, global. get ( ) ) ;
90
- rooted ! ( in( cx) let mut rval = ptr:: null_mut( ) ) ;
91
+ rooted ! ( in( cx) let mut rval = ptr:: null_mut:: < JSObject > ( ) ) ;
91
92
let _ = Uint32Array :: create ( cx, CreateWith :: Slice ( & [ 1 , 2 , 3 , 4 , 5 ] ) , rval. handle_mut ( ) ) ;
92
93
typedarray ! ( in( cx) let mut array: Uint32Array = rval. get( ) ) ;
93
94
array. as_mut ( ) . unwrap ( ) . update ( & [ 0 , 2 , 4 , 6 , 8 , 10 ] ) ;
0 commit comments