Skip to content

Commit 6d3c5c9

Browse files
author
Anis Kadri
committed
Merge branch 'array_replace_ok' of https://github.com/seobyeongky/node-xcode into seobyeongky-array_replace_ok
2 parents 626aef6 + 42e3fb4 commit 6d3c5c9

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

lib/pbxProject.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -681,7 +681,7 @@ function propReplace(obj, prop, value) {
681681
var o = {};
682682
for (var p in obj) {
683683
if (o.hasOwnProperty.call(obj, p)) {
684-
if (typeof obj[p] == 'object') {
684+
if (typeof obj[p] == 'object' && !Array.isArray(obj[p])) {
685685
propReplace(obj[p], prop, value);
686686
} else if (p == prop) {
687687
obj[p] = value;

test/pbxProject.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,9 @@ exports['updateBuildProperty function'] = {
169169
myProj.updateBuildProperty('TARGETED_DEVICE_FAMILY', '"arm"');
170170
var newContents = myProj.writeSync();
171171
test.ok(newContents.match(/TARGETED_DEVICE_FAMILY\s*=\s*"arm"/));
172+
myProj.updateBuildProperty('OTHER_LDFLAGS', ['T','E','S','T']);
173+
newContents = myProj.writeSync();
174+
test.ok(newContents.match(/OTHER_LDFLAGS\s*=\s*\(\s*T,\s*E,\s*S,\s*T,\s*\)/))
172175
test.done();
173176
});
174177
}

0 commit comments

Comments
 (0)