-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Covariant length on ReadOnlyArray<.> #4266
Conversation
I personally would prefer to have |
@vkurchatkin Sure, although I recall reading something about Flow striving toward "JavaScript as it is." Constraining Can I get a "shall" directive from the Flow hive at FB? I was too lazy to look it up on the spec, but I noticed that the Node interpreter admits const a = "asdf"; //a.length===4
a.length = 1; //a.length===4
a.length = 7; //a.length===4 If |
|
Agreed. The PR is good as-is. |
Looks reasonable to me. I'd like to see some tests to ensure that (a) |
Sure. This closes #4265 BTW. |
@nmote has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator. |
$ReadOnlyArray shouldn't allow
length
setting because it can mutate the array.