This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

Move errors for readPause and readResume

  • Loading branch information...
1 parent 7a8ede6 commit c094dda53ca82d14adba4f6221af1c0d5f724811 @ry ry committed Feb 22, 2010
Showing with 11 additions and 2 deletions.
  1. +2 −2 lib/http.js
  2. +9 −0 src/node_net.cc
View
@@ -79,11 +79,11 @@ IncomingMessage.prototype.setBodyEncoding = function (enc) {
};
IncomingMessage.prototype.pause = function () {
- this.connection.readPause();
+ this.connection.pause();
};
IncomingMessage.prototype.resume = function () {
- this.connection.readResume();
+ this.connection.resume();
};
IncomingMessage.prototype._addHeaderLine = function (field, value) {
View
@@ -56,6 +56,13 @@ static const struct addrinfo client_tcp_hints =
Persistent<FunctionTemplate> Connection::constructor_template;
+Handle<Value> ThrottleMissingError(const Arguments& args) {
+ HandleScope scope;
+ return ThrowException(Exception::Error(String::New(
+ "readPause() and readResume() have been renamed to pause() and "
+ "resume() respectively.")));
+}
+
// Initialize the tcp.Connection object.
void Connection::Initialize(v8::Handle<v8::Object> target) {
HandleScope scope;
@@ -102,6 +109,8 @@ void Connection::Initialize(v8::Handle<v8::Object> target) {
NODE_SET_PROTOTYPE_METHOD(constructor_template, "setEncoding", SetEncoding);
NODE_SET_PROTOTYPE_METHOD(constructor_template, "pause", Pause);
NODE_SET_PROTOTYPE_METHOD(constructor_template, "resume", Resume);
+ NODE_SET_PROTOTYPE_METHOD(constructor_template, "readPause", ThrottleMissingError);
+ NODE_SET_PROTOTYPE_METHOD(constructor_template, "readResume", ThrottleMissingError);
NODE_SET_PROTOTYPE_METHOD(constructor_template, "setTimeout", SetTimeout);
NODE_SET_PROTOTYPE_METHOD(constructor_template, "setNoDelay", SetNoDelay);
#if EVCOM_HAVE_GNUTLS

0 comments on commit c094dda

Please sign in to comment.