summaryrefslogtreecommitdiff
path: root/ext/node/polyfills/internal/console/constructor.mjs
diff options
context:
space:
mode:
authorBartek IwaƄczuk <biwanczuk@gmail.com>2023-11-13 23:16:23 +0100
committerGitHub <noreply@github.com>2023-11-13 22:16:23 +0000
commit9b9ec44db7eeec9d390b63f93393578e258f05a0 (patch)
tree45b868369dde5b145f712d137c0e4b3972d2f458 /ext/node/polyfills/internal/console/constructor.mjs
parent9fed7b9caf901a2b5f78e345ad327dd5cc48e02f (diff)
Revert "fix(ext/console): fix inspecting iterators error. (#20720)" (#21191)
This reverts commit 0209f7b46954d1b7bf923b4191e5a356ec09622c. Reverting because it causes failures on `main`: https://github.com/denoland/deno/pull/20720#issuecomment-1809166755
Diffstat (limited to 'ext/node/polyfills/internal/console/constructor.mjs')
-rw-r--r--ext/node/polyfills/internal/console/constructor.mjs13
1 files changed, 12 insertions, 1 deletions
diff --git a/ext/node/polyfills/internal/console/constructor.mjs b/ext/node/polyfills/internal/console/constructor.mjs
index afa18bb97..5ea9eeb3a 100644
--- a/ext/node/polyfills/internal/console/constructor.mjs
+++ b/ext/node/polyfills/internal/console/constructor.mjs
@@ -17,7 +17,17 @@ import {
validateInteger,
validateObject,
} from "ext:deno_node/internal/validators.mjs";
-import { previewEntries } from "ext:deno_node/internal_binding/util.ts";
+const previewEntries = (iter, isKeyValue) => {
+ if (isKeyValue) {
+ const arr = [...iter];
+ if (Array.isArray(arr[0]) && arr[0].length === 2) {
+ return [[].concat(...arr), true];
+ }
+ return [arr, false];
+ } else {
+ return [...iter];
+ }
+};
import { Buffer } from "node:buffer";
const { isBuffer } = Buffer;
import {
@@ -465,6 +475,7 @@ const consoleMethods = {
// https://console.spec.whatwg.org/#table
table(tabularData, properties) {
+ console.log("tabularData", tabularData);
if (properties !== undefined) {
validateArray(properties, "properties");
}