kopia lustrzana https://github.com/backface/turtlestitch
Merge pull request #869 from cycomachead/list-add-fix
Fix type issue when adding blanks to listspull/3/merge
commit
ffd3aafc9d
5
lists.js
5
lists.js
|
@ -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();
|
||||
|
|
Ładowanie…
Reference in New Issue