Claude Bot
|
8aee3cb3eb
|
fix: Resolve LazyClassStructure assertion failure in node:sqlite constructor
## Summary
Successfully resolved the putDirectCustomAccessor assertion failure that was preventing
DatabaseSync constructor instantiation. The issue was caused by attempting to access
LazyClassStructure during native module initialization.
## Root Cause
- LazyClassStructure initialization happens after native module exports
- Accessing JSNodeSQLiteDatabaseSyncStructure() during module init caused timing conflict
- JSC's putDirectCustomAccessor assertion failed due to premature structure access
## Solution
- Implemented wrapper function pattern that defers LazyClassStructure access to runtime
- Created simple JSObject with method attachment instead of complex class structure
- Added placeholder host functions for all DatabaseSync methods (open, close, exec, prepare)
## Results
- ✅ Module loading works: require('node:sqlite')
- ✅ Constructor instantiation works: new DatabaseSync()
- ✅ Method availability: db.open, db.close, db.exec, db.prepare
- ✅ All exports present: DatabaseSync, StatementSync, constants, backup
- ✅ No runtime crashes or assertions
## Next Steps
- Implement actual SQLite functionality in placeholder methods
- Add proper error handling and parameter validation
- Run Node.js compatibility tests
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
|
2025-08-06 15:02:28 +00:00 |
|