Lines Matching refs:JSHandle

30 void JSAsyncFunction::AsyncFunctionAwait(JSThread *thread, const JSHandle<JSAsyncFuncObject> &asyncFuncObj,
31 const JSHandle<JSTaggedValue> &value)
37 JSHandle<JSTaggedValue> asyncCtxt(thread, asyncFuncObj->GetGeneratorContext());
40 JSHandle<GlobalEnv> env = vm->GetGlobalEnv();
42 JSHandle<PromiseCapability> pcap =
43 JSPromise::NewPromiseCapability(thread, JSHandle<JSTaggedValue>::Cast(env->GetPromiseFunction()));
47 JSHandle<JSTaggedValue> resolve(thread, pcap->GetResolve());
48 JSHandle<JSTaggedValue> thisArg = globalConst->GetHandledUndefined();
50 JSHandle<JSTaggedValue> undefined = globalConst->GetHandledUndefined();
59 JSHandle<JSAsyncAwaitStatusFunction> fulFunc = factory->NewJSAsyncAwaitStatusFunction(
63 JSHandle<JSAsyncAwaitStatusFunction> rejFunc = factory->NewJSAsyncAwaitStatusFunction(
73 JSHandle<PromiseCapability> tcap =
74 JSPromise::NewPromiseCapability(thread, JSHandle<JSTaggedValue>::Cast(env->GetPromiseFunction()));
76 JSHandle<JSPromise>(thread, tcap->GetPromise())->SetPromiseIsHandled(true);
79 JSHandle<JSPromise> promise(thread, pcap->GetPromise());
81 thread, promise, JSHandle<JSTaggedValue>::Cast(fulFunc), JSHandle<JSTaggedValue>::Cast(rejFunc), tcap);
91 void JSAsyncFunction::AsyncFunctionAwait(JSThread *thread, const JSHandle<JSTaggedValue> &asyncFuncObj,
92 const JSHandle<JSTaggedValue> &value)
97 JSHandle<JSTaggedValue> asyncCtxt;
99 JSHandle<JSObject> obj = JSTaggedValue::ToObject(thread, asyncFuncObj);
101 JSHandle<JSAsyncGeneratorObject> asyncGen = JSHandle<JSAsyncGeneratorObject>::Cast(obj);
102 asyncCtxt = JSHandle<JSTaggedValue>(thread, asyncGen->GetGeneratorContext());
104 JSHandle<JSObject> obj = JSTaggedValue::ToObject(thread, asyncFuncObj);
106 JSHandle<JSAsyncFuncObject> asyncFun = JSHandle<JSAsyncFuncObject>::Cast(obj);
107 asyncCtxt = JSHandle<JSTaggedValue>(thread, asyncFun->GetGeneratorContext());
111 JSHandle<GlobalEnv> env = vm->GetGlobalEnv();
112 JSHandle<JSTaggedValue> promiseValue =
114 JSHandle<JSTaggedValue>::Cast(env->GetPromiseFunction()),
118 JSHandle<JSAsyncAwaitStatusFunction> fulFunc = factory->NewJSAsyncAwaitStatusFunction(
122 JSHandle<JSAsyncAwaitStatusFunction> rejFunc = factory->NewJSAsyncAwaitStatusFunction(
132 JSHandle<PromiseCapability> tcap =
133 JSPromise::NewPromiseCapability(thread, JSHandle<JSTaggedValue>::Cast(env->GetPromiseFunction()));
135 JSHandle<JSPromise>(thread, tcap->GetPromise())->SetPromiseIsHandled(true);
138 JSHandle<JSObject> promise = JSHandle<JSObject>::Cast(promiseValue);
139 BuiltinsPromise::PerformPromiseThen(thread, JSHandle<JSPromise>::Cast(promise),
140 JSHandle<JSTaggedValue>::Cast(fulFunc),
141 JSHandle<JSTaggedValue>::Cast(rejFunc), tcap);
151 JSHandle<JSTaggedValue> JSAsyncAwaitStatusFunction::AsyncFunctionAwaitFulfilled(
152 JSThread *thread, const JSHandle<JSAsyncAwaitStatusFunction> &func, const JSHandle<JSTaggedValue> &value)
155 JSHandle<GeneratorContext> asyncCtxt(thread, func->GetAsyncContext());
157 JSHandle<JSTaggedValue> tagVal(thread, asyncCtxt->GetGeneratorObject());
160 return JSHandle<JSTaggedValue>(thread, JSTaggedValue::Undefined());
172 return JSHandle<JSTaggedValue>(thread, JSTaggedValue::Undefined());
176 JSHandle<JSTaggedValue> JSAsyncAwaitStatusFunction::AsyncFunctionAwaitRejected(
177 JSThread *thread, const JSHandle<JSAsyncAwaitStatusFunction> &func, const JSHandle<JSTaggedValue> &reason)
180 JSHandle<GeneratorContext> asyncCtxt(thread, func->GetAsyncContext());
182 JSHandle<JSTaggedValue> tagVal(thread, asyncCtxt->GetGeneratorObject());
185 JSHandle<CompletionRecord> completionRecord =
189 return JSHandle<JSTaggedValue>(thread, JSTaggedValue::Undefined());
197 JSHandle<JSObject> result = GeneratorHelper::Throw(thread, asyncCtxt, reason.GetTaggedValue());
202 return JSHandle<JSTaggedValue>::Cast(result);