Merge pull request #869 from cycomachead/list-add-fix

Fix type issue when adding blanks to lists
pull/3/merge
Jens Mönig 2015-07-26 21:32:13 +02:00
commit ffd3aafc9d
1 zmienionych plików z 2 dodań i 3 usunięć

Wyświetl plik

@ -158,9 +158,8 @@ List.prototype.add = function (element, index) {
if no index is specifed, append the element
*/
var idx = index || this.length() + 1,
obj = element === 0 ? 0
: element === false ? false
: element || null;
obj = isNil(element) ? null : element;
this.becomeArray();
this.contents.splice(idx - 1, 0, obj);
this.changed();