summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorBen Noordhuis <info@bnoordhuis.nl>2013-03-21 12:19:03 +0100
committerBen Noordhuis <info@bnoordhuis.nl>2013-05-16 00:02:54 +0200
commit22533c035d0dbe8abfe699c982a1332b1bfb7b9b (patch)
tree89a998b8e36f25d1b92bdb4d71008785e3e46b94 /test
parent1deeab29f27ec5d11cb851e18449cfa2d634c7f5 (diff)
downloadandroid-node-v8-22533c035d0dbe8abfe699c982a1332b1bfb7b9b.tar.gz
android-node-v8-22533c035d0dbe8abfe699c982a1332b1bfb7b9b.tar.bz2
android-node-v8-22533c035d0dbe8abfe699c982a1332b1bfb7b9b.zip
timers: fix setInterval() assert
Test case: var t = setInterval(function() {}, 1); process.nextTick(t.unref); Output: Assertion failed: (args.Holder()->InternalFieldCount() > 0), function Unref, file ../src/handle_wrap.cc, line 78. setInterval() returns a binding layer object. Make it stop doing that, wrap the raw process.binding('timer_wrap').Timer object in a Timeout object. Fixes #4261.
Diffstat (limited to 'test')
-rw-r--r--test/simple/test-timers-unref.js7
1 files changed, 7 insertions, 0 deletions
diff --git a/test/simple/test-timers-unref.js b/test/simple/test-timers-unref.js
index 4be557e506..1c362cb836 100644
--- a/test/simple/test-timers-unref.js
+++ b/test/simple/test-timers-unref.js
@@ -54,6 +54,13 @@ check_unref = setInterval(function() {
checks += 1;
}, 100);
+// Should not assert on args.Holder()->InternalFieldCount() > 0. See #4261.
+(function() {
+ var t = setInterval(function() {}, 1);
+ process.nextTick(t.unref.bind({}));
+ process.nextTick(t.unref.bind(t));
+})();
+
process.on('exit', function() {
assert.strictEqual(interval_fired, false, 'Interval should not fire');
assert.strictEqual(timeout_fired, false, 'Timeout should not fire');