* #7349 - Add "use strict" directive to transformed class bodies * Update tests (#7349) * Add test for program with use strict directive (#7349) * Update tests (#7349) * Update source mapping (#7349) * Add test for parent blockStatement with use strict directive (#7349) * Update tests (#7349) * Update tests (#7349) * Update tests (#7349) * Add test for constructor-only class (#7349) * Constructor only classes are strict, too But constructor only that use non-simple parameters must use a strict function wrapper. * Fix test * Wrapper not needed if class is already strict * Revert change to lerna.json
34 lines
1.0 KiB
JavaScript
34 lines
1.0 KiB
JavaScript
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
|
|
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
|
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
|
|
function _one() {}
|
|
|
|
function _two() {}
|
|
|
|
let Test1 =
|
|
/*#__PURE__*/
|
|
function () {
|
|
"use strict";
|
|
|
|
function Test1() {
|
|
_classCallCheck(this, Test1);
|
|
}
|
|
|
|
_createClass(Test1, [{
|
|
key: "one",
|
|
value: function one() {
|
|
_two.call(_one, 1, 2);
|
|
}
|
|
}, {
|
|
key: "two",
|
|
value: function two() {
|
|
_two.call(_one, 1, 2);
|
|
}
|
|
}]);
|
|
|
|
return Test1;
|
|
}();
|