// debug-sandbox.js - Debug the sandbox structure import { createDefaultJSBridge } from './src/core/js-bridge.js'; const bridge = createDefaultJSBridge({ allowedFunctions: new Set([ 'JSON.parse', 'JSON.stringify', 'Math.abs', 'Math.floor', 'Math.ceil', 'Math.round', 'Math.min', 'Math.max', 'Math.random', 'console.log', 'console.warn', 'console.error', 'Date.now', 'performance.now' ]) }); console.log('Sandbox keys:', Object.keys(bridge.config.sandbox)); console.log('Math object:', bridge.config.sandbox.Math); console.log('Math.abs:', bridge.config.sandbox.Math.abs); console.log('typeof Math.abs:', typeof bridge.config.sandbox.Math.abs); // Test function resolution const fn = bridge.resolveFunction('Math.abs'); console.log('Resolved function:', fn); console.log('Function type:', typeof fn); // Test function call const result = bridge.callFunction('Math.abs', [-5]); console.log('Call result:', result);