Bugfix/deferred chain
The Promise
chain is in fact a Deferred
chain.
However, the implementation of Promise::then()
was incorrect as it relied on signals being emitted by the Promise
. In case of intermediate Promise
s (e.g. when chaining two then()
calls after another), the chain broke because the intermediate Promise
is being destroyed before it emits the signals.
This MR fixes this by connecting to the signals of the Deferred
created in Promise::then()
.