diff options
| author | Yoshiya Hinosawa <stibium121@gmail.com> | 2021-06-22 15:17:44 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-06-22 15:17:44 +0900 |
| commit | 4e3ec478573ede7247fd306cad1ea5bf2d5c9565 (patch) | |
| tree | b78cd4de810d68052f85ae933c4e125d3a4a21ba /runtime | |
| parent | 097c02f11bb5fd43e4346fce03b4bacaed119ed2 (diff) | |
fix(runtime): fix signal promise API (#11069)
Diffstat (limited to 'runtime')
| -rw-r--r-- | runtime/js/40_signals.js | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/runtime/js/40_signals.js b/runtime/js/40_signals.js index dfc604759..bf6be1263 100644 --- a/runtime/js/40_signals.js +++ b/runtime/js/40_signals.js @@ -236,7 +236,15 @@ f, g, ) { - return this.#pollingPromise.then(() => {}).then(f, g); + return this.#pollingPromise.then((done) => { + if (done) { + // If pollingPromise returns true, then + // this signal stream is finished and the promise API + // should never be resolved. + return new Promise(() => {}); + } + return; + }).then(f, g); } async next() { |
