Noah Lemen 4fdd75695b Update Class Fields to Stage 3 and change default behavior (#6076)
* add transform-class-properties to stage 3, set spec mode to default

* update readme with examples; use `buildUndefinedNode()`; change behavior to always define both static and nonstatic class properties regardless of spec/loose mode; update tests
2017-08-10 11:19:49 -04: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);
};
})()
});
}
}