Avoid global variable leak in script files
Merge pull request #9955 from tricknotes/avoid-global

Avoid global variable leak in script files