diff --git a/lib/generators/runtime.js b/lib/generators/runtime.js index 0966e1b6..77a814d9 100644 --- a/lib/generators/runtime.js +++ b/lib/generators/runtime.js @@ -1,25 +1,22 @@ -if (typeof exports !== 'undefined') { - exports = module.exports = Object.create(require('galaxy')); -} else { - exports = (Streamline.runtime = Streamline.runtime || Object.create(require('galaxy'))); -} -var globals = exports.globals = require('../globals'); -exports.globals.runtime = 'generators'; -require("../generators/builtins"); -var fut = require("../util/future"); -exports.streamlinify = fut.streamlinify; +(function(exports) { + var globals = exports.globals = require('../globals'); + exports.globals.runtime = 'generators'; + require("../generators/builtins"); + var fut = require("../util/future"); + exports.streamlinify = fut.streamlinify; -var unstar = exports.unstar; + var unstar = exports.unstar; -exports.unstar = function(fn, options, entering) { - if (typeof options === "number") options = { - callbackIndex: options, - }; - else options = options || {}; - options.promise = options.callbackDefault ? function(fn, args, i) { - return fut.future.call(this, fn, args, i)(options.callbackDefault()); - } : fut.promise; - return unstar(fn, options, entering); -} + exports.unstar = function(fn, options, entering) { + if (typeof options === "number") options = { + callbackIndex: options, + }; + else options = options || {}; + options.promise = options.callbackDefault ? function(fn, args, i) { + return fut.future.call(this, fn, args, i)(options.callbackDefault()); + } : fut.promise; + return unstar(fn, options, entering); + } -exports.then = exports.star(fut.then, 2); + exports.then = exports.star(fut.then, 2); +})(typeof exports !== 'undefined' ? module.exports = Object.create(require('galaxy')) : Streamline.runtime = Streamline.runtime || Object.create(require('galaxy'))); diff --git a/test/common/generators/eval-test.html b/test/common/generators/eval-test.html index bf090523..3043391d 100644 --- a/test/common/generators/eval-test.html +++ b/test/common/generators/eval-test.html @@ -7,9 +7,10 @@ - - - + + + +