xmppo / node-xmpp-bosh

An XMPP BOSH & WebSocket server (connection manager) written on node.js using Javascript
https://github.com/xmppo/node-xmpp-bosh
263 stars 85 forks source link

Placing "use strict" in strophe/strophe.js results in execution error #103

Closed jeffrey-l-turner closed 10 years ago

jeffrey-l-turner commented 10 years ago

Specifically:

$ npm test

node-xmpp-bosh@0.7.10 test /home/jlt/node-xmpp-bosh bash tests/all.sh

CURL: /usr/bin/curl <...> /home/jlt/node-xmpp-bosh/strophe/strophe.js:69 window = {XMLHttpRequest: XMLHttpRequest, Base64: Base64, MD5: MD5}; ^ ReferenceError: window is not defined at Object. (/home/jlt/TrXRTR/strophe/strophe.js:69:8) at Module._compile (module.js:456:26) at Object.Module._extensions..js (module.js:474:10) at Module.load (module.js:356:32) at Function.Module._load (module.js:312:12) at Module.require (module.js:364:17) at require (module.js:380:17) at Object. (/home/jlt/TrXRTR/tests/basic.js:34:15) at Module._compile (module.js:456:26) at Object.Module._extensions..js (module.js:474:10)

<...>

dhruvbird commented 10 years ago

In strict mode, window needs to be defined before it can be used. I'm not sure if using strict mode for files outside of src/ is an objective, especially since these files are used for unit tests, and not in the service itself.