cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a...@apache.org
Subject [23/28] git commit: fixing merge with no target
Date Thu, 24 Apr 2014 21:14:21 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/b225cd30
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugman/tree/b225cd30
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugman/diff/b225cd30

Branch: refs/heads/master
Commit: b225cd30878af37d0087ae17278dd410e0affe7f
Parents: 752be1b
Author: Anis Kadri <anis@apache.org>
Authored: Wed Apr 9 16:25:34 2014 -0700
Committer: Anis Kadri <anis@apache.org>
Committed: Fri Apr 11 12:45:45 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/b225cd30/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