Actualizacion maquina principal
[dotfiles/.git] / .config / coc / extensions / node_modules / coc-prettier / node_modules / rxjs / src / internal / util / tryCatch.ts
diff --git a/.config/coc/extensions/node_modules/coc-prettier/node_modules/rxjs/src/internal/util/tryCatch.ts b/.config/coc/extensions/node_modules/coc-prettier/node_modules/rxjs/src/internal/util/tryCatch.ts
new file mode 100644 (file)
index 0000000..1745421
--- /dev/null
@@ -0,0 +1,20 @@
+import { errorObject } from './errorObject';
+
+let tryCatchTarget: Function;
+
+function tryCatcher(this: any): any {
+  errorObject.e = undefined;
+  try {
+    return tryCatchTarget.apply(this, arguments);
+  } catch (e) {
+    errorObject.e = e;
+    return errorObject;
+  } finally {
+    tryCatchTarget = undefined;
+  }
+}
+
+export function tryCatch<T extends Function>(fn: T): T {
+  tryCatchTarget = fn;
+  return <any>tryCatcher;
+}