Ok, found out what was missing. Two things:
- AHK script is case-insensitive.
- Since
class
is an object by itself in AHK it's possible to override the class by another object.
Here is a piece of the documentation:
Because the class is referenced via a variable, the class name cannot be used to both reference the class and create a separate variable (such as to hold an instance of the class) in the same context. For example, box := new Box
would replace the class object in Box with an instance of itself. [v1.1.27+]: #Warn ClassOverwrite
enables a warning to be shown at load time for each attempt to overwrite a class.
This explains what happened in the code above: variable name scenario
is effectively the same as a class name Scenario
, so I just quietly overrode my class with an empty object.
Also, since the new instance of the class is created before assignment, I got two 'NEW' in a row, only than 'DELETE'.