src/modules/storage.js
function (callbackId) {
    const sender = this.sender
    if (!supportLocalStorage) {
      return callNotSupportFail(sender, callbackId)
    }
    try {
      const len = localStorage.length
      sender.performCallback(callbackId, {
        result: SUCCESS,
        data: len
      })
    }
    catch (e) {
      // accept any exception thrown during a storage attempt as a quota error
      callFail(sender, callbackId)
    }
  }
function (callbackId) {
    const sender = this.sender
    if (!supportLocalStorage) {
      return callNotSupportFail(sender, callbackId)
    }
    try {
      const len = localStorage.length
      sender.performCallback(callbackId, {
        result: SUCCESS,
        data: len
      })
    }
    catch (e) {
      // accept any exception thrown during a storage attempt as a quota error
      callFail(sender, callbackId)
    }
  }
function ( callbackId ) { const sender = this . sender if ( ! supportLocalStorage ) { return callNotSupportFail ( sender , callbackId ) } try { const len = localStorage . length sender . performCallback ( callbackId , { result : SUCCESS , data : len } ) } catch ( e ) { // accept any exception thrown during a storage attempt as a quota error callFail ( sender , callbackId ) } }
Returns an integer representing the number of data items stored in the Storage object.
@param {function} callbackId
Returns an integer representing the number of data items stored in the Storage object .