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 #3222.
  • Loading branch information
joshgoebel committed Jun 4, 2021
1 parent 9268dc2 commit fbf223a
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions tools/build_node.js
Original file line number Diff line number Diff line change
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 fbf223a

Please sign in to comment.