Skip to content

Fixed possible variable name collision in helpers.js#236

Open
TheRedBlueCube3 wants to merge 1 commit intosystem2k:masterfrom
TheRedBlueCube3:master
Open

Fixed possible variable name collision in helpers.js#236
TheRedBlueCube3 wants to merge 1 commit intosystem2k:masterfrom
TheRedBlueCube3:master

Conversation

@TheRedBlueCube3
Copy link

The makeEnum function declares another "enums" variable which is a bad idea for code. I renamed it to enumInProgress because the name fits and doesn't collide.
Snippet where bug originally was:

// helpers.js
// line 1
var enums = {};
function makeEnum(vars) {
	var enums = {}; // bug here and every other instance of enums in this function
	for(var i = 0; i < vars.length; i++) {
		enums[vars[i]] = i;
	}
	return enums;
}

@TheRedBlueCube3
Copy link
Author

Update: It's not a bug, it's more of a code understanding issue. IDEs may still go wrong though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant