mirror of
https://github.com/oven-sh/bun
synced 2026-02-14 12:51:54 +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>
16 lines
468 B
JavaScript
16 lines
468 B
JavaScript
#!/usr/bin/env node
|
|
|
|
// Test constructor instantiation
|
|
try {
|
|
console.log('Testing constructor instantiation...');
|
|
const sqlite = require('node:sqlite');
|
|
console.log('sqlite:', sqlite);
|
|
|
|
console.log('Trying to create new DatabaseSync()...');
|
|
const db = new sqlite.DatabaseSync();
|
|
console.log('DatabaseSync created successfully:', db);
|
|
|
|
} catch (error) {
|
|
console.error('Failed to create DatabaseSync:', error);
|
|
console.error('Stack:', error.stack);
|
|
} |