src: add extractPromiseWrap function
Currently PromiseHook extracts the PromiseWrap from a Local in two places. This commit extracts that code into a function instead.
Checklist
-
make -j4 test
(UNIX), orvcbuild test
(Windows) passes -
commit message follows commit guidelines