@@ -222,11 +222,11 @@ buildDocs = (watch = no) ->
222222 markdownRenderer = require (' markdown-it' )
223223 html : yes
224224 typographer : yes
225- highlight : (str , lang ) ->
225+ highlight : (str , language ) ->
226226 # From https://github.com/markdown-it/markdown-it#syntax-highlighting
227- if lang and hljs .getLanguage (lang )
227+ if language and hljs .getLanguage (language )
228228 try
229- return hljs .highlight (lang, str ).value
229+ return hljs .highlight (str, { language } ).value
230230 catch ex
231231 return ' ' # No syntax highlighting
232232
@@ -502,7 +502,7 @@ task 'test:browser', 'run the test suite against the modern browser compiler in
502502 # version of the browser compiler. There’s no reason to run this test in old
503503 # versions of Node (the runtime is the headless Chrome browser, not Node),
504504 # and Puppeteer 3 only supports Node >= 10.18.1, so limit this test to those
505- # versions. The code below uses `Promise.prototype.finally` because the
505+ # versions. The code below uses `Promise.prototype.finally` because the
506506 # CoffeeScript codebase currently maintains compatibility with Node 6, which
507507 # did not support `async`/`await` syntax. Even though this test doesn’t run
508508 # in Node 6, it needs to still _parse_ in Node 6 so that this file can load.
@@ -537,7 +537,7 @@ task 'test:browser', 'run the test suite against the modern browser compiler in
537537 page = pageHandle
538538 page .goto ' http://localhost:8080/'
539539 ).then (->
540- page .waitFor ' #result' ,
540+ page .waitForSelector ' #result' ,
541541 visible : yes
542542 polling : ' mutation'
543543 ).then ((element ) ->
@@ -548,7 +548,7 @@ task 'test:browser', 'run the test suite against the modern browser compiler in
548548 browser .close ()
549549 ).finally ->
550550 server .close ()
551- if result and ' failed ' not in result
551+ if result and not result . includes ( ' failed ' )
552552 log result, green
553553 else
554554 log result, red
@@ -570,6 +570,9 @@ task 'test:integrations', 'test the module integrated with other libraries and e
570570 # can be built by such tools; if such a build succeeds, it verifies that no
571571 # Node modules are required as part of the compiler (as opposed to the tests)
572572 # and that therefore the compiler will run in a browser environment.
573+ # Webpack 5 requires Node >= 10.13.0.
574+ [major , minor ] = process .versions .node .split (' .' ).map (n) -> parseInt (n, 10 )
575+ return if major < 10 or (major is 10 and minor < 13 )
573576 tmpdir = os .tmpdir ()
574577 webpack = require ' webpack'
575578 webpack {
@@ -594,7 +597,7 @@ task 'test:integrations', 'test the module integrated with other libraries and e
594597 process .exit 1
595598
596599 builtCompiler = path .join tmpdir, ' coffeescript.js'
597- CoffeeScript = require builtCompiler
600+ { CoffeeScript } = require builtCompiler
598601 global .testingBrowser = yes
599602 testResults = runTests CoffeeScript
600603 fs .unlinkSync builtCompiler
0 commit comments