mirror of
https://github.com/denoland/deno.git
synced 2024-12-24 08:09:08 -05:00
This reverts commit 0209f7b469
.
Reverting because it causes failures on `main`:
https://github.com/denoland/deno/pull/20720#issuecomment-1809166755
This commit is contained in:
parent
9fed7b9caf
commit
9b9ec44db7
3 changed files with 21 additions and 20 deletions
|
@ -136,7 +136,6 @@ const {
|
|||
WeakSetPrototypeHas,
|
||||
isNaN,
|
||||
} = primordials;
|
||||
import { previewEntries } from "ext:deno_node/internal_binding/util.ts";
|
||||
|
||||
let noColor = () => false;
|
||||
|
||||
|
@ -1494,7 +1493,9 @@ function getIteratorBraces(type, tag) {
|
|||
|
||||
const iteratorRegExp = new SafeRegExp(" Iterator] {$");
|
||||
function formatIterator(braces, ctx, value, recurseTimes) {
|
||||
const { 0: entries, 1: isKeyValue } = previewEntries(value, true);
|
||||
// TODO(wafuwafu13): Implement
|
||||
// const { 0: entries, 1: isKeyValue } = previewEntries(value, true);
|
||||
const { 0: entries, 1: isKeyValue } = value;
|
||||
if (isKeyValue) {
|
||||
// Mark entry iterators as such.
|
||||
braces[0] = StringPrototypeReplace(
|
||||
|
@ -1703,12 +1704,16 @@ function formatWeakCollection(ctx) {
|
|||
}
|
||||
|
||||
function formatWeakSet(ctx, value, recurseTimes) {
|
||||
const entries = previewEntries(value);
|
||||
// TODO(wafuwafu13): Implement
|
||||
// const entries = previewEntries(value);
|
||||
const entries = value;
|
||||
return formatSetIterInner(ctx, recurseTimes, entries, kWeak);
|
||||
}
|
||||
|
||||
function formatWeakMap(ctx, value, recurseTimes) {
|
||||
const entries = previewEntries(value);
|
||||
// TODO(wafuwafu13): Implement
|
||||
// const entries = previewEntries(value);
|
||||
const entries = value;
|
||||
return formatMapIterInner(ctx, recurseTimes, entries, kWeak);
|
||||
}
|
||||
|
||||
|
|
|
@ -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");
|
||||
}
|
||||
|
|
|
@ -129,18 +129,3 @@ export function getOwnNonIndexProperties(
|
|||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
export function previewEntries(
|
||||
iter: Iterable<unknown>,
|
||||
isKeyValue?: boolean,
|
||||
): Array<unknown | boolean> {
|
||||
if (isKeyValue) {
|
||||
const arr = [...iter];
|
||||
if (Array.isArray(arr[0]) && arr[0].length === 2) {
|
||||
return [([] as unknown[]).concat(...arr), true];
|
||||
}
|
||||
return [arr, false];
|
||||
} else {
|
||||
return [...iter];
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue