-
Notifications
You must be signed in to change notification settings - Fork 156
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
'it' is not defined when referenced only by object literals? #899
Comments
More complicated than just the object literal, it's something to do with the shorthand. ->
{ name: it.name } compiles to => (function(it){
return {
name: it.name
};
}); Similarly, -> { it } compiles to => (function(){
return {
it: it
};
}); |
From code readibility point of view I don't like I wish we could:
|
My reading of the (I have a fix for this bug that's part of a slightly larger unit of work; I'll be PRing it one of these days, either with that work or separately.) |
@rhendric : I beg to differ. My understanding (which of course does not agree with LSC master) had been: the unnamed implicit single argument of the innermost function without an explicit parameter list i.e. As for a stricter syntax, I believe we should emit warning/error when:
Regardless I'm looking forward to your big chunk of change ;) |
Upon revisiting this, it appears that I had entirely imagined this aliasing feature! I thought that was how things worked already in some cases, but I'm quite happy that it isn't. For the record, I retract my ‘should’ above: I'll hold further opining on issuing warnings or errors for possibly confusing uses of |
if (result) {
data = {
name: that.name
};
} |
Add test cases and fix implicit it in object shorthands (#899)
compiles to:
the third function has no argument
Another example:
The text was updated successfully, but these errors were encountered: