Remove transform-classes from priv method tests (#9537)

This commit is contained in:
Tim McClure 2019-02-18 13:57:29 -05:00 committed by Nicolò Ribaudo
parent bbb4d7b6d7
commit f44b29522c
23 changed files with 259 additions and 350 deletions

View File

@ -1,10 +1,5 @@
var Cl =
/*#__PURE__*/
function () {
"use strict";
function Cl() {
babelHelpers.classCallCheck(this, Cl);
class Cl {
constructor() {
Object.defineProperty(this, _privateFieldValue, {
get: _get_privateFieldValue,
set: _set_privateFieldValue
@ -16,19 +11,15 @@ function () {
this.publicField = "not secret string";
}
babelHelpers.createClass(Cl, [{
key: "publicGetPrivateField",
value: function publicGetPrivateField() {
publicGetPrivateField() {
return babelHelpers.classPrivateFieldLooseBase(this, _privateFieldValue)[_privateFieldValue];
}
}, {
key: "publicSetPrivateField",
value: function publicSetPrivateField(newValue) {
publicSetPrivateField(newValue) {
babelHelpers.classPrivateFieldLooseBase(this, _privateFieldValue)[_privateFieldValue] = newValue;
}
}]);
return Cl;
}();
}
var _privateField = babelHelpers.classPrivateFieldLooseKey("privateField");

View File

@ -1,7 +1,5 @@
var Cl = function Cl() {
"use strict";
babelHelpers.classCallCheck(this, Cl);
class Cl {
constructor() {
Object.defineProperty(this, _privateFieldValue, {
set: _set_privateFieldValue
});
@ -10,7 +8,9 @@ var Cl = function Cl() {
value: 0
});
this.publicField = babelHelpers.classPrivateFieldLooseBase(this, _privateFieldValue)[_privateFieldValue];
};
}
}
var _privateField = babelHelpers.classPrivateFieldLooseKey("privateField");

View File

@ -8,7 +8,6 @@
],
["proposal-private-methods", { "loose": true }],
["proposal-class-properties", { "loose": true }],
"transform-classes",
"transform-block-scoping",
"syntax-class-properties"
]

View File

@ -1,7 +1,5 @@
var Cl = function Cl() {
"use strict";
babelHelpers.classCallCheck(this, Cl);
class Cl {
constructor() {
Object.defineProperty(this, _privateFieldValue, {
get: _get_privateFieldValue
});
@ -10,7 +8,9 @@ var Cl = function Cl() {
value: 0
});
babelHelpers.classPrivateFieldLooseBase(this, _privateFieldValue)[_privateFieldValue] = 1;
};
}
}
var _privateField = babelHelpers.classPrivateFieldLooseKey("privateField");

View File

@ -1,10 +1,5 @@
var Cl =
/*#__PURE__*/
function () {
"use strict";
function Cl() {
babelHelpers.classCallCheck(this, Cl);
class Cl {
constructor() {
Object.defineProperty(this, _privateFieldValue, {
get: _get_privateFieldValue,
set: _set_privateFieldValue
@ -16,19 +11,23 @@ function () {
this.publicField = "not secret string";
}
babelHelpers.createClass(Cl, [{
key: "publicGetPrivateField",
value: function publicGetPrivateField() {
publicGetPrivateField() {
return babelHelpers.classPrivateFieldLooseBase(this, _privateFieldValue)[_privateFieldValue];
}
}, {
key: "publicSetPrivateField",
value: function publicSetPrivateField(newValue) {
publicSetPrivateField(newValue) {
babelHelpers.classPrivateFieldLooseBase(this, _privateFieldValue)[_privateFieldValue] = newValue;
}
}, {
key: "testUpdates",
value: function testUpdates() {
get publicFieldValue() {
return this.publicField;
}
set publicFieldValue(newValue) {
this.publicField = newValue;
}
testUpdates() {
babelHelpers.classPrivateFieldLooseBase(this, _privateField)[_privateField] = 0;
this.publicField = 0;
babelHelpers.classPrivateFieldLooseBase(this, _privateFieldValue)[_privateFieldValue] = babelHelpers.classPrivateFieldLooseBase(this, _privateFieldValue)[_privateFieldValue]++;
@ -40,17 +39,8 @@ function () {
babelHelpers.classPrivateFieldLooseBase(this, _privateFieldValue)[_privateFieldValue] = -(babelHelpers.classPrivateFieldLooseBase(this, _privateFieldValue)[_privateFieldValue] ** babelHelpers.classPrivateFieldLooseBase(this, _privateFieldValue)[_privateFieldValue]);
this.publicFieldValue = -(this.publicFieldValue ** this.publicFieldValue);
}
}, {
key: "publicFieldValue",
get: function () {
return this.publicField;
},
set: function (newValue) {
this.publicField = newValue;
}
}]);
return Cl;
}();
var _privateField = babelHelpers.classPrivateFieldLooseKey("privateField");

View File

@ -1,11 +1,5 @@
var Cl =
/*#__PURE__*/
function () {
"use strict";
function Cl() {
babelHelpers.classCallCheck(this, Cl);
class Cl {
constructor() {
_privateFieldValue.set(this, {
get: _get_privateFieldValue,
set: _set_privateFieldValue
@ -19,19 +13,15 @@ function () {
this.publicField = "not secret string";
}
babelHelpers.createClass(Cl, [{
key: "publicGetPrivateField",
value: function publicGetPrivateField() {
publicGetPrivateField() {
return babelHelpers.classPrivateFieldGet(this, _privateFieldValue);
}
}, {
key: "publicSetPrivateField",
value: function publicSetPrivateField(newValue) {
publicSetPrivateField(newValue) {
babelHelpers.classPrivateFieldSet(this, _privateFieldValue, newValue);
}
}]);
return Cl;
}();
}
var _privateField = new WeakMap();

View File

@ -1,8 +1,5 @@
var Cl = function Cl() {
"use strict";
babelHelpers.classCallCheck(this, Cl);
class Cl {
constructor() {
_privateFieldValue.set(this, {
set: _set_privateFieldValue
});
@ -13,7 +10,9 @@ var Cl = function Cl() {
});
this.publicField = babelHelpers.classPrivateFieldGet(this, _privateFieldValue);
};
}
}
var _privateField = new WeakMap();

View File

@ -8,7 +8,6 @@
],
"proposal-private-methods",
"proposal-class-properties",
"transform-classes",
"transform-block-scoping",
"syntax-class-properties"
]

View File

@ -1,8 +1,5 @@
var Cl = function Cl() {
"use strict";
babelHelpers.classCallCheck(this, Cl);
class Cl {
constructor() {
_privateFieldValue.set(this, {
get: _get_privateFieldValue
});
@ -13,7 +10,9 @@ var Cl = function Cl() {
});
babelHelpers.classPrivateMethodSet();
};
}
}
var _privateField = new WeakMap();

View File

@ -1,11 +1,5 @@
var Cl =
/*#__PURE__*/
function () {
"use strict";
function Cl() {
babelHelpers.classCallCheck(this, Cl);
class Cl {
constructor() {
_privateFieldValue.set(this, {
get: _get_privateFieldValue,
set: _set_privateFieldValue
@ -19,19 +13,23 @@ function () {
this.publicField = "not secret string";
}
babelHelpers.createClass(Cl, [{
key: "publicGetPrivateField",
value: function publicGetPrivateField() {
publicGetPrivateField() {
return babelHelpers.classPrivateFieldGet(this, _privateFieldValue);
}
}, {
key: "publicSetPrivateField",
value: function publicSetPrivateField(newValue) {
publicSetPrivateField(newValue) {
babelHelpers.classPrivateFieldSet(this, _privateFieldValue, newValue);
}
}, {
key: "testUpdates",
value: function testUpdates() {
get publicFieldValue() {
return this.publicField;
}
set publicFieldValue(newValue) {
this.publicField = newValue;
}
testUpdates() {
var _this$privateFieldVal, _this$privateFieldVal2;
babelHelpers.classPrivateFieldSet(this, _privateField, 0);
@ -45,17 +43,8 @@ function () {
babelHelpers.classPrivateFieldSet(this, _privateFieldValue, -(babelHelpers.classPrivateFieldGet(this, _privateFieldValue) ** babelHelpers.classPrivateFieldGet(this, _privateFieldValue)));
this.publicFieldValue = -(this.publicFieldValue ** this.publicFieldValue);
}
}, {
key: "publicFieldValue",
get: function () {
return this.publicField;
},
set: function (newValue) {
this.publicField = newValue;
}
}]);
return Cl;
}();
var _privateField = new WeakMap();

View File

@ -1,8 +1,5 @@
var Cl = function Cl() {
"use strict";
babelHelpers.classCallCheck(this, Cl);
class Cl {
constructor() {
_getSet.set(this, {
get: _get_getSet,
set: _set_getSet
@ -12,7 +9,9 @@ var Cl = function Cl() {
writable: true,
value: 0
});
};
}
}
var _privateField = new WeakMap();

View File

@ -8,7 +8,6 @@
],
"proposal-private-methods",
"proposal-class-properties",
"transform-classes",
"transform-block-scoping",
"syntax-class-properties"
]

View File

@ -1,8 +1,5 @@
var Cl = function Cl() {
"use strict";
babelHelpers.classCallCheck(this, Cl);
class Cl {
constructor() {
_getSet.set(this, {
get: _get_getSet,
set: _set_getSet
@ -12,7 +9,9 @@ var Cl = function Cl() {
writable: true,
value: 0
});
};
}
}
var _privateField = new WeakMap();

View File

@ -1,12 +1,12 @@
var Foo = function Foo() {
"use strict";
babelHelpers.classCallCheck(this, Foo);
class Foo {
constructor() {
Object.defineProperty(this, _privateMethod, {
value: _privateMethod2
});
this.publicField = babelHelpers.classPrivateFieldLooseBase(this, _privateMethod)[_privateMethod]();
};
}
}
var _privateMethod = babelHelpers.classPrivateFieldLooseKey("privateMethod");

View File

@ -1,10 +1,5 @@
var Cl =
/*#__PURE__*/
function () {
"use strict";
function Cl() {
babelHelpers.classCallCheck(this, Cl);
class Cl {
constructor() {
Object.defineProperty(this, _method, {
value: _method2
});
@ -15,14 +10,11 @@ function () {
});
}
babelHelpers.createClass(Cl, [{
key: "getPriv",
value: function getPriv() {
getPriv() {
return babelHelpers.classPrivateFieldLooseBase(this, _priv)[_priv];
}
}]);
return Cl;
}();
}
var _priv = babelHelpers.classPrivateFieldLooseKey("priv");

View File

@ -1,29 +1,20 @@
var Foo =
/*#__PURE__*/
function () {
"use strict";
function Foo(status) {
babelHelpers.classCallCheck(this, Foo);
class Foo {
constructor(status) {
Object.defineProperty(this, _getStatus, {
value: _getStatus2
});
this.status = status;
}
babelHelpers.createClass(Foo, [{
key: "getCurrentStatus",
value: function getCurrentStatus() {
getCurrentStatus() {
return babelHelpers.classPrivateFieldLooseBase(this, _getStatus)[_getStatus]();
}
}, {
key: "setCurrentStatus",
value: function setCurrentStatus(newStatus) {
setCurrentStatus(newStatus) {
this.status = newStatus;
}
}, {
key: "getFakeStatus",
value: function getFakeStatus(fakeStatus) {
getFakeStatus(fakeStatus) {
var fakeGetStatus = babelHelpers.classPrivateFieldLooseBase(this, _getStatus)[_getStatus];
return function () {
@ -32,17 +23,15 @@ function () {
});
};
}
}, {
key: "getFakeStatusFunc",
value: function getFakeStatusFunc() {
getFakeStatusFunc() {
return {
status: 'fake-status',
getFakeStatus: babelHelpers.classPrivateFieldLooseBase(this, _getStatus)[_getStatus]
};
}
}]);
return Foo;
}();
}
var _getStatus = babelHelpers.classPrivateFieldLooseKey("getStatus");

View File

@ -1,9 +1,7 @@
var exfiltrated;
var Foo = function Foo() {
"use strict";
babelHelpers.classCallCheck(this, Foo);
class Foo {
constructor() {
Object.defineProperty(this, _privateMethod, {
value: _privateMethod2
});
@ -11,7 +9,9 @@ var Foo = function Foo() {
if (exfiltrated === undefined) {
exfiltrated = babelHelpers.classPrivateFieldLooseBase(this, _privateMethod)[_privateMethod];
}
};
}
}
var _privateMethod = babelHelpers.classPrivateFieldLooseKey("privateMethod");

View File

@ -8,7 +8,6 @@
],
["proposal-private-methods", { "loose": true }],
["proposal-class-properties", { "loose": true }],
"transform-classes",
"transform-block-scoping",
"syntax-class-properties"
]

View File

@ -1,12 +1,11 @@
var Foo = function Foo() {
"use strict";
babelHelpers.classCallCheck(this, Foo);
class Foo {
constructor() {
_privateMethod.add(this);
this.publicField = babelHelpers.classPrivateMethodGet(this, _privateMethod, _privateMethod2).call(this);
};
}
}
var _privateMethod = new WeakSet();

View File

@ -1,11 +1,5 @@
var Cl =
/*#__PURE__*/
function () {
"use strict";
function Cl() {
babelHelpers.classCallCheck(this, Cl);
class Cl {
constructor() {
_method.add(this);
babelHelpers.defineProperty(this, "prop", babelHelpers.classPrivateMethodGet(this, _method, _method2).call(this, 1));
@ -16,14 +10,11 @@ function () {
});
}
babelHelpers.createClass(Cl, [{
key: "getPriv",
value: function getPriv() {
getPriv() {
return babelHelpers.classPrivateFieldGet(this, _priv);
}
}]);
return Cl;
}();
}
var _priv = new WeakMap();

View File

@ -1,29 +1,19 @@
var Foo =
/*#__PURE__*/
function () {
"use strict";
function Foo(status) {
babelHelpers.classCallCheck(this, Foo);
class Foo {
constructor(status) {
_getStatus.add(this);
this.status = status;
}
babelHelpers.createClass(Foo, [{
key: "getCurrentStatus",
value: function getCurrentStatus() {
getCurrentStatus() {
return babelHelpers.classPrivateMethodGet(this, _getStatus, _getStatus2).call(this);
}
}, {
key: "setCurrentStatus",
value: function setCurrentStatus(newStatus) {
setCurrentStatus(newStatus) {
this.status = newStatus;
}
}, {
key: "getFakeStatus",
value: function getFakeStatus(fakeStatus) {
getFakeStatus(fakeStatus) {
var fakeGetStatus = babelHelpers.classPrivateMethodGet(this, _getStatus, _getStatus2);
return function () {
return fakeGetStatus.call({
@ -31,17 +21,15 @@ function () {
});
};
}
}, {
key: "getFakeStatusFunc",
value: function getFakeStatusFunc() {
getFakeStatusFunc() {
return {
status: 'fake-status',
getFakeStatus: babelHelpers.classPrivateMethodGet(this, _getStatus, _getStatus2)
};
}
}]);
return Foo;
}();
}
var _getStatus = new WeakSet();

View File

@ -1,16 +1,15 @@
var exfiltrated;
var Foo = function Foo() {
"use strict";
babelHelpers.classCallCheck(this, Foo);
class Foo {
constructor() {
_privateMethod.add(this);
if (exfiltrated === undefined) {
exfiltrated = babelHelpers.classPrivateMethodGet(this, _privateMethod, _privateMethod2);
}
};
}
}
var _privateMethod = new WeakSet();

View File

@ -8,7 +8,6 @@
],
"proposal-private-methods",
"proposal-class-properties",
"transform-classes",
"transform-block-scoping",
"syntax-class-properties"
]