Explorar o código

Also handle case where AMD is not present

JC Brand %!s(int64=12) %!d(string=hai) anos
pai
achega
d38af7ed89
Modificáronse 1 ficheiros con 5 adicións e 0 borrados
  1. 5 0
      Libraries/strophe.muc.js

+ 5 - 0
Libraries/strophe.muc.js

@@ -12,6 +12,9 @@
 
 // AMD/global registrations
 (function (root, factory) {
+    if (console===undefined || console.log===undefined) {
+        console = { log: function () {}, error: function () {} };
+    }
     if (typeof define === 'function' && define.amd) { 
         define([
             "Libraries/strophe"
@@ -22,6 +25,8 @@
                 return factory(jQuery, console);
             }
         );
+    } else { 
+        return factory(jQuery, console);
     }
 }(this, function ($, console) {