509 matches across 7 files for func main lang:JavaScript lang:JavaScript lang:JavaScript
snippet_mode: auto · sorted by relevance
src/librustdoc/html/static/js/search.js JAVASCRIPT 282 matches · showing 5 view file →
10 * @param {stringdex.Hooks} hooks
11 */
12const initSearch = async function(Stringdex, RoaringBitmap, hooks) {
13
14// polyfill
· · ·
15// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/toSpliced
16if (!Array.prototype.toSpliced) {
17 // Can't use arrow functions, because we want `this`
18 Array.prototype.toSpliced = function() {
19 const me = this.slice();
· · ·
18 Array.prototype.toSpliced = function() {
19 const me = this.slice();
20 // @ts-expect-error
· · ·
28 * @template T
29 * @param {Iterable<T>} arr
30 * @param {function(T): Promise<any>} func
31 * @param {function(T): void} funcBtwn
32 */
· · ·
31 * @param {function(T): void} funcBtwn
32 */
33async function onEachBtwnAsync(arr, func, funcBtwn) {
+ 277 more matches in this file
src/tools/rustdoc-js/tester.js JAVASCRIPT 29 matches · showing 5 view file →
7const CHANNEL_REGEX = new RegExp("/nightly/|/beta/|/stable/|/1\\.[0-9]+\\.[0-9]+/");
8
9function arrayToCode(array) {
10 return array.map((value, index) => {
11 value = value.split("&nbsp;").join(" ");
· · ·
14}
15
16function loadContent(content) {
17 const Module = module.constructor;
18 const m = new Module();
· · ·
27}
28
29function readFile(filePath) {
30 return fs.readFileSync(filePath, "utf8");
31}
· · ·
32
33function contentToDiffLine(key, value) {
34 if (typeof value === "object" && !Array.isArray(value) && value !== null) {
35 const out = Object.entries(value)
· · ·
42}
43
44function shouldIgnoreField(fieldName) {
45 return fieldName === "query" || fieldName === "correction" ||
46 fieldName === "proposeCorrectionFrom" ||
+ 24 more matches in this file
src/librustdoc/html/static/js/main.js JAVASCRIPT 116 matches · showing 5 view file →
5"use strict";
6
7// The amount of time that the cursor must remain still over a hover target before
8// revealing a tooltip.
9//
· · ·
19 * @param {string} extension
20 */
21function resourcePath(basename, extension) {
22 return getVar("root-path") + basename + getVar("resource-suffix") + extension;
23}
· · ·
24
25function hideMain() {
26 addClass(document.getElementById(MAIN_ID), "hidden");
27 const toggle = document.getElementById("toggle-all-docs");
· · ·
26 addClass(document.getElementById(MAIN_ID), "hidden");
27 const toggle = document.getElementById("toggle-all-docs");
28 if (toggle) {
· · ·
31}
32
33function showMain() {
34 const main = document.getElementById(MAIN_ID);
35 if (!main) {
+ 111 more matches in this file
src/librustdoc/html/static/js/storage.js JAVASCRIPT 30 matches · showing 5 view file →
13const builtinThemes = ["light", "dark", "ayu"];
14const darkThemes = ["dark", "ayu"];
15window.currentTheme = (function() {
16 const currentTheme = document.getElementById("themeStyle");
17 return currentTheme instanceof HTMLLinkElement ? currentTheme : null;
· · ·
18})();
19
20const settingsDataset = (function() {
21 const settingsElement = document.getElementById("default-settings");
22 return settingsElement && settingsElement.dataset ? settingsElement.dataset : null;
· · ·
37// used in other files, not yet used in this one.
38// eslint-disable-next-line no-unused-vars
39function nonnull(x, msg) {
40 if (x === null) {
41 throw (msg || "unexpected null value!");
· · ·
59// used in other files, not yet used in this one.
60// eslint-disable-next-line no-unused-vars
61function nonundef(x, msg) {
62 if (x === undefined) {
63 throw (msg || "unexpected null value!");
· · ·
73 * @returns
74 */
75function getSettingValue(settingName) {
76 const current = getCurrentValue(settingName);
77 if (current === null && settingsDataset !== null) {
+ 25 more matches in this file
src/librustdoc/html/static/js/stringdex.js JAVASCRIPT 33 matches · showing 5 view file →
294 }
295 /**
296 * Helper function used when constructing bitmaps from lists.
297 * Returns an array container with at least two free byte slots
298 * and bumps `this.cardinalities`.
· · ·
1036 * @returns {number}
1037 */
1038function bitCount(n) {
1039 n = (~~n) - ((n >> 1) & 0x55555555);
1040 n = (n & 0x33333333) + ((n >> 2) & 0x33333333);
· · ·
1087 * @returns {Promise<stringdex.Database>}
1088 */
1089function loadDatabase(hooks) {
1090 /** @type {stringdex.Callbacks} */
1091 const callbacks = {
· · ·
1092 rr_: function(data) {
1093 const dataObj = JSON.parse(data);
1094 for (const colName of Object.keys(dataObj)) {
· · ·
1126 }
1127 },
1128 err_rr_: function(err) {
1129 const cb = registry.searchTreeRootCallback;
1130 if (cb) {
+ 28 more matches in this file
src/librustdoc/html/static/js/settings.js JAVASCRIPT 16 matches · showing 5 view file →
2/* global getSettingValue, updateLocalStorage, updateTheme */
3/* global addClass, removeClass, onEach, onEachLazy */
4/* global MAIN_ID, getVar, nonnull */
5
6"use strict";
· · ·
7
8(function() {
9 const isSettingsPage = window.location.pathname.endsWith("/settings.html");
10
· · ·
17 * @param {string|boolean} value
18 */
19 function changeSetting(settingName, value) {
20 if (settingName === "theme") {
21 const useSystem = value === "system preference" ? "true" : "false";
· · ·
58 }
59
60 function showLightAndDark() {
61 removeClass(document.getElementById("preferred-light-theme"), "hidden");
62 removeClass(document.getElementById("preferred-dark-theme"), "hidden");
· · ·
63 }
64
65 function hideLightAndDark() {
66 addClass(document.getElementById("preferred-light-theme"), "hidden");
67 addClass(document.getElementById("preferred-dark-theme"), "hidden");
+ 11 more matches in this file
tests/run-make/wasm-exceptions-nostd/verify.mjs JAVASCRIPT 3 matches view file →
16const wasmBuffer = fs.readFileSync(wasmfile);
17
18async function main() {
19
20 let memory = new ArrayBuffer(0) // will be changed after instantiate
· · ·
57}
58
59function assert_equal(captured_output, expected_output) {
60 if (captured_output.length != expected_output.length) {
61 console.error("Unexpected number of output lines. Got", captured_output.length, "but expected", expected_output.length);
· · ·
73}
74
75await main();
Search syntax
auth loginboth terms (AND is implicit)
auth OR logineither term
NOT path:vendorexclude matches
"exact phrase"quoted exact match
/func\s+Test/regex
handler~1fuzzy (Levenshtein 1)
file:*_test.gofilename glob
path:pkg/auth/**full path glob
lang:golanguage filter

Search any public repo from your terminal

This page calls POST /api/v1/code_search. Same tool, available over MCP for Claude/Cursor/Copilot.