I have tried this
Code:
if ($test == null) {
console.log("new");
var $test = new TextCache();
}but everytime I activate the event it shows "new" which means $test is null before it runs
but if I put this line in a plugin
Code:
var $test = null;and edit the script call from
Code:
intovar $test = new TextCache();Code:
everything works fine, it showed the "new" message only once.$test = new TextCache();I also tried putting the var $test = null; in a different event (of course removing the line from the plugin), and it also didnt work. I activated that event first before the main one but it resulted to also showing "new" everytime I activate the main event.
So it made me think that we cannot define a new global variable via the script call command. Is that the case?