mirror of
https://github.com/oven-sh/bun
synced 2026-02-13 12:29:07 +00:00
## What was achieved - ✅ Fixed SyntheticModuleType enum generation by running bundle-modules.ts - ✅ Successfully build and load node:sqlite module with all exports - ✅ Module correctly exports backup, constants, DatabaseSync, StatementSync - ✅ Identified root cause of constructor instantiation issue ## Constructor Export Issue Analysis - 🔍 **Root Cause**: LazyClassStructure timing conflict with native module exports - 🔍 **Assertion**: `putDirectCustomAccessor` fails during module initialization - 🔍 **Affects**: Both direct constructor export and wrapper function approaches - 🔍 **Timing**: Occurs when accessing JSNodeSQLiteDatabaseSyncStructure() during module init ## Implementation Status - ✅ Module loading works: `require('node:sqlite')` - ✅ Proper API surface: DatabaseSync, StatementSync, constants, backup - ✅ Build system integration complete - ⚠️ Constructor instantiation blocked by JSC assertion - ⚠️ StatementSync properly designed to require database instance ## Files changed - STATUS.md: Updated with detailed analysis and current status - NodeSQLiteModule.cpp: Implemented constructor wrappers (blocked by JSC issue) - NodeSQLiteModule.h: Updated exports to use wrapper functions - test_*.js: Created test files to isolate the issue ## Next Steps - Requires JSC/LazyClassStructure expert knowledge - Alternative: Implement constructors without LazyClassStructure system - Current workaround: Placeholders with error messages 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
20 lines
642 B
JavaScript
20 lines
642 B
JavaScript
#!/usr/bin/env node
|
|
|
|
// Test accessing constructors without calling them
|
|
try {
|
|
console.log('Testing constructor access...');
|
|
const sqlite = require('node:sqlite');
|
|
console.log('sqlite module loaded');
|
|
|
|
console.log('typeof DatabaseSync:', typeof sqlite.DatabaseSync);
|
|
console.log('typeof StatementSync:', typeof sqlite.StatementSync);
|
|
|
|
console.log('DatabaseSync.name:', sqlite.DatabaseSync.name);
|
|
console.log('StatementSync.name:', sqlite.StatementSync.name);
|
|
|
|
console.log('Success - constructors are accessible!');
|
|
|
|
} catch (error) {
|
|
console.error('Failed:', error.message);
|
|
console.error('Stack:', error.stack);
|
|
} |