code
code copied to clipboard
Accessing data variable in class wrongly. Use _data instead of data
In class CodeTool:
Current Behaviour: In getters and setters functions we use this._data. Whereas in other parts like onPaste function, constructor, drawView , we are using this.data to access the data variable.
Proposed Fix: Change this.data to this._data everywhere.
Why is this needed? If we dont do this then when migrating to typescript we get a naming conflict error. As data() getter and data variable are of same name.