mirror of
https://github.com/Samsung/escargot.git
synced 2026-06-22 10:01:50 +00:00
Refactoring Job
* all types of job now handled in the task queue Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
This commit is contained in:
parent
01e61f1242
commit
90522697eb
13 changed files with 73 additions and 84 deletions
|
|
@ -274,8 +274,8 @@ static ValueRef* builtinUneval(ExecutionStateRef* state, ValueRef* thisValue, si
|
|||
static ValueRef* builtinDrainJobQueue(ExecutionStateRef* state, ValueRef* thisValue, size_t argc, ValueRef** argv, bool isConstructCall)
|
||||
{
|
||||
ContextRef* context = state->context();
|
||||
while (context->vmInstance()->hasPendingPromiseJob()) {
|
||||
auto jobResult = context->vmInstance()->executePendingPromiseJob();
|
||||
while (context->vmInstance()->hasPendingJob()) {
|
||||
auto jobResult = context->vmInstance()->executePendingJob();
|
||||
if (jobResult.error) {
|
||||
return ValueRef::create(false);
|
||||
}
|
||||
|
|
@ -458,7 +458,7 @@ PersistentRefHolder<ContextRef> createEscargotContext(VMInstanceRef* instance)
|
|||
|
||||
class ShellPlatform : public PlatformRef {
|
||||
public:
|
||||
virtual void didPromiseJobEnqueued(ContextRef* relatedContext, PromiseObjectRef* obj) override
|
||||
virtual void markJSJobEnqueued(ContextRef* relatedContext) override
|
||||
{
|
||||
// ignore. we always check pending job after eval script
|
||||
}
|
||||
|
|
@ -632,8 +632,8 @@ static bool evalScript(ContextRef* context, StringRef* source, StringRef* srcNam
|
|||
puts(evalResult.resultOrErrorToString(context)->toStdUTF8String().data());
|
||||
}
|
||||
|
||||
while (context->vmInstance()->hasPendingPromiseJob()) {
|
||||
auto jobResult = context->vmInstance()->executePendingPromiseJob();
|
||||
while (context->vmInstance()->hasPendingJob()) {
|
||||
auto jobResult = context->vmInstance()->executePendingJob();
|
||||
if (shouldPrintScriptResult) {
|
||||
if (jobResult.error) {
|
||||
fprintf(stderr, "Uncaught %s:\n", jobResult.resultOrErrorToString(context)->toStdUTF8String().data());
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue