Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id B0465200D2E for ; Tue, 17 Oct 2017 00:47:23 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id AECD31609EF; Mon, 16 Oct 2017 22:47:23 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id D76EA160BE9 for ; Tue, 17 Oct 2017 00:47:21 +0200 (CEST) Received: (qmail 18482 invoked by uid 500); 16 Oct 2017 22:47:21 -0000 Mailing-List: contact commits-help@cordova.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list commits@cordova.apache.org Received: (qmail 18473 invoked by uid 99); 16 Oct 2017 22:47:21 -0000 Received: from ec2-52-202-80-70.compute-1.amazonaws.com (HELO gitbox.apache.org) (52.202.80.70) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 16 Oct 2017 22:47:21 +0000 Received: by gitbox.apache.org (ASF Mail Server at gitbox.apache.org, from userid 33) id 4BA5C81A4F; Mon, 16 Oct 2017 22:47:16 +0000 (UTC) Date: Mon, 16 Oct 2017 22:47:20 +0000 To: "commits@cordova.apache.org" Subject: [cordova-browser] 04/04: Update JS snapshot to version 5.1.0-dev (via coho) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit From: steven@apache.org In-Reply-To: <150819403627.19080.11663555018071349186@gitbox.apache.org> References: <150819403627.19080.11663555018071349186@gitbox.apache.org> X-Git-Host: gitbox.apache.org X-Git-Repo: cordova-browser X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Rev: 28643ec51443010529368cb81c0340afbf2bc181 X-Git-NotificationType: diff X-Git-Multimail-Version: 1.5.dev Auto-Submitted: auto-generated Message-Id: <20171016224718.4BA5C81A4F@gitbox.apache.org> archived-at: Mon, 16 Oct 2017 22:47:23 -0000 This is an automated email from the ASF dual-hosted git repository. steven pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/cordova-browser.git commit 28643ec51443010529368cb81c0340afbf2bc181 Author: Steve Gill AuthorDate: Mon Oct 16 15:34:07 2017 -0700 Update JS snapshot to version 5.1.0-dev (via coho) --- cordova-lib/cordova.js | 662 ++++++++++++++++++++++++------------------------- 1 file changed, 321 insertions(+), 341 deletions(-) diff --git a/cordova-lib/cordova.js b/cordova-lib/cordova.js index 8ef5cbe..798dc6c 100644 --- a/cordova-lib/cordova.js +++ b/cordova-lib/cordova.js @@ -1,5 +1,5 @@ // Platform: browser -// f623343b9ff11fbe7c72d319932cc1fd3fdafed2 +// ff66178b108b93be36a1aafe341af17381a727a3 /* Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file @@ -22,32 +22,30 @@ var PLATFORM_VERSION_BUILD_LABEL = '5.1.0-dev'; // file: src/scripts/require.js -/*jshint -W079 */ -/*jshint -W020 */ +/* jshint -W079 */ +/* jshint -W020 */ -var require, - define; +var require; +var define; (function () { - var modules = {}, + var modules = {}; // Stack of moduleIds currently being built. - requireStack = [], + var requireStack = []; // Map of module ID -> index into requireStack of modules currently being built. - inProgressModules = {}, - SEPARATOR = "."; - - - - function build(module) { - var factory = module.factory, - localRequire = function (id) { - var resultantId = id; - //Its a relative path, so lop off the last portion and add the id (minus "./") - if (id.charAt(0) === ".") { - resultantId = module.id.slice(0, module.id.lastIndexOf(SEPARATOR)) + SEPARATOR + id.slice(2); - } - return require(resultantId); - }; + var inProgressModules = {}; + var SEPARATOR = '.'; + + function build (module) { + var factory = module.factory; + var localRequire = function (id) { + var resultantId = id; + // Its a relative path, so lop off the last portion and add the id (minus "./") + if (id.charAt(0) === '.') { + resultantId = module.id.slice(0, module.id.lastIndexOf(SEPARATOR)) + SEPARATOR + id.slice(2); + } + return require(resultantId); + }; module.exports = {}; delete module.factory; factory(localRequire, module.exports, module); @@ -56,10 +54,10 @@ var require, require = function (id) { if (!modules[id]) { - throw "module " + id + " not found"; + throw 'module ' + id + ' not found'; } else if (id in inProgressModules) { var cycle = requireStack.slice(inProgressModules[id]).join('->') + '->' + id; - throw "Cycle in require graph: " + cycle; + throw 'Cycle in require graph: ' + cycle; } if (modules[id].factory) { try { @@ -76,7 +74,7 @@ var require, define = function (id, factory) { if (modules[id]) { - throw "module " + id + " already defined"; + throw 'module ' + id + ' already defined'; } modules[id] = { @@ -92,8 +90,8 @@ var require, define.moduleMap = modules; })(); -//Export for use in node -if (typeof module === "object" && typeof require === "function") { +// Export for use in node +if (typeof module === 'object' && typeof require === 'function') { module.exports.require = require; module.exports.define = define; } @@ -103,15 +101,13 @@ define("cordova", function(require, exports, module) { // Workaround for Windows 10 in hosted environment case // http://www.w3.org/html/wg/drafts/html/master/browsers.html#named-access-on-the-window-object -if (window.cordova && !(window.cordova instanceof HTMLElement)) { - throw new Error("cordova already defined"); +if (window.cordova && !(window.cordova instanceof HTMLElement)) { // eslint-disable-line no-undef + throw new Error('cordova already defined'); } - var channel = require('cordova/channel'); var platform = require('cordova/platform'); - /** * Intercept calls to addEventListener + removeEventListener and handle deviceready, * resume, and pause events. @@ -124,48 +120,48 @@ var m_window_removeEventListener = window.removeEventListener; /** * Houses custom event handlers to intercept on document + window event listeners. */ -var documentEventHandlers = {}, - windowEventHandlers = {}; +var documentEventHandlers = {}; +var windowEventHandlers = {}; -document.addEventListener = function(evt, handler, capture) { +document.addEventListener = function (evt, handler, capture) { var e = evt.toLowerCase(); - if (typeof documentEventHandlers[e] != 'undefined') { + if (typeof documentEventHandlers[e] !== 'undefined') { documentEventHandlers[e].subscribe(handler); } else { m_document_addEventListener.call(document, evt, handler, capture); } }; -window.addEventListener = function(evt, handler, capture) { +window.addEventListener = function (evt, handler, capture) { var e = evt.toLowerCase(); - if (typeof windowEventHandlers[e] != 'undefined') { + if (typeof windowEventHandlers[e] !== 'undefined') { windowEventHandlers[e].subscribe(handler); } else { m_window_addEventListener.call(window, evt, handler, capture); } }; -document.removeEventListener = function(evt, handler, capture) { +document.removeEventListener = function (evt, handler, capture) { var e = evt.toLowerCase(); // If unsubscribing from an event that is handled by a plugin - if (typeof documentEventHandlers[e] != "undefined") { + if (typeof documentEventHandlers[e] !== 'undefined') { documentEventHandlers[e].unsubscribe(handler); } else { m_document_removeEventListener.call(document, evt, handler, capture); } }; -window.removeEventListener = function(evt, handler, capture) { +window.removeEventListener = function (evt, handler, capture) { var e = evt.toLowerCase(); // If unsubscribing from an event that is handled by a plugin - if (typeof windowEventHandlers[e] != "undefined") { + if (typeof windowEventHandlers[e] !== 'undefined') { windowEventHandlers[e].unsubscribe(handler); } else { m_window_removeEventListener.call(window, evt, handler, capture); } }; -function createEvent(type, data) { +function createEvent (type, data) { var event = document.createEvent('Events'); event.initEvent(type, false, false); if (data) { @@ -178,29 +174,32 @@ function createEvent(type, data) { return event; } - +/* eslint-disable no-undef */ var cordova = { - define:define, - require:require, - version:PLATFORM_VERSION_BUILD_LABEL, - platformVersion:PLATFORM_VERSION_BUILD_LABEL, - platformId:platform.id, + define: define, + require: require, + version: PLATFORM_VERSION_BUILD_LABEL, + platformVersion: PLATFORM_VERSION_BUILD_LABEL, + platformId: platform.id, + + /* eslint-enable no-undef */ + /** * Methods to add/remove your own addEventListener hijacking on document + window. */ - addWindowEventHandler:function(event) { + addWindowEventHandler: function (event) { return (windowEventHandlers[event] = channel.create(event)); }, - addStickyDocumentEventHandler:function(event) { + addStickyDocumentEventHandler: function (event) { return (documentEventHandlers[event] = channel.createSticky(event)); }, - addDocumentEventHandler:function(event) { + addDocumentEventHandler: function (event) { return (documentEventHandlers[event] = channel.create(event)); }, - removeWindowEventHandler:function(event) { + removeWindowEventHandler: function (event) { delete windowEventHandlers[event]; }, - removeDocumentEventHandler:function(event) { + removeDocumentEventHandler: function (event) { delete documentEventHandlers[event]; }, /** @@ -208,24 +207,23 @@ var cordova = { * * @return object */ - getOriginalHandlers: function() { + getOriginalHandlers: function () { return {'document': {'addEventListener': m_document_addEventListener, 'removeEventListener': m_document_removeEventListener}, - 'window': {'addEventListener': m_window_addEventListener, 'removeEventListener': m_window_removeEventListener}}; + 'window': {'addEventListener': m_window_addEventListener, 'removeEventListener': m_window_removeEventListener}}; }, /** * Method to fire event from native code * bNoDetach is required for events which cause an exception which needs to be caught in native code */ - fireDocumentEvent: function(type, data, bNoDetach) { + fireDocumentEvent: function (type, data, bNoDetach) { var evt = createEvent(type, data); - if (typeof documentEventHandlers[type] != 'undefined') { - if( bNoDetach ) { + if (typeof documentEventHandlers[type] !== 'undefined') { + if (bNoDetach) { documentEventHandlers[type].fire(evt); - } - else { - setTimeout(function() { + } else { + setTimeout(function () { // Fire deviceready on listeners that were registered before cordova.js was loaded. - if (type == 'deviceready') { + if (type === 'deviceready') { document.dispatchEvent(evt); } documentEventHandlers[type].fire(evt); @@ -235,10 +233,10 @@ var cordova = { document.dispatchEvent(evt); } }, - fireWindowEvent: function(type, data) { - var evt = createEvent(type,data); - if (typeof windowEventHandlers[type] != 'undefined') { - setTimeout(function() { + fireWindowEvent: function (type, data) { + var evt = createEvent(type, data); + if (typeof windowEventHandlers[type] !== 'undefined') { + setTimeout(function () { windowEventHandlers[type].fire(evt); }, 0); } else { @@ -252,7 +250,7 @@ var cordova = { // Randomize the starting callbackId to avoid collisions after refreshing or navigating. // This way, it's very unlikely that any new callback would get the same callbackId as an old callback. callbackId: Math.floor(Math.random() * 2000000000), - callbacks: {}, + callbacks: {}, callbackStatus: { NO_RESULT: 0, OK: 1, @@ -269,14 +267,14 @@ var cordova = { /** * Called by native code when returning successful result from an action. */ - callbackSuccess: function(callbackId, args) { + callbackSuccess: function (callbackId, args) { cordova.callbackFromNative(callbackId, true, args.status, [args.message], args.keepCallback); }, /** * Called by native code when returning error result from an action. */ - callbackError: function(callbackId, args) { + callbackError: function (callbackId, args) { // TODO: Deprecate callbackSuccess and callbackError in favour of callbackFromNative. // Derive success from status. cordova.callbackFromNative(callbackId, false, args.status, [args.message], args.keepCallback); @@ -285,11 +283,11 @@ var cordova = { /** * Called by native code when returning the result from an action. */ - callbackFromNative: function(callbackId, isSuccess, status, args, keepCallback) { + callbackFromNative: function (callbackId, isSuccess, status, args, keepCallback) { try { var callback = cordova.callbacks[callbackId]; if (callback) { - if (isSuccess && status == cordova.callbackStatus.OK) { + if (isSuccess && status === cordova.callbackStatus.OK) { callback.success && callback.success.apply(null, args); } else if (!isSuccess) { callback.fail && callback.fail.apply(null, args); @@ -306,26 +304,24 @@ var cordova = { delete cordova.callbacks[callbackId]; } } - } - catch (err) { - var msg = "Error in " + (isSuccess ? "Success" : "Error") + " callbackId: " + callbackId + " : " + err; + } catch (err) { + var msg = 'Error in ' + (isSuccess ? 'Success' : 'Error') + ' callbackId: ' + callbackId + ' : ' + err; console && console.log && console.log(msg); - cordova.fireWindowEvent("cordovacallbackerror", { 'message': msg }); + cordova.fireWindowEvent('cordovacallbackerror', { 'message': msg }); throw err; } }, - addConstructor: function(func) { - channel.onCordovaReady.subscribe(function() { + addConstructor: function (func) { + channel.onCordovaReady.subscribe(function () { try { func(); - } catch(e) { - console.log("Failed to run constructor: " + e); + } catch (e) { + console.log('Failed to run constructor: ' + e); } }); } }; - module.exports = cordova; }); @@ -346,29 +342,29 @@ var typeMap = { 'O': 'Object' }; -function extractParamName(callee, argIndex) { +function extractParamName (callee, argIndex) { return (/.*?\((.*?)\)/).exec(callee)[1].split(', ')[argIndex]; } -function checkArgs(spec, functionName, args, opt_callee) { +function checkArgs (spec, functionName, args, opt_callee) { if (!moduleExports.enableChecks) { return; } var errMsg = null; var typeName; for (var i = 0; i < spec.length; ++i) { - var c = spec.charAt(i), - cUpper = c.toUpperCase(), - arg = args[i]; + var c = spec.charAt(i); + var cUpper = c.toUpperCase(); + var arg = args[i]; // Asterix means allow anything. - if (c == '*') { + if (c === '*') { continue; } typeName = utils.typeName(arg); - if ((arg === null || arg === undefined) && c == cUpper) { + if ((arg === null || arg === undefined) && c === cUpper) { continue; } - if (typeName != typeMap[cUpper]) { + if (typeName !== typeMap[cUpper]) { errMsg = 'Expected ' + typeMap[cUpper]; break; } @@ -377,14 +373,14 @@ function checkArgs(spec, functionName, args, opt_callee) { errMsg += ', but got ' + typeName + '.'; errMsg = 'Wrong type for parameter "' + extractParamName(opt_callee || args.callee, i) + '" of ' + functionName + ': ' + errMsg; // Don't log when running unit tests. - if (typeof jasmine == 'undefined') { + if (typeof jasmine === 'undefined') { console.error(errMsg); } throw TypeError(errMsg); } } -function getValue(value, defaultValue) { +function getValue (value, defaultValue) { return value === undefined ? defaultValue : value; } @@ -392,7 +388,6 @@ moduleExports.checkArgs = checkArgs; moduleExports.getValue = getValue; moduleExports.enableChecks = true; - }); // file: src/common/base64.js @@ -400,58 +395,58 @@ define("cordova/base64", function(require, exports, module) { var base64 = exports; -base64.fromArrayBuffer = function(arrayBuffer) { +base64.fromArrayBuffer = function (arrayBuffer) { var array = new Uint8Array(arrayBuffer); return uint8ToBase64(array); }; -base64.toArrayBuffer = function(str) { - var decodedStr = typeof atob != 'undefined' ? atob(str) : new Buffer(str,'base64').toString('binary'); +base64.toArrayBuffer = function (str) { + var decodedStr = typeof atob !== 'undefined' ? atob(str) : Buffer.from(str, 'base64').toString('binary'); // eslint-disable-line no-undef var arrayBuffer = new ArrayBuffer(decodedStr.length); var array = new Uint8Array(arrayBuffer); - for (var i=0, len=decodedStr.length; i < len; i++) { + for (var i = 0, len = decodedStr.length; i < len; i++) { array[i] = decodedStr.charCodeAt(i); } return arrayBuffer; }; -//------------------------------------------------------------------------------ +// ------------------------------------------------------------------------------ /* This code is based on the performance tests at http://jsperf.com/b64tests * This 12-bit-at-a-time algorithm was the best performing version on all * platforms tested. */ -var b64_6bit = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; +var b64_6bit = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'; var b64_12bit; -var b64_12bitTable = function() { +var b64_12bitTable = function () { b64_12bit = []; - for (var i=0; i<64; i++) { - for (var j=0; j<64; j++) { - b64_12bit[i*64+j] = b64_6bit[i] + b64_6bit[j]; + for (var i = 0; i < 64; i++) { + for (var j = 0; j < 64; j++) { + b64_12bit[i * 64 + j] = b64_6bit[i] + b64_6bit[j]; } } - b64_12bitTable = function() { return b64_12bit; }; + b64_12bitTable = function () { return b64_12bit; }; return b64_12bit; }; -function uint8ToBase64(rawData) { +function uint8ToBase64 (rawData) { var numBytes = rawData.byteLength; - var output=""; + var output = ''; var segment; var table = b64_12bitTable(); - for (var i=0;i> 12]; output += table[segment & 0xfff]; } - if (numBytes - i == 2) { - segment = (rawData[i] << 16) + (rawData[i+1] << 8); + if (numBytes - i === 2) { + segment = (rawData[i] << 16) + (rawData[i + 1] << 8); output += table[segment >> 12]; output += b64_6bit[(segment & 0xfff) >> 6]; output += '='; - } else if (numBytes - i == 1) { + } else if (numBytes - i === 1) { segment = (rawData[i] << 16); output += table[segment >> 12]; output += '=='; @@ -466,7 +461,7 @@ define("cordova/builder", function(require, exports, module) { var utils = require('cordova/utils'); -function each(objects, func, context) { +function each (objects, func, context) { for (var prop in objects) { if (objects.hasOwnProperty(prop)) { func.apply(context, [objects[prop], prop]); @@ -474,7 +469,7 @@ function each(objects, func, context) { } } -function clobber(obj, key, value) { +function clobber (obj, key, value) { exports.replaceHookForTesting(obj, key); var needsProperty = false; try { @@ -484,15 +479,15 @@ function clobber(obj, key, value) { } // Getters can only be overridden by getters. if (needsProperty || obj[key] !== value) { - utils.defineGetter(obj, key, function() { + utils.defineGetter(obj, key, function () { return value; }); } } -function assignOrWrapInDeprecateGetter(obj, key, value, message) { +function assignOrWrapInDeprecateGetter (obj, key, value, message) { if (message) { - utils.defineGetter(obj, key, function() { + utils.defineGetter(obj, key, function () { console.log(message); delete obj[key]; clobber(obj, key, value); @@ -503,7 +498,7 @@ function assignOrWrapInDeprecateGetter(obj, key, value, message) { } } -function include(parent, objects, clobber, merge) { +function include (parent, objects, clobber, merge) { each(objects, function (obj, key) { try { var result = obj.path ? require(obj.path) : {}; @@ -523,7 +518,7 @@ function include(parent, objects, clobber, merge) { result = parent[key]; } else { // Overwrite if not currently defined. - if (typeof parent[key] == 'undefined') { + if (typeof parent[key] === 'undefined') { assignOrWrapInDeprecateGetter(parent, key, result, obj.deprecated); } else { // Set result to what already exists, so we can build children into it if they exist. @@ -534,7 +529,7 @@ function include(parent, objects, clobber, merge) { if (obj.children) { include(result, obj.children, clobber, merge); } - } catch(e) { + } catch (e) { utils.alert('Exception building Cordova JS globals: ' + e + ' for key "' + key + '"'); } }); @@ -547,7 +542,7 @@ function include(parent, objects, clobber, merge) { * @param target Object to merge properties into. * @param src Object to merge properties from. */ -function recursiveMerge(target, src) { +function recursiveMerge (target, src) { for (var prop in src) { if (src.hasOwnProperty(prop)) { if (target.prototype && target.prototype.constructor === target) { @@ -564,26 +559,26 @@ function recursiveMerge(target, src) { } } -exports.buildIntoButDoNotClobber = function(objects, target) { +exports.buildIntoButDoNotClobber = function (objects, target) { include(target, objects, false, false); }; -exports.buildIntoAndClobber = function(objects, target) { +exports.buildIntoAndClobber = function (objects, target) { include(target, objects, true, false); }; -exports.buildIntoAndMerge = function(objects, target) { +exports.buildIntoAndMerge = function (objects, target) { include(target, objects, true, true); }; exports.recursiveMerge = recursiveMerge; exports.assignOrWrapInDeprecateGetter = assignOrWrapInDeprecateGetter; -exports.replaceHookForTesting = function() {}; +exports.replaceHookForTesting = function () {}; }); // file: src/common/channel.js define("cordova/channel", function(require, exports, module) { -var utils = require('cordova/utils'), - nextGuid = 1; +var utils = require('cordova/utils'); +var nextGuid = 1; /** * Custom pub-sub "channel" that can have functions subscribed to it @@ -623,7 +618,7 @@ var utils = require('cordova/utils'), * @constructor * @param type String the channel name */ -var Channel = function(type, sticky) { +var Channel = function (type, sticky) { this.type = type; // Map of guid -> function. this.handlers = {}; @@ -636,72 +631,73 @@ var Channel = function(type, sticky) { // Function that is called when the first listener is subscribed, or when // the last listener is unsubscribed. this.onHasSubscribersChange = null; -}, - channel = { - /** - * Calls the provided function only after all of the channels specified - * have been fired. All channels must be sticky channels. - */ - join: function(h, c) { - var len = c.length, - i = len, - f = function() { - if (!(--i)) h(); - }; - for (var j=0; j - if (strategy == 'r') { + if (strategy === 'r') { continue; } var symbolPath = symbolList[i + 2]; @@ -1370,9 +1362,9 @@ exports.mapModules = function(context) { var parentObj = prepareNamespace(namespace, context); var target = parentObj[lastName]; - if (strategy == 'm' && target) { + if (strategy === 'm' && target) { builder.recursiveMerge(target, module); - } else if ((strategy == 'd' && !target) || (strategy != 'd')) { + } else if ((strategy === 'd' && !target) || (strategy !== 'd')) { if (!(symbolPath in origSymbols)) { origSymbols[symbolPath] = target; } @@ -1381,7 +1373,7 @@ exports.mapModules = function(context) { } }; -exports.getOriginalSymbol = function(context, symbolPath) { +exports.getOriginalSymbol = function (context, symbolPath) { var origSymbols = context.CDV_origSymbols; if (origSymbols && (symbolPath in origSymbols)) { return origSymbols[symbolPath]; @@ -1396,22 +1388,21 @@ exports.getOriginalSymbol = function(context, symbolPath) { exports.reset(); - }); // file: src/common/modulemapper_b.js define("cordova/modulemapper_b", function(require, exports, module) { -var builder = require('cordova/builder'), - symbolList = [], - deprecationMap; +var builder = require('cordova/builder'); +var symbolList = []; +var deprecationMap; -exports.reset = function() { +exports.reset = function () { symbolList = []; deprecationMap = {}; }; -function addEntry(strategy, moduleName, symbolPath, opt_deprecationMessage) { +function addEntry (strategy, moduleName, symbolPath, opt_deprecationMessage) { symbolList.push(strategy, moduleName, symbolPath); if (opt_deprecationMessage) { deprecationMap[symbolPath] = opt_deprecationMessage; @@ -1419,35 +1410,35 @@ function addEntry(strategy, moduleName, symbolPath, opt_deprecationMessage) { } // Note: Android 2.3 does have Function.bind(). -exports.clobbers = function(moduleName, symbolPath, opt_deprecationMessage) { +exports.clobbers = function (moduleName, symbolPath, opt_deprecationMessage) { addEntry('c', moduleName, symbolPath, opt_deprecationMessage); }; -exports.merges = function(moduleName, symbolPath, opt_deprecationMessage) { +exports.merges = function (moduleName, symbolPath, opt_deprecationMessage) { addEntry('m', moduleName, symbolPath, opt_deprecationMessage); }; -exports.defaults = function(moduleName, symbolPath, opt_deprecationMessage) { +exports.defaults = function (moduleName, symbolPath, opt_deprecationMessage) { addEntry('d', moduleName, symbolPath, opt_deprecationMessage); }; -exports.runs = function(moduleName) { +exports.runs = function (moduleName) { addEntry('r', moduleName, null); }; -function prepareNamespace(symbolPath, context) { +function prepareNamespace (symbolPath, context) { if (!symbolPath) { return context; } var parts = symbolPath.split('.'); var cur = context; - for (var i = 0, part; part = parts[i]; ++i) { + for (var i = 0, part; part = parts[i]; ++i) { // eslint-disable-line no-cond-assign cur = cur[part] = cur[part] || {}; } return cur; } -exports.mapModules = function(context) { +exports.mapModules = function (context) { var origSymbols = {}; context.CDV_origSymbols = origSymbols; for (var i = 0, len = symbolList.length; i < len; i += 3) { @@ -1455,7 +1446,7 @@ exports.mapModules = function(context) { var moduleName = symbolList[i + 1]; var module = require(moduleName); // - if (strategy == 'r') { + if (strategy === 'r') { continue; } var symbolPath = symbolList[i + 2]; @@ -1467,9 +1458,9 @@ exports.mapModules = function(context) { var parentObj = prepareNamespace(namespace, context); var target = parentObj[lastName]; - if (strategy == 'm' && target) { + if (strategy === 'm' && target) { builder.recursiveMerge(target, module); - } else if ((strategy == 'd' && !target) || (strategy != 'd')) { + } else if ((strategy === 'd' && !target) || (strategy !== 'd')) { if (!(symbolPath in origSymbols)) { origSymbols[symbolPath] = target; } @@ -1478,7 +1469,7 @@ exports.mapModules = function(context) { } }; -exports.getOriginalSymbol = function(context, symbolPath) { +exports.getOriginalSymbol = function (context, symbolPath) { var origSymbols = context.CDV_origSymbols; if (origSymbols && (symbolPath in origSymbols)) { return origSymbols[symbolPath]; @@ -1493,7 +1484,6 @@ exports.getOriginalSymbol = function(context, symbolPath) { exports.reset(); - }); // file: /Users/steveng/repo/cordova/cordova-browser/cordova-js-src/platform.js @@ -1531,12 +1521,11 @@ module.exports = { define("cordova/pluginloader", function(require, exports, module) { var modulemapper = require('cordova/modulemapper'); -var urlutil = require('cordova/urlutil'); // Helper function to inject a