mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-01-31 19:02:59 +01:00
server: Fix Gate constructor
The ECMAScript spec for `.then()` requires Promise subclass constructors to take an executor.
This commit is contained in:
parent
4c6cb53d18
commit
84c1d74f8b
1 changed files with 2 additions and 2 deletions
|
@ -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 a new issue