nodejs / help

:sparkles: Need help with Node.js? File an Issue here. :rocket:
1.48k stars 284 forks source link

add feature to node for printing property name while each lookups #4038

Closed jackfromeast closed 10 months ago

jackfromeast commented 1 year ago

Details

Hi,

I am trying to find every undefined property in my codebase. I thought it would be most straightforward to add a few lines in the get object property part in Node.js. After a day of hard work, I finally make a progress: I added the following code to the Runtime::GetObjectProperty function in ./deps/v8/src/runtime/runtime-object.cc.

if(result.ToHandleChecked()->IsUndefined(isolate)){
    printf("[!] Found undefined property: ");
    lookup_key.GetName()->NameShortPrint();
    printf("\n");
  }

However, it doesn't print the stuff I want. When I try it with a simple case, it outputs something shown below:

a = {
    "nohello": 1
}
console.log(a.hello);

Output by the revised Node.js

[!] Found undefined property: <kHandle>
[!] Found undefined property: <kHandle>
[!] Found undefined property: <kHandle>
[!] Found undefined property: /home/x/tmp/test.js 
[!] Found undefined property: MODULE
[!] Found undefined property: /home/x/tmp/test.js
undefined
[!] Found undefined property: beforeExit

Expected output

[!] Found undefined property: <a:hello>

Is there anyone who can help me to achieve this feature? Happy Thanksgiving:>

Node.js version

v20.0.0-pre

Example code

No response

Operating system

Linux version 5.15.49-linuxkit (root@buildkitsandbox) (gcc (Alpine 10.2.1_pre1) 10.2.1 20201203, GNU ld (GNU Binutils) 2.35.2)

Scope

code

Module and version

Not applicable.

bmuenzenmeyer commented 1 year ago

I don't think this repo is actively monitored by core team members or used to discuss node internals or feature development. Since what you are trying to do touches node's functionality, you might have more luck within https://github.com/nodejs/node/issues

the process for contribution there, IIRC, is that an issue would be opened first to discuss with maintainers whether or not this would be acceptable as a feature

github-actions[bot] commented 11 months ago

There has been no activity on this issue for 11 months. The help repository works best when sustained engagement moves conversation forward. The issue will be closed in 1 month. If you are still experiencing this issue on the latest supported versions of Node.js, please leave a comment.

github-actions[bot] commented 10 months ago

Closing after no activity on this issue for 12 months.