Skip to main content

promise_try_static

Function promise_try_static 

Source
pub(crate) fn promise_try_static(
    it: &mut Interp,
    _t: Value,
    a: &[Value],
) -> Result<Value, Value>
Expand description

Promise.try(callbackFn, ...args)(ES2025): callbackFn を同期実行し、 同期例外なら reject、戻り値が thenable ならその状態を採用、それ以外は resolve する。 new Promise(...) と違い、callbackFn は非 async 関数でも同期/非同期どちらの結果も統一的に扱える。