PageRenderTime 44ms CodeModel.GetById 27ms RepoModel.GetById 0ms app.codeStats 0ms

/js/lib/Socket.IO-node/support/expresso/deps/jscoverage/tests/javascript-ignore/ignore.js

http://github.com/onedayitwillmake/RealtimeMultiplayerNodeJs
JavaScript | 44 lines | 31 code | 5 blank | 8 comment | 11 complexity | 5a18789fbab9d03113f23fe06274ff80 MD5 | raw file
Possible License(s): GPL-2.0, LGPL-2.1, MPL-2.0-no-copyleft-exception, BSD-3-Clause
  1. function createRequest() {
  2. //#JSCOVERAGE_IF
  3. if (window.XMLHttpRequest) {
  4. return new XMLHttpRequest();
  5. }
  6. else if (window.ActiveXObject) {
  7. return new ActiveXObject('Msxml2.XMLHTTP');
  8. }
  9. else {
  10. throw 'no XMLHttpRequest implementation available';
  11. }
  12. }
  13. function createRequest2() {
  14. //#JSCOVERAGE_IF
  15. if (window.XMLHttpRequest) {
  16. return new XMLHttpRequest();
  17. }
  18. //#JSCOVERAGE_IF ! window.XMLHttpRequest
  19. //#JSCOVERAGE_IF
  20. if (window.ActiveXObject) {
  21. return new ActiveXObject('Msxml2.XMLHTTP');
  22. }
  23. //#JSCOVERAGE_IF 0
  24. throw 'no XMLHttpRequest implementation available';
  25. //#JSCOVERAGE_ENDIF
  26. //#JSCOVERAGE_ENDIF
  27. }
  28. function log(s) {
  29. //#JSCOVERAGE_IF
  30. if (window.console && window.console.log) {
  31. console.log(s);
  32. }
  33. else if (window.opera && window.opera.postError) {
  34. opera.postError(s);
  35. }
  36. }
  37. var request = createRequest();
  38. var request2 = createRequest2();
  39. log('created requests');