Skip to content

Commit

Permalink
(fix) use console.log for .js.js deprecation warning
Browse files Browse the repository at this point in the history
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 highlightjs#3222.
  • Loading branch information
joshgoebel committed Jun 4, 2021
1 parent a672b82 commit 524a0ba
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions tools/build_node.js
Expand Up @@ -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"'
);
}
}
Expand Down

0 comments on commit 524a0ba

Please sign in to comment.