Refactoring representation of variable type.

This commit is contained in:
Karishma Chadha 2017-11-13 16:29:38 -05:00
parent 1d4acde7dc
commit 26d4a3a069
2 changed files with 22 additions and 4 deletions

View file

@ -124,7 +124,7 @@ class Target extends EventEmitter {
const list = this.lookupVariableById(id);
if (list) return list;
// No variable with this name exists - create it locally.
const newList = new Variable(id, name, 'list', false);
const newList = new Variable(id, name, Variable.LIST_TYPE, false);
this.variables[id] = newList;
return newList;
}
@ -134,7 +134,7 @@ class Target extends EventEmitter {
* dictionary of variables.
* @param {string} id Id of variable
* @param {string} name Name of variable.
* @param {string} type Type of variable, one of string, number, list
* @param {string} type Type of variable, '' or 'list'
*/
createVariable (id, name, type) {
if (!this.variables.hasOwnProperty(id)) {