-
-
Save indutny/44586daf809530f8b6f0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/src/node_http_parser.cc b/src/node_http_parser.cc | |
index 782bdf9..6747409 100644 | |
--- a/src/node_http_parser.cc | |
+++ b/src/node_http_parser.cc | |
@@ -243,7 +243,8 @@ public: | |
HTTP_CB(on_headers_complete) { | |
- Local<Value> cb = handle_->Get(on_headers_complete_sym); | |
+ static Object::CachedProperty prop(on_headers_complete_sym); | |
+ Local<Value> cb = handle_->Get(prop); | |
if (!cb->IsFunction()) | |
return 0; | |
@@ -304,7 +305,8 @@ public: | |
HTTP_DATA_CB(on_body) { | |
HandleScope scope(node_isolate); | |
- Local<Value> cb = handle_->Get(on_body_sym); | |
+ static Object::CachedProperty prop(on_body_sym); | |
+ Local<Value> cb = handle_->Get(prop); | |
if (!cb->IsFunction()) | |
return 0; | |
@@ -331,7 +333,8 @@ public: | |
if (num_fields_) | |
Flush(); // Flush trailing HTTP headers. | |
- Local<Value> cb = handle_->Get(on_message_complete_sym); | |
+ static Object::CachedProperty prop(on_message_complete_sym); | |
+ Local<Value> cb = handle_->Get(prop); | |
if (!cb->IsFunction()) | |
return 0; | |
@@ -515,7 +518,8 @@ private: | |
void Flush() { | |
HandleScope scope(node_isolate); | |
- Local<Value> cb = handle_->Get(on_headers_sym); | |
+ static Object::CachedProperty prop(on_headers_sym); | |
+ Local<Value> cb = handle_->Get(prop); | |
if (!cb->IsFunction()) | |
return; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment