WurstScript icon indicating copy to clipboard operation
WurstScript copied to clipboard

[Lua] Reflection natives are not implemented in lua backend

Open jlfarris91 opened this issue 3 years ago • 1 comments

image

image

image

jlfarris91 avatar Mar 22 '22 18:03 jlfarris91

After discussing with @peq and @Frotty it makes sense that instanceCount() and maxInstanceCount() would be challenging to implement in lua. Though, I suspect that maxTypeId and typeIdToTypeName implementations are reasonable.

I request that all of these functions are implemented with stub functions being implemented for instanceCount and maxInstanceCount that return 0.

I believe this would be more correct such that maps built using these standard library functions won't fail due to lack of implementation but, at least for the stub functions, would have "undefined" behavior as implied by the contract defined by the warning comment in the Reflection package.

jlfarris91 avatar Mar 22 '22 19:03 jlfarris91