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
If you want to achieve this behavior in CoffeeScript, you can use explicit line continuation with a backslash \ or enclose the object in curly braces {} as you've mentioned in the workaround.
Here's your code with explicit line continuation using backslashes:
#tryuse k, v for k, v of \
k: v
And here's the same code with explicit curly braces:
#tryuse k, v for k, v of {
k: v
}
As for your question about terminology, what you're referring to as "implicit objects" or "omitting object braces" in CoffeeScript is essentially CoffeeScript's syntax for creating objects without using explicit braces. It's part of CoffeeScript's syntactic sugar for creating objects and can be considered a form of implicit object declaration. There's no widely standardized terminology for this specific syntax, but it's often referred to as "object literals" or "object shorthand" in the context of CoffeeScript and JavaScript.
Choose one: is this a bug report or feature request?
A bit of both.
Input Code
#try
While this also applies to
i don't see any point in supporting that.
Expected Behavior
Current Behavior
Workaround
Possible Solution
Add implicit line continuation support for objects in eof for-of loop headers.
The logic used in function calls might be reusable.
Context
Ran into this a couple of times expecting the compiler to accept it.
Environment
Btw, do you call this an implicit object? What's the term generally used for omitting object braces?
The text was updated successfully, but these errors were encountered: