-
Notifications
You must be signed in to change notification settings - Fork 12.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
Js improvements #50214
Js improvements #50214
Conversation
f33e31e
to
ac0f99c
Compare
@@ -40,6 +40,8 @@ | |||
"union", | |||
"foreigntype"]; | |||
|
|||
var search_input = document.getElementsByClassName('search-input')[0]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think i'm a little fuzzy on JS's scoping/object rules. Does this automatically get updated if someone types in a search, deletes it, then searches for something else? Having everything reference this variable here seems a little off, but my intuition is based around Rust's rules, not JavaScript's. >_>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider it the same as a reference (or a view). You point to an element but you get the accurate information when you access its fields.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense, thanks! C# has a similar system for what they call "reference types".
@bors r+ |
📌 Commit ac0f99c has been approved by |
…uietMisdreavus Js improvements r? @QuietMisdreavus
r? @QuietMisdreavus