Backed out changeset 3e4f6dd35a2b (bug 932763)

This commit is contained in:
Reuben Morais 2013-10-30 19:48:46 -02:00
Родитель e08ba777b1
Коммит 7be5760ac1
2 изменённых файлов: 9 добавлений и 25 удалений

Просмотреть файл

@ -176,18 +176,18 @@ function validateArrayField(data, createCb) {
}
};
if (data === null || data === undefined) {
return undefined;
}
data = Array.isArray(data) ? data : [data];
let filtered = [];
for (let i = 0, n = data.length; i < n; ++i) {
if (data[i]) {
if (data) {
data = Array.isArray(data) ? data : [data];
let filtered = [];
for (let i = 0, n = data.length; i < n; ++i) {
filtered.push(createCb(data[i]));
}
if (filtered.length === 0) {
return undefined;
}
return new Proxy(filtered, ArrayPropertyHandler);
}
return new Proxy(filtered, ArrayPropertyHandler);
return undefined;
}
// We need this to create a copy of the mozContact object in ContactManager.save

Просмотреть файл

@ -1668,22 +1668,6 @@ var steps = [
}
next();
},
function() {
ok(true, "Setting array properties to an empty array should work");
var c = new mozContact();
function testArrayProp(prop) {
is(c[prop], null, "property is initially null");
c[prop] = [];
ok(Array.isArray(c[prop]), "property is an array after setting");
is(c[prop].length, 0, "property has length 0 after setting");
}
testArrayProp("email");
testArrayProp("adr");
testArrayProp("tel");
testArrayProp("impp");
testArrayProp("url");
next();
},
function () {
ok(true, "all done!\n");
clearTemps();