Subj : Re: Creating classes/namespaces on the fly from existing functions? To : netscape.public.mozilla.jseng From : bubbfree Date : Thu Jan 06 2005 10:20 pm Very cool. That works perfectly. Thanks Brendan. What's your opinion of the 2nd part, where instead of explicitly asking the user to call addLibrary(...), I trap an error call and attempt to do the lookup myself? I was digging around and also noticed JS_SetDebugErrorHook() in the debug API files. From the .c's it looks like this is called before a real error is thrown. Are there advantages either way for attempting to do this dynamic lookup/creation using the DebugErrorHook or the regular ErrorReporter callbacks? ie in "no addLibrary()" land: external1.something() -- errors out in native code, attempt to lookup external1.js in current folder if successful, proceded to evaluateScript and defineProperty on it. stop the script execution, and restart it. Smells a little hacky =). .