Niedzielski has uploaded a new change for review. (
https://gerrit.wikimedia.org/r/389784 )
Change subject: Fix: RedirectError prototype chain
......................................................................
Fix: RedirectError prototype chain
Add missed call to Object.setPrototypeOf() required by Error subclasses
to set the prototype chain. For unknown reasons, its absence does not
appear to affect instanceof usage.
Note: Object.setPrototypeOf() requires the ES2015 core library (added in
this patch).
https://www.typescriptlang.org/docs/handbook/release-notes/typescript-2-2.html#support-for-newtarget
Change-Id: Ibaea97c2b8810c3921e43f7f28761ac233661516
---
M src/client/tsconfig.json
M src/common/http/fetch-with-redirect.ts
2 files changed, 5 insertions(+), 1 deletion(-)
git pull ssh://gerrit.wikimedia.org:29418/marvin refs/changes/84/389784/1
diff --git a/src/client/tsconfig.json b/src/client/tsconfig.json
index 864986b..8ae74ec 100644
--- a/src/client/tsconfig.json
+++ b/src/client/tsconfig.json
@@ -11,6 +11,6 @@
// https://github.com/Microsoft/TypeScript/issues/16675
// https://github.com/DefinitelyTyped/DefinitelyTyped/issues/15020
"module": "esnext",
- "lib": [ "es5", "es2015.iterable", "es2015.promise", "dom" ]
+ "lib": [ "es5", "es2015.core", "es2015.iterable", "es2015.promise", "dom" ]
}
}
diff --git a/src/common/http/fetch-with-redirect.ts
b/src/common/http/fetch-with-redirect.ts
index afa4730..a6a884b 100644
--- a/src/common/http/fetch-with-redirect.ts
+++ b/src/common/http/fetch-with-redirect.ts
@@ -13,6 +13,10 @@
constructor(status: number, url: string) {
super();
+
+ //
https://www.typescriptlang.org/docs/handbook/release-notes/typescript-2-2.html#support-for-newtarget
+ Object.setPrototypeOf(this, RedirectError.prototype);
+
this.status = status;
this.url = url;
}
--
To view, visit https://gerrit.wikimedia.org/r/389784
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ibaea97c2b8810c3921e43f7f28761ac233661516
Gerrit-PatchSet: 1
Gerrit-Project: marvin
Gerrit-Branch: master
Gerrit-Owner: Niedzielski <[email protected]>
Gerrit-Reviewer: Sniedzielski <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits