Last active
June 11, 2016 08:13
-
-
Save qubyte/43e0093274e793cc82ba to your computer and use it in GitHub Desktop.
Fat arrow inconsistency between Aurora 33.0a2 (2014-08-24) and Canary 39.0.2135.0 canary (64-bit)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var a = true; | |
var test = () => console.log(this.a); | |
test(); // true | |
var test2 = test.bind({ a: false }); | |
test2(); // Canary: false, Firefox: true |
Wow, for some reason I got no notifications for this thread. Sorry all. @domenic is quite right. This was me looking at an experimental feature, and I was jumping the gun somewhat. Fat-arrows are only partially implemented in the version of V8 in that version of Canary and full support will come in time.
The two versions were not picked to be equivalent in terms of their development process. They just happened to be the browsers I was testing with.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@phistuck pay attention to the arrow, the thin one does not bind the context at creation time.
this
would be the expected object in that method.