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?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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?
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.