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
This commit is contained in:
Markus Török 2018-04-10 23:33:38 +02:00 committed by Justin Ridgewell
parent fdd0789936
commit 6597a472b3
127 changed files with 410 additions and 23 deletions

View File

@ -1,6 +1,8 @@
var Foo = var Foo =
/*#__PURE__*/ /*#__PURE__*/
function (_Bar) { function (_Bar) {
"use strict";
babelHelpers.inherits(Foo, _Bar); babelHelpers.inherits(Foo, _Bar);
function Foo(options) { function Foo(options) {

View File

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

View File

@ -4,7 +4,7 @@
"column": 10 "column": 10
}, },
"generated": { "generated": {
"line": 11, "line": 13,
"column": 15 "column": 15
} }
}] }]

View File

@ -24,6 +24,8 @@ var _ref4 = `template${expression}`;
var MyClass = var MyClass =
/*#__PURE__*/ /*#__PURE__*/
function () { function () {
"use strict";
function MyClass() { function MyClass() {
babelHelpers.classCallCheck(this, MyClass); babelHelpers.classCallCheck(this, MyClass);
this[null] = "null"; this[null] = "null";

View File

@ -1,6 +1,8 @@
var foo = "bar"; var foo = "bar";
var Foo = function Foo() { var Foo = function Foo() {
"use strict";
babelHelpers.classCallCheck(this, Foo); babelHelpers.classCallCheck(this, Foo);
this.bar = foo; this.bar = foo;
var _foo = "foo"; var _foo = "foo";

View File

@ -1,6 +1,8 @@
var Foo = var Foo =
/*#__PURE__*/ /*#__PURE__*/
function (_Bar) { function (_Bar) {
"use strict";
babelHelpers.inherits(Foo, _Bar); babelHelpers.inherits(Foo, _Bar);
function Foo(...args) { function Foo(...args) {

View File

@ -1,6 +1,8 @@
var Child = var Child =
/*#__PURE__*/ /*#__PURE__*/
function (_Parent) { function (_Parent) {
"use strict";
babelHelpers.inherits(Child, _Parent); babelHelpers.inherits(Child, _Parent);
function Child() { function Child() {

View File

@ -2,6 +2,8 @@ function test(x) {
var _x = x; var _x = x;
var F = function F() { var F = function F() {
"use strict";
babelHelpers.classCallCheck(this, F); babelHelpers.classCallCheck(this, F);
this[_x] = 1; this[_x] = 1;
}; };

View File

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

View File

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

View File

@ -4,6 +4,8 @@ function withContext(ComposedComponent) {
return _temp = _class = return _temp = _class =
/*#__PURE__*/ /*#__PURE__*/
function (_Component) { function (_Component) {
"use strict";
babelHelpers.inherits(WithContext, _Component); babelHelpers.inherits(WithContext, _Component);
function WithContext() { function WithContext() {

View File

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

View File

@ -1,4 +1,6 @@
var Foo = function Foo() { var Foo = function Foo() {
"use strict";
babelHelpers.classCallCheck(this, Foo); babelHelpers.classCallCheck(this, Foo);
}; };

View File

@ -1,4 +1,6 @@
var Foo = function Foo() { var Foo = function Foo() {
"use strict";
babelHelpers.classCallCheck(this, Foo); babelHelpers.classCallCheck(this, Foo);
}; };

View File

@ -1,6 +1,8 @@
var A = var A =
/*#__PURE__*/ /*#__PURE__*/
function () { function () {
"use strict";
function A() { function A() {
babelHelpers.classCallCheck(this, A); babelHelpers.classCallCheck(this, A);
} }
@ -17,6 +19,8 @@ function () {
var B = var B =
/*#__PURE__*/ /*#__PURE__*/
function (_A) { function (_A) {
"use strict";
babelHelpers.inherits(B, _A); babelHelpers.inherits(B, _A);
function B(...args) { function B(...args) {

View File

@ -1,6 +1,8 @@
var Foo = var Foo =
/*#__PURE__*/ /*#__PURE__*/
function (_Bar) { function (_Bar) {
"use strict";
babelHelpers.inherits(Foo, _Bar); babelHelpers.inherits(Foo, _Bar);
function Foo() { function Foo() {

View File

@ -1,6 +1,8 @@
var Foo = var Foo =
/*#__PURE__*/ /*#__PURE__*/
function (_Bar) { function (_Bar) {
"use strict";
babelHelpers.inherits(Foo, _Bar); babelHelpers.inherits(Foo, _Bar);
function Foo() { function Foo() {

View File

@ -1,4 +1,6 @@
var A = function A(_force) { var A = function A(_force) {
"use strict";
babelHelpers.classCallCheck(this, A); babelHelpers.classCallCheck(this, A);
this.force = force; this.force = force;
this.foo = babelHelpers.get(babelHelpers.getPrototypeOf(A.prototype), "method", babelHelpers.assertThisInitialized(this)).call(this); this.foo = babelHelpers.get(babelHelpers.getPrototypeOf(A.prototype), "method", babelHelpers.assertThisInitialized(this)).call(this);

View File

@ -24,6 +24,8 @@ var _ref4 = `template${expression}`;
var MyClass = var MyClass =
/*#__PURE__*/ /*#__PURE__*/
function () { function () {
"use strict";
function MyClass() { function MyClass() {
babelHelpers.classCallCheck(this, MyClass); babelHelpers.classCallCheck(this, MyClass);
Object.defineProperty(this, null, { Object.defineProperty(this, null, {

View File

@ -1,6 +1,8 @@
var foo = "bar"; var foo = "bar";
var Foo = function Foo() { var Foo = function Foo() {
"use strict";
babelHelpers.classCallCheck(this, Foo); babelHelpers.classCallCheck(this, Foo);
Object.defineProperty(this, "bar", { Object.defineProperty(this, "bar", {
configurable: true, configurable: true,

View File

@ -1,6 +1,8 @@
var Foo = var Foo =
/*#__PURE__*/ /*#__PURE__*/
function (_Bar) { function (_Bar) {
"use strict";
babelHelpers.inherits(Foo, _Bar); babelHelpers.inherits(Foo, _Bar);
function Foo(...args) { function Foo(...args) {

View File

@ -1,6 +1,8 @@
var Child = var Child =
/*#__PURE__*/ /*#__PURE__*/
function (_Parent) { function (_Parent) {
"use strict";
babelHelpers.inherits(Child, _Parent); babelHelpers.inherits(Child, _Parent);
function Child() { function Child() {

View File

@ -2,6 +2,8 @@ function test(x) {
var _x = x; var _x = x;
var F = function F() { var F = function F() {
"use strict";
babelHelpers.classCallCheck(this, F); babelHelpers.classCallCheck(this, F);
Object.defineProperty(this, _x, { Object.defineProperty(this, _x, {
configurable: true, configurable: true,

View File

@ -1,4 +1,6 @@
var Foo = function Foo() { var Foo = function Foo() {
"use strict";
babelHelpers.classCallCheck(this, Foo); babelHelpers.classCallCheck(this, Foo);
Object.defineProperty(this, "bar", { Object.defineProperty(this, "bar", {
configurable: true, configurable: true,

View File

@ -1,4 +1,6 @@
var Foo = function Foo() { var Foo = function Foo() {
"use strict";
babelHelpers.classCallCheck(this, Foo); babelHelpers.classCallCheck(this, Foo);
Object.defineProperty(this, "bar", { Object.defineProperty(this, "bar", {
configurable: true, configurable: true,

View File

@ -4,6 +4,8 @@ function withContext(ComposedComponent) {
return _temp = _class = return _temp = _class =
/*#__PURE__*/ /*#__PURE__*/
function (_Component) { function (_Component) {
"use strict";
babelHelpers.inherits(WithContext, _Component); babelHelpers.inherits(WithContext, _Component);
function WithContext() { function WithContext() {

View File

@ -1,6 +1,8 @@
var _class, _temp; var _class, _temp;
var Foo = (_temp = _class = function Foo() { var Foo = (_temp = _class = function Foo() {
"use strict";
babelHelpers.classCallCheck(this, Foo); babelHelpers.classCallCheck(this, Foo);
}, Object.defineProperty(_class, "num", { }, Object.defineProperty(_class, "num", {
configurable: true, configurable: true,

View File

@ -1,4 +1,6 @@
var Foo = function Foo() { var Foo = function Foo() {
"use strict";
babelHelpers.classCallCheck(this, Foo); babelHelpers.classCallCheck(this, Foo);
}; };

View File

@ -1,4 +1,6 @@
var Foo = function Foo() { var Foo = function Foo() {
"use strict";
babelHelpers.classCallCheck(this, Foo); babelHelpers.classCallCheck(this, Foo);
}; };

View File

@ -1,6 +1,8 @@
var A = var A =
/*#__PURE__*/ /*#__PURE__*/
function () { function () {
"use strict";
function A() { function A() {
babelHelpers.classCallCheck(this, A); babelHelpers.classCallCheck(this, A);
} }
@ -17,6 +19,8 @@ function () {
var B = var B =
/*#__PURE__*/ /*#__PURE__*/
function (_A) { function (_A) {
"use strict";
babelHelpers.inherits(B, _A); babelHelpers.inherits(B, _A);
function B(...args) { function B(...args) {

View File

@ -1,6 +1,8 @@
var Foo = var Foo =
/*#__PURE__*/ /*#__PURE__*/
function (_Bar) { function (_Bar) {
"use strict";
babelHelpers.inherits(Foo, _Bar); babelHelpers.inherits(Foo, _Bar);
function Foo() { function Foo() {

View File

@ -1,6 +1,8 @@
var Foo = var Foo =
/*#__PURE__*/ /*#__PURE__*/
function (_Bar) { function (_Bar) {
"use strict";
babelHelpers.inherits(Foo, _Bar); babelHelpers.inherits(Foo, _Bar);
function Foo() { function Foo() {

View File

@ -1,4 +1,6 @@
var A = function A(_force) { var A = function A(_force) {
"use strict";
babelHelpers.classCallCheck(this, A); babelHelpers.classCallCheck(this, A);
Object.defineProperty(this, "force", { Object.defineProperty(this, "force", {
configurable: true, configurable: true,

View File

@ -17,6 +17,8 @@ function _getPrototypeOf(o) { _getPrototypeOf = Object.getPrototypeOf || functio
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
var Test = function Test() { var Test = function Test() {
"use strict";
var _this2 = this; var _this2 = this;
_classCallCheck(this, Test); _classCallCheck(this, Test);

View File

@ -4,6 +4,8 @@ function withContext(ComposedComponent) {
return _temp = _class = return _temp = _class =
/*#__PURE__*/ /*#__PURE__*/
function (_Component) { function (_Component) {
"use strict";
babelHelpers.inherits(WithContext, _Component); babelHelpers.inherits(WithContext, _Component);
function WithContext() { function WithContext() {

View File

@ -30,6 +30,8 @@ function generateAsyncAction(type) {
var A = var A =
/*#__PURE__*/ /*#__PURE__*/
function (_B) { function (_B) {
"use strict";
_inherits(A, _B); _inherits(A, _B);
function A(timestamp) { function A(timestamp) {

View File

@ -11,6 +11,8 @@ function _two() {}
let Test1 = let Test1 =
/*#__PURE__*/ /*#__PURE__*/
function () { function () {
"use strict";
function Test1() { function Test1() {
_classCallCheck(this, Test1); _classCallCheck(this, Test1);
} }

View File

@ -688,16 +688,51 @@ export default function transformClass(
classState.staticPropBody.map(fn => fn(t.cloneNode(classState.classRef))), classState.staticPropBody.map(fn => fn(t.cloneNode(classState.classRef))),
); );
if (classState.classId && body.length === 1) { const strictParent = path.findParent(path => {
if (path.isProgram() && path.node.sourceType === "module") {
return true;
}
if (path.isClassBody()) {
return true;
}
if (!path.isProgram() && !path.isBlockStatement()) {
return false;
}
return path.node.directives.some(
directive => directive.value.value === "use strict",
);
});
let constructorOnly = classState.classId && body.length === 1;
if (constructorOnly && !strictParent) {
for (const param of classState.construct.params) {
// It's illegal to put a use strict directive into the body of a function
// with non-simple parameters for some reason. So, we have to use a strict
// wrapper function.
if (!t.isIdentifier(param)) {
constructorOnly = false;
break;
}
}
}
const directives = constructorOnly ? body[0].body.directives : [];
if (!strictParent) {
directives.push(t.directive(t.directiveLiteral("use strict")));
}
if (constructorOnly) {
// named class with only a constructor // named class with only a constructor
return t.toExpression(body[0]); return t.toExpression(body[0]);
} }
body.push(t.returnStatement(t.cloneNode(classState.classRef))); body.push(t.returnStatement(t.cloneNode(classState.classRef)));
const container = t.arrowFunctionExpression( const container = t.arrowFunctionExpression(
closureParams, closureParams,
t.blockStatement(body), t.blockStatement(body, directives),
); );
return t.callExpression(container, closureArgs); return t.callExpression(container, closureArgs);
} }

View File

@ -11,6 +11,8 @@ function _getPrototypeOf(o) { _getPrototypeOf = Object.getPrototypeOf || functio
var List = var List =
/*#__PURE__*/ /*#__PURE__*/
function (_Array) { function (_Array) {
"use strict";
_inheritsLoose(List, _Array); _inheritsLoose(List, _Array);
function List() { function List() {

View File

@ -1,10 +1,14 @@
let Array = function Array() { let Array = function Array() {
"use strict";
babelHelpers.classCallCheck(this, Array); babelHelpers.classCallCheck(this, Array);
}; };
let List = let List =
/*#__PURE__*/ /*#__PURE__*/
function (_Array) { function (_Array) {
"use strict";
babelHelpers.inherits(List, _Array); babelHelpers.inherits(List, _Array);
function List() { function List() {

View File

@ -17,6 +17,8 @@ function _getPrototypeOf(o) { _getPrototypeOf = Object.getPrototypeOf || functio
var List = var List =
/*#__PURE__*/ /*#__PURE__*/
function (_Array) { function (_Array) {
"use strict";
_inherits(List, _Array); _inherits(List, _Array);
function List() { function List() {

View File

@ -1 +1,3 @@
let A = function A() {}; let A = function A() {
"use strict";
};

View File

@ -1,10 +1,14 @@
let A = function A() { let A = function A() {
"use strict";
console.log('a'); console.log('a');
}; };
let B = let B =
/*#__PURE__*/ /*#__PURE__*/
function () { function () {
"use strict";
function B() {} function B() {}
var _proto = B.prototype; var _proto = B.prototype;

View File

@ -2,11 +2,15 @@ function _assertThisInitialized(self) { if (self === void 0) { throw new Referen
function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; } function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; }
let B = function B() {}; let B = function B() {
"use strict";
};
let A = let A =
/*#__PURE__*/ /*#__PURE__*/
function (_B) { function (_B) {
"use strict";
_inheritsLoose(A, _B); _inheritsLoose(A, _B);
function A(track) { function A(track) {

View File

@ -1,6 +1,8 @@
var Test = var Test =
/*#__PURE__*/ /*#__PURE__*/
function (_Foo) { function (_Foo) {
"use strict";
babelHelpers.inheritsLoose(Test, _Foo); babelHelpers.inheritsLoose(Test, _Foo);
function Test() { function Test() {

View File

@ -1,6 +1,8 @@
var Test = var Test =
/*#__PURE__*/ /*#__PURE__*/
function (_Foo) { function (_Foo) {
"use strict";
babelHelpers.inheritsLoose(Test, _Foo); babelHelpers.inheritsLoose(Test, _Foo);
function Test() { function Test() {

View File

@ -0,0 +1,6 @@
function t() {
"use strict";
class Foo {
method() {}
}
}

View File

@ -0,0 +1,15 @@
function t() {
"use strict";
var Foo =
/*#__PURE__*/
function () {
function Foo() {}
var _proto = Foo.prototype;
_proto.method = function method() {};
return Foo;
}();
}

View File

@ -1,6 +1,8 @@
var Test = var Test =
/*#__PURE__*/ /*#__PURE__*/
function (_Foo) { function (_Foo) {
"use strict";
babelHelpers.inheritsLoose(Test, _Foo); babelHelpers.inheritsLoose(Test, _Foo);
function Test() { function Test() {

View File

@ -1,6 +1,8 @@
var x = var x =
/*#__PURE__*/ /*#__PURE__*/
function () { function () {
"use strict";
var _proto = x.prototype; var _proto = x.prototype;
_proto.f = function f() { _proto.f = function f() {

View File

@ -1,6 +1,8 @@
var Foo = var Foo =
/*#__PURE__*/ /*#__PURE__*/
function (_Bar) { function (_Bar) {
"use strict";
babelHelpers.inheritsLoose(Foo, _Bar); babelHelpers.inheritsLoose(Foo, _Bar);
function Foo() { function Foo() {

View File

@ -1,6 +1,8 @@
var Child = var Child =
/*#__PURE__*/ /*#__PURE__*/
function (_Base) { function (_Base) {
"use strict";
babelHelpers.inheritsLoose(Child, _Base); babelHelpers.inheritsLoose(Child, _Base);
function Child() { function Child() {

View File

@ -1,6 +1,8 @@
var Child = var Child =
/*#__PURE__*/ /*#__PURE__*/
function (_Base) { function (_Base) {
"use strict";
babelHelpers.inheritsLoose(Child, _Base); babelHelpers.inheritsLoose(Child, _Base);
function Child() { function Child() {

View File

@ -1,6 +1,8 @@
var Foo = var Foo =
/*#__PURE__*/ /*#__PURE__*/
function () { function () {
"use strict";
function Foo() {} function Foo() {}
var _proto = Foo.prototype; var _proto = Foo.prototype;

View File

@ -2,6 +2,8 @@
var C = var C =
/*#__PURE__*/ /*#__PURE__*/
function () { function () {
"use strict";
function C() {} function C() {}
var _proto = C.prototype; var _proto = C.prototype;

View File

@ -1,6 +1,8 @@
var Test = var Test =
/*#__PURE__*/ /*#__PURE__*/
function () { function () {
"use strict";
function Test() {} function Test() {}
var _proto = Test.prototype; var _proto = Test.prototype;

View File

@ -0,0 +1,7 @@
"use strict";
class Foo {
method() {
}
}

View File

@ -0,0 +1,13 @@
"use strict";
var Foo =
/*#__PURE__*/
function () {
function Foo() {}
var _proto = Foo.prototype;
_proto.method = function method() {};
return Foo;
}();

View File

@ -1,6 +1,8 @@
var BaseController = var BaseController =
/*#__PURE__*/ /*#__PURE__*/
function (_Chaplin$Controller) { function (_Chaplin$Controller) {
"use strict";
babelHelpers.inheritsLoose(BaseController, _Chaplin$Controller); babelHelpers.inheritsLoose(BaseController, _Chaplin$Controller);
function BaseController() { function BaseController() {
@ -13,6 +15,8 @@ function (_Chaplin$Controller) {
var BaseController2 = var BaseController2 =
/*#__PURE__*/ /*#__PURE__*/
function (_Chaplin$Controller$A) { function (_Chaplin$Controller$A) {
"use strict";
babelHelpers.inheritsLoose(BaseController2, _Chaplin$Controller$A); babelHelpers.inheritsLoose(BaseController2, _Chaplin$Controller$A);
function BaseController2() { function BaseController2() {

View File

@ -1,6 +1,8 @@
var Test = var Test =
/*#__PURE__*/ /*#__PURE__*/
function (_Foo) { function (_Foo) {
"use strict";
babelHelpers.inheritsLoose(Test, _Foo); babelHelpers.inheritsLoose(Test, _Foo);
function Test() { function Test() {

View File

@ -1,3 +1,5 @@
var Test = function Test() { var Test = function Test() {
"use strict";
Function.prototype.hasOwnProperty.call(this, "test"); Function.prototype.hasOwnProperty.call(this, "test");
}; };

View File

@ -1,6 +1,8 @@
var A = var A =
/*#__PURE__*/ /*#__PURE__*/
function (_B) { function (_B) {
"use strict";
babelHelpers.inherits(A, _B); babelHelpers.inherits(A, _B);
function A() { function A() {

View File

@ -2,6 +2,8 @@ var x = {
Foo: Foo:
/*#__PURE__*/ /*#__PURE__*/
function (_Foo) { function (_Foo) {
"use strict";
babelHelpers.inherits(_class, _Foo); babelHelpers.inherits(_class, _Foo);
function _class() { function _class() {

View File

@ -1,10 +1,14 @@
var A = function A() { var A = function A() {
"use strict";
babelHelpers.classCallCheck(this, A); babelHelpers.classCallCheck(this, A);
}; };
var B = var B =
/*#__PURE__*/ /*#__PURE__*/
function (_A) { function (_A) {
"use strict";
babelHelpers.inherits(B, _A); babelHelpers.inherits(B, _A);
function B() { function B() {

View File

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

View File

@ -1,6 +1,8 @@
var Example = var Example =
/*#__PURE__*/ /*#__PURE__*/
function () { function () {
"use strict";
function Example() {} function Example() {}
var _proto = Example.prototype; var _proto = Example.prototype;

View File

@ -1,6 +1,8 @@
var Foo = var Foo =
/*#__PURE__*/ /*#__PURE__*/
function () { function () {
"use strict";
function Foo(val) { function Foo(val) {
babelHelpers.classCallCheck(this, Foo); babelHelpers.classCallCheck(this, Foo);
this._val = val; this._val = val;

View File

@ -15,12 +15,16 @@ function _instanceof(left, right) { if (right != null && typeof Symbol !== "unde
function _classCallCheck(instance, Constructor) { if (!_instanceof(instance, Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _classCallCheck(instance, Constructor) { if (!_instanceof(instance, Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
var B = function B() { var B = function B() {
"use strict";
_classCallCheck(this, B); _classCallCheck(this, B);
}; };
var A = var A =
/*#__PURE__*/ /*#__PURE__*/
function (_B) { function (_B) {
"use strict";
_inherits(A, _B); _inherits(A, _B);
function A(track) { function A(track) {

View File

@ -1,6 +1,8 @@
var Test = var Test =
/*#__PURE__*/ /*#__PURE__*/
function (_Foo) { function (_Foo) {
"use strict";
babelHelpers.inherits(Test, _Foo); babelHelpers.inherits(Test, _Foo);
function Test() { function Test() {

View File

@ -1,6 +1,8 @@
var Test = var Test =
/*#__PURE__*/ /*#__PURE__*/
function (_Foo) { function (_Foo) {
"use strict";
babelHelpers.inherits(Test, _Foo); babelHelpers.inherits(Test, _Foo);
function Test() { function Test() {

View File

@ -1,6 +1,8 @@
var Test = var Test =
/*#__PURE__*/ /*#__PURE__*/
function (_Foo) { function (_Foo) {
"use strict";
babelHelpers.inherits(Test, _Foo); babelHelpers.inherits(Test, _Foo);
function Test() { function Test() {

View File

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

View File

@ -1,4 +1,6 @@
var Example = function Example() { var Example = function Example() {
"use strict";
babelHelpers.classCallCheck(this, Example); babelHelpers.classCallCheck(this, Example);
var _Example; var _Example;

View File

@ -0,0 +1,5 @@
class Foo {
constructor() {
}
}

View File

@ -0,0 +1,5 @@
var Foo = function Foo() {
"use strict";
babelHelpers.classCallCheck(this, Foo);
};

View File

@ -1,4 +1,6 @@
var Test = function Test() { var Test = function Test() {
"use strict";
babelHelpers.classCallCheck(this, Test); babelHelpers.classCallCheck(this, Test);
this.state = "test"; this.state = "test";
}; };
@ -6,6 +8,8 @@ var Test = function Test() {
var Foo = var Foo =
/*#__PURE__*/ /*#__PURE__*/
function (_Bar) { function (_Bar) {
"use strict";
babelHelpers.inherits(Foo, _Bar); babelHelpers.inherits(Foo, _Bar);
function Foo() { function Foo() {
@ -21,6 +25,8 @@ function (_Bar) {
}(Bar); }(Bar);
var ConstructorScoping = function ConstructorScoping() { var ConstructorScoping = function ConstructorScoping() {
"use strict";
babelHelpers.classCallCheck(this, ConstructorScoping); babelHelpers.classCallCheck(this, ConstructorScoping);
var bar; var bar;
{ {

View File

@ -1,6 +1,8 @@
var Foo = var Foo =
/*#__PURE__*/ /*#__PURE__*/
function (_Bar) { function (_Bar) {
"use strict";
babelHelpers.inherits(Foo, _Bar); babelHelpers.inherits(Foo, _Bar);
function Foo() { function Foo() {

View File

@ -1,6 +1,8 @@
var Foo = var Foo =
/*#__PURE__*/ /*#__PURE__*/
function (_Bar) { function (_Bar) {
"use strict";
babelHelpers.inherits(Foo, _Bar); babelHelpers.inherits(Foo, _Bar);
function Foo() { function Foo() {

View File

@ -1,6 +1,8 @@
var Foo = var Foo =
/*#__PURE__*/ /*#__PURE__*/
function (_Bar) { function (_Bar) {
"use strict";
babelHelpers.inherits(Foo, _Bar); babelHelpers.inherits(Foo, _Bar);
function Foo() { function Foo() {

View File

@ -1,6 +1,8 @@
var Foo = var Foo =
/*#__PURE__*/ /*#__PURE__*/
function (_Bar) { function (_Bar) {
"use strict";
babelHelpers.inherits(Foo, _Bar); babelHelpers.inherits(Foo, _Bar);
function Foo() { function Foo() {

View File

@ -1,6 +1,8 @@
var Foo = var Foo =
/*#__PURE__*/ /*#__PURE__*/
function (_Bar) { function (_Bar) {
"use strict";
babelHelpers.inherits(Foo, _Bar); babelHelpers.inherits(Foo, _Bar);
function Foo() { function Foo() {

View File

@ -1,6 +1,8 @@
var Child = var Child =
/*#__PURE__*/ /*#__PURE__*/
function (_Base) { function (_Base) {
"use strict";
babelHelpers.inherits(Child, _Base); babelHelpers.inherits(Child, _Base);
function Child() { function Child() {

View File

@ -1,6 +1,8 @@
var Child = var Child =
/*#__PURE__*/ /*#__PURE__*/
function (_Base) { function (_Base) {
"use strict";
babelHelpers.inherits(Child, _Base); babelHelpers.inherits(Child, _Base);
function Child() { function Child() {

View File

@ -1,5 +1,7 @@
var o = { var o = {
foo: function foo() { foo: function foo() {
"use strict";
babelHelpers.classCallCheck(this, foo); babelHelpers.classCallCheck(this, foo);
} }
}; };

View File

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

View File

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

View File

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

View File

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

View File

@ -2,6 +2,8 @@
var C = var C =
/*#__PURE__*/ /*#__PURE__*/
function () { function () {
"use strict";
function C() { function C() {
babelHelpers.classCallCheck(this, C); babelHelpers.classCallCheck(this, C);
} }

View File

@ -1,3 +1,5 @@
var Test = function Test() { var Test = function Test() {
"use strict";
babelHelpers.classCallCheck(this, Test); babelHelpers.classCallCheck(this, Test);
}; };

View File

@ -1,5 +1,6 @@
var MyCtrl = function MyCtrl(a) { var MyCtrl = function MyCtrl(a) {
"any directive prologue"; "any directive prologue";
"use strict";
babelHelpers.classCallCheck(this, MyCtrl); babelHelpers.classCallCheck(this, MyCtrl);
foo; foo;
@ -8,6 +9,7 @@ var MyCtrl = function MyCtrl(a) {
var MyCtrl2 = function MyCtrl2(a) { var MyCtrl2 = function MyCtrl2(a) {
"a"; "a";
"b"; "b";
"use strict";
babelHelpers.classCallCheck(this, MyCtrl2); babelHelpers.classCallCheck(this, MyCtrl2);
foo; foo;
@ -15,6 +17,7 @@ var MyCtrl2 = function MyCtrl2(a) {
var MyCtrl3 = function MyCtrl3(a) { var MyCtrl3 = function MyCtrl3(a) {
"a"; "a";
"use strict";
babelHelpers.classCallCheck(this, MyCtrl3); babelHelpers.classCallCheck(this, MyCtrl3);
foo; foo;

View File

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

View File

@ -1,9 +1,13 @@
var BaseView = function BaseView() { var BaseView = function BaseView() {
"use strict";
babelHelpers.classCallCheck(this, BaseView); babelHelpers.classCallCheck(this, BaseView);
this.autoRender = true; this.autoRender = true;
}; };
var BaseView = function BaseView() { var BaseView = function BaseView() {
"use strict";
babelHelpers.classCallCheck(this, BaseView); babelHelpers.classCallCheck(this, BaseView);
this.autoRender = true; this.autoRender = true;
}; };
@ -11,6 +15,8 @@ var BaseView = function BaseView() {
var BaseView = var BaseView =
/*#__PURE__*/ /*#__PURE__*/
function () { function () {
"use strict";
function BaseView() { function BaseView() {
babelHelpers.classCallCheck(this, BaseView); babelHelpers.classCallCheck(this, BaseView);
} }

View File

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

View File

@ -1,6 +1,8 @@
var TestEmpty = var TestEmpty =
/*#__PURE__*/ /*#__PURE__*/
function (_ref) { function (_ref) {
"use strict";
babelHelpers.inherits(TestEmpty, _ref); babelHelpers.inherits(TestEmpty, _ref);
function TestEmpty() { function TestEmpty() {
@ -12,6 +14,8 @@ function (_ref) {
}( }(
/*#__PURE__*/ /*#__PURE__*/
function () { function () {
"use strict";
function _class() { function _class() {
babelHelpers.classCallCheck(this, _class); babelHelpers.classCallCheck(this, _class);
} }
@ -22,6 +26,8 @@ function () {
var TestConstructorOnly = var TestConstructorOnly =
/*#__PURE__*/ /*#__PURE__*/
function (_ref2) { function (_ref2) {
"use strict";
babelHelpers.inherits(TestConstructorOnly, _ref2); babelHelpers.inherits(TestConstructorOnly, _ref2);
function TestConstructorOnly() { function TestConstructorOnly() {
@ -33,6 +39,8 @@ function (_ref2) {
}( }(
/*#__PURE__*/ /*#__PURE__*/
function () { function () {
"use strict";
function _class2() { function _class2() {
babelHelpers.classCallCheck(this, _class2); babelHelpers.classCallCheck(this, _class2);
} }
@ -43,6 +51,8 @@ function () {
var TestMethodOnly = var TestMethodOnly =
/*#__PURE__*/ /*#__PURE__*/
function (_ref3) { function (_ref3) {
"use strict";
babelHelpers.inherits(TestMethodOnly, _ref3); babelHelpers.inherits(TestMethodOnly, _ref3);
function TestMethodOnly() { function TestMethodOnly() {
@ -54,6 +64,8 @@ function (_ref3) {
}( }(
/*#__PURE__*/ /*#__PURE__*/
function () { function () {
"use strict";
function _class3() { function _class3() {
babelHelpers.classCallCheck(this, _class3); babelHelpers.classCallCheck(this, _class3);
} }
@ -68,6 +80,8 @@ function () {
var TestConstructorAndMethod = var TestConstructorAndMethod =
/*#__PURE__*/ /*#__PURE__*/
function (_ref4) { function (_ref4) {
"use strict";
babelHelpers.inherits(TestConstructorAndMethod, _ref4); babelHelpers.inherits(TestConstructorAndMethod, _ref4);
function TestConstructorAndMethod() { function TestConstructorAndMethod() {
@ -79,6 +93,8 @@ function (_ref4) {
}( }(
/*#__PURE__*/ /*#__PURE__*/
function () { function () {
"use strict";
function _class4() { function _class4() {
babelHelpers.classCallCheck(this, _class4); babelHelpers.classCallCheck(this, _class4);
} }
@ -93,6 +109,8 @@ function () {
var TestMultipleMethods = var TestMultipleMethods =
/*#__PURE__*/ /*#__PURE__*/
function (_ref5) { function (_ref5) {
"use strict";
babelHelpers.inherits(TestMultipleMethods, _ref5); babelHelpers.inherits(TestMultipleMethods, _ref5);
function TestMultipleMethods() { function TestMultipleMethods() {
@ -104,6 +122,8 @@ function (_ref5) {
}( }(
/*#__PURE__*/ /*#__PURE__*/
function () { function () {
"use strict";
function _class5() { function _class5() {
babelHelpers.classCallCheck(this, _class5); babelHelpers.classCallCheck(this, _class5);
} }

View File

@ -1,6 +1,8 @@
var BaseController = var BaseController =
/*#__PURE__*/ /*#__PURE__*/
function (_Chaplin$Controller) { function (_Chaplin$Controller) {
"use strict";
babelHelpers.inherits(BaseController, _Chaplin$Controller); babelHelpers.inherits(BaseController, _Chaplin$Controller);
function BaseController() { function BaseController() {
@ -14,6 +16,8 @@ function (_Chaplin$Controller) {
var BaseController2 = var BaseController2 =
/*#__PURE__*/ /*#__PURE__*/
function (_Chaplin$Controller$A) { function (_Chaplin$Controller$A) {
"use strict";
babelHelpers.inherits(BaseController2, _Chaplin$Controller$A); babelHelpers.inherits(BaseController2, _Chaplin$Controller$A);
function BaseController2() { function BaseController2() {

View File

@ -1,6 +1,8 @@
var Test = var Test =
/*#__PURE__*/ /*#__PURE__*/
function (_Foo) { function (_Foo) {
"use strict";
babelHelpers.inherits(Test, _Foo); babelHelpers.inherits(Test, _Foo);
function Test() { function Test() {

View File

@ -1,4 +1,6 @@
var Test = function Test() { var Test = function Test() {
"use strict";
babelHelpers.classCallCheck(this, Test); babelHelpers.classCallCheck(this, Test);
babelHelpers.get(babelHelpers.getPrototypeOf(Test.prototype), "hasOwnProperty", babelHelpers.assertThisInitialized(this)).call(this, "test"); babelHelpers.get(babelHelpers.getPrototypeOf(Test.prototype), "hasOwnProperty", babelHelpers.assertThisInitialized(this)).call(this, "test");
}; };

View File

@ -15,6 +15,8 @@ function _assertThisInitialized(self) { if (self === void 0) { throw new Referen
var Foo = var Foo =
/*#__PURE__*/ /*#__PURE__*/
function (_Bar) { function (_Bar) {
"use strict";
_inherits(Foo, _Bar); _inherits(Foo, _Bar);
function Foo() { function Foo() {

View File

@ -15,6 +15,8 @@ function _assertThisInitialized(self) { if (self === void 0) { throw new Referen
var Foo = var Foo =
/*#__PURE__*/ /*#__PURE__*/
function (_Bar) { function (_Bar) {
"use strict";
_inherits(Foo, _Bar); _inherits(Foo, _Bar);
function Foo() { function Foo() {

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