JavaSc...romise(3pm)
π JavaScript::QuickJS::Promise π
okay bestie, so this is the User Contributed Perl Documentation page for the 3pm manual section, and it's all about JavaScript::QuickJS::Promise β no cap, it's giving "Perl meets JavaScript, and they're holding hands". π«Ά
β¨ NAME β¨
JavaScript::QuickJS::Promise β JavaScript Promise in Perl π
π SYNOPSIS π
okay so here's the whole vibe in code, literally copy-paste-core:
my $js = JavaScript::QuickJS->new();
$js->eval("Promise.resolve(123)")->then( sub { CORE::say "resolved: @_" } );
CORE::say "before await";
$js->await();
CORE::say "after await";
it's giving setup, resolve, await, slay. β
π¦ DESCRIPTION π¦
This class is literally the Perl representation of a JavaScript Promise instance. Like, the actual thing. πΈ
here's the MDN link so you can go read up on Promise in JS-land, exactly as written:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise
π important bestie: this class is not instantiated directly. don't come for me trying JavaScript::QuickJS::Promise->new, that's not the move. you get these from QuickJS itself. periodt.
π METHODS π
not me exposing then(), catch(), and finally() β because yes, this class exposes all three of those, and each one wraps the JavaScript method with the exact same name. iykyk. β¨
then()β wraps the JavaScriptthen()π«Άcatch()β wraps the JavaScriptcatch()πfinally()β wraps the JavaScriptfinally(), yes the finale, the last act π
and that's the whole page, bestie!! this was perl v5.42.3, dated 2026-08-19, from the JavaSc...romise(3pm) manual. mwah, love u, go await something. πππ¦
π¦ where this page comes from
- ubuntu stonking: libjavascript-quickjs-perl 0.21-3build1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms