diff options
| author | Kevin (Kun) "Kassimo" Qian <kevinkassimo@gmail.com> | 2018-12-12 02:32:24 -0500 |
|---|---|---|
| committer | Ryan Dahl <ry@tinyclouds.org> | 2018-12-12 02:32:24 -0500 |
| commit | 8502cb0ccba2697d6922b3256655ca445910b7e8 (patch) | |
| tree | 5ecb7b68b12a5bbfbcfa8d1fc9847eaca130f989 /js/console.ts | |
| parent | 585de35b1d472a94fb2652fce1f2cc32077f7814 (diff) | |
Avoid Uint8Array.prototype throwing type error in console.log (#1327)
Diffstat (limited to 'js/console.ts')
| -rw-r--r-- | js/console.ts | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/js/console.ts b/js/console.ts index 3d2d65909..bb597d9f2 100644 --- a/js/console.ts +++ b/js/console.ts @@ -63,9 +63,12 @@ function createIterableString( ctx.add(value); const entries: string[] = []; - for (const el of value) { - entries.push(config.entryHandler(el, ctx, level + 1, maxLevel)); - } + // In cases e.g. Uint8Array.prototype + try { + for (const el of value) { + entries.push(config.entryHandler(el, ctx, level + 1, maxLevel)); + } + } catch (e) {} ctx.delete(value); const iPrefix = `${config.displayName ? config.displayName + " " : ""}`; const iContent = entries.length === 0 ? "" : ` ${entries.join(", ")} `; |
