diff options
author | 迷渡 <justjavac@gmail.com> | 2019-04-19 09:56:33 +0800 |
---|---|---|
committer | Ryan Dahl <ry@tinyclouds.org> | 2019-04-18 21:56:33 -0400 |
commit | d0cd7a39a2d05343c5501dc286bb59096659654f (patch) | |
tree | adffb215b15e8ca3411db732f5604158e5ab9640 /js/console_table.ts | |
parent | 2be7e4440339f616a37b9535cc38936f80efc0e1 (diff) |
avoid prototype builtin hasOwnProperty (#2144)
Diffstat (limited to 'js/console_table.ts')
-rw-r--r-- | js/console_table.ts | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/js/console_table.ts b/js/console_table.ts index d7cae124c..43819c5fe 100644 --- a/js/console_table.ts +++ b/js/console_table.ts @@ -2,6 +2,7 @@ // Forked from Node's lib/internal/cli_table.js import { TextEncoder } from "./text_encoding"; +import { hasOwnProperty } from "./util"; const encoder = new TextEncoder(); @@ -64,7 +65,7 @@ export function cliTable(head: string[], columns: string[][]): string { if (rows[j] === undefined) { rows[j] = []; } - const value = (rows[j][i] = column.hasOwnProperty(j) ? column[j] : ""); + const value = (rows[j][i] = hasOwnProperty(column, j) ? column[j] : ""); const width = columnWidths[i] || 0; const counted = countBytes(value); columnWidths[i] = Math.max(width, counted); |