Update JS snapshot to version 6.1.0-dev (via coho)

This commit is contained in:
Joe Bowser 2016-10-20 11:49:04 -07:00
parent 3e7be6cc0f
commit 7f9e7c73ab

View File

@ -1,5 +1,5 @@
// Platform: android
// 0030f1d859d2a8360b621b0d48072f3f08eb6925
// 53ea1913735222d326e65326e03391405df3cd4e
/*
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
@ -19,7 +19,7 @@
under the License.
*/
;(function() {
var PLATFORM_VERSION_BUILD_LABEL = '5.3.0-dev';
var PLATFORM_VERSION_BUILD_LABEL = '6.1.0-dev';
// file: src/scripts/require.js
/*jshint -W079 */
@ -330,7 +330,7 @@ module.exports = cordova;
});
// file: F:/coho/cordova-android/cordova-js-src/android/nativeapiprovider.js
// file: /Users/jbowser/cordova/cordova-android/cordova-js-src/android/nativeapiprovider.js
define("cordova/android/nativeapiprovider", function(require, exports, module) {
/**
@ -353,7 +353,7 @@ module.exports = {
});
// file: F:/coho/cordova-android/cordova-js-src/android/promptbasednativeapi.js
// file: /Users/jbowser/cordova/cordova-android/cordova-js-src/android/promptbasednativeapi.js
define("cordova/android/promptbasednativeapi", function(require, exports, module) {
/**
@ -742,8 +742,13 @@ var Channel = function(type, sticky) {
}
};
function forceFunction(f) {
if (typeof f != 'function') throw "Function required as first argument!";
function checkSubscriptionArgument(argument) {
if (typeof argument !== "function" && typeof argument.handleEvent !== "function") {
throw new Error(
"Must provide a function or an EventListener object " +
"implementing the handleEvent interface."
);
}
}
/**
@ -753,28 +758,39 @@ function forceFunction(f) {
* and a guid that can be used to stop subscribing to the channel.
* Returns the guid.
*/
Channel.prototype.subscribe = function(f, c) {
// need a function to call
forceFunction(f);
Channel.prototype.subscribe = function(eventListenerOrFunction, eventListener) {
checkSubscriptionArgument(eventListenerOrFunction);
var handleEvent, guid;
if (eventListenerOrFunction && typeof eventListenerOrFunction === "object") {
// Received an EventListener object implementing the handleEvent interface
handleEvent = eventListenerOrFunction.handleEvent;
eventListener = eventListenerOrFunction;
} else {
// Received a function to handle event
handleEvent = eventListenerOrFunction;
}
if (this.state == 2) {
f.apply(c || this, this.fireArgs);
handleEvent.apply(eventListener || this, this.fireArgs);
return;
}
var func = f,
guid = f.observer_guid;
if (typeof c == "object") { func = utils.close(c, f); }
guid = eventListenerOrFunction.observer_guid;
if (typeof eventListener === "object") {
handleEvent = utils.close(eventListener, handleEvent);
}
if (!guid) {
// first time any channel has seen this subscriber
// First time any channel has seen this subscriber
guid = '' + nextGuid++;
}
func.observer_guid = guid;
f.observer_guid = guid;
handleEvent.observer_guid = guid;
eventListenerOrFunction.observer_guid = guid;
// Don't add the same handler more than once.
if (!this.handlers[guid]) {
this.handlers[guid] = func;
this.handlers[guid] = handleEvent;
this.numHandlers++;
if (this.numHandlers == 1) {
this.onHasSubscribersChange && this.onHasSubscribersChange();
@ -785,12 +801,20 @@ Channel.prototype.subscribe = function(f, c) {
/**
* Unsubscribes the function with the given guid from the channel.
*/
Channel.prototype.unsubscribe = function(f) {
// need a function to unsubscribe
forceFunction(f);
Channel.prototype.unsubscribe = function(eventListenerOrFunction) {
checkSubscriptionArgument(eventListenerOrFunction);
var handleEvent, guid, handler;
var guid = f.observer_guid,
handler = this.handlers[guid];
if (eventListenerOrFunction && typeof eventListenerOrFunction === "object") {
// Received an EventListener object implementing the handleEvent interface
handleEvent = eventListenerOrFunction.handleEvent;
} else {
// Received a function to handle event
handleEvent = eventListenerOrFunction;
}
guid = handleEvent.observer_guid;
handler = this.handlers[guid];
if (handler) {
delete this.handlers[guid];
this.numHandlers--;
@ -862,7 +886,7 @@ module.exports = channel;
});
// file: F:/coho/cordova-android/cordova-js-src/exec.js
// file: /Users/jbowser/cordova/cordova-android/cordova-js-src/exec.js
define("cordova/exec", function(require, exports, module) {
/**
@ -924,6 +948,9 @@ function androidExec(success, fail, service, action, args) {
androidExec.setJsToNativeBridgeMode(jsToNativeModes.JS_OBJECT);
}
// If args is not provided, default to an empty array
args = args || [];
// Process any ArrayBuffers in the args into a string.
for (var i = 0; i < args.length; i++) {
if (utils.typeName(args[i]) == 'ArrayBuffer') {
@ -1622,7 +1649,7 @@ exports.reset();
});
// file: F:/coho/cordova-android/cordova-js-src/platform.js
// file: /Users/jbowser/cordova/cordova-android/cordova-js-src/platform.js
define("cordova/platform", function(require, exports, module) {
// The last resume event that was received that had the result of a plugin call.
@ -1732,7 +1759,7 @@ function onMessageFromNative(msg) {
});
// file: F:/coho/cordova-android/cordova-js-src/plugin/android/app.js
// file: /Users/jbowser/cordova/cordova-android/cordova-js-src/plugin/android/app.js
define("cordova/plugin/android/app", function(require, exports, module) {
var exec = require('cordova/exec');
@ -2094,7 +2121,10 @@ utils.clone = function(obj) {
retVal = {};
for(i in obj){
if((!(i in retVal) || retVal[i] != obj[i]) && typeof obj[i] != 'undefined') {
// https://issues.apache.org/jira/browse/CB-11522 'unknown' type may be returned in
// custom protocol activation case on Windows Phone 8.1 causing "No such interface supported" exception
// on cloning.
if((!(i in retVal) || retVal[i] != obj[i]) && typeof obj[i] != 'undefined' && typeof obj[i] != 'unknown') {
retVal[i] = utils.clone(obj[i]);
}
}