Mark class prototype as read-only (#12115)

* initial code 2 fix the issue #2025

* Mark class prototype as read-only

* Update fixtures

* Fix failure

* Update Babel 8 fixtures

* Disable in loose mode

* Update fixtures

Co-authored-by: Nicolò Ribaudo <nicolo.ribaudo@gmail.com>
This commit is contained in:
wentout 2021-12-10 23:44:48 +03:00 committed by GitHub
parent 39080492f4
commit c59870c526
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
221 changed files with 490 additions and 458 deletions

View File

@ -14,6 +14,9 @@
function _createClass(Constructor, protoProps, staticProps) {
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
if (staticProps) _defineProperties(Constructor, staticProps);
Object.defineProperty(Constructor, "prototype", {
writable: false
});
return Constructor;
}

View File

@ -16,5 +16,5 @@ var Foo = /*#__PURE__*/function (_Bar) {
return _super.call(this, parentOptions);
}
return Foo;
return babelHelpers.createClass(Foo);
}(Bar);

View File

@ -223,6 +223,7 @@ helpers.createClass = helper("7.0.0-beta.0")`
export default function _createClass(Constructor, protoProps, staticProps) {
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
if (staticProps) _defineProperties(Constructor, staticProps);
Object.defineProperty(Constructor, "prototype", { writable: false });
return Constructor;
}
`;
@ -334,12 +335,15 @@ helpers.inherits = helper("7.0.0-beta.0")`
if (typeof superClass !== "function" && superClass !== null) {
throw new TypeError("Super expression must either be null or a function");
}
subClass.prototype = Object.create(superClass && superClass.prototype, {
constructor: {
value: subClass,
writable: true,
configurable: true
}
Object.defineProperty(subClass, "prototype", {
value: Object.create(superClass && superClass.prototype, {
constructor: {
value: subClass,
writable: true,
configurable: true
}
}),
writable: false,
});
if (superClass) setPrototypeOf(subClass, superClass);
}

View File

@ -18,5 +18,5 @@ var Child = /*#__PURE__*/function (_Parent) {
return _this;
}
return Child;
return babelHelpers.createClass(Child);
}(Parent);

View File

@ -5,14 +5,14 @@ function dec() {} // Create a local function binding so babel has to change the
function _defineProperty() {}
let A = (_class = function A() {
let A = (_class = /*#__PURE__*/babelHelpers.createClass(function A() {
"use strict";
babelHelpers.classCallCheck(this, A);
babelHelpers.initializerDefineProperty(this, "a", _descriptor, this);
babelHelpers.initializerDefineProperty(this, "b", _descriptor2, this);
babelHelpers.defineProperty(this, "c", 456);
}, (_descriptor = babelHelpers.applyDecoratedDescriptor(_class.prototype, "a", [dec], {
}), (_descriptor = babelHelpers.applyDecoratedDescriptor(_class.prototype, "a", [dec], {
configurable: true,
enumerable: true,
writable: true,

View File

@ -2,14 +2,14 @@ var _class, _descriptor, _descriptor2;
function dec() {}
let A = (_class = function A() {
let A = (_class = /*#__PURE__*/babelHelpers.createClass(function A() {
"use strict";
babelHelpers.classCallCheck(this, A);
babelHelpers.initializerDefineProperty(this, "a", _descriptor, this);
babelHelpers.initializerDefineProperty(this, "b", _descriptor2, this);
this.c = 456;
}, (_descriptor = babelHelpers.applyDecoratedDescriptor(_class.prototype, "a", [dec], {
}), (_descriptor = babelHelpers.applyDecoratedDescriptor(_class.prototype, "a", [dec], {
configurable: true,
enumerable: true,
writable: true,

View File

@ -2,14 +2,14 @@ var _class, _descriptor, _descriptor2;
function dec() {}
let A = (_class = function A() {
let A = (_class = /*#__PURE__*/babelHelpers.createClass(function A() {
"use strict";
babelHelpers.classCallCheck(this, A);
babelHelpers.initializerDefineProperty(this, "a", _descriptor, this);
babelHelpers.initializerDefineProperty(this, "b", _descriptor2, this);
babelHelpers.defineProperty(this, "c", 456);
}, (_descriptor = babelHelpers.applyDecoratedDescriptor(_class.prototype, "a", [dec], {
}), (_descriptor = babelHelpers.applyDecoratedDescriptor(_class.prototype, "a", [dec], {
configurable: true,
enumerable: true,
writable: true,

View File

@ -1,6 +1,6 @@
"use strict";
let Hello = function Hello() {
let Hello = /*#__PURE__*/babelHelpers.createClass(function Hello() {
babelHelpers.classCallCheck(this, Hello);
return {
toString() {
@ -8,7 +8,7 @@ let Hello = function Hello() {
}
};
};
});
let Outer = /*#__PURE__*/function (_Hello) {
babelHelpers.inherits(Outer, _Hello);
@ -22,16 +22,14 @@ let Outer = /*#__PURE__*/function (_Hello) {
babelHelpers.classCallCheck(this, Outer);
_this2 = _this = _super.call(this);
let Inner = function Inner() {
let Inner = /*#__PURE__*/babelHelpers.createClass(function Inner() {
babelHelpers.classCallCheck(this, Inner);
babelHelpers.defineProperty(this, _this2, "hello");
};
});
return babelHelpers.possibleConstructorReturn(_this, new Inner());
}
return Outer;
return babelHelpers.createClass(Outer);
}(Hello);
expect(new Outer().hello).toBe('hello');

View File

@ -27,16 +27,14 @@ let Outer = /*#__PURE__*/function (_Hello) {
babelHelpers.classCallCheck(this, Outer);
_this = _super.call(this);
_babelHelpers$get$cal = babelHelpers.get((_thisSuper = babelHelpers.assertThisInitialized(_this), babelHelpers.getPrototypeOf(Outer.prototype)), "toString", _thisSuper).call(_thisSuper);
let Inner = function Inner() {
let Inner = /*#__PURE__*/babelHelpers.createClass(function Inner() {
babelHelpers.classCallCheck(this, Inner);
babelHelpers.defineProperty(this, _babelHelpers$get$cal, 'hello');
};
});
return babelHelpers.possibleConstructorReturn(_this, new Inner());
}
return Outer;
return babelHelpers.createClass(Outer);
}(Hello);
expect(new Outer().hello).toBe('hello');

View File

@ -2,7 +2,7 @@ var foo = "bar";
var _bar = /*#__PURE__*/babelHelpers.classPrivateFieldLooseKey("bar");
var Foo = function Foo() {
var Foo = /*#__PURE__*/babelHelpers.createClass(function Foo() {
"use strict";
babelHelpers.classCallCheck(this, Foo);
@ -11,4 +11,4 @@ var Foo = function Foo() {
value: foo
});
var _foo = "foo";
};
});

View File

@ -1,6 +1,6 @@
var _x = /*#__PURE__*/babelHelpers.classPrivateFieldLooseKey("x");
var C = function C() {
var C = /*#__PURE__*/babelHelpers.createClass(function C() {
"use strict";
babelHelpers.classCallCheck(this, C);
@ -9,8 +9,7 @@ var C = function C() {
writable: true,
value: void 0
});
};
});
expect(() => {
new C();
}).toThrow();

View File

@ -29,5 +29,5 @@ var Foo = /*#__PURE__*/function (_Bar) {
return babelHelpers.possibleConstructorReturn(_this);
}
return Foo;
return babelHelpers.createClass(Foo);
}(Bar);

View File

@ -1,6 +1,6 @@
var _prop = /*#__PURE__*/babelHelpers.classPrivateFieldLooseKey("prop");
var Foo = function Foo() {
var Foo = /*#__PURE__*/babelHelpers.createClass(function Foo() {
"use strict";
babelHelpers.classCallCheck(this, Foo);
@ -8,7 +8,7 @@ var Foo = function Foo() {
writable: true,
value: "foo"
});
};
});
var _prop2 = /*#__PURE__*/babelHelpers.classPrivateFieldLooseKey("prop");
@ -31,5 +31,5 @@ var Bar = /*#__PURE__*/function (_Foo) {
return _this;
}
return Bar;
return babelHelpers.createClass(Bar);
}(Foo);

View File

@ -1,6 +1,6 @@
var _client = /*#__PURE__*/babelHelpers.classPrivateFieldLooseKey("client");
var Foo = function Foo(props) {
var Foo = /*#__PURE__*/babelHelpers.createClass(function Foo(props) {
"use strict";
babelHelpers.classCallCheck(this, Foo);
@ -10,4 +10,4 @@ var Foo = function Foo(props) {
});
babelHelpers.classPrivateFieldLooseBase(this, _client)[_client] = 1;
[this.x = babelHelpers.classPrivateFieldLooseBase(this, _client)[_client], babelHelpers.classPrivateFieldLooseBase(this, _client)[_client], this.y = babelHelpers.classPrivateFieldLooseBase(this, _client)[_client]] = props;
};
});

View File

@ -1,6 +1,6 @@
var _client = /*#__PURE__*/babelHelpers.classPrivateFieldLooseKey("client");
var Foo = function Foo(props) {
var Foo = /*#__PURE__*/babelHelpers.createClass(function Foo(props) {
"use strict";
babelHelpers.classCallCheck(this, Foo);
@ -9,4 +9,4 @@ var Foo = function Foo(props) {
value: void 0
});
[x, ...babelHelpers.classPrivateFieldLooseBase(this, _client)[_client]] = props;
};
});

View File

@ -1,6 +1,6 @@
var _client = /*#__PURE__*/babelHelpers.classPrivateFieldLooseKey("client");
var Foo = function Foo(props) {
var Foo = /*#__PURE__*/babelHelpers.createClass(function Foo(props) {
"use strict";
babelHelpers.classCallCheck(this, Foo);
@ -9,4 +9,4 @@ var Foo = function Foo(props) {
value: void 0
});
[babelHelpers.classPrivateFieldLooseBase(this, _client)[_client] = 5] = props;
};
});

View File

@ -1,12 +1,11 @@
var _client = /*#__PURE__*/babelHelpers.classPrivateFieldLooseKey("client");
var Foo = function Foo(props) {
var Foo = /*#__PURE__*/babelHelpers.createClass(function Foo(props) {
"use strict";
babelHelpers.classCallCheck(this, Foo);
[babelHelpers.classPrivateFieldLooseBase(Foo, _client)[_client]] = props;
};
});
Object.defineProperty(Foo, _client, {
writable: true,
value: void 0

View File

@ -1,6 +1,6 @@
var _client = /*#__PURE__*/babelHelpers.classPrivateFieldLooseKey("client");
var Foo = function Foo(props) {
var Foo = /*#__PURE__*/babelHelpers.createClass(function Foo(props) {
"use strict";
babelHelpers.classCallCheck(this, Foo);
@ -9,4 +9,4 @@ var Foo = function Foo(props) {
value: void 0
});
[babelHelpers.classPrivateFieldLooseBase(this, _client)[_client]] = props;
};
});

View File

@ -1,6 +1,6 @@
var _client = /*#__PURE__*/babelHelpers.classPrivateFieldLooseKey("client");
var Foo = function Foo(props) {
var Foo = /*#__PURE__*/babelHelpers.createClass(function Foo(props) {
"use strict";
babelHelpers.classCallCheck(this, Foo);
@ -14,4 +14,4 @@ var Foo = function Foo(props) {
y: babelHelpers.classPrivateFieldLooseBase(this, _client)[_client],
z: this.z = babelHelpers.classPrivateFieldLooseBase(this, _client)[_client]
} = props);
};
});

View File

@ -1,6 +1,6 @@
var _client = /*#__PURE__*/babelHelpers.classPrivateFieldLooseKey("client");
var Foo = function Foo(props) {
var Foo = /*#__PURE__*/babelHelpers.createClass(function Foo(props) {
"use strict";
babelHelpers.classCallCheck(this, Foo);
@ -12,4 +12,4 @@ var Foo = function Foo(props) {
x,
...babelHelpers.classPrivateFieldLooseBase(this, _client)[_client]
} = props);
};
});

View File

@ -1,6 +1,6 @@
var _client = /*#__PURE__*/babelHelpers.classPrivateFieldLooseKey("client");
var Foo = function Foo(props) {
var Foo = /*#__PURE__*/babelHelpers.createClass(function Foo(props) {
"use strict";
babelHelpers.classCallCheck(this, Foo);
@ -11,4 +11,4 @@ var Foo = function Foo(props) {
({
client: babelHelpers.classPrivateFieldLooseBase(this, _client)[_client] = 5
} = props);
};
});

View File

@ -1,14 +1,13 @@
var _client = /*#__PURE__*/babelHelpers.classPrivateFieldLooseKey("client");
var Foo = function Foo(props) {
var Foo = /*#__PURE__*/babelHelpers.createClass(function Foo(props) {
"use strict";
babelHelpers.classCallCheck(this, Foo);
({
client: babelHelpers.classPrivateFieldLooseBase(Foo, _client)[_client]
} = props);
};
});
Object.defineProperty(Foo, _client, {
writable: true,
value: void 0

View File

@ -1,6 +1,6 @@
var _client = /*#__PURE__*/babelHelpers.classPrivateFieldLooseKey("client");
var Foo = function Foo(props) {
var Foo = /*#__PURE__*/babelHelpers.createClass(function Foo(props) {
"use strict";
babelHelpers.classCallCheck(this, Foo);
@ -11,4 +11,4 @@ var Foo = function Foo(props) {
({
client: babelHelpers.classPrivateFieldLooseBase(this, _client)[_client]
} = props);
};
});

View File

@ -4,7 +4,7 @@ var _bar = /*#__PURE__*/babelHelpers.classPrivateFieldLooseKey("bar");
var _baz = /*#__PURE__*/babelHelpers.classPrivateFieldLooseKey("baz");
var Foo = function Foo(_foo) {
var Foo = /*#__PURE__*/babelHelpers.createClass(function Foo(_foo) {
"use strict";
babelHelpers.classCallCheck(this, Foo);
@ -16,4 +16,4 @@ var Foo = function Foo(_foo) {
writable: true,
value: foo
});
};
});

View File

@ -21,5 +21,5 @@ let Child = /*#__PURE__*/function (_Parent) {
return _this;
}
return Child;
return babelHelpers.createClass(Child);
}(Parent);

View File

@ -1,6 +1,6 @@
var _bar = /*#__PURE__*/babelHelpers.classPrivateFieldLooseKey("bar");
var Foo = function Foo() {
var Foo = /*#__PURE__*/babelHelpers.createClass(function Foo() {
"use strict";
babelHelpers.classCallCheck(this, Foo);
@ -8,4 +8,4 @@ var Foo = function Foo() {
writable: true,
value: void 0
});
};
});

View File

@ -1,6 +1,6 @@
var _bar = /*#__PURE__*/babelHelpers.classPrivateFieldLooseKey("bar");
var Foo = function Foo() {
var Foo = /*#__PURE__*/babelHelpers.createClass(function Foo() {
"use strict";
babelHelpers.classCallCheck(this, Foo);
@ -8,4 +8,4 @@ var Foo = function Foo() {
writable: true,
value: "foo"
});
};
});

View File

@ -2,7 +2,7 @@ var _x = /*#__PURE__*/babelHelpers.classPrivateFieldLooseKey("x");
var _y = /*#__PURE__*/babelHelpers.classPrivateFieldLooseKey("y");
var Foo = function Foo() {
var Foo = /*#__PURE__*/babelHelpers.createClass(function Foo() {
"use strict";
babelHelpers.classCallCheck(this, Foo);
@ -14,4 +14,4 @@ var Foo = function Foo() {
writable: true,
value: babelHelpers.classPrivateFieldLooseBase(this, _x)[_x]
});
};
});

View File

@ -37,7 +37,7 @@ var Foo = /*#__PURE__*/function () {
return _this;
}
return Nested;
return babelHelpers.createClass(Nested);
}((_foo3 = /*#__PURE__*/babelHelpers.classPrivateFieldLooseKey("foo"), _babelHelpers$classPr = babelHelpers.classPrivateFieldLooseBase(this, _foo3)[_foo3], /*#__PURE__*/function () {
function _class2() {
babelHelpers.classCallCheck(this, _class2);
@ -48,7 +48,7 @@ var Foo = /*#__PURE__*/function () {
this[_babelHelpers$classPr] = 2;
}
return _class2;
return babelHelpers.createClass(_class2);
}()));
}
}]);

View File

@ -35,14 +35,14 @@ var Foo = /*#__PURE__*/function () {
return _this;
}
return Nested;
return babelHelpers.createClass(Nested);
}((_babelHelpers$classPr = babelHelpers.classPrivateFieldLooseBase(this, _foo)[_foo], /*#__PURE__*/function () {
function _class2() {
babelHelpers.classCallCheck(this, _class2);
this[_babelHelpers$classPr] = 2;
}
return _class2;
return babelHelpers.createClass(_class2);
}()));
}
}]);

View File

@ -1,6 +1,6 @@
var _outer = /*#__PURE__*/babelHelpers.classPrivateFieldLooseKey("outer");
var Outer = function Outer() {
var Outer = /*#__PURE__*/babelHelpers.createClass(function Outer() {
"use strict";
babelHelpers.classCallCheck(this, Outer);
@ -19,6 +19,6 @@ var Outer = function Outer() {
return _super.apply(this, arguments);
}
return Test;
return babelHelpers.createClass(Test);
}(babelHelpers.classPrivateFieldLooseBase(this, _outer)[_outer]);
};
});

View File

@ -4,7 +4,7 @@ var _private = /*#__PURE__*/babelHelpers.classPrivateFieldLooseKey("private");
var _four = /*#__PURE__*/babelHelpers.classPrivateFieldLooseKey("four");
var Foo = function Foo() {
var Foo = /*#__PURE__*/babelHelpers.createClass(function Foo() {
"use strict";
babelHelpers.classCallCheck(this, Foo);
@ -22,4 +22,4 @@ var Foo = function Foo() {
writable: true,
value: babelHelpers.classPrivateFieldLooseBase(this, _private)[_private]
});
};
});

View File

@ -2,12 +2,11 @@ var _self = /*#__PURE__*/babelHelpers.classPrivateFieldLooseKey("self");
var _getA = /*#__PURE__*/babelHelpers.classPrivateFieldLooseKey("getA");
var A = function A() {
var A = /*#__PURE__*/babelHelpers.createClass(function A() {
"use strict";
babelHelpers.classCallCheck(this, A);
};
});
Object.defineProperty(A, _self, {
writable: true,
value: A

View File

@ -18,5 +18,5 @@ var Foo = /*#__PURE__*/function (_Bar) {
return _this;
}
return Foo;
return babelHelpers.createClass(Foo);
}(Bar);

View File

@ -19,5 +19,5 @@ var Foo = /*#__PURE__*/function (_Bar) {
return _this;
}
return Foo;
return babelHelpers.createClass(Foo);
}(Bar);

View File

@ -2,7 +2,7 @@ var foo = "bar";
var _bar = /*#__PURE__*/new WeakMap();
var Foo = function Foo() {
var Foo = /*#__PURE__*/babelHelpers.createClass(function Foo() {
"use strict";
babelHelpers.classCallCheck(this, Foo);
@ -11,4 +11,4 @@ var Foo = function Foo() {
value: foo
});
var _foo = "foo";
};
});

View File

@ -1,6 +1,6 @@
var _x = /*#__PURE__*/new WeakMap();
var C = function C() {
var C = /*#__PURE__*/babelHelpers.createClass(function C() {
"use strict";
babelHelpers.classCallCheck(this, C);
@ -9,8 +9,7 @@ var C = function C() {
writable: true,
value: void 0
});
};
});
expect(() => {
new C();
}).toThrow();

View File

@ -29,5 +29,5 @@ var Foo = /*#__PURE__*/function (_Bar) {
return babelHelpers.possibleConstructorReturn(_this);
}
return Foo;
return babelHelpers.createClass(Foo);
}(Bar);

View File

@ -1,6 +1,6 @@
var _prop = /*#__PURE__*/new WeakMap();
var Foo = function Foo() {
var Foo = /*#__PURE__*/babelHelpers.createClass(function Foo() {
"use strict";
babelHelpers.classCallCheck(this, Foo);
@ -8,7 +8,7 @@ var Foo = function Foo() {
writable: true,
value: "foo"
});
};
});
var _prop2 = /*#__PURE__*/new WeakMap();
@ -31,5 +31,5 @@ var Bar = /*#__PURE__*/function (_Foo) {
return _this;
}
return Bar;
return babelHelpers.createClass(Bar);
}(Foo);

View File

@ -1,6 +1,6 @@
var _client = /*#__PURE__*/new WeakMap();
var Foo = function Foo(props) {
var Foo = /*#__PURE__*/babelHelpers.createClass(function Foo(props) {
"use strict";
babelHelpers.classCallCheck(this, Foo);
@ -10,4 +10,4 @@ var Foo = function Foo(props) {
});
babelHelpers.classPrivateFieldSet(this, _client, 1);
[this.x = babelHelpers.classPrivateFieldGet(this, _client), babelHelpers.classPrivateFieldDestructureSet(this, _client).value, this.y = babelHelpers.classPrivateFieldGet(this, _client)] = props;
};
});

View File

@ -1,6 +1,6 @@
var _client = /*#__PURE__*/new WeakMap();
var Foo = function Foo(props) {
var Foo = /*#__PURE__*/babelHelpers.createClass(function Foo(props) {
"use strict";
babelHelpers.classCallCheck(this, Foo);
@ -9,4 +9,4 @@ var Foo = function Foo(props) {
value: void 0
});
[x, ...babelHelpers.classPrivateFieldDestructureSet(this, _client).value] = props;
};
});

View File

@ -1,6 +1,6 @@
var _client = /*#__PURE__*/new WeakMap();
var Foo = function Foo(props) {
var Foo = /*#__PURE__*/babelHelpers.createClass(function Foo(props) {
"use strict";
babelHelpers.classCallCheck(this, Foo);
@ -9,4 +9,4 @@ var Foo = function Foo(props) {
value: void 0
});
[babelHelpers.classPrivateFieldDestructureSet(this, _client).value = 5] = props;
};
});

View File

@ -1,10 +1,9 @@
var Foo = function Foo(props) {
var Foo = /*#__PURE__*/babelHelpers.createClass(function Foo(props) {
"use strict";
babelHelpers.classCallCheck(this, Foo);
[babelHelpers.classStaticPrivateFieldDestructureSet(Foo, Foo, _client).value] = props;
};
});
var _client = {
writable: true,
value: void 0

View File

@ -1,6 +1,6 @@
var _client = /*#__PURE__*/new WeakMap();
var Foo = function Foo(props) {
var Foo = /*#__PURE__*/babelHelpers.createClass(function Foo(props) {
"use strict";
babelHelpers.classCallCheck(this, Foo);
@ -9,4 +9,4 @@ var Foo = function Foo(props) {
value: void 0
});
[babelHelpers.classPrivateFieldDestructureSet(this, _client).value] = props;
};
});

View File

@ -1,6 +1,6 @@
var _client = /*#__PURE__*/new WeakMap();
var Foo = function Foo(props) {
var Foo = /*#__PURE__*/babelHelpers.createClass(function Foo(props) {
"use strict";
babelHelpers.classCallCheck(this, Foo);
@ -14,4 +14,4 @@ var Foo = function Foo(props) {
y: babelHelpers.classPrivateFieldDestructureSet(this, _client).value,
z: this.z = babelHelpers.classPrivateFieldGet(this, _client)
} = props);
};
});

View File

@ -1,6 +1,6 @@
var _client = /*#__PURE__*/new WeakMap();
var Foo = function Foo(props) {
var Foo = /*#__PURE__*/babelHelpers.createClass(function Foo(props) {
"use strict";
babelHelpers.classCallCheck(this, Foo);
@ -12,4 +12,4 @@ var Foo = function Foo(props) {
x,
...babelHelpers.classPrivateFieldDestructureSet(this, _client).value
} = props);
};
});

View File

@ -1,6 +1,6 @@
var _client = /*#__PURE__*/new WeakMap();
var Foo = function Foo(props) {
var Foo = /*#__PURE__*/babelHelpers.createClass(function Foo(props) {
"use strict";
babelHelpers.classCallCheck(this, Foo);
@ -11,4 +11,4 @@ var Foo = function Foo(props) {
({
x: babelHelpers.classPrivateFieldDestructureSet(this, _client).value = 5
} = props);
};
});

View File

@ -1,12 +1,11 @@
var Foo = function Foo(props) {
var Foo = /*#__PURE__*/babelHelpers.createClass(function Foo(props) {
"use strict";
babelHelpers.classCallCheck(this, Foo);
({
client: babelHelpers.classStaticPrivateFieldDestructureSet(Foo, Foo, _client).value
} = props);
};
});
var _client = {
writable: true,
value: void 0

View File

@ -1,6 +1,6 @@
var _client = /*#__PURE__*/new WeakMap();
var Foo = function Foo(props) {
var Foo = /*#__PURE__*/babelHelpers.createClass(function Foo(props) {
"use strict";
babelHelpers.classCallCheck(this, Foo);
@ -11,4 +11,4 @@ var Foo = function Foo(props) {
({
client: babelHelpers.classPrivateFieldDestructureSet(this, _client).value
} = props);
};
});

View File

@ -4,7 +4,7 @@ var _bar = /*#__PURE__*/new WeakMap();
var _baz = /*#__PURE__*/new WeakMap();
var Foo = function Foo(_foo) {
var Foo = /*#__PURE__*/babelHelpers.createClass(function Foo(_foo) {
"use strict";
babelHelpers.classCallCheck(this, Foo);
@ -16,4 +16,4 @@ var Foo = function Foo(_foo) {
writable: true,
value: foo
});
};
});

View File

@ -21,5 +21,5 @@ var Child = /*#__PURE__*/function (_Parent) {
return _this;
}
return Child;
return babelHelpers.createClass(Child);
}(Parent);

View File

@ -1,6 +1,6 @@
var _bar = /*#__PURE__*/new WeakMap();
var Foo = function Foo() {
var Foo = /*#__PURE__*/babelHelpers.createClass(function Foo() {
"use strict";
babelHelpers.classCallCheck(this, Foo);
@ -8,4 +8,4 @@ var Foo = function Foo() {
writable: true,
value: void 0
});
};
});

View File

@ -1,6 +1,6 @@
var _bar = /*#__PURE__*/new WeakMap();
var Foo = function Foo() {
var Foo = /*#__PURE__*/babelHelpers.createClass(function Foo() {
"use strict";
babelHelpers.classCallCheck(this, Foo);
@ -8,4 +8,4 @@ var Foo = function Foo() {
writable: true,
value: "foo"
});
};
});

View File

@ -2,7 +2,7 @@ var _x = /*#__PURE__*/new WeakMap();
var _y = /*#__PURE__*/new WeakMap();
var Foo = function Foo() {
var Foo = /*#__PURE__*/babelHelpers.createClass(function Foo() {
"use strict";
babelHelpers.classCallCheck(this, Foo);
@ -14,4 +14,4 @@ var Foo = function Foo() {
writable: true,
value: babelHelpers.classPrivateFieldGet(this, _x)
});
};
});

View File

@ -37,7 +37,7 @@ var Foo = /*#__PURE__*/function () {
return _this;
}
return Nested;
return babelHelpers.createClass(Nested);
}((_foo3 = /*#__PURE__*/new WeakMap(), _babelHelpers$classPr = babelHelpers.classPrivateFieldGet(this, _foo3), /*#__PURE__*/function () {
function _class2() {
babelHelpers.classCallCheck(this, _class2);
@ -48,7 +48,7 @@ var Foo = /*#__PURE__*/function () {
babelHelpers.defineProperty(this, _babelHelpers$classPr, 2);
}
return _class2;
return babelHelpers.createClass(_class2);
}()));
}
}]);

View File

@ -35,14 +35,14 @@ var Foo = /*#__PURE__*/function () {
return _this;
}
return Nested;
return babelHelpers.createClass(Nested);
}((_babelHelpers$classPr = babelHelpers.classPrivateFieldGet(this, _foo), /*#__PURE__*/function () {
function _class2() {
babelHelpers.classCallCheck(this, _class2);
babelHelpers.defineProperty(this, _babelHelpers$classPr, 2);
}
return _class2;
return babelHelpers.createClass(_class2);
}()));
}
}]);

View File

@ -1,6 +1,6 @@
var _outer = /*#__PURE__*/new WeakMap();
var Outer = function Outer() {
var Outer = /*#__PURE__*/babelHelpers.createClass(function Outer() {
"use strict";
babelHelpers.classCallCheck(this, Outer);
@ -19,6 +19,6 @@ var Outer = function Outer() {
return _super.apply(this, arguments);
}
return Test;
return babelHelpers.createClass(Test);
}(babelHelpers.classPrivateFieldGet(this, _outer));
};
});

View File

@ -4,7 +4,7 @@ var _private = /*#__PURE__*/new WeakMap();
var _four = /*#__PURE__*/new WeakMap();
var Foo = function Foo() {
var Foo = /*#__PURE__*/babelHelpers.createClass(function Foo() {
"use strict";
babelHelpers.classCallCheck(this, Foo);
@ -22,4 +22,4 @@ var Foo = function Foo() {
writable: true,
value: babelHelpers.classPrivateFieldGet(this, _private)
});
};
});

View File

@ -1,9 +1,8 @@
var A = function A() {
var A = /*#__PURE__*/babelHelpers.createClass(function A() {
"use strict";
babelHelpers.classCallCheck(this, A);
};
});
var _self = {
writable: true,
value: A

View File

@ -35,5 +35,5 @@ var B = /*#__PURE__*/function (_A) {
return _this;
}
return B;
return babelHelpers.createClass(B);
}(A);

View File

@ -18,5 +18,5 @@ var Foo = /*#__PURE__*/function (_Bar) {
return _this;
}
return Foo;
return babelHelpers.createClass(Foo);
}(Bar);

View File

@ -19,5 +19,5 @@ var Foo = /*#__PURE__*/function (_Bar) {
return _this;
}
return Foo;
return babelHelpers.createClass(Foo);
}(Bar);

View File

@ -1,12 +1,10 @@
var foo = "bar";
var Foo = function Foo() {
var Foo = /*#__PURE__*/babelHelpers.createClass(function Foo() {
"use strict";
babelHelpers.classCallCheck(this, Foo);
this.bar = foo;
var _foo = "foo";
var baz = "baz";
};
});
Foo.bar = baz;

View File

@ -14,5 +14,5 @@ var Foo = /*#__PURE__*/function (_Bar) {
return _this;
}
return Foo;
return babelHelpers.createClass(Foo);
}(Bar);

View File

@ -18,5 +18,5 @@ let Child = /*#__PURE__*/function (_Parent) {
return _this;
}
return Child;
return babelHelpers.createClass(Child);
}(Parent);

View File

@ -2,14 +2,12 @@ function test(x) {
var _x;
_x = x;
var F = function F() {
var F = /*#__PURE__*/babelHelpers.createClass(function F() {
"use strict";
babelHelpers.classCallCheck(this, F);
this[_x] = 1;
};
});
x = 'deadbeef';
expect(new F().foo).toBe(1);
x = 'wrong';

View File

@ -1,6 +1,6 @@
var Foo = function Foo() {
var Foo = /*#__PURE__*/babelHelpers.createClass(function Foo() {
"use strict";
babelHelpers.classCallCheck(this, Foo);
this.bar = void 0;
};
});

View File

@ -1,6 +1,6 @@
var Foo = function Foo() {
var Foo = /*#__PURE__*/babelHelpers.createClass(function Foo() {
"use strict";
babelHelpers.classCallCheck(this, Foo);
this.bar = "foo";
};
});

View File

@ -1,12 +1,12 @@
var _class, _temp;
call((_temp = _class = function _class() {
call((_temp = _class = /*#__PURE__*/babelHelpers.createClass(function _class() {
babelHelpers.classCallCheck(this, _class);
}, _class.test = true, _temp));
}), _class.test = true, _temp));
var _default = function _default() {
var _default = /*#__PURE__*/babelHelpers.createClass(function _default() {
babelHelpers.classCallCheck(this, _default);
};
});
_default.test = true;
export { _default as default };

View File

@ -13,7 +13,7 @@ function withContext(ComposedComponent) {
return _super.apply(this, arguments);
}
return WithContext;
return babelHelpers.createClass(WithContext);
}(Component), _class.propTypes = {
context: PropTypes.shape({
addCss: PropTypes.func,

View File

@ -1,11 +1,9 @@
export var MyClass = function MyClass() {
export var MyClass = /*#__PURE__*/babelHelpers.createClass(function MyClass() {
babelHelpers.classCallCheck(this, MyClass);
};
});
MyClass.property = value;
var MyClass2 = function MyClass2() {
var MyClass2 = /*#__PURE__*/babelHelpers.createClass(function MyClass2() {
babelHelpers.classCallCheck(this, MyClass2);
};
});
MyClass2.property = value;
export { MyClass2 as default };

View File

@ -1,7 +1,7 @@
var _class, _temp;
var Foo = (_temp = _class = function Foo() {
var Foo = (_temp = _class = /*#__PURE__*/babelHelpers.createClass(function Foo() {
"use strict";
babelHelpers.classCallCheck(this, Foo);
}, _class.num = 0, _temp);
}), _class.num = 0, _temp);

View File

@ -1,9 +1,8 @@
var A = function A() {
var A = /*#__PURE__*/babelHelpers.createClass(function A() {
"use strict";
babelHelpers.classCallCheck(this, A);
};
});
A.prop = 1;
var B = /*#__PURE__*/function (_A) {
@ -18,7 +17,7 @@ var B = /*#__PURE__*/function (_A) {
return _super.apply(this, arguments);
}
return B;
return babelHelpers.createClass(B);
}(A);
B.prop = 2;

View File

@ -1,9 +1,8 @@
var A = function A() {
var A = /*#__PURE__*/babelHelpers.createClass(function A() {
"use strict";
babelHelpers.classCallCheck(this, A);
};
});
A.self = A;
A.getA = () => A;

View File

@ -1,7 +1,6 @@
var Foo = function Foo() {
var Foo = /*#__PURE__*/babelHelpers.createClass(function Foo() {
"use strict";
babelHelpers.classCallCheck(this, Foo);
};
});
Foo.bar = void 0;

View File

@ -1,7 +1,6 @@
var Foo = function Foo() {
var Foo = /*#__PURE__*/babelHelpers.createClass(function Foo() {
"use strict";
babelHelpers.classCallCheck(this, Foo);
};
});
Foo.bar = "foo";

View File

@ -30,5 +30,5 @@ var B = /*#__PURE__*/function (_A) {
return _this;
}
return B;
return babelHelpers.createClass(B);
}(A);

View File

@ -13,5 +13,5 @@ var Foo = /*#__PURE__*/function (_Bar) {
return _this;
}
return Foo;
return babelHelpers.createClass(Foo);
}(Bar);

View File

@ -14,5 +14,5 @@ var Foo = /*#__PURE__*/function (_Bar) {
return _this;
}
return Foo;
return babelHelpers.createClass(Foo);
}(Bar);

View File

@ -1,7 +1,7 @@
var A = function A(_force) {
var A = /*#__PURE__*/babelHelpers.createClass(function A(_force) {
"use strict";
babelHelpers.classCallCheck(this, A);
this.force = force;
this.foo = babelHelpers.get(babelHelpers.getPrototypeOf(A.prototype), "method", this).call(this);
};
});

View File

@ -9,6 +9,6 @@ var createClass = k => {
babelHelpers.defineProperty(this, _k, 2);
}
return _class2;
return babelHelpers.createClass(_class2);
}();
};

View File

@ -1,12 +1,10 @@
var foo = "bar";
var Foo = function Foo() {
var Foo = /*#__PURE__*/babelHelpers.createClass(function Foo() {
"use strict";
babelHelpers.classCallCheck(this, Foo);
babelHelpers.defineProperty(this, "bar", foo);
var _foo = "foo";
var baz = "baz";
};
});
babelHelpers.defineProperty(Foo, "bar", baz);

View File

@ -21,5 +21,5 @@ var Foo = /*#__PURE__*/function (_Bar) {
return babelHelpers.possibleConstructorReturn(_this);
}
return Foo;
return babelHelpers.createClass(Foo);
}(Bar);

View File

@ -14,5 +14,5 @@ var Foo = /*#__PURE__*/function (_Bar) {
return _this;
}
return Foo;
return babelHelpers.createClass(Foo);
}(Bar);

View File

@ -1,9 +1,8 @@
var foo = "bar";
var Foo = function Foo(_foo) {
var Foo = /*#__PURE__*/babelHelpers.createClass(function Foo(_foo) {
"use strict";
babelHelpers.classCallCheck(this, Foo);
babelHelpers.defineProperty(this, "bar", this);
babelHelpers.defineProperty(this, "baz", foo);
};
});

View File

@ -16,5 +16,5 @@ var Child = /*#__PURE__*/function (_Parent) {
return _this;
}
return Child;
return babelHelpers.createClass(Child);
}(Parent);

View File

@ -2,14 +2,12 @@ function test(x) {
var _x;
_x = x;
var F = function F() {
var F = /*#__PURE__*/babelHelpers.createClass(function F() {
"use strict";
babelHelpers.classCallCheck(this, F);
babelHelpers.defineProperty(this, _x, 1);
};
});
x = 'deadbeef';
expect(new F().foo).toBe(1);
x = 'wrong';

View File

@ -1,6 +1,6 @@
var Foo = function Foo() {
var Foo = /*#__PURE__*/babelHelpers.createClass(function Foo() {
"use strict";
babelHelpers.classCallCheck(this, Foo);
babelHelpers.defineProperty(this, "bar", void 0);
};
});

View File

@ -1,6 +1,6 @@
var Foo = function Foo() {
var Foo = /*#__PURE__*/babelHelpers.createClass(function Foo() {
"use strict";
babelHelpers.classCallCheck(this, Foo);
babelHelpers.defineProperty(this, "bar", "foo");
};
});

View File

@ -1,7 +1,7 @@
var Foo = function Foo() {
var Foo = /*#__PURE__*/babelHelpers.createClass(function Foo() {
"use strict";
babelHelpers.classCallCheck(this, Foo);
babelHelpers.defineProperty(this, 0, "foo");
babelHelpers.defineProperty(this, 1, "bar");
};
});

View File

@ -1,12 +1,12 @@
var _class, _temp;
call((_temp = _class = function _class() {
call((_temp = _class = /*#__PURE__*/babelHelpers.createClass(function _class() {
babelHelpers.classCallCheck(this, _class);
}, babelHelpers.defineProperty(_class, "test", true), _temp));
}), babelHelpers.defineProperty(_class, "test", true), _temp));
var _default = function _default() {
var _default = /*#__PURE__*/babelHelpers.createClass(function _default() {
babelHelpers.classCallCheck(this, _default);
};
});
babelHelpers.defineProperty(_default, "test", true);
export { _default as default };

View File

@ -13,7 +13,7 @@ function withContext(ComposedComponent) {
return _super.apply(this, arguments);
}
return WithContext;
return babelHelpers.createClass(WithContext);
}(Component), babelHelpers.defineProperty(_class, "propTypes", {
context: PropTypes.shape({
addCss: PropTypes.func,

View File

@ -1,11 +1,9 @@
export var MyClass = function MyClass() {
export var MyClass = /*#__PURE__*/babelHelpers.createClass(function MyClass() {
babelHelpers.classCallCheck(this, MyClass);
};
});
babelHelpers.defineProperty(MyClass, "property", value);
var MyClass2 = function MyClass2() {
var MyClass2 = /*#__PURE__*/babelHelpers.createClass(function MyClass2() {
babelHelpers.classCallCheck(this, MyClass2);
};
});
babelHelpers.defineProperty(MyClass2, "property", value);
export { MyClass2 as default };

View File

@ -1,7 +1,7 @@
var _class, _temp;
var Foo = (_temp = _class = function Foo() {
var Foo = (_temp = _class = /*#__PURE__*/babelHelpers.createClass(function Foo() {
"use strict";
babelHelpers.classCallCheck(this, Foo);
}, babelHelpers.defineProperty(_class, "num", 0), _temp);
}), babelHelpers.defineProperty(_class, "num", 0), _temp);

View File

@ -1,9 +1,8 @@
var A = function A() {
var A = /*#__PURE__*/babelHelpers.createClass(function A() {
"use strict";
babelHelpers.classCallCheck(this, A);
};
});
babelHelpers.defineProperty(A, "prop", 1);
var B = /*#__PURE__*/function (_A) {
@ -18,7 +17,7 @@ var B = /*#__PURE__*/function (_A) {
return _super.apply(this, arguments);
}
return B;
return babelHelpers.createClass(B);
}(A);
babelHelpers.defineProperty(B, "prop", 2);

View File

@ -1,8 +1,7 @@
var A = function A() {
var A = /*#__PURE__*/babelHelpers.createClass(function A() {
"use strict";
babelHelpers.classCallCheck(this, A);
};
});
babelHelpers.defineProperty(A, "self", A);
babelHelpers.defineProperty(A, "getA", () => A);

View File

@ -1,7 +1,6 @@
var Foo = function Foo() {
var Foo = /*#__PURE__*/babelHelpers.createClass(function Foo() {
"use strict";
babelHelpers.classCallCheck(this, Foo);
};
});
babelHelpers.defineProperty(Foo, "bar", void 0);

View File

@ -1,7 +1,6 @@
var Foo = function Foo() {
var Foo = /*#__PURE__*/babelHelpers.createClass(function Foo() {
"use strict";
babelHelpers.classCallCheck(this, Foo);
};
});
babelHelpers.defineProperty(Foo, "bar", "foo");

View File

@ -30,5 +30,5 @@ var B = /*#__PURE__*/function (_A) {
return _this;
}
return B;
return babelHelpers.createClass(B);
}(A);

View File

@ -13,5 +13,5 @@ var Foo = /*#__PURE__*/function (_Bar) {
return _this;
}
return Foo;
return babelHelpers.createClass(Foo);
}(Bar);

Some files were not shown because too many files have changed in this diff Show More