Moti Zilberman f8ddd80f96 Greater spec compliance for class properties (#4544)
* Desugar class properties to Object.defineProperty per spec
* Define uninitialized static class properties with value=undefined
* Make class-properties increased spec compliance opt-in (spec: true)
2016-11-15 16:35:51 -05:00

63 lines
1.2 KiB
JavaScript

class MyClass {
constructor() {
var _this = this;
Object.defineProperty(this, "myAsyncMethod", {
enumerable: true,
writable: true,
value: (() => {
var _ref = babelHelpers.asyncToGenerator(function* () {
console.log(_this);
});
return function value() {
return _ref.apply(this, arguments);
};
})()
});
}
}
(class MyClass2 {
constructor() {
var _this2 = this;
Object.defineProperty(this, "myAsyncMethod", {
enumerable: true,
writable: true,
value: (() => {
var _ref2 = babelHelpers.asyncToGenerator(function* () {
console.log(_this2);
});
return function value() {
return _ref2.apply(this, arguments);
};
})()
});
}
});
export default class MyClass3 {
constructor() {
var _this3 = this;
Object.defineProperty(this, "myAsyncMethod", {
enumerable: true,
writable: true,
value: (() => {
var _ref3 = babelHelpers.asyncToGenerator(function* () {
console.log(_this3);
});
return function value() {
return _ref3.apply(this, arguments);
};
})()
});
}
}