deadunit-core
Advanced tools
Comparing version 5.0.7 to 5.0.8
@@ -147,4 +147,5 @@ "use strict"; | ||
var that = this | ||
var doStuff = function() { | ||
that.lastEmitFuture = that.lastEmitFuture.then(function() { | ||
var lastEmitFuture = that.lastEmitFuture // capture it for the possible setTimeout threadlet | ||
var doStuff = function(f) { | ||
var resultFuture = lastEmitFuture.then(function() { | ||
return eventDataFuture | ||
@@ -157,9 +158,19 @@ }).then(function(eventData){ | ||
}) | ||
if(f !== undefined) { | ||
resultFuture.finally(function() { | ||
f.return() | ||
}) | ||
} | ||
return resultFuture | ||
} | ||
this.emitDepth++ | ||
if(this.emitDepth%50 == 0) { | ||
doStuff() | ||
if(this.emitDepth % 50 === 0) { | ||
var f = new Future | ||
that.lastEmitFuture = f | ||
setTimeout(function(){doStuff(f)}, 0) // make sure we don't get a "too much recursion error" // todo: test not doing this once browsers all support proper tail calls | ||
} else { | ||
setTimeout(doStuff, 0) // make sure we don't get a "too much recursion error" // todo: test not doing this once browsers all support proper tail calls | ||
that.lastEmitFuture = doStuff() | ||
} | ||
@@ -166,0 +177,0 @@ |
{ | ||
"name": "deadunit-core", | ||
"version": "5.0.5", | ||
"version": "5.0.7", | ||
"dependencies": { | ||
@@ -5,0 +5,0 @@ "ajax": { |
{"name":"deadunit-core", | ||
"description": "The core for deadunit - a dead-simple nestable unit testing library for javascript in node.js and the browser.", | ||
"keywords": ["unit", "test", "testing", "javascript", "node", "deadunit", "asynchronous"], | ||
"version":"5.0.7", | ||
"version":"5.0.8", | ||
"dependencies":{ | ||
@@ -16,3 +16,3 @@ "async-future":"1.0.0", | ||
"devDependencies": { | ||
"deadunit":"5.1.1", | ||
"deadunit":"5.1.2", | ||
"fibers":"", | ||
@@ -19,0 +19,0 @@ "requirejs":"", |
@@ -305,2 +305,3 @@ `deadunitCore` | ||
* 5.0.8 - attempting to fix some bugs in the last commit | ||
* 5.0.7 - adding bundle that was left out of last commit | ||
@@ -307,0 +308,0 @@ * 5.0.6 |
Sorry, the diff of this file is too big to display
1315231
17044
371