server: Fix Gate constructor
The ECMAScript spec for `.then()` requires Promise subclass constructors to take an executor.pull/4822/head
parent
4c6cb53d18
commit
84c1d74f8b
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue