cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a...@apache.org
Subject [12/28] git commit: fixing merge with no target
Date Thu, 24 Apr 2014 21:14:10 GMT
fixing merge with no target


Project: http://git-wip-us.apache.org/repos/asf/cordova-plugman/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugman/commit/1e758680
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugman/tree/1e758680
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugman/diff/1e758680

Branch: refs/heads/master
Commit: 1e758680a101f7d7744f2889cf588cf7d0de7621
Parents: 7d85eaa
Author: Anis Kadri <anis@apache.org>
Authored: Wed Apr 9 16:25:34 2014 -0700
Committer: Anis Kadri <anis@apache.org>
Committed: Wed Apr 9 16:25:34 2014 -0700

----------------------------------------------------------------------
 src/util/prepare-namespace.js | 18 ++++++++++--------
 1 file changed, 10 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/1e758680/src/util/prepare-namespace.js
----------------------------------------------------------------------
diff --git a/src/util/prepare-namespace.js b/src/util/prepare-namespace.js
index 2cb9560..8c18b1f 100644
--- a/src/util/prepare-namespace.js
+++ b/src/util/prepare-namespace.js
@@ -1,6 +1,6 @@
 // FIXME this is extremely guettho
 module.exports = function(target, method) {
-  
+  var old = target; 
   target = target.replace(/^window(\.)?/, '');
 
   var lastDot = target.lastIndexOf('.');
@@ -8,9 +8,12 @@ module.exports = function(target, method) {
   var lastName = target.substr(lastDot + 1);
   var props = target.split(".");
   var code = "";
-  for(var i = 1, len = props.length ; i <= len ; i++) {
-    var sub = props.slice(0, i).join(".");
-    code += util.format("window.%s = window.%s || {};\n", sub, sub);
+
+  if(target !== "") {
+    for(var i = 1, len = props.length ; i <= len ; i++) {
+      var sub = props.slice(0, i).join(".");
+      code += util.format("window.%s = window.%s || {};\n", sub, sub);
+    }
   }
   
   props.unshift('window');  
@@ -18,17 +21,16 @@ module.exports = function(target, method) {
 //  code = "\n";
   if(method === "c") {
     return util.format(
-      "%s\n;require('cordova/builder').assignOrWrapInDeprecateGetter(%s, '%s', module.exports);",

+      "%s\nrequire('cordova/builder').assignOrWrapInDeprecateGetter(%s, '%s', module.exports);",

       code,
       object,
       lastName
     );
   } else if(method === "m") {
     return util.format(
-      "%s\n;require('cordova/builder').recursiveMerge(%s, '%s', module.exports);", 
+      "%s\n;require('cordova/builder').recursiveMerge(%s, module.exports);", 
       code,
-      object,
-      lastName
+      object
     );
   }
 }


Mime
View raw message