Commit 7651c8f1 authored by Robert Knight's avatar Robert Knight

Remove an obsolete ES5-ism

Remove ability to construct `RPC` class without calling `new`. This
confused TypeScript's inference of the types of various fields.
parent 0313ff16
...@@ -37,7 +37,6 @@ const VERSION = '1.0.0'; ...@@ -37,7 +37,6 @@ const VERSION = '1.0.0';
* @param {(Object<string, ((any) => any)>) | ((any) => any)} methods * @param {(Object<string, ((any) => any)>) | ((any) => any)} methods
*/ */
export default function RPC(src, dst, origin, methods) { export default function RPC(src, dst, origin, methods) {
if (!(this instanceof RPC)) return new RPC(src, dst, origin, methods);
const self = this; const self = this;
this.src = src; this.src = src;
this.dst = dst; this.dst = dst;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment