Software: Apache. PHP/8.1.30 uname -a: Linux server1.tuhinhossain.com 5.15.0-151-generic #161-Ubuntu SMP Tue Jul 22 14:25:40 UTC uid=1002(picotech) gid=1003(picotech) groups=1003(picotech),0(root) Safe-mode: OFF (not secure) /usr/share/nodejs/jsdom/lib/jsdom/living/webstorage/ drwxr-xr-x |
Viewing file: Select action/file-type: "use strict"; const DOMException = require("domexception/webidl2js-wrapper"); const StorageEvent = require("../generated/StorageEvent"); const idlUtils = require("../generated/utils"); const { fireAnEvent } = require("../helpers/events"); // https://html.spec.whatwg.org/multipage/webstorage.html#the-storage-interface class StorageImpl { constructor(globalObject, args, privateData) { const { associatedWindow, storageArea, url, type, storageQuota } = privateData; this._associatedWindow = associatedWindow; this._items = storageArea; this._url = url; this._type = type; this._quota = storageQuota; this._globalObject = globalObject; } _dispatchStorageEvent(key, oldValue, newValue) { return this._associatedWindow._currentOriginData.windowsInSameOrigin .filter(target => target !== this._associatedWindow) .forEach(target => fireAnEvent("storage", target, StorageEvent, { key, oldValue, newValue, url: this._url, storageArea: target["_" + this._type] })); } get length() { return this._items.size; } key(n) { if (n >= this._items.size) { return null; } return [...this._items.keys()][n]; } getItem(key) { if (this._items.has(key)) { return this._items.get(key); } return null; } setItem(key, value) { const oldValue = this._items.get(key) || null; if (oldValue === value) { return; } // Concatenate all keys and values to measure their length against the quota let itemsTotalLength = key.length + value.length; for (const [curKey, curValue] of this._items) { // If the key already exists, skip it as it will be set to the new value instead if (key !== curKey) { itemsTotalLength += curKey.length + curValue.length; } } if (itemsTotalLength > this._quota) { throw DOMException.create(this._globalObject, [ `The ${this._quota}-code unit storage quota has been exceeded.`, "QuotaExceededError" ]); } setTimeout(this._dispatchStorageEvent.bind(this), 0, key, oldValue, value); this._items.set(key, value); } removeItem(key) { if (this._items.has(key)) { setTimeout(this._dispatchStorageEvent.bind(this), 0, key, this._items.get(key), null); this._items.delete(key); } } clear() { if (this._items.size > 0) { setTimeout(this._dispatchStorageEvent.bind(this), 0, null, null, null); this._items.clear(); } } get [idlUtils.supportedPropertyNames]() { return this._items.keys(); } } module.exports = { implementation: StorageImpl }; |
:: Command execute :: | |
--[ c99shell v. 2.5 [PHP 8 Update] [24.05.2025] | Generation time: 0.0041 ]-- |