Bump to v3.3.0.

This commit is contained in:
jdalton
2015-02-20 00:57:26 -08:00
parent 05cb7419a6
commit 5dc85cc9a8
91 changed files with 830 additions and 408 deletions

View File

@@ -1,5 +1,4 @@
var baseSlice = require('../internal/baseSlice'),
isError = require('../lang/isError');
var isError = require('../lang/isError');
/**
* Attempts to invoke `func`, returning either the result or the caught error
@@ -21,9 +20,16 @@ var baseSlice = require('../internal/baseSlice'),
* elements = [];
* }
*/
function attempt(func) {
function attempt() {
var length = arguments.length,
func = arguments[0];
try {
return func.apply(undefined, baseSlice(arguments, 1));
var args = Array(length ? length - 1 : 0);
while (--length > 0) {
args[length - 1] = arguments[length];
}
return func.apply(undefined, args);
} catch(e) {
return isError(e) ? e : new Error(e);
}