Add 'configurable' property to class fields (#6123)

This commit is contained in:
Anup
2017-08-16 19:42:38 +05:30
committed by Henry Zhu
parent 70ab2e0620
commit 6ab3b4c0e3
19 changed files with 27 additions and 1 deletions

View File

@@ -2,11 +2,13 @@ class C {
// Output should not use `_initialiseProps`
constructor(T) {
Object.defineProperty(this, "x", {
configurable: true,
enumerable: true,
writable: true,
value: void 0
});
Object.defineProperty(this, "y", {
configurable: true,
enumerable: true,
writable: true,
value: 0

View File

@@ -10,6 +10,7 @@ var Foo = function Foo() {
var _initialiseProps = function () {
Object.defineProperty(this, "bar", {
configurable: true,
enumerable: true,
writable: true,
value: foo

View File

@@ -6,6 +6,7 @@ var Foo = function (_Bar) {
babelHelpers.classCallCheck(this, Foo);
return babelHelpers.possibleConstructorReturn(_this, (_temp = _this = babelHelpers.possibleConstructorReturn(this, (Foo.__proto__ || Object.getPrototypeOf(Foo)).call(this, ...args)), Object.defineProperty(_this, "bar", {
configurable: true,
enumerable: true,
writable: true,
value: "foo"

View File

@@ -9,6 +9,7 @@ var Child = function (_Parent) {
babelHelpers.classCallCheck(this, Child);
_this = babelHelpers.possibleConstructorReturn(this, (Child.__proto__ || Object.getPrototypeOf(Child)).call(this));
Object.defineProperty(_this, "scopedFunctionWithThis", {
configurable: true,
enumerable: true,
writable: true,
value: function value() {

View File

@@ -1,6 +1,7 @@
var Foo = function Foo() {
babelHelpers.classCallCheck(this, Foo);
Object.defineProperty(this, "bar", {
configurable: true,
enumerable: true,
writable: true,
value: void 0

View File

@@ -1,6 +1,7 @@
var Foo = function Foo() {
babelHelpers.classCallCheck(this, Foo);
Object.defineProperty(this, "bar", {
configurable: true,
enumerable: true,
writable: true,
value: "foo"

View File

@@ -14,6 +14,7 @@ export default (param => {
}]);
return App;
}(), Object.defineProperty(_class, "props", {
configurable: true,
enumerable: true,
writable: true,
value: {

View File

@@ -3,6 +3,7 @@ var _class, _temp;
call((_temp = _class = function _class() {
babelHelpers.classCallCheck(this, _class);
}, Object.defineProperty(_class, "test", {
configurable: true,
enumerable: true,
writable: true,
value: true
@@ -13,6 +14,7 @@ var _class2 = function _class2() {
};
Object.defineProperty(_class2, "test", {
configurable: true,
enumerable: true,
writable: true,
value: true

View File

@@ -11,6 +11,7 @@ function withContext(ComposedComponent) {
return WithContext;
}(Component), Object.defineProperty(_class, "propTypes", {
configurable: true,
enumerable: true,
writable: true,
value: {

View File

@@ -3,6 +3,7 @@ class MyClass {
var _this = this;
Object.defineProperty(this, "myAsyncMethod", {
configurable: true,
enumerable: true,
writable: true,
value: (() => {
@@ -24,6 +25,7 @@ class MyClass {
var _this2 = this;
Object.defineProperty(this, "myAsyncMethod", {
configurable: true,
enumerable: true,
writable: true,
value: (() => {
@@ -45,6 +47,7 @@ export default class MyClass3 {
var _this3 = this;
Object.defineProperty(this, "myAsyncMethod", {
configurable: true,
enumerable: true,
writable: true,
value: (() => {

View File

@@ -2,6 +2,7 @@ export var MyClass = function MyClass() {
babelHelpers.classCallCheck(this, MyClass);
};
Object.defineProperty(MyClass, "property", {
configurable: true,
enumerable: true,
writable: true,
value: value
@@ -12,6 +13,7 @@ var MyClass2 = function MyClass2() {
};
Object.defineProperty(MyClass2, "property", {
configurable: true,
enumerable: true,
writable: true,
value: value

View File

@@ -3,6 +3,7 @@ var _class, _temp;
var Foo = (_temp = _class = function Foo() {
babelHelpers.classCallCheck(this, Foo);
}, Object.defineProperty(_class, "num", {
configurable: true,
enumerable: true,
writable: true,
value: 0

View File

@@ -3,6 +3,7 @@ var Foo = function Foo() {
};
Object.defineProperty(Foo, "bar", {
configurable: true,
enumerable: true,
writable: true,
value: void 0

View File

@@ -3,6 +3,7 @@ var Foo = function Foo() {
};
Object.defineProperty(Foo, "bar", {
configurable: true,
enumerable: true,
writable: true,
value: "foo"

View File

@@ -20,6 +20,7 @@ var B = function (_A) {
babelHelpers.classCallCheck(this, B);
return babelHelpers.possibleConstructorReturn(_this, (_temp = _this = babelHelpers.possibleConstructorReturn(this, (B.__proto__ || Object.getPrototypeOf(B)).call(this, ...args)), Object.defineProperty(_this, "foo", {
configurable: true,
enumerable: true,
writable: true,
value: babelHelpers.get(B.prototype.__proto__ || Object.getPrototypeOf(B.prototype), "foo", _this).call(_this)

View File

@@ -6,6 +6,7 @@ var Foo = function (_Bar) {
babelHelpers.classCallCheck(this, Foo);
foo((_temp = _this = babelHelpers.possibleConstructorReturn(this, (Foo.__proto__ || Object.getPrototypeOf(Foo)).call(this)), Object.defineProperty(_this, "bar", {
configurable: true,
enumerable: true,
writable: true,
value: "foo"

View File

@@ -7,6 +7,7 @@ var Foo = function (_Bar) {
babelHelpers.classCallCheck(this, Foo);
_this = babelHelpers.possibleConstructorReturn(this, (Foo.__proto__ || Object.getPrototypeOf(Foo)).call(this));
Object.defineProperty(_this, "bar", {
configurable: true,
enumerable: true,
writable: true,
value: "foo"