I've found another bug:
If you create an object with a function but omit a parameter it needs miniSphere hard crashes if you try and access that field later
e.g.:
function CoolObject(a, b, c)
{
this.a = a;
this.b = b;
this.c = c;
}
var fun = new CoolObject(5, 6);
throw fun.c;//results in a hard crash
Obviously this is bad code that would always cause problems - but ideally it would trigger miniSPhere's error handling to make it easier to debug OR it should give you a "undefined" value rather than
Crashed Thread: 9
Exception Type: EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Exception Note: EXC_CORPSE_NOTIFY
Thread 9 Crashed:
0 libsystem_kernel.dylib 0x00007fff9a1bbd42 __pthread_kill + 10
1 libsystem_pthread.dylib 0x00007fff9a2a9457 pthread_kill + 90
2 libsystem_c.dylib 0x00007fff9a121420 abort + 129
3 spheredev.miniSphere 0x0000000106bb2bfc duk_default_fatal_handler + 9 (duk_api_heap.c:68)
4 spheredev.miniSphere 0x0000000106bbc027 duk_fatal_raw + 15 (duk_api_stack.c:5428)
5 spheredev.miniSphere 0x0000000106bbc00e duk_err_longjmp + 102 (duk_error_longjmp.c:102)
6 spheredev.miniSphere 0x0000000106bbdd23 duk_err_create_and_throw + 300 (duk_api_bytecode.c:48)
7 spheredev.miniSphere 0x0000000106bb0e96 duk_err_handle_error_fmt + 187 (duk_api_stack.c:5801)
8 spheredev.miniSphere 0x0000000106bb45ed duk_hobject_getprop + 2391 (duk_api_stack.c:3886)
9 spheredev.miniSphere 0x0000000106bb3c7e duk_get_prop + 45 (duk_api_object.c:30)
10 spheredev.miniSphere 0x0000000106bf742a _al_mangled_main + 2922 (main.c:316)
11 spheredev.miniSphere 0x0000000106d7b8da +[AllegroAppDelegate app_main:] + 23
12 com.apple.Foundation 0x00007fff863308ad __NSThread__start__ + 1243
13 libsystem_pthread.dylib 0x00007fff9a2a693b _pthread_body + 180
14 libsystem_pthread.dylib 0x00007fff9a2a6887 _pthread_start + 286
15 libsystem_pthread.dylib 0x00007fff9a2a608d thread_start + 13