Name shadows another variable error

Monte Goulding monte at sweattechnologies.com
Thu Nov 14 05:14:01 EST 2013


Anyone waning to patch their IDE also needs this handler changed in the Template Editor behavior:

# Parameters
#   pObject : reference to the object to compile the script of. Must be one of the target objects.
# Description
#   Attempts to compile the specified script. Does not apply it to the target object, instead
#   creates a temporary object and attemps to set the script of that. If compilation is successful
#   stores a map of handler names to line numbers for later use.
# Returns
#   Empty if compilation suceeded, otherwise a list of errors.
command scriptCompile pObject
   lock screen
   lock messages
   
   local tOldPreserveVariables, tOldExplicitVariables
   put the preserveVariables into tOldPreserveVariables
   put the explicitVariables into tOldExplicitVariables
   set the preserveVariables to sePrefGet("preserveVariables")
   
   local tScript
   scriptGet pObject
   put the result into tScript
   
   local tResult
   set the script of button "revCompileObject" of me to tScript
   put the result into tResult
   
   if tResult is empty then
      # MERG-2013-11-14: Compile without explicitVariables to avoid variable shadow errors
      if not the explicitVariables then
         set the explicitVariables to sePrefGet("explicitVariables")
         if not the explicitVariables then
            set the script of button "revCompileObject" of me to tScript
            put the result into tResult
         end if
      end if
   end if
   
   if tResult is empty then
      put the revAvailableHandlers of button "revCompileObject" of me into sHandlerList
   end if
   
   set the preserveVariables to tOldPreserveVariables
   set the explicitVariables to tOldExplicitVariables
   
   # The script should be unset because it could cause issues with idle handlers
   set the script of button "revCompileObject" of me to empty
   
   unlock messages
   unlock screen
   
   return tResult
end scriptCompile

--
Monte Goulding

M E R Goulding - software development services
mergExt - There's an external for that!









More information about the use-livecode mailing list