src/js/libs/spiritual-gui.js
function(thing) {
		var nativeprops = Object.prototype;
		if (!gui.unloading && !thing.$destructed) {
			thing.$destructed = true;
			for (var prop in thing) {
				if (thing.hasOwnProperty(prop) || gui.debug) {
					if (nativeprops[prop] === undefined) {
						if (prop !== '$destructed') {
							var desc = Object.getOwnPropertyDescriptor(thing, prop);
							if (!desc || desc.configurable) {
								if (gui.debug) {
									this._definePropertyItentified(thing, prop);
								} else {
									Object.defineProperty(thing, prop, this.DENIED);
								}
							}
						}
					}
				}
			}
		}
	}
function(thing) {
		var nativeprops = Object.prototype;
		if (!gui.unloading && !thing.$destructed) {
			thing.$destructed = true;
			for (var prop in thing) {
				if (thing.hasOwnProperty(prop) || gui.debug) {
					if (nativeprops[prop] === undefined) {
						if (prop !== '$destructed') {
							var desc = Object.getOwnPropertyDescriptor(thing, prop);
							if (!desc || desc.configurable) {
								if (gui.debug) {
									this._definePropertyItentified(thing, prop);
								} else {
									Object.defineProperty(thing, prop, this.DENIED);
								}
							}
						}
					}
				}
			}
		}
	}
function ( thing ) { var nativeprops = Object . prototype ; if ( ! gui . unloading && ! thing . $destructed ) { thing . $destructed = true ; for ( var prop in thing ) { if ( thing . hasOwnProperty ( prop ) || gui . debug ) { if ( nativeprops [ prop ] === undefined ) { if ( prop !== '$destructed' ) { var desc = Object . getOwnPropertyDescriptor ( thing , prop ) ; if ( ! desc || desc . configurable ) { if ( gui . debug ) { this . _definePropertyItentified ( thing , prop ) ; } else { Object . defineProperty ( thing , prop , this . DENIED ) ; } } } } } } } }
Replace own properties with an accessor to throw an exception.
In 'gui.debug' mode we replace all props, not just own props,
so that we may fail fast on attempt to handle destructed spirit.
@TODO: keep track of non-enumerables and nuke those as well :/
@param {object} thing
Replace own properties with an accessor to throw an exception . In gui . debug mode we replace all props not just own props so that we may fail fast on attempt to handle destructed spirit .