code icon indicating copy to clipboard operation
code copied to clipboard

Accessing data variable in class wrongly. Use _data instead of data

Open Prakhar-FF13 opened this issue 1 year ago • 0 comments

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.

Prakhar-FF13 avatar Jan 15 '24 08:01 Prakhar-FF13