mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2025-02-17 08:50:58 -05:00
Warn people who try to run the headless client, but webworkers didn't install.
This commit is contained in:
parent
80ecf1aa1d
commit
0a603a8e26
1 changed files with 11 additions and 1 deletions
|
@ -45,7 +45,17 @@ disable = [
|
|||
GLOBAL.window = GLOBAL
|
||||
GLOBAL.document = location: pathname: 'headless_client'
|
||||
GLOBAL.console.debug = console.log
|
||||
GLOBAL.Worker = require('webworker-threads').Worker
|
||||
try
|
||||
GLOBAL.Worker = require('webworker-threads').Worker
|
||||
catch
|
||||
console.log ""
|
||||
console.log "Headless client needs the webworker-threads package from NPM to function."
|
||||
console.log "Try installing it with the command:"
|
||||
console.log ""
|
||||
console.log " npm install webworker-threads"
|
||||
console.log ""
|
||||
process.exit(1)
|
||||
|
||||
Worker::removeEventListener = (what) ->
|
||||
if what is 'message'
|
||||
@onmessage = -> #This webworker api has only one event listener at a time.
|
||||
|
|
Loading…
Reference in a new issue