Permalink
Browse files

Removed unnecesary check.

  • Loading branch information...
1 parent ca94641 commit 54ed8dc5c043da768fa509dae9c99912c70e2fa4 @lm1 committed Jan 26, 2011
Showing with 2 additions and 8 deletions.
  1. +2 −8 fiberize.js
View
@@ -31,12 +31,6 @@ module.exports.require = function(path) {
function get_current_fiber() {
var f = Fiber.current;
if (f === undefined) throw new Error("You need to start a fiber first!");
- if (!f.resume) {
- f.resume = function() {
- if (this.started) this.run();
- else throw new Error("The fiber is not started!");
- }
- }
return f;
}
@@ -49,7 +43,7 @@ function wrapf(fn, type) {
var cb = function(err) {
cb_args = Array.prototype.slice.call(arguments);
if (Fiber.current !== fiber) {
- fiber.resume();
+ fiber.run();
}
};
args.push(cb);
@@ -121,7 +115,7 @@ fiberize.sleep = function(ms) {
var fiber = get_current_fiber();
setTimeout(function() {
wake = true;
- fiber.resume();
+ fiber.run();
}, ms);
while (!wake) {
yield();

0 comments on commit 54ed8dc

Please sign in to comment.