[Pkg-javascript-commits] [node-mocks-http] 04/296: Moved the object initialization into the constructor.

Thorsten Alteholz alteholz at moszumanska.debian.org
Mon Feb 8 18:13:16 UTC 2016


This is an automated email from the git hooks/post-receive script.

alteholz pushed a commit to branch master
in repository node-mocks-http.

commit 2f4d74c3c58b53b86f30617c2cc84f5f85c15c53
Author: Howard Abrams <howard at cloud-eco.com>
Date:   Sun Feb 19 09:42:33 2012 -0800

    Moved the object initialization into the constructor.
---
 .gitignore          |  2 ++
 lib/mockResponse.js | 16 +++++++---------
 2 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/.gitignore b/.gitignore
index 4f0682f..d1968e0 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,2 +1,4 @@
 .project
 .settings
+node_modules
+test/results
diff --git a/lib/mockResponse.js b/lib/mockResponse.js
index 99bf5b3..59631d4 100644
--- a/lib/mockResponse.js
+++ b/lib/mockResponse.js
@@ -8,7 +8,12 @@
  * @author Howard Abrams <howard.abrams at gmail.com>
  */
 
-Provider = function(){};
+Provider = function() {
+    this._endCalled = false;
+    this._data = "";
+    this.statusCode = -1;
+    this._headers = {};
+};
 
 /**
  * Function: writeHead
@@ -243,12 +248,5 @@ Provider.prototype._isDataLengthValid = function() {
  */
 
 exports.createResponse = function(options) {
-    var p = new Provider();
-    
-    p._endCalled = false;
-    p._data = "";
-    p.statusCode = -1;
-    p._headers = {};
-
-    return p;
+    return new Provider(options);
 };

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/node-mocks-http.git



More information about the Pkg-javascript-commits mailing list