Comparing version 0.1.0 to 0.1.1
{ | ||
"name": "hutil", | ||
"version": "0.1.0", | ||
"version": "0.1.1", | ||
"description": "Hola Utilities", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -1376,2 +1376,17 @@ // LICENSE_CODE ZON ISC | ||
}; | ||
E._fn = function(opt, states){ | ||
if (Array.isArray(opt) || typeof opt=='function') | ||
{ | ||
states = opt; | ||
opt = undefined; | ||
} | ||
if (typeof states=='function') | ||
states = [states]; | ||
return function(){ | ||
var _states = array.copy(states); | ||
var arg = [this].concat(array.slice(arguments)); | ||
_states[0] = function(){ return states[0].apply(this, arg); }; | ||
return etask(opt, _states); | ||
}; | ||
}; | ||
E._generator = function(gen, ctor, opt){ | ||
@@ -1401,3 +1416,5 @@ opt = opt||{}; | ||
}, function ensure$(){ | ||
if (!done && gen.return) // generator .return() not yet supported by v8 | ||
// https://kangax.github.io/compat-table/es6/#test-generators_%GeneratorPrototype%.return | ||
// .return() supported only in node>=6.x.x | ||
if (!done && gen.return) | ||
try { gen.return(); } catch(e){} | ||
@@ -1404,0 +1421,0 @@ }]); |
292060
9061