delay this assignment when referencing this inside an arrow function pre-bare super in derived class constructors - fixes #1920
This commit is contained in:
@@ -0,0 +1,7 @@
|
||||
class Foo extends Bar {
|
||||
constructor() {
|
||||
super(() => {
|
||||
this.test;
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
"use strict";
|
||||
|
||||
var Foo = (function (_Bar) {
|
||||
function Foo() {
|
||||
babelHelpers.classCallCheck(this, Foo);
|
||||
|
||||
babelHelpers.get(Object.getPrototypeOf(Foo.prototype), "constructor", this).call(this, function () {
|
||||
_this.test;
|
||||
});
|
||||
|
||||
var _this = this;
|
||||
}
|
||||
|
||||
babelHelpers.inherits(Foo, _Bar);
|
||||
return Foo;
|
||||
})(Bar);
|
||||
Reference in New Issue
Block a user