зеркало из https://github.com/mozilla/gecko-dev.git
Backed out changeset 3e4f6dd35a2b (bug 932763)
This commit is contained in:
Родитель
e08ba777b1
Коммит
7be5760ac1
|
@ -176,18 +176,18 @@ function validateArrayField(data, createCb) {
|
|||
}
|
||||
};
|
||||
|
||||
if (data === null || data === undefined) {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
if (data) {
|
||||
data = Array.isArray(data) ? data : [data];
|
||||
let filtered = [];
|
||||
for (let i = 0, n = data.length; i < n; ++i) {
|
||||
if (data[i]) {
|
||||
filtered.push(createCb(data[i]));
|
||||
}
|
||||
if (filtered.length === 0) {
|
||||
return undefined;
|
||||
}
|
||||
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();
|
||||
|
|
Загрузка…
Ссылка в новой задаче