@optique/core 1.0.0-dev.1876 → 1.0.0-dev.1878

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -524,13 +524,14 @@ function createProtectedURLSearchParamsView(target, context) {
524
524
  }
525
525
  function createProtectedURLView(target, context) {
526
526
  const syncPrototype = !hasBuiltInSubclassPrototype(target, URL.prototype);
527
+ const methodCache = /* @__PURE__ */ new Map();
527
528
  const cloned = syncPrototype ? new URL(target.href) : tryCloneURLSubclass(target) ?? new URL(target.href);
528
529
  const view = new Proxy(cloned, {
529
530
  get(clonedTarget, key) {
530
531
  if (key === "valueOf") return () => view;
531
532
  if (key === "searchParams") return protectAnnotationValue(clonedTarget.searchParams, context);
532
533
  const value = Reflect.get(clonedTarget, key, clonedTarget);
533
- return typeof value === "function" ? value.bind(clonedTarget) : protectAnnotationValue(value, context);
534
+ return getProtectedClonePropertyValue(methodCache, clonedTarget, key, value, context);
534
535
  },
535
536
  set() {
536
537
  throwReadonlyAnnotationMutation();
@@ -523,13 +523,14 @@ function createProtectedURLSearchParamsView(target, context) {
523
523
  }
524
524
  function createProtectedURLView(target, context) {
525
525
  const syncPrototype = !hasBuiltInSubclassPrototype(target, URL.prototype);
526
+ const methodCache = /* @__PURE__ */ new Map();
526
527
  const cloned = syncPrototype ? new URL(target.href) : tryCloneURLSubclass(target) ?? new URL(target.href);
527
528
  const view = new Proxy(cloned, {
528
529
  get(clonedTarget, key) {
529
530
  if (key === "valueOf") return () => view;
530
531
  if (key === "searchParams") return protectAnnotationValue(clonedTarget.searchParams, context);
531
532
  const value = Reflect.get(clonedTarget, key, clonedTarget);
532
- return typeof value === "function" ? value.bind(clonedTarget) : protectAnnotationValue(value, context);
533
+ return getProtectedClonePropertyValue(methodCache, clonedTarget, key, value, context);
533
534
  },
534
535
  set() {
535
536
  throwReadonlyAnnotationMutation();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@optique/core",
3
- "version": "1.0.0-dev.1876+f8b0c4ec",
3
+ "version": "1.0.0-dev.1878+1ab0e08e",
4
4
  "description": "Type-safe combinatorial command-line interface parser",
5
5
  "keywords": [
6
6
  "CLI",