How to use the es5-ext/array/#/remove.call function in es5-ext

To help you get started, we’ve selected a few es5-ext examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github medikoo / dbjs / lib / types / base.js View on Github external
$$setValue: d('c', function (nu) {
		var old = getPrototypeOf(this), objects;
		if (!nu) nu = Base;
		if (old === nu) return;

		if (old._childType_ === 'object') objects = this.values;

		this.__proto__ = nu;
		this.prototype.__proto__ = nu.prototype;

		remove.call(old._children_, this);
		remove.call(old.prototype._children_, this.prototype);

		if (!nu.hasOwnProperty('_children_')) {
			defineProperty(nu, '_children_', d('', []));
		}
		if (!nu.prototype.hasOwnProperty('_children_')) {
			defineProperty(nu.prototype, '_children_', d('', []));
		}
		nu._children_.push(this);
		nu.prototype._children_.push(this);

		if (old === Base) Base[this._id_] = this;
		if (nu === Base) delete Base[this._id_];

		// Fix relations proto
		this._forEachRelation_(setRelationProto.bind(nu));
		this.prototype._forEachRelation_(setRelationProto.bind(nu.prototype));
github medikoo / dbjs / lib / types / base.js View on Github external
$$setValue: d('c', function (nu) {
		var old = getPrototypeOf(this), objects;
		if (!nu) nu = Base;
		if (old === nu) return;

		if (old._childType_ === 'object') objects = this.values;

		this.__proto__ = nu;
		this.prototype.__proto__ = nu.prototype;

		remove.call(old._children_, this);
		remove.call(old.prototype._children_, this.prototype);

		if (!nu.hasOwnProperty('_children_')) {
			defineProperty(nu, '_children_', d('', []));
		}
		if (!nu.prototype.hasOwnProperty('_children_')) {
			defineProperty(nu.prototype, '_children_', d('', []));
		}
		nu._children_.push(this);
		nu.prototype._children_.push(this);

		if (old === Base) Base[this._id_] = this;
		if (nu === Base) delete Base[this._id_];

		// Fix relations proto
		this._forEachRelation_(setRelationProto.bind(nu));
github medikoo / fs2 / readdir.js View on Github external
status.on("change", function (value) {
					if (value) {
						remove.call(result, path);
						promise.emit("change", { data: result, removed: [path], added: [] });
					} else {
						result.push(path);
						promise.emit("change", { data: result, removed: [], added: [path] });
					}
				});
			}
github medikoo / dbjs / _setup / 3.descriptor-property / iterator.js View on Github external
_unBind: d(function () {
		if (!this.__map__) return;
		remove.call(this.__map__.object
			._getDescriptorIterators_(this.__map__._sKey_), this);
		this.__map__ = null;
		unBind.call(this);
	}),
	'@@toStringTag': d('c', 'Map Iterator'),
github medikoo / fs2 / watch.js View on Github external
switchToReg = function (watcher) {
	var emitter = watcher.emitter, closePrevious = emitter._close;

	try {
		watchReg(watcher.path, watcher.emitter);
	} catch (err) {
		if (err.code === "EMFILE") {
			descHandler.limit = descHandler.taken;
			releaseDescs();
			return;
		}
		if (err.code === "ENOENT" || err.code === "DIFFTYPE") {
			emitter.off("change", emitter._watchSwitchListener);
			delete emitter._watchSwitchListener;
			remove.call(watchers.alt, watcher);
			watcher.emitter.end(err);
			return;
		}
		throw err;
	}
	emitter.off("change", emitter._watchSwitchListener);
	delete emitter._watchSwitchListener;
	remove.call(watchers.alt, watcher);
	closePrevious();
	descHandler.open();
	watcher.alt = false;
	watchers.reg.push(watcher);
	watchers.reg.sort(compare);
};
github medikoo / dbjs / lib / types / base.js View on Github external
setItemProto = function (item) {
	var old = getPrototypeOf(item), nu = this._itemPrototype_;

	remove.call(old._children_, item);
	item.__proto__ = nu;
	if (!nu.hasOwnProperty('_children_')) {
		defineProperty(nu, '_children_', d('', []));
	}
	nu._children_.push(item);

	item._forEachRelation_(setRelationProto.bind(nu));
};
github medikoo / dbjs / lib / _relation / getter.js View on Github external
remove = function (obj) {
		var rel;
		rel = obj[name];
		if (!rel.hasOwnProperty('_getter_')) return;
		delete rel._getter_;
		arrRemove.call(objects, obj);
		obj.off('extend', onadd);
		obj.off('reduce', onremove);
		if (obj._type_ === 'prototype') {
			obj.ns.off('extend', onnsadd);
			obj.ns.off('reduce', onnsremove);
		}
		baseRel.triggers.forEach(function (triggerName) {
			var trigger = obj['_' + triggerName];
			trigger.off('change', rel._update_);
			trigger.off('add', rel._update_);
			trigger.off('delete', rel._update_);
		});
		if (obj.hasOwnProperty('_children_')) obj._children_.forEach(remove);
	};
github medikoo / dbjs / _setup / utils / resolve-dynamic-triggers.js View on Github external
off = function (onChange, obj) {
	var listeners = obj._dynamicListeners_;
	if (listeners) remove.call(listeners, this);
	else obj.off('change', onChange);
};
github medikoo / dbjs / lib / _proto / object-ordered-list.js View on Github external
_onDelete: d(function (obj) {
		remove.call(this, obj);
		this._sort();
	}),
	__sort: d(function () {