@@ -5,7 +5,7 @@ use dynify::Dynify;
55
66use super :: { IndexOperand , RegisterOperand } ;
77use crate :: {
8- Context , JsError , JsObject , JsResult , JsValue , NativeFunction ,
8+ Context , JsError , JsExpect , JsObject , JsResult , JsValue , NativeFunction ,
99 builtins:: { Promise , promise:: PromiseCapability } ,
1010 error:: JsNativeError ,
1111 job:: NativeAsyncJob ,
@@ -107,12 +107,12 @@ impl CallEvalSpread {
107107 let arguments_array = context. vm . stack . pop ( ) ;
108108 let arguments_array_object = arguments_array
109109 . as_object ( )
110- . expect ( "arguments array in call spread function must be an object" ) ;
110+ . js_expect ( "arguments array in call spread function must be an object" ) ? ;
111111 let arguments = arguments_array_object
112112 . borrow ( )
113113 . properties ( )
114114 . to_dense_indexed_properties ( )
115- . expect ( "arguments array in call spread function must be dense" ) ;
115+ . js_expect ( "arguments array in call spread function must be dense" ) ? ;
116116
117117 let func = context. vm . stack . calling_convention_get_function ( 0 ) ;
118118
@@ -223,12 +223,12 @@ impl CallSpread {
223223 let arguments_array = context. vm . stack . pop ( ) ;
224224 let arguments_array_object = arguments_array
225225 . as_object ( )
226- . expect ( "arguments array in call spread function must be an object" ) ;
226+ . js_expect ( "arguments array in call spread function must be an object" ) ? ;
227227 let arguments = arguments_array_object
228228 . borrow ( )
229229 . properties ( )
230230 . to_dense_indexed_properties ( )
231- . expect ( "arguments array in call spread function must be dense" ) ;
231+ . js_expect ( "arguments array in call spread function must be dense" ) ? ;
232232
233233 let argument_count = arguments. len ( ) ;
234234 context
@@ -303,13 +303,13 @@ fn parse_import_attributes(
303303 for entry in entries {
304304 let entry = entry
305305 . as_object ( )
306- . expect ( "entry from EnumerableOwnProperties must be an object" ) ;
306+ . js_expect ( "entry from EnumerableOwnProperties must be an object" ) ? ;
307307
308308 // 1. Let key be entry.[[Key]].
309309 let key = entry. get ( 0 , context) ?;
310310 let key_str = key
311311 . as_string ( )
312- . expect ( "key from EnumerableOwnProperties must be a string" )
312+ . js_expect ( "key from EnumerableOwnProperties must be a string" ) ?
313313 . clone ( ) ;
314314
315315 // 2. Let value be entry.[[Value]].
0 commit comments