/
githubmirror
/
deno
Обзор
Документация
Войти
/
githubmirror
/
deno
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
ext/node/polyfills/console_esm.ts
50 строк
1 KB
Divy Srivastava
perf: startup time (22ms -> 15ms) (#34450)
18 июн 2026, 20:48
Не верифицирован
18 июн 2026, 20:48
7b54748
Код
Авторство
О чём код?
// Copyright 2018-2026 the Deno authors. MIT license. import { core, primordials } from "ext:core/mod.js"; import { windowOrWorkerGlobalScope } from "ext:runtime/98_global_scope_shared.js"; const { Console } = core.loadExtScript("ext:deno_node/console.ts"); // Don't rely on global `console` because during bootstrapping, it is pointing // to the native `console` object provided by V8. Read via the property // descriptor from `windowOrWorkerGlobalScope` so this works whether the // install used a data descriptor (`propNonEnumerable`) or an accessor // descriptor (`propNonEnumerableLazyLoaded`). // deno-lint-ignore no-explicit-any const _consoleDesc = windowOrWorkerGlobalScope.console as any; const console = typeof _consoleDesc.get === "function" ? _consoleDesc.get() : _consoleDesc.value; const { ObjectAssign } = primordials; ObjectAssign(console, { Console }); export default console; export { Console }; export const { assert, clear, count, countReset, debug, dir, dirxml, error, group, groupCollapsed, groupEnd, info, log, profile, profileEnd, table, time, timeEnd, timeLog, timeStamp, trace, warn, } = console; // deno-lint-ignore no-explicit-any export const indentLevel = (console as any)?.indentLevel;