Fix `set` for Firefox & Safari (don't set non-own properties in for..in loop)

This commit is contained in:
Chris 2015-01-18 11:50:20 -07:00
parent ab99683454
commit 5aafafd50d
2 changed files with 6 additions and 0 deletions

View File

@ -195,6 +195,9 @@ vAPI.storage = {
var key, values = [], placeholders = [];
for ( key in details ) {
if ( !details.hasOwnProperty(key) ) {
continue;
}
values.push(key);
values.push(JSON.stringify(details[key]));
placeholders.push('?, ?');

View File

@ -126,6 +126,9 @@ vAPI.storage = {
set: function(details, callback) {
for ( var key in details ) {
if ( !details.hasOwnProperty(key) ) {
continue;
}
this._storage.setItem(key, JSON.stringify(details[key]));
}