@@ -199,7 +199,7 @@ impl StepLog {
199199            error, 
200200            contract, 
201201        }  = self ; 
202-         let  obj = JsObject :: default ( ) ; 
202+         let  obj = JsObject :: with_object_proto ( ctx . intrinsics ( ) ) ; 
203203
204204        // fields 
205205        let  op = op. into_js_object ( ctx) ?; 
@@ -252,7 +252,7 @@ impl MemoryRef {
252252    } 
253253
254254    pub ( crate )  fn  into_js_object ( self ,  ctx :  & mut  Context )  -> JsResult < JsObject >  { 
255-         let  obj = JsObject :: default ( ) ; 
255+         let  obj = JsObject :: with_object_proto ( ctx . intrinsics ( ) ) ; 
256256        let  len = self . len ( ) ; 
257257
258258        let  length = FunctionObjectBuilder :: new ( 
@@ -269,8 +269,8 @@ impl MemoryRef {
269269            ctx. realm ( ) , 
270270            NativeFunction :: from_copy_closure_with_captures ( 
271271                move  |_this,  args,  memory,  ctx| { 
272-                     let  start = args. get_or_undefined ( 0 ) . to_number ( ctx) ?; 
273-                     let  end = args. get_or_undefined ( 1 ) . to_number ( ctx) ?; 
272+                     let  start = args. get_or_undefined ( 0 ) . to_numeric_number ( ctx) ?; 
273+                     let  end = args. get_or_undefined ( 1 ) . to_numeric_number ( ctx) ?; 
274274                    if  end < start || start < 0.  || ( end as  usize )  > memory. len ( )  { 
275275                        return  Err ( JsError :: from_native ( JsNativeError :: typ ( ) . with_message ( 
276276                            format ! ( 
@@ -298,7 +298,7 @@ impl MemoryRef {
298298            ctx. realm ( ) , 
299299            NativeFunction :: from_copy_closure_with_captures ( 
300300                move  |_this,  args,  memory,  ctx| { 
301-                     let  offset_f64 = args. get_or_undefined ( 0 ) . to_number ( ctx) ?; 
301+                     let  offset_f64 = args. get_or_undefined ( 0 ) . to_numeric_number ( ctx) ?; 
302302                    let  len = memory. len ( ) ; 
303303                    let  offset = offset_f64 as  usize ; 
304304                    if  len < offset + 32  || offset_f64 < 0.  { 
@@ -379,7 +379,7 @@ pub(crate) struct OpObj(pub(crate) u8);
379379
380380impl  OpObj  { 
381381    pub ( crate )  fn  into_js_object ( self ,  context :  & mut  Context )  -> JsResult < JsObject >  { 
382-         let  obj = JsObject :: default ( ) ; 
382+         let  obj = JsObject :: with_object_proto ( context . intrinsics ( ) ) ; 
383383        let  value = self . 0 ; 
384384        let  is_push = ( PUSH0 ..=PUSH32 ) . contains ( & value) ; 
385385
@@ -457,7 +457,7 @@ impl StackRef {
457457    } 
458458
459459    pub ( crate )  fn  into_js_object ( self ,  context :  & mut  Context )  -> JsResult < JsObject >  { 
460-         let  obj = JsObject :: default ( ) ; 
460+         let  obj = JsObject :: with_object_proto ( context . intrinsics ( ) ) ; 
461461        let  len = self . 0 . with_inner ( |stack| stack. len ( ) ) . unwrap_or_default ( ) ; 
462462        let  length = FunctionObjectBuilder :: new ( 
463463            context. realm ( ) , 
@@ -471,7 +471,7 @@ impl StackRef {
471471            context. realm ( ) , 
472472            NativeFunction :: from_copy_closure_with_captures ( 
473473                move  |_this,  args,  stack,  ctx| { 
474-                     let  idx_f64 = args. get_or_undefined ( 0 ) . to_number ( ctx) ?; 
474+                     let  idx_f64 = args. get_or_undefined ( 0 ) . to_numeric_number ( ctx) ?; 
475475                    let  idx = idx_f64 as  usize ; 
476476                    if  len <= idx || idx_f64 < 0.  { 
477477                        return  Err ( JsError :: from_native ( JsNativeError :: typ ( ) . with_message ( 
@@ -513,7 +513,7 @@ impl Contract {
513513     /// Caution: this expects a global property `bigint` to be present. 
514514     pub ( crate )  fn  into_js_object ( self ,  ctx :  & mut  Context )  -> JsResult < JsObject >  { 
515515        let  Self  {  caller,  contract,  value,  input }  = self ; 
516-         let  obj = JsObject :: default ( ) ; 
516+         let  obj = JsObject :: with_object_proto ( ctx . intrinsics ( ) ) ; 
517517
518518        let  get_caller = FunctionObjectBuilder :: new ( 
519519            ctx. realm ( ) , 
@@ -570,7 +570,7 @@ pub(crate) struct FrameResult {
570570impl  FrameResult  { 
571571    pub ( crate )  fn  into_js_object ( self ,  ctx :  & mut  Context )  -> JsResult < JsObject >  { 
572572        let  Self  {  gas_used,  output,  error }  = self ; 
573-         let  obj = JsObject :: default ( ) ; 
573+         let  obj = JsObject :: with_object_proto ( ctx . intrinsics ( ) ) ; 
574574
575575        let  output = to_uint8_array_value ( output,  ctx) ?; 
576576        let  get_output = FunctionObjectBuilder :: new ( 
@@ -605,7 +605,7 @@ pub(crate) struct CallFrame {
605605impl  CallFrame  { 
606606    pub ( crate )  fn  into_js_object ( self ,  ctx :  & mut  Context )  -> JsResult < JsObject >  { 
607607        let  Self  {  contract :  Contract  {  caller,  contract,  value,  input } ,  kind,  gas }  = self ; 
608-         let  obj = JsObject :: default ( ) ; 
608+         let  obj = JsObject :: with_object_proto ( ctx . intrinsics ( ) ) ; 
609609
610610        let  get_from = FunctionObjectBuilder :: new ( 
611611            ctx. realm ( ) , 
@@ -708,7 +708,7 @@ impl JsEvmContext {
708708            transaction_ctx, 
709709            error, 
710710        }  = self ; 
711-         let  obj = JsObject :: default ( ) ; 
711+         let  obj = JsObject :: with_object_proto ( ctx . intrinsics ( ) ) ; 
712712
713713        // add properties 
714714
@@ -849,7 +849,7 @@ impl EvmDbRef {
849849    } 
850850
851851    pub ( crate )  fn  into_js_object ( self ,  ctx :  & mut  Context )  -> JsResult < JsObject >  { 
852-         let  obj = JsObject :: default ( ) ; 
852+         let  obj = JsObject :: with_object_proto ( ctx . intrinsics ( ) ) ; 
853853        let  exists = FunctionObjectBuilder :: new ( 
854854            ctx. realm ( ) , 
855855            NativeFunction :: from_copy_closure_with_captures ( 
0 commit comments