|
1 | 1 | (function() {
|
2 | 2 | const CAT_namespace = 0;
|
3 |
| - const CAT_global_variable = 1; |
4 |
| - const CAT_function = 2; |
5 |
| - const CAT_primitive = 3; |
6 |
| - const CAT_error_set = 4; |
7 |
| - const CAT_global_const = 5; |
8 |
| - const CAT_alias = 6; |
9 |
| - const CAT_type = 7; |
10 |
| - const CAT_type_type = 8; |
11 |
| - const CAT_type_function = 9; |
| 3 | + const CAT_container = 1; |
| 4 | + const CAT_global_variable = 2; |
| 5 | + const CAT_function = 3; |
| 6 | + const CAT_primitive = 4; |
| 7 | + const CAT_error_set = 5; |
| 8 | + const CAT_global_const = 6; |
| 9 | + const CAT_alias = 7; |
| 10 | + const CAT_type = 8; |
| 11 | + const CAT_type_type = 9; |
| 12 | + const CAT_type_function = 10; |
| 13 | + |
| 14 | + const LOG_err = 0; |
| 15 | + const LOG_warn = 1; |
| 16 | + const LOG_info = 2; |
| 17 | + const LOG_debug = 3; |
12 | 18 |
|
13 | 19 | const domDocTestsCode = document.getElementById("docTestsCode");
|
14 | 20 | const domFnErrorsAnyError = document.getElementById("fnErrorsAnyError");
|
|
47 | 53 | const domStatus = document.getElementById("status");
|
48 | 54 | const domTableFnErrors = document.getElementById("tableFnErrors");
|
49 | 55 | const domTldDocs = document.getElementById("tldDocs");
|
| 56 | + const domErrors = document.getElementById("errors"); |
| 57 | + const domErrorsText = document.getElementById("errorsText"); |
50 | 58 |
|
51 | 59 | var searchTimer = null;
|
52 | 60 |
|
|
83 | 91 |
|
84 | 92 | WebAssembly.instantiateStreaming(wasm_promise, {
|
85 | 93 | js: {
|
86 |
| - log: function(ptr, len) { |
| 94 | + log: function(level, ptr, len) { |
87 | 95 | const msg = decodeString(ptr, len);
|
88 |
| - console.log(msg); |
89 |
| - }, |
90 |
| - panic: function (ptr, len) { |
91 |
| - const msg = decodeString(ptr, len); |
92 |
| - throw new Error("panic: " + msg); |
| 96 | + switch (level) { |
| 97 | + case LOG_err: |
| 98 | + console.error(msg); |
| 99 | + domErrorsText.textContent += msg + "\n"; |
| 100 | + domErrors.classList.remove("hidden"); |
| 101 | + break; |
| 102 | + case LOG_warn: |
| 103 | + console.warn(msg); |
| 104 | + break; |
| 105 | + case LOG_info: |
| 106 | + console.info(msg); |
| 107 | + break; |
| 108 | + case LOG_debug: |
| 109 | + console.debug(msg); |
| 110 | + break; |
| 111 | + } |
93 | 112 | },
|
94 | 113 | },
|
95 | 114 | }).then(function(obj) {
|
|
184 | 203 | const category = wasm_exports.categorize_decl(decl_index, 0);
|
185 | 204 | switch (category) {
|
186 | 205 | case CAT_namespace:
|
| 206 | + case CAT_container: |
187 | 207 | return renderNamespacePage(decl_index);
|
188 | 208 | case CAT_global_variable:
|
189 | 209 | case CAT_primitive:
|
|
426 | 446 | while (true) {
|
427 | 447 | const member_category = wasm_exports.categorize_decl(member, 0);
|
428 | 448 | switch (member_category) {
|
429 |
| - case CAT_namespace: |
430 |
| - if (wasm_exports.decl_field_count(member) > 0) { |
431 |
| - typesList.push({original: original, member: member}); |
432 |
| - } else { |
433 |
| - namespacesList.push({original: original, member: member}); |
434 |
| - } |
435 |
| - continue member_loop; |
436 | 449 | case CAT_namespace:
|
437 | 450 | namespacesList.push({original: original, member: member});
|
438 | 451 | continue member_loop;
|
| 452 | + case CAT_container: |
| 453 | + typesList.push({original: original, member: member}); |
| 454 | + continue member_loop; |
439 | 455 | case CAT_global_variable:
|
440 | 456 | varsList.push(member);
|
441 | 457 | continue member_loop;
|
|
0 commit comments