From 1911b0b8299b54cad2c6fd69dee92e8331d59370 Mon Sep 17 00:00:00 2001 From: Andrew Patton Date: Tue, 2 Jul 2024 11:42:26 -0700 Subject: [PATCH] =?UTF-8?q?Update=20node.js=20workaround=20from=20global?= =?UTF-8?q?=20=E2=86=92=20globalThis?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit the node.js global object is deprecated in favor of the cross-platform standard globalThis object. references: • https://nodejs.org/api/globals.html#global • https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/globalThis --- prism.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/prism.js b/prism.js index 4b9c9a0f8a..3758ddc3ae 100644 --- a/prism.js +++ b/prism.js @@ -1214,8 +1214,8 @@ if (typeof module !== 'undefined' && module.exports) { } // hack for components to work correctly in node.js -if (typeof global !== 'undefined') { - global.Prism = Prism; +if (typeof globalThis !== 'undefined') { + globalThis.Prism = Prism; } // some additional documentation/types