[Feature Request] Filter properties on Proxy objects?
volundmush opened this issue · 1 comments
volundmush commented
When you expose a JavaScript object such as a class instance as a Lua object, it gets Proxied. This is good, I like it!
The only problem is that the resulting Lua Proxy does not respect private/protected/readonly sorts of TypeScript access types. Which, of course, it cannot, since JavaScript is unaware of those things.
That being the case, another approach is needed in order to protect methods and traits. Possibly a prefix mask like _ or h or something which Proxy could filter out when creating __index?
tims-bsquare commented
I think you'll be able to do this by prefixing fields with a #. https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes/Private_properties