Skip to content

Commit 14e1342

Browse files
committed
fixing a few issues with delete and using splice instead
1 parent 9e1ebed commit 14e1342

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

lib/pbxProject.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ pbxProject.prototype.addPluginFile = function (path, opt) {
8686

8787
pbxProject.prototype.removePluginFile = function (path, opt) {
8888
var file = new pbxFile(path, opt);
89-
//correctForPluginsPath(file, this);
89+
correctForPluginsPath(file, this);
9090

9191
this.removeFromPbxFileReferenceSection(file); // PBXFileReference
9292
this.removeFromPluginsPbxGroup(file); // PBXGroup
@@ -191,6 +191,7 @@ pbxProject.prototype.removeFromPbxFileReferenceSection = function (file) {
191191
if(this.pbxFileReferenceSection()[i].name == refObj.name &&
192192
this.pbxFileReferenceSection()[i].path == refObj.path) {
193193
file.fileRef = i;
194+
delete this.pbxFileReferenceSection()[i];
194195
break;
195196
}
196197
}
@@ -212,7 +213,7 @@ pbxProject.prototype.removeFromPluginsPbxGroup = function (file) {
212213
for(i in pluginsGroupChildren) {
213214
if(pbxGroupChild(file).value == pluginsGroupChildren[i].value &&
214215
pbxGroupChild(file).comment == pluginsGroupChildren[i].comment) {
215-
delete pluginsGroupChildren[i];
216+
pluginsGroupChildren.splice(i, 1);
216217
break;
217218
}
218219
}
@@ -232,7 +233,7 @@ pbxProject.prototype.removeFromPbxSourcesBuildPhase = function (file) {
232233
var sources = this.pbxSourcesBuildPhaseObj(), i;
233234
for(i in sources.files) {
234235
if(sources.files[i].comment = longComment(file)) {
235-
delete sources.files[i];
236+
sources.files.splice(i, 1);
236237
break;
237238
}
238239
}
@@ -248,7 +249,7 @@ pbxProject.prototype.removeFromPbxResourcesBuildPhase = function (file) {
248249

249250
for(i in sources.files) {
250251
if(sources.files[i].comment = longComment(file)) {
251-
delete sources.files[i];
252+
sources.files.splice(i, 1);
252253
break;
253254
}
254255
}

0 commit comments

Comments
 (0)