import { bind, call, identity, makeCallable } from "./function.js";
 import {
   defineOwnProperties,
+  getOwnPropertyDescriptors,
   getPrototype,
   objectCreate,
   setPrototype,
       return call(getUnicode, this.#regExp, []);
     }
   };
-  const matcherPrototype = setPrototype(
-    Matcher.prototype,
-    rePrototype,
+
+  const matcherConstructor = defineOwnProperties(
+    class extends RegExp {
+      constructor(...args) {
+        return new Matcher(...args);
+      }
+    },
+    {
+      name: { value: "Matcher" },
+      length: { value: 1 },
+    },
+  );
+  const matcherPrototype = defineOwnProperties(
+    matcherConstructor.prototype,
+    getOwnPropertyDescriptors(Matcher.prototype),
+    { constructor: { value: matcherConstructor } },
   );
 
-  return { Matcher };
+  return { Matcher: matcherConstructor };
 })();
 
 export const {