src/Cache.js
function Cache(opts) {
	//debug.log('new Cache');

	opts = opts || {};
	debug.assert(opts).is('object');

	/** {boolean} True if this cache is using cursors */
	this._has_cursors = opts.cursors ? true : false;

	// All cursors in a VariableStore
	if(this._has_cursors) {
		this._cursors = new VariableStore();
		this._parents = new VariableStore();
		this._cursor_map = {};
	}

	/** Store for all objects */
	this.objects = new VariableStore();

	/** Array of current parents of the element which we are scanning -- this is used to find circular references */
	this._current_parents = [];

	/** Array of cursors pointing to circular references */
	this.circulars = [];

}
function Cache(opts) {
	//debug.log('new Cache');

	opts = opts || {};
	debug.assert(opts).is('object');

	/** {boolean} True if this cache is using cursors */
	this._has_cursors = opts.cursors ? true : false;

	// All cursors in a VariableStore
	if(this._has_cursors) {
		this._cursors = new VariableStore();
		this._parents = new VariableStore();
		this._cursor_map = {};
	}

	/** Store for all objects */
	this.objects = new VariableStore();

	/** Array of current parents of the element which we are scanning -- this is used to find circular references */
	this._current_parents = [];

	/** Array of cursors pointing to circular references */
	this.circulars = [];

}
function Cache ( opts ) { //debug.log('new Cache'); opts = opts || { } ; debug . assert ( opts ) . is ( 'object' ) ; /** {boolean} True if this cache is using cursors */ this . _has_cursors = opts . cursors ? true : false ; // All cursors in a VariableStore if ( this . _has_cursors ) { this . _cursors = new VariableStore ( ) ; this . _parents = new VariableStore ( ) ; this . _cursor_map = { } ; } /** Store for all objects */ this . objects = new VariableStore ( ) ; /** Array of current parents of the element which we are scanning -- this is used to find circular references */ this . _current_parents = [ ] ; /** Array of cursors pointing to circular references */ this . circulars = [ ] ; }
The cache object
The cache object