What problem does it solve?
This Skill helps you understand and troubleshoot cross-language Promise bridging between ETS (ArkTS) and JavaScript in ArkCompiler’s hybrid runtime, so resolved/rejected async results propagate correctly across VM boundaries.
Core Features & Use Cases
- Promise Bridging (Wrap/Unwrap): Convert JS Promise ↔ ETS Promise proxy/wrapper with correct identity reuse and state handling (pending/linked/settled).
- Await & Coroutine Safety: Diagnose stuck awaits by validating proxy detection, coroutine scheduling (yield-before-wait), and callback queue execution.
- Interop State Machine Debugging: Trace fast-path vs slow-path behavior for JSCONVERT_WRAP(Promise) and JSCONVERT_UNWRAP(Promise), including SettleJsPromise and PromiseInterop.connectPromise.
- Targets & Hotspots to Inspect: JSConvertPromise in js_convert.h, EtsPromise/EtsPromiseRef in ets_promise(.h/.cpp)/ets_promise_ref.h, JsJobQueue/Promise link in js_job_queue, and PromiseInterop.ets.
Quick Start
Use the interop-promise skill to diagnose why an awaited ArkTS Promise never resolves when it wraps a JavaScript Promise by reviewing EtsPromise proxy state, JsJobQueue callback wiring, and SettleJsPromise execution.