src/aria/storage/AbstractStorage.js
function (options) {
        /**
         * Whether the serializer instance should be disposed when this instance is disposed
         * @type Boolean
         * @protected
         */
        this._disposeSerializer = false;

        /**
         * Callback for storage events
         * @type aria.core.CfgBeans:Callback
         */
        this._eventCallback = {
            fn : this._onStorageEvent,
            scope : this
        };

        // listen to events raised by other instances on the same window
        ariaStorageEventBus.$on({
            "change" : this._eventCallback
        });

        var serializer = options ? options.serializer : null, create = true;
        if (serializer) {
            if ("serialize" in serializer && "parse" in serializer) {
                // There is a serializer matching the interface, it's the only case where we don't have to create a
                // new instance
                create = false;
            } else {
                this.$logError(this.INVALID_SERIALIZER);
            }
        }
        if (create) {
            serializer = new ariaUtilsJsonJsonSerializer(true);
            this._disposeSerializer = true;
        }

        /**
         * Serializer instance
         * @type aria.utils.json.ISerializer
         */
        this.serializer = serializer;

        var nspace = "";
        if (options && options.namespace) {
            if (!ariaUtilsType.isString(options.namespace)) {
                this.$logError(this.INVALID_NAMESPACE);
            } else {
                // The dollar is just there to separate the keys from the namespace
                nspace = options.namespace + "$";
            }
        }
        /**
         * Namespace. It's the prefix used to store keys. It's a sort of security feature altough it doesn't provide
         * much of it.
         * @type String
         */
        this.namespace = nspace;
    }
function (options) {
        /**
         * Whether the serializer instance should be disposed when this instance is disposed
         * @type Boolean
         * @protected
         */
        this._disposeSerializer = false;

        /**
         * Callback for storage events
         * @type aria.core.CfgBeans:Callback
         */
        this._eventCallback = {
            fn : this._onStorageEvent,
            scope : this
        };

        // listen to events raised by other instances on the same window
        ariaStorageEventBus.$on({
            "change" : this._eventCallback
        });

        var serializer = options ? options.serializer : null, create = true;
        if (serializer) {
            if ("serialize" in serializer && "parse" in serializer) {
                // There is a serializer matching the interface, it's the only case where we don't have to create a
                // new instance
                create = false;
            } else {
                this.$logError(this.INVALID_SERIALIZER);
            }
        }
        if (create) {
            serializer = new ariaUtilsJsonJsonSerializer(true);
            this._disposeSerializer = true;
        }

        /**
         * Serializer instance
         * @type aria.utils.json.ISerializer
         */
        this.serializer = serializer;

        var nspace = "";
        if (options && options.namespace) {
            if (!ariaUtilsType.isString(options.namespace)) {
                this.$logError(this.INVALID_NAMESPACE);
            } else {
                // The dollar is just there to separate the keys from the namespace
                nspace = options.namespace + "$";
            }
        }
        /**
         * Namespace. It's the prefix used to store keys. It's a sort of security feature altough it doesn't provide
         * much of it.
         * @type String
         */
        this.namespace = nspace;
    }
function ( options ) { /**
         * Whether the serializer instance should be disposed when this instance is disposed
         * @type Boolean
         * @protected
         */ this . _disposeSerializer = false ; /**
         * Callback for storage events
         * @type aria.core.CfgBeans:Callback
         */ this . _eventCallback = { fn : this . _onStorageEvent , scope : this } ; // listen to events raised by other instances on the same window ariaStorageEventBus . $on ( { "change" : this . _eventCallback } ) ; var serializer = options ? options . serializer : null , create = true ; if ( serializer ) { if ( "serialize" in serializer && "parse" in serializer ) { // There is a serializer matching the interface, it's the only case where we don't have to create a // new instance create = false ; } else { this . $logError ( this . INVALID_SERIALIZER ) ; } } if ( create ) { serializer = new ariaUtilsJsonJsonSerializer ( true ) ; this . _disposeSerializer = true ; } /**
         * Serializer instance
         * @type aria.utils.json.ISerializer
         */ this . serializer = serializer ; var nspace = "" ; if ( options && options . namespace ) { if ( ! ariaUtilsType . isString ( options . namespace ) ) { this . $logError ( this . INVALID_NAMESPACE ) ; } else { // The dollar is just there to separate the keys from the namespace nspace = options . namespace + "$" ; } } /**
         * Namespace. It's the prefix used to store keys. It's a sort of security feature altough it doesn't provide
         * much of it.
         * @type String
         */ this . namespace = nspace ; }
Create an abstract instance of storage
@param {aria.storage.Beans:ConstructorArgs} options Constructor options
Create an abstract instance of storage