Skip to content

Conversation

krichprollsch
Copy link
Member

Adding a Callback parameter on a constructor failed with:

$ zig build                                                                                                                                  
install                                                                                                                                      
└─ install browsercore                                                                                                                       
   └─ zig build-exe browsercore Debug native 1 errors                                                                                        
vendor/zig-js-runtime/src/engines/v8/generate.zig:980:73: error: overflow of integer type 'usize' with value '-1'                            
        const js_func_index = func.callback_index.? - func.index_offset - 1;                                                                 
                              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~                                                                                                                                                                                                               
referenced by:                                                                                                                               
    constructor: vendor/zig-js-runtime/src/engines/v8/generate.zig:999:21                                                                    
    generateConstructor__anon_19702: vendor/zig-js-runtime/src/engines/v8/generate.zig:1007:6                                                
    remaining reference traces hidden; use '-freference-trace' to see all reference traces                                                   

This PR:

  • adds a kind to Func struct
  • uses kind to fix callback offset creation

@krichprollsch krichprollsch merged commit 211ef05 into main Jun 19, 2024
@krichprollsch krichprollsch deleted the callback-constr branch June 19, 2024 13:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants