Skip to content

Commit

Permalink
[fix] emit data events on the next tick to avoid being handled by the…
Browse files Browse the repository at this point in the history
… parser error handler.
  • Loading branch information
Garrett Johnson committed Aug 28, 2013
1 parent e39c813 commit ace4052
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion spark.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,9 @@ Spark.prototype.initialise = function initialise() {
data = packet.data;
}

spark.emit('data', data, raw);
process.nextTick(function tick() {
spark.emit('data', data, raw);
});
});
});

Expand Down

0 comments on commit ace4052

Please sign in to comment.