core icon indicating copy to clipboard operation
core copied to clipboard

Testing claude for reviewing NodeJS Class/Object support: #343

Open josead opened this issue 2 months ago • 0 comments

Implement class and object interfaces for the Node.js loader:

  • Add struct definitions for loader_impl_node_class and loader_impl_node_object
  • Implement class interface callbacks (create, constructor, static_get, static_set, static_invoke, static_await, destroy)
  • Implement object interface callbacks (create, get, set, method_invoke, method_await, destructor, destroy)
  • Update value conversion functions for TYPE_CLASS and TYPE_OBJECT
  • Add class discovery in bootstrap.js using espree AST parsing:
    • node_loader_trampoline_is_class() for ES6 class detection
    • node_loader_trampoline_discover_klass() for class metadata extraction
    • Support for static/instance methods and attributes
    • Constructor signature detection
  • Update discover function to handle classes alongside functions

This implementation follows the pattern established by py_loader and rb_loader for class/object support.

Description

Please include a summary of the change and which issue is fixed. List any dependencies that are required for this change.

Fixes #(issue_no)

Type of change

  • [ ] Bug fix (non-breaking change which fixes an issue)
  • [ ] New feature (non-breaking change which adds functionality)
  • [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • [ ] This change requires a documentation update
  • [ ] Documentation update

Checklist:

  • [ ] I have performed a self-review of my own code.
  • [ ] I have commented my code, particularly in hard-to-understand areas.
  • [ ] I have made corresponding changes to the documentation.
  • [ ] My changes generate no new warnings.
  • [ ] I have added tests/screenshots (if any) that prove my fix is effective or that my feature works.
  • [ ] I have tested the tests implicated (if any) by my own code and they pass (make test or ctest -VV -R <test-name>).
  • [ ] If my change is significant or breaking, I have passed all tests with ./docker-compose.sh test &> output and attached the output.
  • [ ] I have tested my code with OPTION_BUILD_ADDRESS_SANITIZER or ./docker-compose.sh test-address-sanitizer &> output and OPTION_TEST_MEMORYCHECK.
  • [ ] I have tested my code with OPTION_BUILD_THREAD_SANITIZER or ./docker-compose.sh test-thread-sanitizer &> output.
  • [ ] I have tested with Helgrind in case my code works with threading.
  • [ ] I have run make clang-format in order to format my code and my code follows the style guidelines.

If you are unclear about any of the above checks, have a look at our documentation here.

josead avatar Dec 09 '25 15:12 josead