Added arrow function in below files (#4061)

This commit is contained in:
Saravyas
2018-11-18 09:03:35 +05:30
committed by John-David Dalton
parent 580cd4cd1b
commit 136d5253e7
2 changed files with 2 additions and 4 deletions

View File

@@ -21,7 +21,7 @@ import isError from './isError.js'
*/
function attempt(func, ...args) {
try {
return func.apply(undefined, args)
return func(...args)
} catch (e) {
return isError(e) ? e : new Error(e)
}