Menu

Bug in sys.isVariableDefined()

2010-12-23
2012-09-04
  • Lord Samael

    Lord Samael - 2010-12-23

    Unless I'm missing something, the sys.isVariableDefined() scripting function
    is not using the right context to check if the variable is defined. It seems
    to always check in the scraper's base context, so if it's called from within a
    function it will not give the expected result.

    A quick fix I did was to replace the body of
    SystemUtilities.isVariableDefined() method with simply "return getVar(varName)
    != null;", since the getVar() method does get the variable from the correct
    context. Would there be any unwanted side-effects to this correction?

     
  • Alex Wajda

    Alex Wajda - 2010-12-25

    True. It's a well known issue in WH ver 2 beta 1.

    The variable handling has been rewritten and significantly improved in the
    upcoming version which introduces the dynamic variable scope, adds a few new
    tags (def, set, get, value-of) and deprecates some older ones (var, var-def).

    Please check the trunk.

     

Log in to post a comment.