From fbf223af2911ab1a0b41c3fa3dc38eafaf6f5d24 Mon Sep 17 00:00:00 2001 From: Josh Goebel Date: Thu, 3 Jun 2021 21:36:55 -0400 Subject: [PATCH] (fix) use console.log for .js.js deprecation warning Technically (with a build system) this code could end up in the browser, so we should use only APIs available in both browser and node.js. Resolves #3222. --- tools/build_node.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tools/build_node.js b/tools/build_node.js index 5d6bb6e7d8..94463a2131 100644 --- a/tools/build_node.js +++ b/tools/build_node.js @@ -34,9 +34,8 @@ async function buildNodeLanguage(language, options) { const EMIT = `function emitWarning() { if (!emitWarning.warned) { emitWarning.warned = true; - process.emitWarning( - 'Using file extension in specifier is deprecated, use "highlight.js/lib/languages/%%%%" instead of "highlight.js/lib/languages/%%%%.js"', - 'DeprecationWarning' + console.log( + 'Deprecation (warning): Using file extension in specifier is deprecated, use "highlight.js/lib/languages/%%%%" instead of "highlight.js/lib/languages/%%%%.js"' ); } }