fix(ext/node): Module.wrap cleanup for npm:v8-code-cache (#29725)

This removes the additional arguments on the function returned by
`Module.wrap`.

Allow libraries that overwrite this behavior (like `v8-code-cache`) to
work correctly.

---------

Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
This commit is contained in:
Luca Casonato 2025-06-17 02:32:10 +02:00 committed by GitHub
parent f609bbb267
commit 8362881c09
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 67 additions and 27 deletions

View file

@ -94,6 +94,7 @@ import {
} from "ext:runtime/98_global_scope_worker.js";
import { SymbolDispose, SymbolMetadata } from "ext:deno_web/00_infra.js";
import { bootstrap as bootstrapOtel } from "ext:deno_telemetry/telemetry.ts";
import { nodeGlobals } from "ext:deno_node/00_globals.js";
// deno-lint-ignore prefer-primordials
if (Symbol.metadata) {
@ -730,7 +731,7 @@ function removeImportedOps() {
// FIXME(bartlomieju): temporarily add whole `Deno.core` to
// `Deno[Deno.internal]` namespace. It should be removed and only necessary
// methods should be left there.
ObjectAssign(internals, { core });
ObjectAssign(internals, { core, nodeGlobals: { ...nodeGlobals } });
const internalSymbol = Symbol("Deno.internal");
const finalDenoNs = {
internal: internalSymbol,