Specify context in which callbacks are called #58

Closed
domenic opened this Issue Dec 30, 2012 · 3 comments

Projects

None yet

4 participants

@domenic
Member
domenic commented Dec 30, 2012

It's left unspecified what context (i.e. this value) onFulfilled and onRejected are called in. Should we specify? I say yes.

I think the obvious choice is undefined (which in sloppy mode becomes the global object), i.e. simply call the function as you normally would.

This prevents the antipattern of using this as a zeroth argument from creeping into implementations, which we currently allow and creates noninteroperable code.

@novemberborn
Contributor

+1

@juandopazo
Contributor

Yup. +1

@briancavalier
Member

Good catch. +1

@domenic domenic closed this in 223b599 Feb 16, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment