Skip to content
Browse files

Use MakeCallback in node_http_parser

Note: This causes tests to fail, and changes the API
considerably.  More work is required to bring this in
line, and it may not be ready in time for v0.8
  • Loading branch information...
1 parent c644078 commit 001fe776239fe709495c401e3b7ede67124f0b62 @isaacs committed Apr 11, 2012
Showing with 16 additions and 5 deletions.
  1. +16 −5 src/node_http_parser.cc
View
21 src/node_http_parser.cc
@@ -283,8 +283,10 @@ class Parser : public ObjectWrap {
Local<Value> argv[1] = { message_info };
- Local<Value> head_response =
- Local<Function>::Cast(cb)->Call(handle_, 1, argv);
+ Local<Value> head_response;
+ head_response = Local<Value>::New(MakeCallback(handle_,
+ Local<Function>::Cast(cb),
+ 1, argv));
if (head_response.IsEmpty()) {
got_exception_ = true;
@@ -308,7 +310,10 @@ class Parser : public ObjectWrap {
Integer::New(length)
};
- Local<Value> r = Local<Function>::Cast(cb)->Call(handle_, 3, argv);
+ Local<Value> r;
+ r = Local<Value>::New(MakeCallback(handle_,
+ Local<Function>::Cast(cb),
+ 3, argv));
if (r.IsEmpty()) {
got_exception_ = true;
@@ -330,7 +335,10 @@ class Parser : public ObjectWrap {
if (!cb->IsFunction())
return 0;
- Local<Value> r = Local<Function>::Cast(cb)->Call(handle_, 0, NULL);
+ Local<Value> r;
+ r = Local<Value>::New(MakeCallback(handle_,
+ Local<Function>::Cast(cb),
+ 0, NULL));
if (r.IsEmpty()) {
got_exception_ = true;
@@ -519,7 +527,10 @@ class Parser : public ObjectWrap {
url_.ToString()
};
- Local<Value> r = Local<Function>::Cast(cb)->Call(handle_, 2, argv);
+ Local<Value> r;
+ r = Local<Value>::New(MakeCallback(handle_,
+ Local<Function>::Cast(cb),
+ 2, argv));
if (r.IsEmpty())
got_exception_ = true;

0 comments on commit 001fe77

Please sign in to comment.
Something went wrong with that request. Please try again.