[libpromise.js] Add explicit addPromise helper function#26950
Conversation
In addition to making things more explicitly, this saves on codesize when more than one promise function is included (see dylink_all codesize changes).
|
"explicitly" => "explicit" in the description, but lgtm. How do you decide when adding a tiny helper like this is worth it for code size benefits? It seems like you would structure lots of code differently if you were really trying to code golf it. |
TBH, what inspired me to make this change was readability. I was working on #26947 and I didn't at first see how promises were added to the mapping other than Having both |
|
Also this just seemed better than repeating the |
In addition to making things more explicitly, this saves on codesize when more than one promise function is included (see dylink_all codesize changes).