server: Fix Gate constructor

The ECMAScript spec for `.then()` requires Promise subclass
constructors to take an executor.
pull/4822/head
Richard Hansen 2021-02-18 02:08:25 -05:00 committed by John McLear
parent 4c6cb53d18
commit 84c1d74f8b
1 changed files with 2 additions and 2 deletions

View File

@ -65,9 +65,9 @@ const State = {
let state = State.INITIAL;
class Gate extends Promise {
constructor() {
constructor(executor = null) {
let res;
super((resolve) => { res = resolve; });
super((resolve, reject) => { res = resolve; if (executor != null) executor(resolve, reject); });
this.resolve = res;
}
}