cppalliance / mrdocs

MrDocs: A Clang/LLVM tool for building reference documentation from C++ code and javadoc comments.
https://mrdocs.com
Other
66 stars 16 forks source link

feat: complete JavaScript helpers support #503

Closed alandefreitas closed 7 months ago

alandefreitas commented 7 months ago

This commit uses proxy objects to offer complete support for JavaScript helpers that return reference types. Previously, JavaScript reference types returned by these functions were deep-copied or not handled at all. Now, proxy objects in both directions are used while helpers create a scope that's kept alive as long as necessary by the Handlebars engine.

As the objects don't need to be deep copied, this change improves performance and allows objects with circular references, which are common in MrDocs. Additionally, JavaScript helpers receive a proxy object equivalent to the handlebars options object, and helper function registration was also simplified and improved to remove redundant code.

This commit provides new test cases to validate the current code without counting on MrDocs.