Open jkeath opened 8 years ago
I did notice if I change the code in ES6 for the prototype from this
ES6 Code
MyClass.prototype.toJSON = () => {
let self = this;
}
To this
Compiled Code
MyClass.prototype.toJSON = function() {
let self = this;
}
It correctly leaves keyword "this" as keyword "this".
Installed product versions
Description
When adding a prototype function to a class, if the prototype function has keyword "this" in it, it compiles to be "undefined". Example.
ES6 code
Compiled Code
Steps to recreate
add the noted code above to a file and compile it.
Current behavior
It is incorrectly changing the keyword "this" to "undefined". This is obviously wrong and makes the code not do what is expected.
Expected behavior
It should result in the keyword "this" still be the keyword "this" after compile.