Open
Description
Version
23.10.0
Platform
Darwin LM-JNVH7RPW6J 23.6.0 Darwin Kernel Version 23.6.0: Thu Dec 19 20:47:53 PST 2024; root:xnu-10063.141.1.703.2~1/RELEASE_ARM64_T6030 arm64
Subsystem
repl
What steps will reproduce the bug?
- Open the repl ( type
node
) - Paste the following code
const handler = {
get(target, prop, receiver) {
console.log(`Accessed prop: ${String(prop)}`);
return new Proxy(function () {}, {
apply: function (_target, _thisArg, args) {
console.log(`Called function: ${String(prop)} with args:`, args);
return `Result of calling ${prop}`;
},
get: function (_target, subProp) {
console.log(`Accessed nested prop: ${String(subProp)} on ${String(prop)}`);
return `Nested value of ${subProp}`;
}
});
}
};
const obj = new Proxy({}, handler);
- Try to access a nested prop like
obj.hello.world
.
How often does it reproduce? Is there a required condition?
Always
What is the expected behavior? Why is that the expected behavior?
It should allow me to type something like obj.hello.world
.
What do you see instead?
I can type obj.hello
but once I type the other dot, it already triggers the proxy. See the video:
node-repl-proxy-issue.mov
Additional information
No response