The following is a snippet from the Chrome Developer Tool:
WebInspector.DOMStorage.prototype = {
get id()
{
return this._id;
},
get domain()
{
return this._domain;
},
get isLocalStorage()
{
return this._isLocalStorage;
},
getEntries: function(callback)
{
DOMStorageAgent.getDOMStorageEntries(this._id, callback);
},
setItem: function(key, value, callback)
{
DOMStorageAgent.setDOMStorageItem(this._id, key, value, callback);
},
removeItem: function(key, callback)
{
DOMStorageAgent.removeDOMStorageItem(this._id, key, callback);
}
}
WebInspector.DOMStorageis a function, and in the code above its prototypes. The strangest thing for me is the following method: get id()or getsomething - I checked that only objects are recognized in the prototype of the object removeItem, getEntriesand setItem. What about others?
source
share