<commit_before>var ArrayFace = function(objectId, className){
	this.objectId = objectId;
	this.className = className;
	this.object = mw3.objects[this.objectId];
	this.objectDivId = mw3._getObjectDivId(this.objectId);
}

ArrayFace.prototype = {
	getValue: function(){
		var toBeReturned = [];
		if(this.object){
			var j=0;
			for(var i=0; i<this.object.length; i++){
				if(this.object[i] && this.object[i].__objectId){
					var element = mw3.getObject(this.object[i].__objectId);
					if(element){
						toBeReturned[j++] = element;
					}
				}
			}
		}
		this.object = toBeReturned;
		return toBeReturned;
	},
	addNew : function(){
		var arrayObj = mw3.getObject(this.objectId);
		var newOne = {__className: this.className, metaworksContext: {when: mw3.WHEN_NEW}};

		this.add(newOne);
	},

	add : function(item){
		var arrayObj = mw3.getObject(this.objectId);
		arrayObj[arrayObj.length] = item;

		mw3.locateObject(
			item,
			item.__className,
			'#' + this.objectDivId,
			null,
			{
				objectId: this.objectId,
				name: '[' + (arrayObj.length-1).toString() + ']'
			}
		);
	},

	remove: function(item){
		var removeItemObjectKeys = mw3._createObjectKey(item, true);

		var pos = this.indexOf(removeItemObjectKeys);

		if(pos == 0 && pos == this.object.length-1){
			this.object = [];
		}else if(pos == this.object.length-1){
			this.object.pop();
		}else if(pos == 0){
			this.object.shift();
		}else{
			this.object.splice(pos,pos);<commit_msg>ArrayFace must call the mw3.afterLoadFaceHelperScript after locating objects.<commit_after>var ArrayFace = function(objectId, className){
	this.objectId = objectId;
	this.className = className;
	this.object = mw3.objects[this.objectId];
	this.objectDivId = mw3._getObjectDivId(this.objectId);
}

ArrayFace.prototype = {
	getValue: function(){
		var toBeReturned = [];
		if(this.object){
			var j=0;
			for(var i=0; i<this.object.length; i++){
				if(this.object[i] && this.object[i].__objectId){
					var element = mw3.getObject(this.object[i].__objectId);
					if(element){
						toBeReturned[j++] = element;
					}
				}
			}
		}
		this.object = toBeReturned;
		return toBeReturned;
	},
	addNew : function(){
		var arrayObj = mw3.getObject(this.objectId);
		var newOne = {__className: this.className, metaworksContext: {when: mw3.WHEN_NEW}};

		this.add(newOne);
	},

	add : function(item){
		var arrayObj = mw3.getObject(this.objectId);
		arrayObj[arrayObj.length] = item;

		mw3.locateObject(
			item,
			item.__className,
			'#' + this.objectDivId,
			null,
			{
				objectId: this.objectId,
				name: '[' + (arrayObj.length-1).toString() + ']'
			}
		);

		mw3.onLoadFaceHelperScript();
	},

	remove: function(item){
		var removeItemObjectKeys = mw3._createObjectKey(item, true);

		var pos = this.indexOf(removeItemObjectKeys);

		if(pos == 0 && pos == this.object.length-1){
			this.object = [];
		}else if(pos == this.object.length-1){
			this.object.pop();
		}else if(pos == 0){
			this.object.shift();
		}else{
			this.object.splice(pos,pos);
{'fraction_non_alphanumeric': 0.16284479893652376, 'fraction_numerical': 0.010634762379528082, 'mean_word_length': 3.7104851330203443, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2399083', 'n_tokens_mistral': 1282, 'n_tokens_neox': 1107, 'n_words': 185}