Skip to content

Conversation

GuillaumeGomez
Copy link
Member

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Apr 25, 2018
"union",
"foreigntype"];

var search_input = document.getElementsByClassName('search-input')[0];
Copy link
Contributor

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. >_>

Copy link
Member Author

@GuillaumeGomez GuillaumeGomez Apr 25, 2018

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.

Copy link
Contributor

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".

@QuietMisdreavus
Copy link
Contributor

@bors r+

@bors
Copy link
Collaborator

bors commented Apr 25, 2018

📌 Commit ac0f99c has been approved by QuietMisdreavus

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Apr 25, 2018
GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this pull request Apr 26, 2018
bors added a commit that referenced this pull request Apr 26, 2018
Rollup of 4 pull requests

Successful merges:

 - #50177 (mark std::str::replace(,n) as #[must_use])
 - #50207 (Hash EntryKind::AssociatedConst const data)
 - #50214 (Js improvements)
 - #50219 (Added missing `.` in docs.)

Failed merges:

 - #50229 (Add setting to go to item if there is only one result)
@bors bors merged commit ac0f99c into rust-lang:master Apr 26, 2018
@GuillaumeGomez GuillaumeGomez deleted the JS-improvements branch April 26, 2018 14:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants