Fixing various badness as I still can't get rooms to work.
git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@4038 ed5197a5-7fde-0310-b194-c3ffbd925b24
This commit is contained in:
22
src/ssb.js.c
22
src/ssb.js.c
@ -750,29 +750,9 @@ void tf_ssb_run_file(JSContext* context, const char* file_name)
|
||||
fclose(file);
|
||||
|
||||
JSValue result = JS_Eval(context, source, file_size, file_name, 0);
|
||||
if (JS_IsError(context, result))
|
||||
if (tf_util_report_error(context, result))
|
||||
{
|
||||
printf("Error running %s.\n", file_name);
|
||||
const char* value = JS_ToCString(context, result);
|
||||
printf("ERROR: %s\n", value);
|
||||
JS_FreeCString(context, value);
|
||||
JSValue stack = JS_GetPropertyStr(context, result, "stack");
|
||||
if (!JS_IsUndefined(stack))
|
||||
{
|
||||
const char* stack_str = JS_ToCString(context, stack);
|
||||
printf("%s\n", stack_str);
|
||||
JS_FreeCString(context, stack_str);
|
||||
}
|
||||
JS_FreeValue(context, stack);
|
||||
}
|
||||
else if (JS_IsException(result))
|
||||
{
|
||||
printf("Exception running %s.\n", file_name);
|
||||
JSValue error = JS_GetException(context);
|
||||
const char* value = JS_ToCString(context, error);
|
||||
printf("Exception: %s\n", value);
|
||||
JS_FreeCString(context, value);
|
||||
JS_FreeValue(context, error);
|
||||
}
|
||||
|
||||
JSRuntime* runtime = JS_GetRuntime(context);
|
||||
|
Reference in New Issue
Block a user