diff --git a/dist/cordova-plugin-iosrtc.js b/dist/cordova-plugin-iosrtc.js index ba5531c5..71e70eda 100644 --- a/dist/cordova-plugin-iosrtc.js +++ b/dist/cordova-plugin-iosrtc.js @@ -1,7 +1,7 @@ /* - * cordova-plugin-iosrtc v2.2.2 + * cordova-plugin-iosrtc v2.2.3-pre * Cordova iOS plugin exposing the full WebRTC W3C JavaScript APIs - * Copyright 2015 Iñaki Baz Castillo at eFace2Face, inc. (https://eface2face.com) + * Copyright 2015-2016 Iñaki Baz Castillo at eFace2Face, inc. (https://eface2face.com) * License MIT */ @@ -963,8 +963,8 @@ function RTCDataChannel(peerConnection, label, options, dataFromEvent) { if (!dataFromEvent) { debug('new() | [label:%o, options:%o]', label, options); - if (!label || typeof label !== 'string') { - throw new Error('label argument required'); + if (typeof label !== 'string') { + label = ''; } options = options || {}; @@ -3218,8 +3218,8 @@ void function(root){ function generator(options){ options = defaults(options) return function(min, max, integer){ - options.min = min || options.min - options.max = max || options.max + options.min = min != null ? min : options.min + options.max = max != null ? max : options.max options.integer = integer != null ? integer : options.integer return random(options) } @@ -3232,8 +3232,8 @@ void function(root){ },{}],20:[function(require,module,exports){ module.exports = { - EventTarget: require('./lib/EventTarget'), - Event: require('./lib/Event') + EventTarget : require('./lib/EventTarget'), + Event : require('./lib/Event') }; },{"./lib/Event":21,"./lib/EventTarget":22}],21:[function(require,module,exports){ @@ -3251,7 +3251,6 @@ module.exports = global.Event; */ module.exports = _EventTarget; - function _EventTarget() { // Do nothing if called for a native EventTarget object.. if (typeof this.addEventListener === 'function') { @@ -3265,7 +3264,6 @@ function _EventTarget() { this.dispatchEvent = _dispatchEvent; } - Object.defineProperties(_EventTarget.prototype, { listeners: { get: function () { @@ -3274,9 +3272,9 @@ Object.defineProperties(_EventTarget.prototype, { } }); - function _addEventListener(type, newListener) { - var listenersType, + var + listenersType, i, listener; if (!type || !newListener) { @@ -3297,9 +3295,9 @@ function _addEventListener(type, newListener) { listenersType.push(newListener); } - function _removeEventListener(type, oldListener) { - var listenersType, + var + listenersType, i, listener; if (!type || !oldListener) { @@ -3323,9 +3321,9 @@ function _removeEventListener(type, oldListener) { } } - function _dispatchEvent(event) { - var type, + var + type, listenersType, dummyListener, stopImmediatePropagation = false, @@ -3335,19 +3333,19 @@ function _dispatchEvent(event) { throw new Error('`event` must have a valid `type` property'); } - if (event._dispatched) { - throw new Error('event already dispatched'); + // Do some stuff to emulate DOM Event behavior (just if this is not a + // DOM Event object) + if (event._yaeti) { + event.target = this; + event.cancelable = true; } - event._dispatched = true; - // Force the event to be cancelable. - event.cancelable = true; - event.target = this; - - // Override stopImmediatePropagation() function. - event.stopImmediatePropagation = function () { - stopImmediatePropagation = true; - }; + // Attempt to override the stopImmediatePropagation() method + try { + event.stopImmediatePropagation = function () { + stopImmediatePropagation = true; + }; + } catch (error) {} type = event.type; listenersType = (this._listeners[type] || []); diff --git a/package.json b/package.json index f116a687..b56479d4 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "cordova-plugin-iosrtc", - "version": "2.2.2", + "version": "2.2.3-pre", "description": "Cordova iOS plugin exposing the full WebRTC W3C JavaScript APIs", "author": "Iñaki Baz Castillo at eFace2Face, inc. (https://eface2face.com)", "license": "MIT", @@ -21,11 +21,11 @@ "dependencies": { "debug": "^2.2.0", "domready": "^1.0.8", - "random-number": "^0.0.6", + "random-number": "^0.0.7", "yaeti": "^0.0.5" }, "devDependencies": { - "browserify": "^12.0.1", + "browserify": "^13.0.0", "gulp": "git+https://github.com/gulpjs/gulp.git#4.0", "gulp-header": "^1.7.1", "gulp-jscs": "^3.0.2", diff --git a/plugin.xml b/plugin.xml index c9af8d98..13c43ce6 100644 --- a/plugin.xml +++ b/plugin.xml @@ -1,7 +1,7 @@ + version="2.2.3-pre"> iosrtc Cordova iOS plugin exposing the full WebRTC W3C JavaScript APIs