-
Notifications
You must be signed in to change notification settings - Fork 6
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
Should we allow function.sent
in arrow functions?
#9
Comments
In your first example, i have no idea why that's a function rather than just a variable ( Generator arrows (if they ever manifest) would need their own I'm very confused why it would need to be a function in any case. |
Sorry I wrote a bad example, fixed now.
Currently we define PS. Make it a function also provide possibility of rich semantic, for example, it could have arg. See #3 (comment) |
sure, you could think of it as a getter on I think those "richer semantics" would be very confusing. Requiring that you save it in a variable if you need it across yields seems reasonable to me. |
Yeah, but it still not solve the "no simple way to alias it" problem. And if we think it as getter on |
We can refer other meta properties in arrow functions, for example:
Shall we also allow it for
function.sent
?Possible usage: short alias for
function.sent
Problem: arrow functions are also "function" so programmers may expect they have own
function.sent
? And there will be generator arrow functions and they should have their ownfunction.sent
... (This is just again a naming issue like #1 (comment))Alternative: make
function.sent
a function instead of a changing value so we can just write(Another possibility is do not change anything, wait for refs proposal
const ref v = ref function.sent
)The text was updated successfully, but these errors were encountered: