@@ -49,34 +49,34 @@ unsafe extern "C" fn bar(_cx: *mut JSContext, argc: u32, vp: *mut Value) -> bool
4949
5050fn run ( mut rt : Runtime ) {
5151 let options = RealmOptions :: default ( ) ;
52- rooted ! ( in( * rt. cx( ) ) let global = unsafe {
53- JS_NewGlobalObject ( * rt. cx( ) , & SIMPLE_GLOBAL_CLASS , ptr:: null_mut( ) ,
52+ rooted ! ( in( * * rt. cx( ) ) let global = unsafe {
53+ JS_NewGlobalObject ( * * rt. cx( ) , & SIMPLE_GLOBAL_CLASS , ptr:: null_mut( ) ,
5454 OnNewGlobalHookOption :: FireOnNewGlobalHook ,
5555 & * options)
5656 } ) ;
57- let _ac = JSAutoRealm :: new ( * rt. cx ( ) , global. get ( ) ) ;
57+ let _ac = JSAutoRealm :: new ( * * rt. cx ( ) , global. get ( ) ) ;
5858
5959 // Get WebAssembly.Module and WebAssembly.Instance constructors.
60- rooted ! ( in( * rt. cx( ) ) let mut wasm = UndefinedValue ( ) ) ;
61- rooted ! ( in( * rt. cx( ) ) let mut wasm_module = UndefinedValue ( ) ) ;
62- rooted ! ( in( * rt. cx( ) ) let mut wasm_instance = UndefinedValue ( ) ) ;
60+ rooted ! ( in( * * rt. cx( ) ) let mut wasm = UndefinedValue ( ) ) ;
61+ rooted ! ( in( * * rt. cx( ) ) let mut wasm_module = UndefinedValue ( ) ) ;
62+ rooted ! ( in( * * rt. cx( ) ) let mut wasm_instance = UndefinedValue ( ) ) ;
6363
6464 unsafe {
6565 assert ! ( JS_GetProperty (
66- * rt. cx( ) ,
66+ * * rt. cx( ) ,
6767 global. handle( ) ,
6868 c"WebAssembly" . as_ptr( ) ,
6969 wasm. handle_mut( )
7070 ) ) ;
71- rooted ! ( in( * rt. cx( ) ) let mut wasm_obj = wasm. to_object( ) ) ;
71+ rooted ! ( in( * * rt. cx( ) ) let mut wasm_obj = wasm. to_object( ) ) ;
7272 assert ! ( JS_GetProperty (
73- * rt. cx( ) ,
73+ * * rt. cx( ) ,
7474 wasm_obj. handle( ) ,
7575 c"Module" . as_ptr( ) ,
7676 wasm_module. handle_mut( )
7777 ) ) ;
7878 assert ! ( JS_GetProperty (
79- * rt. cx( ) ,
79+ * * rt. cx( ) ,
8080 wasm_obj. handle( ) ,
8181 c"Instance" . as_ptr( ) ,
8282 wasm_instance. handle_mut( )
@@ -86,85 +86,85 @@ fn run(mut rt: Runtime) {
8686 assert ! ( HI_WASM . 0 . as_ptr( ) as usize % 8 == 0 ) ;
8787
8888 // Construct Wasm module from bytes.
89- rooted ! ( in( * rt. cx( ) ) let mut module = null_mut:: <JSObject >( ) ) ;
89+ rooted ! ( in( * * rt. cx( ) ) let mut module = null_mut:: <JSObject >( ) ) ;
9090 {
9191 let array_buffer = JS :: NewArrayBufferWithUserOwnedContents (
92- * rt. cx ( ) ,
92+ * * rt. cx ( ) ,
9393 HI_WASM . 0 . len ( ) ,
9494 HI_WASM . 0 . as_ptr ( ) as _ ,
9595 ) ;
9696 assert ! ( !array_buffer. is_null( ) ) ;
9797
98- rooted ! ( in( * rt. cx( ) ) let val = ObjectValue ( array_buffer) ) ;
98+ rooted ! ( in( * * rt. cx( ) ) let val = ObjectValue ( array_buffer) ) ;
9999 let args = HandleValueArray :: from ( val. handle ( ) . into_handle ( ) ) ;
100100
101101 assert ! ( Construct1 (
102- * rt. cx( ) ,
102+ * * rt. cx( ) ,
103103 wasm_module. handle( ) ,
104104 & args,
105105 module. handle_mut( )
106106 ) )
107107 }
108108
109109 // Construct Wasm module instance with required imports.
110- rooted ! ( in( * rt. cx( ) ) let mut instance = null_mut:: <JSObject >( ) ) ;
110+ rooted ! ( in( * * rt. cx( ) ) let mut instance = null_mut:: <JSObject >( ) ) ;
111111 {
112112 // Build "env" imports object.
113- rooted ! ( in( * rt. cx( ) ) let mut env_import_obj = JS_NewPlainObject ( * rt. cx( ) ) ) ;
113+ rooted ! ( in( * * rt. cx( ) ) let mut env_import_obj = JS_NewPlainObject ( * * rt. cx( ) ) ) ;
114114 assert ! ( !env_import_obj. is_null( ) ) ;
115115 let function = JS_DefineFunction (
116- * rt. cx ( ) ,
116+ * * rt. cx ( ) ,
117117 env_import_obj. handle ( ) . into ( ) ,
118118 c"bar" . as_ptr ( ) ,
119119 Some ( bar) ,
120120 1 ,
121121 0 ,
122122 ) ;
123123 assert ! ( !function. is_null( ) ) ;
124- rooted ! ( in( * rt. cx( ) ) let mut env_import = ObjectValue ( env_import_obj. get( ) ) ) ;
124+ rooted ! ( in( * * rt. cx( ) ) let mut env_import = ObjectValue ( env_import_obj. get( ) ) ) ;
125125 // Build imports bag.
126- rooted ! ( in( * rt. cx( ) ) let mut imports = JS_NewPlainObject ( * rt. cx( ) ) ) ;
126+ rooted ! ( in( * * rt. cx( ) ) let mut imports = JS_NewPlainObject ( * * rt. cx( ) ) ) ;
127127 assert ! ( !imports. is_null( ) ) ;
128128 assert ! ( JS_SetProperty (
129- * rt. cx( ) ,
129+ * * rt. cx( ) ,
130130 imports. handle( ) ,
131131 c"env" . as_ptr( ) ,
132132 env_import. handle( )
133133 ) ) ;
134134
135- rooted ! ( in( * rt. cx( ) ) let mut args = ValueArray :: new( [ ObjectValue ( module. get( ) ) , ObjectValue ( imports. get( ) ) ] ) ) ;
135+ rooted ! ( in( * * rt. cx( ) ) let mut args = ValueArray :: new( [ ObjectValue ( module. get( ) ) , ObjectValue ( imports. get( ) ) ] ) ) ;
136136
137137 assert ! ( Construct1 (
138- * rt. cx( ) ,
138+ * * rt. cx( ) ,
139139 wasm_instance. handle( ) ,
140140 & HandleValueArray :: from( & args) ,
141141 instance. handle_mut( )
142142 ) ) ;
143143 }
144144
145145 // Find `foo` method in exports.
146- rooted ! ( in( * rt. cx( ) ) let mut exports = UndefinedValue ( ) ) ;
146+ rooted ! ( in( * * rt. cx( ) ) let mut exports = UndefinedValue ( ) ) ;
147147
148148 assert ! ( JS_GetProperty (
149- * rt. cx( ) ,
149+ * * rt. cx( ) ,
150150 instance. handle( ) ,
151151 c"exports" . as_ptr( ) ,
152152 exports. handle_mut( )
153153 ) ) ;
154154
155- rooted ! ( in( * rt. cx( ) ) let mut exports_obj = exports. to_object( ) ) ;
156- rooted ! ( in( * rt. cx( ) ) let mut foo = UndefinedValue ( ) ) ;
155+ rooted ! ( in( * * rt. cx( ) ) let mut exports_obj = exports. to_object( ) ) ;
156+ rooted ! ( in( * * rt. cx( ) ) let mut foo = UndefinedValue ( ) ) ;
157157 assert ! ( JS_GetProperty (
158- * rt. cx( ) ,
158+ * * rt. cx( ) ,
159159 exports_obj. handle( ) ,
160160 c"foo" . as_ptr( ) ,
161161 foo. handle_mut( )
162162 ) ) ;
163163
164164 // call foo and get its result
165- rooted ! ( in( * rt. cx( ) ) let mut rval = UndefinedValue ( ) ) ;
165+ rooted ! ( in( * * rt. cx( ) ) let mut rval = UndefinedValue ( ) ) ;
166166 assert ! ( Call (
167- * rt. cx( ) ,
167+ * * rt. cx( ) ,
168168 JS :: UndefinedHandleValue ,
169169 foo. handle( ) . into( ) ,
170170 & HandleValueArray :: empty( ) ,
0 commit comments