Bläddra i källkod

fix debug flag

ericz 12 år sedan
förälder
incheckning
81e1caedda
5 ändrade filer med 21 tillägg och 9 borttagningar
  1. 7 3
      demo/static/peer.js
  2. 7 3
      dist/peer.js
  3. 0 0
      dist/peer.min.js
  4. 3 1
      lib/sink.js
  5. 4 2
      lib/util.js

+ 7 - 3
demo/static/peer.js

@@ -726,8 +726,10 @@ EventEmitter.prototype.emit = function(type) {
 
 
 
-
 var util = {
+  
+  debug: false,
+  
   inherits: function(ctor, superCtor) {
     ctor.super_ = superCtor;
     ctor.prototype = Object.create(superCtor.prototype, {
@@ -754,7 +756,7 @@ var util = {
   },
   
   log: function () {
-    if (debug) {
+    if (util.debug) {
       for (var i = 0; i < arguments.length; i++) {
         console.log('*', i, '-- ', arguments[i]);
       }
@@ -828,9 +830,11 @@ function Peer(options) {
   EventEmitter.call(this);
   
   options = util.extend({
-    // Defaults
+    debug: false
   }, options);
   
+  util.debug = options.debug;
+  
   
   this._config = options.config || { 'iceServers': [{ 'url': 'stun:stun.l.google.com:19302' }] };
   this._id = null;

+ 7 - 3
dist/peer.js

@@ -726,8 +726,10 @@ EventEmitter.prototype.emit = function(type) {
 
 
 
-
 var util = {
+  
+  debug: false,
+  
   inherits: function(ctor, superCtor) {
     ctor.super_ = superCtor;
     ctor.prototype = Object.create(superCtor.prototype, {
@@ -754,7 +756,7 @@ var util = {
   },
   
   log: function () {
-    if (debug) {
+    if (util.debug) {
       for (var i = 0; i < arguments.length; i++) {
         console.log('*', i, '-- ', arguments[i]);
       }
@@ -828,9 +830,11 @@ function Peer(options) {
   EventEmitter.call(this);
   
   options = util.extend({
-    // Defaults
+    debug: false
   }, options);
   
+  util.debug = options.debug;
+  
   
   this._config = options.config || { 'iceServers': [{ 'url': 'stun:stun.l.google.com:19302' }] };
   this._id = null;

Filskillnaden har hållts tillbaka eftersom den är för stor
+ 0 - 0
dist/peer.min.js


+ 3 - 1
lib/sink.js

@@ -4,9 +4,11 @@ function Peer(options) {
   EventEmitter.call(this);
   
   options = util.extend({
-    // Defaults
+    debug: false
   }, options);
   
+  util.debug = options.debug;
+  
   
   this._config = options.config || { 'iceServers': [{ 'url': 'stun:stun.l.google.com:19302' }] };
   this._id = null;

+ 4 - 2
lib/util.js

@@ -1,5 +1,7 @@
-
 var util = {
+  
+  debug: false,
+  
   inherits: function(ctor, superCtor) {
     ctor.super_ = superCtor;
     ctor.prototype = Object.create(superCtor.prototype, {
@@ -26,7 +28,7 @@ var util = {
   },
   
   log: function () {
-    if (debug) {
+    if (util.debug) {
       for (var i = 0; i < arguments.length; i++) {
         console.log('*', i, '-- ', arguments[i]);
       }

Vissa filer visades inte eftersom för många filer har ändrats