Module initialization proxy function - C wrapper for Go export This function serves as a bridge between QuickJS C API and Go ModuleBuilder functionality Called by QuickJS when a module is being initialized Corresponds to JSModuleInitFunc signature: int (*)(JSContext *ctx, JSModuleDef *m)
| 1155 | // Called by QuickJS when a module is being initialized |
| 1156 | // Corresponds to JSModuleInitFunc signature: int (*)(JSContext *ctx, JSModuleDef *m) |
| 1157 | int GoModuleInitProxy(JSContext *ctx, JSModuleDef *m) { |
| 1158 | // Call the Go export function which handles the actual module initialization logic |
| 1159 | // The Go function will: |
| 1160 | // 1. Retrieve the ModuleBuilder from module private value |
| 1161 | // 2. Set all export values using JS_SetModuleExport |
| 1162 | // 3. Call user initialization function if provided |
| 1163 | // 4. Handle error cases and resource cleanup |
| 1164 | return goModuleInitProxy(ctx, m); |
| 1165 | } |
nothing calls this directly
no test coverage detected