(fn, instance, type, args)
| 1931 | } |
| 1932 | } |
| 1933 | function callWithAsyncErrorHandling(fn, instance, type, args) { |
| 1934 | if (isFunction(fn)) { |
| 1935 | const res = callWithErrorHandling(fn, instance, type, args); |
| 1936 | if (res && isPromise(res)) { |
| 1937 | res.catch((err) => { |
| 1938 | handleError(err, instance, type); |
| 1939 | }); |
| 1940 | } |
| 1941 | return res; |
| 1942 | } |
| 1943 | if (isArray(fn)) { |
| 1944 | const values = []; |
| 1945 | for (let i = 0; i < fn.length; i++) { |
| 1946 | values.push(callWithAsyncErrorHandling(fn[i], instance, type, args)); |
| 1947 | } |
| 1948 | return values; |
| 1949 | } |
| 1950 | } |
| 1951 | function handleError(err, instance, type, throwInDev = true) { |
| 1952 | const contextVNode = instance ? instance.vnode : null; |
| 1953 | const { errorHandler, throwUnhandledErrorInProduction } = instance && instance.appContext.config || EMPTY_OBJ; |
no test coverage detected