ReferenceError using class
sgodwin424 opened this issue · 2 comments
sgodwin424 commented
The following code example:
class Test {
fn() {
let var1 = 'test';
this.fn2((value) => {
var1 = value;
});
}
fn2(callback) {
callback('value');
}
}
new Test().fn();
produces the following error when it is ran with this plugin:
C:\Users\Scott\documents\github\test\foo.js:8
var1 = value;
^
ReferenceError: var1 is not defined
at _ref3 (foo.js:6:13)
at Test._ref2 (foo.js:11:9)
at Test._ref (foo.js:5:14)
at Object.<anonymous> (foo.js:15:12)
at Module._compile (module.js:425:26)
at loader (C:\Users\Scott\documents\github\test\node_modules\babel-register\lib\node.js:128:5)
at Object.require.extensions.(anonymous function) [as .js] (C:\Users\Scott\documents\github\test\node_modules\babel-register\lib\node.js:138:7)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:313:12)
at Module.require (module.js:366:17)
The exact same error happens when using a promise instead of a callback and when a regular function is used instead of an arrow function.
Gvozd commented
@sgodwin424 , please check with new version