View Issue Details

IDProjectCategoryView StatusLast Update
0029872RunnerFunctionsPublic2019-01-30 16:20
ReporterSam CummingAssigned ToRussell Kay 
PriorityLowSeverityC - GeneralReproducibility100%
Status ClosedResolutionFixed 
Product Version2.1.5 
Target Version2.2.2Fixed in Version2.2.2 
Summary0029872: Functions: 'variable_instance_exists' fails to find variable declared as 'arguments'
DescriptionIf you declare an instance variable called 'arguments', then try to use the 'variable_instance_exists' to find out if 'arguments' exists as a variable, the function returns false when it should return true.

At present I believe that because arguments is a system word, the function may be getting confused. Targeting other instance variables with the function returns true if they exist and false if they don't.

Expected: 'variable_instance_exists(id, "arguments")' returns true when 'arguments' is declared.
Steps To Reproduce1. Open the attached project.
2. Open object0.
3. Observe that 'arguments' is declared, and 'variable_instance_exists' is targeting it.
4. Run.
5. Observe that 'arguments' is not found.
TagsNo tags attached.
1.4 Found In2.1.5.322
2.x Runtime Found In2.1.5.246
2.x Runtime Verified In2.2.2.302

Activities

Sam Cumming

2018-08-07 11:38

Developer  

arguments_test.yyz (12,479 bytes)

Gavin

2018-08-08 09:47

Manager   ~0061092

try "argument"

Sam Cumming

2018-08-08 10:02

Developer   ~0061097

Trying "argument" returns:

illegal access of argument, argument is not provided to script
 at gml_Object_object0_Create_0 (line 5) - var arguments_exists = variable_instance_exists(id, "argument");

Russell Kay

2018-09-13 12:02

Manager   ~0061576

This is really documentation issue as argument and arguments are handled in a special way (one is for Javascript and one for GML) they are special arrays that handle the arguments to a script... this should be noted in the documentation

Russell Kay

2018-09-13 12:13

Manager   ~0061578

Actually talking to Alex the variable names are not checked against the instance built in names or the global built in names as they are all reserved already

Alexander Borup

2018-09-21 14:59

Developer   ~0061595

Assigning reachable instance variables, built-in instance variables and global variables is allowed (scope is reachable). Making it so it blocks read-only variables and everything else.

Russell Kay

2018-12-19 17:18

Manager   ~0062309

Fixed in gitlab