14 lines
202 B
JavaScript
14 lines
202 B
JavaScript
|
var Fiber = require('fibers');
|
||
|
|
||
|
var current;
|
||
|
Fiber(function() {
|
||
|
current = Fiber.current;
|
||
|
Fiber.yield();
|
||
|
console.log('pass');
|
||
|
}).run();
|
||
|
if (current) {
|
||
|
current.run();
|
||
|
} else {
|
||
|
console.log('fail');
|
||
|
}
|