/** @license MIT License (c) copyright 2010-2013 original author or authors */

/**
 * Licensed under the MIT License at:
 * http://www.opensource.org/licenses/mit-license.php
 *
 * @author: Brian Cavalier
 * @author: John Hann
 */

(function(define) { 'use strict';
define(function() {

	var when, slice;

	when = require('./when');
	slice = Array.prototype.slice;

	return {
		apply: apply,
		call: call,
		lift: lift
	};

	function lift(generator) {
		return function() {
			return apply(generator, arguments);
		}
	}

	function call(generator) {
		return apply(generator, slice.call(arguments, 1));
	}

	function apply(generator, args) {
		var iterator = generator.apply(this, args);

		return next();

		function next(x) {
			return step('next', x);
		}

		function fail(e) {
			return step('throw', e);
		}

		function step(action, x) {
			var result;

			try {
				result = iterator[action](x);
			} catch (e) {
				return when.reject(e);
			}

			return result.done ? result.value : when(result.value, next, fail);
		}
	}
});
}(typeof define === 'function' && define.amd ? define : function(factory) { module.exports = factory(); }));

@@ -272,24 +272,31 @@
 ne(function(
+require
 ) %7B%0A%0A%09var wh
@@ -513,24 +513,25 @@
 uments);%0A%09%09%7D
+;
 %0A%09%7D%0A%0A%09functi
@@ -643,16 +643,44 @@
 args) %7B%0A
+%09%09/*jshint validthis:true*/%0A
 %09%09var it
@@ -1164,16 +1164,23 @@
 factory(
+require
 ); %7D));%0A

Fix jshint warnings