<commit_before>/**

_enyo.FormData_ is an [XHR2](http://www.w3.org/TR/XMLHttpRequest/)
`FormData` implementation.  It is used to send `multipart/form-data`
Ajax requests.  _enyo.Blob_ is the associated content provider for
file-parts.

*Note:* On IE < 10, both _enyo.FormData_ and _enyo.Blob_ are limited
to `String` content: an _enyo.Blob_ can be instanciated only using an
`Array` or `String`.

_enyo.FormData_ is inspired by
[html5-formdata](https://github.com/francois2metz/html5-formdata/blob/master/formdata.js)

    Emulate FormData for some browsers
    MIT License
    (c) 2010 <NAME>

 */
(function(w) {
	if (w.FormData) {
		try {
			var t1 = new w.FormData();
			var t2 = new w.Blob();
			// Android Chrome 18 will throw an error trying to create these
			enyo.FormData = w.FormData;
			enyo.Blob = w.Blob;
			return;
		}
		catch (e) {
			// ignore error and fall through to fake FormData code
		}
	}
	function FormData() {
		this.fake = true;
		this._fields = [];
		// This generates a 50 character boundary similar to
		// those used by Firefox.  They are optimized for
		// boyer-moore parsing.
		this.boundary = '--------------------------';
		for (var i = 0; i < 24; i++) {
			this.boundary += Math.floor(Math.random() * 10).toString(16);
		}
	}
	FormData.prototype.getContentType = function() {
		return "multipart/form-data; boundary=" + this.boundary;
	};
	FormData.prototype.append = function(key, value, filename) {
		this._fields.push([key, value, filename]);
	};
	FormData.prototype.toString = function() {
		var boundary = this.boundary;
		var body = "";
		this._fields.forEach(function(field) {
			body += "--" + boundary + "\r\n";<commit_msg>ENYO-1636: use enyo.forEach instead of native forEach for IE8 compatibility<commit_after>/**

_enyo.FormData_ is an [XHR2](http://www.w3.org/TR/XMLHttpRequest/)
`FormData` implementation.  It is used to send `multipart/form-data`
Ajax requests.  _enyo.Blob_ is the associated content provider for
file-parts.

*Note:* On IE < 10, both _enyo.FormData_ and _enyo.Blob_ are limited
to `String` content: an _enyo.Blob_ can be instanciated only using an
`Array` or `String`.

_enyo.FormData_ is inspired by
[html5-formdata](https://github.com/francois2metz/html5-formdata/blob/master/formdata.js)

    Emulate FormData for some browsers
    MIT License
    (c) 2010 <NAME>

 */
(function(w) {
	if (w.FormData) {
		try {
			var t1 = new w.FormData();
			var t2 = new w.Blob();
			// Android Chrome 18 will throw an error trying to create these
			enyo.FormData = w.FormData;
			enyo.Blob = w.Blob;
			return;
		}
		catch (e) {
			// ignore error and fall through to fake FormData code
		}
	}
	function FormData() {
		this.fake = true;
		this._fields = [];
		// This generates a 50 character boundary similar to
		// those used by Firefox.  They are optimized for
		// boyer-moore parsing.
		this.boundary = '--------------------------';
		for (var i = 0; i < 24; i++) {
			this.boundary += Math.floor(Math.random() * 10).toString(16);
		}
	}
	FormData.prototype.getContentType = function() {
		return "multipart/form-data; boundary=" + this.boundary;
	};
	FormData.prototype.append = function(key, value, filename) {
		this._fields.push([key, value, filename]);
	};
	FormData.prototype.toString = function() {
		var boundary = this.boundary;
		var body = "";
		enyo.forEach(this._fields, function(field) {
			body += "--" + boundary + "\r\n";
{'fraction_non_alphanumeric': 0.14864864864864866, 'fraction_numerical': 0.015569917743830788, 'mean_word_length': 3.1779141104294477, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 5, 'https://': 2, 'lorem ipsum': 0, 'www.': 2, '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': '4404798', 'n_tokens_mistral': 1266, 'n_tokens_neox': 1141, 'n_words': 327}