Mercurial > spidermonkey-playground
diff spidermonkey-playground.cpp @ 16:36b66c249446
Added some TODOs.
author | Atul Varma <varmaa@toolness.com> |
---|---|
date | Mon, 22 Jun 2009 06:32:32 -0700 |
parents | 1d73446eef62 |
children | 83b891ccc471 |
line wrap: on
line diff
--- a/spidermonkey-playground.cpp Fri Jun 19 22:42:00 2009 -0700 +++ b/spidermonkey-playground.cpp Mon Jun 22 06:32:32 2009 -0700 @@ -67,12 +67,15 @@ fread(source, MAX_SCRIPT_SIZE, 1, f); fclose(f); + // TODO: Check for return values here. JSContext *module_cx = JS_NewContext(JS_GetRuntime(cx), 8192); - JSObject *module_global = JS_NewObject(module_cx, &global_class, NULL, NULL); + JSObject *module_global = JS_NewObject(module_cx, &global_class, NULL, + NULL); JS_InitStandardClasses(module_cx, module_global); JS_DefineProperty(module_cx, module_global, "imports", OBJECT_TO_JSVAL(exports), NULL, NULL, 0); - JSObject *module_exports = JS_NewObject(module_cx, NULL, NULL, module_global); + JSObject *module_exports = JS_NewObject(module_cx, NULL, NULL, + module_global); JS_DefineProperty(module_cx, module_global, "exports", OBJECT_TO_JSVAL(module_exports), NULL, NULL, 0); @@ -129,6 +132,7 @@ filenameVal = STRING_TO_JSVAL(filenameStr); } + // TODO: Check for return values here. JSObject *funcInfo = JS_NewObject(cx, NULL, NULL, NULL); JS_DefineProperty(cx, funcInfo, "filename", filenameVal, NULL, NULL, 0); @@ -189,6 +193,7 @@ scopeChainVal = OBJECT_TO_JSVAL(scopeChain); } + // TODO: Check for return values here. JSObject *frameInfo = JS_NewObject(cx, NULL, NULL, NULL); JS_DefineProperty(cx, frameInfo, "filename", filenameVal, NULL, NULL, 0); @@ -317,6 +322,7 @@ if (!JS_DefineFunctions(tcb_cx, tcb_global, tcb_global_functions)) return 1; + // TODO: Check for return values here. JS_SetThrowHook(rt, throwHook, tcb_global); JS_DefineProperty(tcb_cx, tcb_global, "lastExceptionTraceback", JSVAL_NULL, NULL, NULL, 0);