From c5ff0a8bd97410f8962e5f741c772e3d8b183976 Mon Sep 17 00:00:00 2001 From: akdubya Date: Wed, 10 Nov 2010 15:10:48 -0500 Subject: [PATCH] use dust.nextTick internally --- lib/dust.js | 2 +- test/examples.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/dust.js b/lib/dust.js index 15d1f1c..5e12056 100644 --- a/lib/dust.js +++ b/lib/dust.js @@ -15,7 +15,7 @@ dust.render = function(name, context, callback) { dust.stream = function(name, context) { var stream = new Stream(); - setTimeout(function() { + dust.nextTick(function() { dust.load(name, stream.head, Context.wrap(context)).end(); }); return stream; diff --git a/test/examples.js b/test/examples.js index 3f40e9d..683bc3a 100644 --- a/test/examples.js +++ b/test/examples.js @@ -147,9 +147,9 @@ exports.dustExamples = [ context: { type: function(chunk) { return chunk.map(function(chunk) { - setTimeout(function() { + dust.nextTick(function() { chunk.end("Async"); - }, 0); + }); }); } },