Skip to content

Commit

Permalink
Move Future.ret alias to fiber_helpers.
Browse files Browse the repository at this point in the history
  • Loading branch information
glasser committed Nov 10, 2012
1 parent a87c658 commit 4f952da
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
11 changes: 11 additions & 0 deletions packages/meteor/fiber_helpers.js
@@ -1,3 +1,9 @@
(function () {

var path = __meteor_bootstrap__.require('path');
var Fiber = __meteor_bootstrap__.require('fibers');
var Future = __meteor_bootstrap__.require(path.join('fibers', 'future'));

Meteor._noYieldsAllowed = function (f) { Meteor._noYieldsAllowed = function (f) {
// "Fiber" and "yield" are both in the global namespace. The yield function is // "Fiber" and "yield" are both in the global namespace. The yield function is
// at both "yield" and "Fiber.yield". (It's also at require('fibers').yield // at both "yield" and "Fiber.yield". (It's also at require('fibers').yield
Expand All @@ -14,3 +20,8 @@ Meteor._noYieldsAllowed = function (f) {
global.yield = savedYield; global.yield = savedYield;
} }
}; };

// js2-mode AST blows up when parsing 'future.return()', so alias.
Future.prototype.ret = Future.prototype.return;

})();
3 changes: 0 additions & 3 deletions packages/mongo-livedata/mongo_driver.js
Expand Up @@ -11,9 +11,6 @@ var path = __meteor_bootstrap__.require('path');
var MongoDB = __meteor_bootstrap__.require('mongodb'); var MongoDB = __meteor_bootstrap__.require('mongodb');
var Future = __meteor_bootstrap__.require(path.join('fibers', 'future')); var Future = __meteor_bootstrap__.require(path.join('fibers', 'future'));


// js2-mode AST blows up when parsing 'future.return()', so alias.
Future.prototype.ret = Future.prototype.return;

_Mongo = function (url) { _Mongo = function (url) {
var self = this; var self = this;


Expand Down

0 comments on commit 4f952da

Please sign in to comment.