Am I missing something obvious in `super((resolve, reject) => this)` ?

First of all, it makes perfect sense for `this` not work work before super
has been called - and it has not been called yet. I think that the crux is
that the promise constructor runs _synchronously_ so when you pass it
`this` it has not finished running yet.

Of course, the workaround as domenic has pointed is to extract `resolve`
and `reject` from the `super` call since it is synchronous.

(also I'm assuming you're not really mapping `(resolve, reject)` to `this`?
`this` is an object and the promise constructor ignores return values
anyway, you might as well pass a no-op in.)
_______________________________________________
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to