Lines Matching refs:promise
47 // 3. Let promise be OrdinaryCreateFromConstructor(NewTarget, "%PromisePrototype%",
49 // 4. ReturnIfAbrupt(promise).
55 // 5. Set promise's [[PromiseState]] internal slot to "pending".
56 // 6. Set promise's [[PromiseFulfillReactions]] internal slot to a new empty List.
57 // 7. Set promise's [[PromiseRejectReactions]] internal slot to a new empty List.
58 // 8. Let resolvingFunctions be CreateResolvingFunctions(promise).
86 // 11. Return promise.
270 JSHandle<JSObject> promise(thread, promiseCapability->GetPromise());
271 return promise.GetTaggedValue();
307 JSHandle<JSObject> promise(thread, promiseCapability->GetPromise());
308 return promise.GetTaggedValue();
322 // 1. Let promise be the this value.
323 // 2. Return Invoke(promise, "then", «undefined, onRejected»).
329 JSHandle<JSTaggedValue> promise = GetThis(argv);
334 EcmaInterpreter::NewRuntimeCallInfo(thread, undefined, promise, undefined, 2); // 2: «undefined, onRejected»
350 // 1. Let promise be the this value.
352 // 2. If IsPromise(promise) is false, throw a TypeError exception.
354 THROW_TYPE_ERROR_AND_RETURN(thread, "Then: thisValue is not promise!", JSTaggedValue::Exception());
356 // 3. Let C be SpeciesConstructor(promise, %Promise%).
358 JSHandle<JSObject> promise = JSHandle<JSObject>::Cast(thisValue);
360 JSHandle<JSTaggedValue> constructor = JSObject::SpeciesConstructor(thread, promise, defaultFunc);
371 // 7. Return PerformPromiseThen(promise, onFulfilled, onRejected, resultCapability).
372 return PerformPromiseThen(thread, JSHandle<JSPromise>::Cast(promise), onFulfilled, onRejected, resultCapability);
375 JSTaggedValue BuiltinsPromise::PerformPromiseThen(JSThread *thread, const JSHandle<JSPromise> &promise,
402 PromiseState state = promise->GetPromiseState();
404 JSHandle<TaggedQueue> fulfillReactions(thread, promise->GetPromiseFulfillReactions());
407 promise->SetPromiseFulfillReactions(thread, JSTaggedValue(newQueue));
409 JSHandle<TaggedQueue> rejectReactions(thread, promise->GetPromiseRejectReactions());
411 promise->SetPromiseRejectReactions(thread, JSTaggedValue(newQueue));
415 argv->Set(thread, 1, promise->GetPromiseResult());
422 argv->Set(thread, 1, promise->GetPromiseResult());
423 // When a handler is added to a rejected promise for the first time, it is called with its operation
425 if (!promise->GetPromiseIsHandled()) {
427 thread->GetCurrentEcmaContext()->PromiseRejectionTracker(promise, reason, PromiseRejectionEvent::HANDLE);
432 promise->SetPromiseIsHandled(true);
592 JSHandle<JSTaggedValue> promise(thread, capability->GetPromise());
594 factory->NewCompletionRecord(CompletionRecordType::NORMAL, promise);
1046 // 1. Let promise be the this value.
1047 // 2. If Type(promise) is not Object, throw a TypeError exception.
1048 JSHandle<JSTaggedValue> promise = GetThis(argv);
1049 if (!promise->IsECMAObject()) {
1052 // 3. Let C be SpeciesConstructor(promise, %Promise%).
1055 JSHandle<JSObject> ctor = JSHandle<JSObject>::Cast(promise);
1089 // 7. return invoke(promise, "then", <<thenFinally, catchFinally>>)
1093 EcmaInterpreter::NewRuntimeCallInfo(thread, undefined, promise, undefined, 2); // 2: two args