Commits

jer...@jeremylatt.com  committed 372e5b2

use prototypal()

  • Participants
  • Parent commits 4bc6704

Comments (0)

Files changed (1)

 
 
 // TODO: Headers needs to append values for SOME keys... not sure which yet.
-var Headers = function(headers) {
-	this.clear();
+var Headers = prototypal({
+	'constructor': function(headers) {
+		this.clear();
 	
-	if (headers) {
-		for (var key in headers) {
-			this.set(key, headers[key]);
+		if (headers) {
+			for (var key in headers) {
+				this.set(key, headers[key]);
+			}
 		}
-	}
-};
-Headers.prototype = {
-	'constructor': Headers,
+	},
 
 	'set': function(key, value) {
 		var lkey = key.toLowerCase();
 		});
 		return headers;
 	}
-};
+});
 
 
-var XMLHttpRequest = function() {
-	this.requestHeaders = new Headers();
-};
-XMLHttpRequest.prototype = {
-	'constructor': XMLHttpRequest,
+var XMLHttpRequest = prototypal({
+	'constructor': function() {
+		this.requestHeaders = new Headers();
+	},
 
 	// recognized methods
 	'METHODS': ['CONNECT', 'DELETE', 'GET', 'HEAD', 'OPTIONS', 'POST', 'PUT', 'TRACE', 'TRACK'],
 
 		return this.responseHeaders.toString();
 	}
-};
+});