503 matches across 25 files for error lang:JavaScript lang:JavaScript
snippet_mode: auto · sorted by relevance
src/librustdoc/html/static/js/search.js JAVASCRIPT 60 matches · showing 5 view file →
18 Array.prototype.toSpliced = function() {
19 const me = this.slice();
20 // @ts-expect-error
21 Array.prototype.splice.apply(me, arguments);
22 return me;
· · ·
84 reject = rej;
85 });
86 // @ts-expect-error
87 return {promise, resolve, reject};
88 };
· · ·
414 checkExtraTypeFilterCharacters(start, parserState);
415 // typeFilterElem is not undefined. If it was, the elems.length check would have fired.
416 // @ts-expect-error
417 parserState.typeFilter = typeFilterElem.normalizedPathLast;
418 parserState.pos += 1;
· · ·
428 *
429 * If there is no `endChar`, this function will implicitly stop at the end
430 * without raising an error.
431 *
432 * @param {rustdoc.ParsedQuery<rustdoc.ParserQueryElement>} query
· · ·
920 * from it until we find another `"`.
921 *
922 * This function will throw an error in the following cases:
923 * * There is already another string element.
924 * * We are parsing a generic argument.
+ 55 more matches in this file
src/librustdoc/html/static/js/main.js JAVASCRIPT 38 matches · showing 5 view file →
119 el.className = classes;
120 // MAIN_ID exists, and is not the root
121 // @ts-expect-error
122 insertAfter(el, document.getElementById(MAIN_ID));
123 }
· · ·
203 * Run a JavaScript file asynchronously.
204 * @param {string} url
205 * @param {function(): any} [errorCallback]
206 */
207 function loadScript(url, errorCallback) {
· · ·
207 function loadScript(url, errorCallback) {
208 const script = document.createElement("script");
209 script.src = url;
· · ·
210 if (errorCallback !== undefined) {
211 script.onerror = errorCallback;
212 }
· · ·
211 script.onerror = errorCallback;
212 }
213 document.head.append(script);
+ 33 more matches in this file
src/tools/rustdoc-js/tester.js JAVASCRIPT 46 matches · showing 5 view file →
112
113// This function checks if `expected` has all the required fields needed for the checks.
114function checkNeededFields(fullPath, expected, error_text, queryName, position) {
115 let fieldsToCheck;
116 if (fullPath.length === 0) {
· · ·
119 "returned",
120 "userQuery",
121 "error",
122 ];
123 } else if (fullPath.endsWith("elems") || fullPath.endsWith("returned")) {
· · ·
149 }
150 }
151 error_text.push(text);
152 }
153 }
· · ·
154}
155
156function valueCheck(fullPath, expected, result, error_text, queryName) {
157 if (Array.isArray(expected) && result instanceof Map) {
158 const expected_set = new Set();
· · ·
159 for (const [key, expected_value] of expected) {
160 expected_set.add(key);
161 checkNeededFields(fullPath, expected_value, error_text, queryName, key);
162 if (result.has(key)) {
163 valueCheck(
+ 41 more matches in this file
src/librustdoc/html/static/js/stringdex.js JAVASCRIPT 26 matches · showing 5 view file →
192 const has_runs = u8array[i] === 0x3b;
193 if (u8array[i] !== 0x3a && u8array[i] !== 0x3b) {
194 throw new Error("not a roaring bitmap: " + u8array[i]);
195 }
196 const size = has_runs ?
· · ·
220 for (let j = 0; j < size; ++j) {
221 if (offsets && offsets[j] !== i - start) {
222 throw new Error(`corrupt bitmap ${j}: ${i - start} / ${offsets[j]}`);
223 }
224 const cardinality = (this.keysAndCardinalities[(j * 4) + 2] |
· · ·
1341 /** @returns {Generator<[number, Promise<ST>|null]>} */
1342 entries() {
1343 throw new Error();
1344 }
1345 /**
· · ·
1348 */
1349 getIndex(_k) {
1350 throw new Error();
1351 }
1352 /**
· · ·
1355 */
1356 getKey(_i) {
1357 throw new Error();
1358 }
1359 /**
+ 21 more matches in this file
src/librustdoc/html/static/js/storage.js JAVASCRIPT 2 matches view file →
26 * Assert that the passed value is nonnull, then return it.
27 *
28 * Takes an optional error message argument.
29 *
30 * Must be defined in this file, as it is loaded before all others.
· · ·
48 * Assert that the passed value is not undefined, then return it.
49 *
50 * Takes an optional error message argument.
51 *
52 * Must be defined in this file, as it is loaded before all others.
src/librustdoc/html/static/js/src-script.js JAVASCRIPT 2 matches view file →
119 const selected_elem = sidebar.getElementsByClassName("selected")[0];
120 if (typeof selected_elem !== "undefined") {
121 // @ts-expect-error
122 selected_elem.focus();
123 }
· · ·
177 };
178
179 // @ts-expect-error
180 return ev => {
181 let cur_line_id = parseInt(ev.target.id, 10);
src/tools/rust-analyzer/.github/actions/github-release/main.js JAVASCRIPT 3 matches view file →
54 });
55 } catch (e) {
56 core.error(e);
57 core.info(`creating nightly tag`);
58 await octokit.rest.git.createTag({
· · ·
126 throw e;
127
128 core.error(e);
129 const currentDelay = Math.round(Math.random() * delay);
130 core.info(`sleeping ${currentDelay} ms`);
· · ·
140
141run().catch(err => {
142 core.error(err);
143 core.setFailed(err.message);
144});
src/librustdoc/html/static/js/scrape-examples.js JAVASCRIPT 2 matches view file →
21 /** @type {HTMLElement[]} */
22 // blocked on https://github.com/microsoft/TypeScript/issues/29037
23 // @ts-expect-error
24 const lines = elt.querySelectorAll("[data-nosnippet]");
25 let scrollOffset;
· · ·
71 const isHidden = nonnull(example.parentElement).classList.contains("more-scraped-examples");
72
73 // @ts-expect-error
74 const locs = example.locs;
75 if (locs.length > 1) {
tests/run-make/wasm-exceptions-nostd/verify.mjs JAVASCRIPT 8 matches · showing 5 view file →
10const wasmfile = process.argv[2];
11if (!fs.existsSync(wasmfile)) {
12 console.log("Error: File not found:", wasmfile);
13 process.exit(1);
14}
· · ·
41
42 if (return_code !== 0) {
43 console.error("Expected return code 0");
44 process.exit(return_code);
45 }
· · ·
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);
62 process.exit(1); // exit with error
63 }
· · ·
62 process.exit(1); // exit with error
63 }
64
· · ·
65 for (let idx = 0; idx < expected_output.length; ++idx) {
66 if (captured_output[idx] !== expected_output[idx]) {
67 console.error("Unexpected output");
68 console.error("[got] ", captured_output[idx]);
69 console.error("[expected]", expected_output[idx]);
+ 3 more matches in this file
src/tools/error_index_generator/redirect.js JAVASCRIPT 2 matches view file →
5 // open redirect.
6 if (/^E[0-9]+$/.test(code)) {
7 window.location.replace('./error_codes/' + code + '.html');
8 return;
9 }
· · ·
10 }
11 window.location.replace('./error_codes/error-index.html');
12})()
13
src/tools/rustdoc-js/.eslintrc.js JAVASCRIPT 51 matches · showing 5 view file →
12 "rules": {
13 "linebreak-style": [
14 "error",
15 "unix"
16 ],
· · ·
17 "semi": [
18 "error",
19 "always"
20 ],
· · ·
21 "quotes": [
22 "error",
23 "double"
24 ],
· · ·
25 "linebreak-style": [
26 "error",
27 "unix"
28 ],
· · ·
29 "no-trailing-spaces": "error",
30 "no-var": ["error"],
31 "prefer-const": ["error"],
+ 46 more matches in this file
src/librustdoc/html/static/.eslintrc.js JAVASCRIPT 52 matches · showing 5 view file →
11 "rules": {
12 "linebreak-style": [
13 "error",
14 "unix"
15 ],
· · ·
16 "semi": [
17 "error",
18 "always"
19 ],
· · ·
20 "quotes": [
21 "error",
22 "double"
23 ],
· · ·
24 "linebreak-style": [
25 "error",
26 "unix"
27 ],
· · ·
28 "no-trailing-spaces": "error",
29 "no-var": ["error"],
30 "prefer-const": ["error"],
+ 47 more matches in this file
tests/rustdoc-js-std/return-based-sort.js JAVASCRIPT 4 matches view file →
6const EXPECTED = [
7 {
8 'query': '-> AllocError',
9 'others': [
10 { 'path': 'core::alloc::Allocator', 'name': 'allocate' },
· · ·
11 { 'path': 'core::alloc::AllocError', 'name': 'clone' },
12 ],
13 },
· · ·
14 {
15 'query': 'AllocError',
16 'returned': [
17 { 'path': 'core::alloc::Allocator', 'name': 'allocate' },
· · ·
18 { 'path': 'core::alloc::AllocError', 'name': 'clone' },
19 ],
20 },
tests/rustdoc-js-std/parser-quote.js JAVASCRIPT 7 matches · showing 5 view file →
13 typeFilter: null,
14 }],
15 error: null,
16 },
17 {
· · ·
28 userQuery: '"p",',
29 returned: [],
30 error: null,
31 },
32 {
· · ·
36 userQuery: '"p" -> a',
37 returned: [],
38 error: "Cannot have more than one element if you use quotes",
39 },
40 {
· · ·
44 userQuery: '"a" -> "p"',
45 returned: [],
46 error: "Cannot have more than one literal search element",
47 },
48 {
· · ·
52 userQuery: '->"-"',
53 returned: [],
54 error: 'Unexpected `-` in a string element',
55 },
56 {
+ 2 more matches in this file
tests/rustdoc-js-std/parser-weird-queries.js JAVASCRIPT 6 matches · showing 5 view file →
18 userQuery: "a b",
19 returned: [],
20 error: null,
21 },
22 {
· · ·
34 userQuery: "a b",
35 returned: [],
36 error: null,
37 },
38 {
· · ·
57 userQuery: "aaa,a",
58 returned: [],
59 error: null,
60 },
61 {
· · ·
65 userQuery: ",,,,",
66 returned: [],
67 error: null,
68 },
69 {
· · ·
73 userQuery: 'mod :',
74 returned: [],
75 error: "Unexpected `:` (expected path after type filter `mod:`)",
76 },
77 {
+ 1 more matches in this file
tests/rustdoc-js-std/parser-literal.js JAVASCRIPT 1 matches view file →
21 userQuery: "R<P>",
22 returned: [],
23 error: null,
24 }
25];
tests/rustdoc-js-std/parser-ident.js JAVASCRIPT 11 matches · showing 5 view file →
22 userQuery: "R<!>",
23 returned: [],
24 error: null,
25 },
26 {
· · ·
37 userQuery: "!",
38 returned: [],
39 error: null,
40 },
41 {
· · ·
52 userQuery: "a!",
53 returned: [],
54 error: null,
55 },
56 {
· · ·
60 userQuery: "a!::b",
61 returned: [],
62 error: "Cannot have associated items in macros",
63 },
64 {
· · ·
68 userQuery: "!<T>",
69 returned: [],
70 error: "Never type `!` does not accept generic parameters",
71 },
72 {
+ 6 more matches in this file
tests/rustdoc-js-std/parser-paths.js JAVASCRIPT 7 matches · showing 5 view file →
13 userQuery: "A::B",
14 returned: [],
15 error: null,
16 },
17 {
· · ·
28 userQuery: 'a:: a',
29 returned: [],
30 error: null,
31 },
32 {
· · ·
43 userQuery: 'a ::a',
44 returned: [],
45 error: null,
46 },
47 {
· · ·
58 userQuery: 'a :: a',
59 returned: [],
60 error: null,
61 },
62 {
· · ·
83 userQuery: 'A::B,C',
84 returned: [],
85 error: null,
86 },
87 {
+ 2 more matches in this file
tests/rustdoc-js-std/parser-returned.js JAVASCRIPT 9 matches · showing 5 view file →
21 typeFilter: null,
22 }],
23 error: null,
24 },
25 {
· · ·
36 typeFilter: null,
37 }],
38 error: null,
39 },
40 {
· · ·
51 typeFilter: null,
52 }],
53 error: null,
54 },
55 {
· · ·
73 typeFilter: null,
74 }],
75 error: null,
76 },
77 {
· · ·
88 typeFilter: "primitive",
89 }],
90 error: null,
91 },
92 {
+ 4 more matches in this file
tests/rustdoc-js-std/parser-filter.js JAVASCRIPT 9 matches · showing 5 view file →
13 userQuery: "fn:foo",
14 returned: [],
15 error: null,
16 },
17 {
· · ·
28 userQuery: "enum : foo",
29 returned: [],
30 error: null,
31 },
32 {
· · ·
36 userQuery: "macro<f>:foo",
37 returned: [],
38 error: "Unexpected `<` in type filter (before `:`)",
39 },
40 {
· · ·
51 userQuery: "macro!",
52 returned: [],
53 error: null,
54 },
55 {
· · ·
66 userQuery: "macro:mac!",
67 returned: [],
68 error: null,
69 },
70 {
+ 4 more matches in this file
tests/rustdoc-js-std/parser-separators.js JAVASCRIPT 8 matches · showing 5 view file →
17 userQuery: "aaaaaa b",
18 returned: [],
19 error: null,
20 },
21 {
· · ·
42 userQuery: "aaaaaa, b",
43 returned: [],
44 error: null,
45 },
46 {
· · ·
59 userQuery: "a b",
60 returned: [],
61 error: null,
62 },
63 {
· · ·
84 userQuery: "a,b",
85 returned: [],
86 error: null,
87 },
88 {
· · ·
101 userQuery: "a b",
102 returned: [],
103 error: null,
104 },
105 {
+ 3 more matches in this file
tests/rustdoc-js-std/parser-generics.js JAVASCRIPT 6 matches · showing 5 view file →
6 userQuery: 'A<B<C<D>, E>',
7 returned: [],
8 error: 'Unclosed `<`',
9 },
10 {
· · ·
31 userQuery: "p<>,u8",
32 returned: [],
33 error: null,
34 },
35 {
· · ·
56 userQuery: '"p"<a>',
57 returned: [],
58 error: null,
59 },
60 {
· · ·
89 userQuery: 'p<u<x>>',
90 returned: [],
91 error: null,
92 },
93 {
· · ·
129 userQuery: 'p<u<x>, r>',
130 returned: [],
131 error: null,
132 },
133 {
+ 1 more matches in this file
tests/rustdoc-js/non-english-identifier.js JAVASCRIPT 6 matches · showing 5 view file →
13 foundElems: 1,
14 userQuery: "中文",
15 error: null,
16 },
17 {
· · ·
29 userQuery: "_0Mixed中英文",
30 returned: [],
31 error: null,
32 },
33 {
· · ·
44 userQuery: "my_crate::中文API",
45 returned: [],
46 error: null,
47 },
48 {
· · ·
85 }]]],
86 }],
87 error: null,
88 },
89 {
· · ·
100 userQuery: "my_crate 中文宏!",
101 returned: [],
102 error: null,
103 },
104 {
+ 1 more matches in this file
tests/rustdoc-js-std/parser-bindings.js JAVASCRIPT 10 matches · showing 5 view file →
32 userQuery: 'A<B=C>',
33 returned: [],
34 error: null,
35 },
36 {
· · ·
62 userQuery: 'A<B = C>',
63 returned: [],
64 error: null,
65 },
66 {
· · ·
92 userQuery: 'A<B=!>',
93 returned: [],
94 error: null,
95 },
96 {
· · ·
122 userQuery: 'A<B=[]>',
123 returned: [],
124 error: null,
125 },
126 {
· · ·
161 userQuery: 'A<B=[!]>',
162 returned: [],
163 error: null,
164 },
165 {
+ 5 more matches in this file
tests/rustdoc-js-std/parser-slice-array.js JAVASCRIPT 18 matches · showing 5 view file →
6 userQuery: '[[[D, []]]',
7 returned: [],
8 error: 'Unclosed `[`',
9 },
10 {
· · ·
58 userQuery: '[[[D, []]]]',
59 returned: [],
60 error: null,
61 },
62 {
· · ·
83 userQuery: "[],u8",
84 returned: [],
85 error: null,
86 },
87 {
· · ·
109 userQuery: "[u8]",
110 returned: [],
111 error: null,
112 },
113 {
· · ·
143 userQuery: "[u8,u8]",
144 returned: [],
145 error: null,
146 },
147 {
+ 13 more matches in this file
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.