An experiment in requesting permissions and some related fixes.

git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@3937 ed5197a5-7fde-0310-b194-c3ffbd925b24
This commit is contained in:
2022-07-27 00:27:10 +00:00
parent b2ecc24e85
commit f787eb077b
7 changed files with 108 additions and 11 deletions

View File

@ -270,7 +270,7 @@ static void _export_record_release_for_task(tf_task_t* task, taskid_t task_id)
}
}
void tf_task_send_error_to_parent(tf_task_t* task, JSValue error)
bool tf_task_send_error_to_parent(tf_task_t* task, JSValue error)
{
if (task && task->_parent)
{
@ -279,7 +279,9 @@ void tf_task_send_error_to_parent(tf_task_t* task, JSValue error)
tf_serialize_store(task, task->_parent, &buffer, &size, error);
tf_packetstream_send(tf_taskstub_get_stream(task->_parent), kTaskError, buffer, size);
tf_free(buffer);
return true;
}
return false;
}
static const char* _task_loadFile(const char* fileName)
@ -337,7 +339,10 @@ int tf_task_execute(tf_task_t* task, const char* fileName)
if (source)
{
JSValue result = JS_Eval(task->_context, source, strlen(source), fileName, JS_EVAL_TYPE_MODULE);
tf_util_report_error(task->_context, result);
if (tf_util_report_error(task->_context, result))
{
printf("Reported an error.\n");
}
if (!JS_IsError(task->_context, result) && !JS_IsException(result))
{
executed = true;