Markus Török 6597a472b3 Add "use strict" directive (#7411)
* #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
2018-04-10 17:33:38 -04:00

60 lines
1.4 KiB
JavaScript

var concat = function () {
var x = arguments.length <= 0 ? undefined : arguments[0];
var y = arguments.length <= 1 ? undefined : arguments[1];
};
var somefun = function () {
var get2ndArg = function (a, b) {
var _b = arguments.length <= 2 ? undefined : arguments[2];
var somef = function (x, y, z) {
var _a = arguments.length <= 3 ? undefined : arguments[3];
};
var somefg = function (c, d, e, f) {
var _a = arguments.length <= 4 ? undefined : arguments[4];
};
var _d = arguments.length <= 3 ? undefined : arguments[3];
};
var get3rdArg = function () {
return arguments.length <= 2 ? undefined : arguments[2];
};
};
function demo1() {
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
return function (i) {
return args[i + 0];
};
}
var x = function () {
if (noNeedToWork) return 0;
for (var _len2 = arguments.length, rest = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
rest[_key2] = arguments[_key2];
}
return rest;
};
var innerclassproperties = function () {
var _class, _temp;
for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
args[_key3] = arguments[_key3];
}
return _temp = _class = function _class() {
"use strict";
babelHelpers.classCallCheck(this, _class);
this.args = args;
}, _class.args = args, _temp;
};