• Advertisement
Sign in to follow this  

Deprecation warning for application-registered entities

This topic is 674 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

We've been using AngelScript for quite some time and had to deprecate some global variables and functions over the years. We try to keep backward compatibility, so they are still supported, but may not play nicely with newer features. However, our users who don't check our documentation for updates are often unaware of deprecation and use those entities anyway, commonly leading to bugs that they have trouble finding. Is there a way we could detect usage of such deprecated entities in a module and issue a compile-time warning?

Share this post


Link to post
Share on other sites
Advertisement

My first idea would be to check the reference count of such objects and print a warning if they exceed 1 (I'm assuming that one reference is reserved for the engine).

Share this post


Link to post
Share on other sites

Hmm, I can't think of an easy way for this. You could use the JIT compiler interface and go through the bytecode to see if any of the deprecated entitites are being accessed, but it would probably be much easier to modify the library to print a warning while compiling the code if the deprecated entity is accessed. 

 

I'll add this to my to-do list as this sounds like the kind of feature that the core library would have to have. 

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement