From f798a0cfe8372e7df62d9514e6785e6f16549d25 Mon Sep 17 00:00:00 2001 From: dave caruso Date: Fri, 2 Jun 2023 22:03:16 -0400 Subject: fix readableStreamToArrayBuffer (#3181) * fix discord.js again * remove one of the async hooks warnings * clarify hardcoded modules docs --- src/js/node/async_hooks.js | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) (limited to 'src/js/node/async_hooks.js') diff --git a/src/js/node/async_hooks.js b/src/js/node/async_hooks.js index c5b0c8fe5..c68a15dbe 100644 --- a/src/js/node/async_hooks.js +++ b/src/js/node/async_hooks.js @@ -5,7 +5,9 @@ var drainMicrotasks = () => { }; var notImplemented = () => { - console.warn("[bun]: async_hooks has not been implemented yet. See https://github.com/oven-sh/bun/issues/1832"); + console.warn( + "[bun] Warning: async_hooks has not been implemented yet. See https://github.com/oven-sh/bun/issues/1832", + ); notImplemented = () => {}; }; @@ -146,19 +148,11 @@ class AsyncResource { constructor(type, triggerAsyncId) { this.type = type; this.triggerAsyncId = triggerAsyncId; - - if (AsyncResource.allowedRunInAsyncScope.has(type)) { - this.runInAsyncScope = this.#runInAsyncScope; - } } type; triggerAsyncId; - // We probably will not fully support AsyncResource - // But some packages in the wild do depend on it - static allowedRunInAsyncScope = new Set(["prisma-client-request"]); - emitBefore() { return true; } @@ -169,10 +163,7 @@ class AsyncResource { emitDestroy() {} - runInAsyncScope; - - #runInAsyncScope(fn, ...args) { - notImplemented(); + runInAsyncScope(fn, ...args) { var result, err; process.nextTick(fn => { try { -- cgit v1.2.3