Replace all usage of `bind()` with arrow functions
This left all test files untouched.
Change-Id: I677383d51adb5bf8ca7fd5f18f16c34eca8b3498
diff --git a/polygerrit-ui/app/services/gr-reporting/gr-reporting_impl.ts b/polygerrit-ui/app/services/gr-reporting/gr-reporting_impl.ts
index 1cf4bea..d3b652a 100644
--- a/polygerrit-ui/app/services/gr-reporting/gr-reporting_impl.ts
+++ b/polygerrit-ui/app/services/gr-reporting/gr-reporting_impl.ts
@@ -117,11 +117,11 @@
// TODO(dmfilippo): TS-fix-any oldOnError - define correct type
const onError = function (
oldOnError: Function,
- msg: string,
- url: string,
- line: number,
- column: number,
- error: Error
+ msg: Event | string,
+ url?: string,
+ line?: number,
+ column?: number,
+ error?: Error
) {
if (oldOnError) {
oldOnError(msg, url, line, column, error);
@@ -147,7 +147,7 @@
reportingService.reporter(
ERROR.TYPE,
ERROR.CATEGORY.EXCEPTION,
- msg,
+ `${msg}`,
payload
);
return true;
@@ -155,7 +155,15 @@
// TODO(dmfilippov): TS-fix-any unclear what is context
const catchErrors = function (opt_context?: any) {
const context = opt_context || window;
- context.onerror = onError.bind(null, context.onerror);
+ context.onerror = (
+ event: Event | string,
+ source?: string,
+ lineno?: number,
+ colno?: number,
+ error?: Error
+ ) => {
+ return onError(context.onerror, event, source, lineno, colno, error);
+ };
context.addEventListener(
'unhandledrejection',
(e: PromiseRejectionEvent) => {