1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-11-25 15:29:32 -05:00

fix(ext/node): use primordials in ext/node/polyfills/console.ts (#25572)

Contributing toward #24236

- Swapped `Object.assign` for `ObjectAssign` primordial.
- Removed referencing TODO comment.

Please disregard if no longer desired.
This commit is contained in:
Jake Abed 2024-09-11 00:55:58 -07:00 committed by GitHub
parent ef2d98fe11
commit 87bc47b3bf
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1,15 +1,15 @@
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
// TODO(petamoriken): enable prefer-primordials for node polyfills import { primordials } from "ext:core/mod.js";
// deno-lint-ignore-file prefer-primordials
import { Console } from "ext:deno_node/internal/console/constructor.mjs"; import { Console } from "ext:deno_node/internal/console/constructor.mjs";
import { windowOrWorkerGlobalScope } from "ext:runtime/98_global_scope_shared.js"; import { windowOrWorkerGlobalScope } from "ext:runtime/98_global_scope_shared.js";
// Don't rely on global `console` because during bootstrapping, it is pointing // Don't rely on global `console` because during bootstrapping, it is pointing
// to native `console` object provided by V8. // to native `console` object provided by V8.
const console = windowOrWorkerGlobalScope.console.value; const console = windowOrWorkerGlobalScope.console.value;
Object.assign(console, { Console }); const { ObjectAssign } = primordials;
ObjectAssign(console, { Console });
export default console; export default console;