]> Lady’s Gitweb - Pisces/blobdiff - string.js
Add toIntegralNumber to numeric.js
[Pisces] / string.js
index 28412fc98b8854b9b26f248c5e8b8ae98526d033..3dc39acade9259c7c5120c28cde20ad398225426 100644 (file)
--- a/string.js
+++ b/string.js
@@ -10,6 +10,7 @@
 import { bind, call, identity, makeCallable } from "./function.js";
 import {
   defineOwnProperties,
+  getOwnPropertyDescriptors,
   getPrototype,
   objectCreate,
   setPrototype,
@@ -213,12 +214,25 @@ export const {
       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 {
This page took 0.024727 seconds and 4 git commands to generate.