Proxy get handler is used when evaluating the proxyΒ #16483
Copy link
Copy link
Closed
Labels
replIssues and PRs related to the REPL subsystem.Issues and PRs related to the REPL subsystem.utilIssues and PRs related to the built-in util module.Issues and PRs related to the built-in util module.
Description
- Version: v8.7.0
The defined 'not ready' error is raised when evaluating the proxy. This error does not occur in chrome or firefox consoles.
const o1 = {
ready: false
};
setTimeout(() => {
o1.ready = true;
}, 1000000000);
const handler = {
get(target, propKey, receiver) {
if (target.ready == false) {
throw new Error('not ready');
} else {
return 'ready'
}
}
};
const proxy = new Proxy(o1, handler);
proxy; // raises 'not ready'
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
replIssues and PRs related to the REPL subsystem.Issues and PRs related to the REPL subsystem.utilIssues and PRs related to the built-in util module.Issues and PRs related to the built-in util module.
Activity
[-]Proxy getter raises on evaluation of proxy[/-][+]Proxy get handler is used when evaluating the proxy[/+]bnoordhuis commentedon Oct 25, 2017
I think missing from your description is that it happens in the REPL?
vsemozhetbyt commentedon Oct 25, 2017
There are some properties that are requested during REPL evaluation of an Object. You can filter them out:
repl: show proxies as Proxy objects
bnoordhuis commentedon Oct 25, 2017
#16485 - possible solution.
kuanee commentedon Oct 25, 2017
yup, encountered this in repl. Thanks alot!
repl: show proxies as Proxy objects