From 08bf01593fa09a00f404cccc2be069f80efa7f92 Mon Sep 17 00:00:00 2001 From: Shelley Vohr Date: Wed, 1 Mar 2023 13:25:20 +0100 Subject: [PATCH] lib: fix BroadcastChannel initialization location PR-URL: https://github.com/nodejs/node/pull/46864 Reviewed-By: Joyee Cheung Reviewed-By: Yagiz Nizipli Reviewed-By: Luigi Pinca Reviewed-By: Chengzhong Wu --- lib/internal/bootstrap/browser.js | 1 + lib/internal/bootstrap/node.js | 6 ------ 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/lib/internal/bootstrap/browser.js b/lib/internal/bootstrap/browser.js index e1f3d775c6ac13..16384dac72c46a 100644 --- a/lib/internal/bootstrap/browser.js +++ b/lib/internal/bootstrap/browser.js @@ -43,6 +43,7 @@ defineOperation(globalThis, 'setInterval', timers.setInterval); defineOperation(globalThis, 'setTimeout', timers.setTimeout); // Lazy ones. +exposeLazyInterfaces(globalThis, 'internal/worker/io', ['BroadcastChannel']); exposeLazyInterfaces(globalThis, 'internal/abort_controller', [ 'AbortController', 'AbortSignal', ]); diff --git a/lib/internal/bootstrap/node.js b/lib/internal/bootstrap/node.js index c3235e5bdcf610..9d1a16c5c95749 100644 --- a/lib/internal/bootstrap/node.js +++ b/lib/internal/bootstrap/node.js @@ -70,7 +70,6 @@ const { defineOperation, deprecate, defineLazyProperties, - exposeLazyInterfaces, } = require('internal/util'); const { privateSymbols: { @@ -214,11 +213,6 @@ defineLazyProperties( ['structuredClone'], ); -exposeLazyInterfaces( - globalThis, - 'internal/worker/io', - ['BroadcastChannel'], -); // Set the per-Environment callback that will be called // when the TrackingTraceStateObserver updates trace state. // Note that when NODE_USE_V8_PLATFORM is true, the observer is