Allow string primitives to be added to ItemLists

This commit is contained in:
Toby Zerner 2015-08-29 15:25:36 +09:30
parent bb7d51440c
commit 616d3e30ee

View File

@ -50,6 +50,10 @@ export default class ItemList {
for (const i in this) {
if (this.hasOwnProperty(i) && this[i] instanceof Item) {
if (typeof this[i].content === 'string') {
this[i].content = new String(this[i].content);
}
this[i].content.itemName = i;
items.push(this[i]);
this[i].key = items.length;