You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
consthandler={get(target,prop,receiver){console.log(`Accessed prop: ${String(prop)}`);returnnewProxy(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}`;}});}};constobj=newProxy({},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:
In #57909 we decided that there's still some work to do around REPL tab completion (see: #57909 (comment)).
So that's why my PR didn't close this issue.
I'm planning to improve the REPL tab completion check more (after #58775) before closing this if that works for you, or if you prefer (since the specific bug your issue referred to has been fixed) we can close this issue and I can open a new one for the extra work, whatever you prefer 🙂
Activity
BridgeAR commentedon Apr 11, 2025
I guess it is related to the input preview triggering util.inspect on it.
dario-piotrowicz commentedon Apr 12, 2025
I'm pretty sure this is caused by the REPL completer 🤔
Example
The following code reproduces the issue:
(+ typing
obj.hello.worldof course)But the following, where the completer if overridden by a noop function does not:
(+ typing
obj.hello.worldof course)Actually based on the following code comment I think that this is a known limitation/issue
node/lib/repl.js
Lines 1314 to 1315 in 09ecd2e
dario-piotrowicz commentedon Apr 12, 2025
Yeah here it is:
node/lib/repl.js
Line 1519 in 09ecd2e
this is the eval triggering the getter...
mh... I can't imagine how this could be fixed... besides maybe disabling the completer on nested object fields
would that be a valid tradeoff? maybe it could be done behind a flag? 🤔
geeksilva97 commentedon Jun 24, 2025
Can we close this issue, @dario-piotrowicz ?
dario-piotrowicz commentedon Jun 24, 2025
Hey @geeksilva97 🙂
In #57909 we decided that there's still some work to do around REPL tab completion (see: #57909 (comment)).
So that's why my PR didn't close this issue.
I'm planning to improve the REPL tab completion check more (after #58775) before closing this if that works for you, or if you prefer (since the specific bug your issue referred to has been fixed) we can close this issue and I can open a new one for the extra work, whatever you prefer 🙂
geeksilva97 commentedon Jun 24, 2025
Nah, we're good. Let's leave it open until it is finished. Thank you.
BridgeAR commentedon Sep 11, 2025
This got fully resolved by now. Closing as fixed