File tree 3 files changed +17
-3
lines changed
3 files changed +17
-3
lines changed Original file line number Diff line number Diff line change @@ -55,7 +55,7 @@ namespace node {
55
55
V (bytes_parsed_string, " bytesParsed" ) \
56
56
V (callback_string, " callback" ) \
57
57
V (change_string, " change" ) \
58
- V (close_string , " close " ) \
58
+ V (onclose_string , " _onclose " ) \
59
59
V (code_string, " code" ) \
60
60
V (compare_string, " compare" ) \
61
61
V (ctime_string, " ctime" ) \
Original file line number Diff line number Diff line change @@ -52,7 +52,7 @@ void HandleWrap::Close(const FunctionCallbackInfo<Value>& args) {
52
52
wrap->handle__ = nullptr ;
53
53
54
54
if (args[0 ]->IsFunction ()) {
55
- wrap->object ()->Set (env->close_string (), args[0 ]);
55
+ wrap->object ()->Set (env->onclose_string (), args[0 ]);
56
56
wrap->flags_ |= kCloseCallback ;
57
57
}
58
58
}
@@ -94,7 +94,7 @@ void HandleWrap::OnClose(uv_handle_t* handle) {
94
94
Local<Object> object = wrap->object ();
95
95
96
96
if (wrap->flags_ & kCloseCallback ) {
97
- wrap->MakeCallback (env->close_string (), 0 , nullptr );
97
+ wrap->MakeCallback (env->onclose_string (), 0 , nullptr );
98
98
}
99
99
100
100
object->SetAlignedPointerInInternalField (0 , nullptr );
Original file line number Diff line number Diff line change
1
+ var assert = require ( 'assert' ) ;
2
+
3
+ var t = new ( process . binding ( 'timer_wrap' ) . Timer ) ;
4
+ var called = 0 ;
5
+ function onclose ( ) {
6
+ called ++ ;
7
+ }
8
+
9
+ t . close ( onclose ) ;
10
+ t . close ( onclose ) ;
11
+
12
+ process . on ( 'exit' , function ( ) {
13
+ assert . equal ( 1 , called ) ;
14
+ } ) ;
You can’t perform that action at this time.
0 commit comments