@optique/core 1.0.0-dev.1876 → 1.0.0-dev.1880
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.
- package/dist/annotations.cjs +3 -2
- package/dist/annotations.js +3 -2
- package/package.json +1 -1
package/dist/annotations.cjs
CHANGED
|
@@ -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
|
-
if (key === "valueOf") return () => view;
|
|
531
|
+
if (key === "valueOf") return cacheProtectedMethod(methodCache, key, () => () => view);
|
|
531
532
|
if (key === "searchParams") return protectAnnotationValue(clonedTarget.searchParams, context);
|
|
532
533
|
const value = Reflect.get(clonedTarget, key, clonedTarget);
|
|
533
|
-
return
|
|
534
|
+
return getProtectedClonePropertyValue(methodCache, clonedTarget, key, value, context);
|
|
534
535
|
},
|
|
535
536
|
set() {
|
|
536
537
|
throwReadonlyAnnotationMutation();
|
package/dist/annotations.js
CHANGED
|
@@ -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
|
-
if (key === "valueOf") return () => view;
|
|
530
|
+
if (key === "valueOf") return cacheProtectedMethod(methodCache, key, () => () => view);
|
|
530
531
|
if (key === "searchParams") return protectAnnotationValue(clonedTarget.searchParams, context);
|
|
531
532
|
const value = Reflect.get(clonedTarget, key, clonedTarget);
|
|
532
|
-
return
|
|
533
|
+
return getProtectedClonePropertyValue(methodCache, clonedTarget, key, value, context);
|
|
533
534
|
},
|
|
534
535
|
set() {
|
|
535
536
|
throwReadonlyAnnotationMutation();
|