You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@sebmck I'm wondering if babel can "warn" the user if this is transformed to undefined as s/he may unintentionally misused the arrow function? Which is likely the case...
Activity
sebmck commentedon Feb 9, 2015
Top level
thisisundefinedES6 modules as they're implicitly strict mode. Arrow functions inherit the outerthis. Expected behaviour.fkling commentedon Feb 9, 2015
Put differently: If you want a function with its own
thisvalue, you cannot use an arrow function.sebmck commentedon Feb 9, 2015
Yeah, I phrased that terribly. Arrow functions aren't synonymous with normal functions. You can check out more about their usage here.
developit commentedon Feb 9, 2015
Summary: arrows are awesome
007lva commentedon Feb 9, 2015
Oh, thank you very much, this is very instructive 😃
dashed commentedon Feb 21, 2015
@sebmck I'm wondering if babel can "warn" the user if
thisis transformed toundefinedas s/he may unintentionally misused the arrow function? Which is likely the case...sebmck commentedon Feb 21, 2015
@dashed I wish, #562.
dashed commentedon Feb 21, 2015
@sebmck Hmm. What about warning of the misuse of
thiswithin just arrow functions?sebmck commentedon Feb 21, 2015
@dashed It would only catch the top level case and adding warning messages is a slippery slope.