Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F4504211
proxy_has_own.cjs
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
815 B
Referenced Files
None
Subscribers
None
proxy_has_own.cjs
View Options
const target = {};
function makeClientCounter() {
return function ClientCounter() {};
}
const proxy = new Proxy(target, {
get(_target, key) {
if (key === 'ClientCounter') return makeClientCounter();
return undefined;
},
getOwnPropertyDescriptor(_target, key) {
if (key === 'ClientCounter') {
return {
value: makeClientCounter(),
writable: false,
configurable: false,
enumerable: false,
};
}
return undefined;
},
});
console.log(`get:${typeof proxy.ClientCounter}`);
console.log(`hasOwn:${Object.prototype.hasOwnProperty.call(proxy, 'ClientCounter')}`);
console.log(`objHasOwn:${Object.hasOwn(proxy, 'ClientCounter')}`);
const desc = Object.getOwnPropertyDescriptor(proxy, 'ClientCounter');
console.log(`desc.value:${typeof desc?.value}`);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, May 3, 9:44 AM (18 h, 38 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
541875
Default Alt Text
proxy_has_own.cjs (815 B)
Attached To
Mode
rANT Ant
Attached
Detach File
Event Timeline
Log In to Comment