test: Timeout#unref() does not return instance
authorJan Schär <jscissr@gmail.com>
Mon, 9 Feb 2015 15:51:12 +0000 (16:51 +0100)
committercjihrig <cjihrig@gmail.com>
Fri, 13 Feb 2015 18:37:25 +0000 (13:37 -0500)
Timeout#unref() call returns undefined, not this. The test already
worked before, because the interval was still unref'd, and the test also
succeeds without clearing the interval.

PR-URL: https://github.com/joyent/node/pull/9171
Reviewed-by: Colin Ihrig <cjihrig@gmail.com>
Reviewed-by: Timothy J Fontaine <tjfontaine@gmail.com>
Conflicts:
test/simple/test-timers-unref.js

test/parallel/test-timers-unref.js

index c4f9d82..9434dbb 100644 (file)
@@ -21,7 +21,8 @@ setTimeout(function() {
 interval = setInterval(function() {
   unref_interval = true;
   clearInterval(interval);
-}, SHORT_TIME).unref();
+}, SHORT_TIME);
+interval.unref();
 
 setTimeout(function() {
   unref_timer = true;