Jump to content
  • Advertisement
Sign in to follow this  
_Vicious_

Accessing global property from within script namespace

This topic is 2297 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

Hi Andreas,

I'm having trouble getting my script to work. Whenever I try to access application-registered global property from within namespace'd method, the script fails to compile with error "'property' is not declared".
Please note that the property in question was registered without prior setDefaultNamespace call, basically it resides in global namespace. Prefixing property references with '::' doesn't work (the error message changes to "'::property' is not declared"). Edited by Andreas Jonsson

Share this post


Link to post
Share on other sites
Advertisement
Looks like a bug that slipped in when implementing the support for namespaces.

I'll investigate it.

Share this post


Link to post
Share on other sites
I've fixed this bug in revision 1295.

Observe that the compiler does not yet do a recursive search in parent namespaces, so you need to explicitly name the global scope with :: in order to access the global property from the function in the namespace.

Regards,
Andreas

Share this post


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

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!