mirror of
https://github.com/rust-lang/rust.git
synced 2025-01-13 00:04:12 +00:00
Add comments regarding object shapes in buildIndex
This commit is contained in:
parent
b7d14b1b4d
commit
7834aeb95c
@ -1852,6 +1852,9 @@ function defocusSearchBar() {
|
|||||||
var crateSize = 0;
|
var crateSize = 0;
|
||||||
|
|
||||||
searchWords.push(crate);
|
searchWords.push(crate);
|
||||||
|
// This object should have exactly the same set of fields as the "row"
|
||||||
|
// object defined below. Your JavaScript runtime will thank you.
|
||||||
|
// https://mathiasbynens.be/notes/shapes-ics
|
||||||
var crateRow = {
|
var crateRow = {
|
||||||
crate: crate,
|
crate: crate,
|
||||||
ty: 1, // == ExternCrate
|
ty: 1, // == ExternCrate
|
||||||
@ -1902,6 +1905,8 @@ function defocusSearchBar() {
|
|||||||
len = itemTypes.length;
|
len = itemTypes.length;
|
||||||
var lastPath = "";
|
var lastPath = "";
|
||||||
for (i = 0; i < len; ++i) {
|
for (i = 0; i < len; ++i) {
|
||||||
|
// This object should have exactly the same set of fields as the "crateRow"
|
||||||
|
// object defined above.
|
||||||
var row = {
|
var row = {
|
||||||
crate: crate,
|
crate: crate,
|
||||||
ty: itemTypes[i],
|
ty: itemTypes[i],
|
||||||
|
Loading…
Reference in New Issue
Block a user