Updated to use ECMAScript 2015 Object.assign. (#14)
authorMark Atkinson <markatkinson0@gmail.com>
Wed, 19 Dec 2018 19:48:59 +0000 (19:48 +0000)
committerChris Brody <chris.brody@gmail.com>
Wed, 19 Dec 2018 19:48:59 +0000 (14:48 -0500)
Updated pbxproj.js to use ECMAScript 2015 Object.assign to avoid
Maximum call stack size exceeded error when running
react-native link.

lib/parser/pbxproj.js

index 1ed30c5..81ae25f 100644 (file)
@@ -178,7 +178,7 @@ function peg$parse(input, options) {
               var returnObject = list[0][0];
               for(var i = 1; i < list.length; i++){
                   var another = list[i][0];
-                  returnObject = merge_obj(returnObject, another);
+                  returnObject = Object.assign(returnObject, another);
               }
               return returnObject;
           },
@@ -1879,18 +1879,6 @@ function peg$parse(input, options) {
     return s0;
   }
 
-
-      function merge_obj(obj, secondObj) {
-          if (!obj)
-              return secondObj;
-
-          for(var i in secondObj)
-              obj[i] = merge_obj(obj[i], secondObj[i]);
-
-          return obj;
-      }
-
-
   peg$result = peg$startRuleFunction();
 
   if (peg$result !== peg$FAILED && peg$currPos === input.length) {