Issue 1:
I am working on finding the version where this broke.

The following input:

'use strict';

import * as React from 'react-tools/build/modules/React';

module.exports = React.createClass({
render: function(){
return <div></div>;
}
});

Should produce:

'use strict';

var _interopRequireWildcard = function (obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (typeof obj === 'object' && obj !== null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj['default'] = obj; return newObj; } };

var _import = require('react-tools/build/modules/React');

var React = _interopRequireWildcard(_import);

module.exports = React.createClass({
displayName: 'exports',

render: function render() {
return React.createElement('div', null);
}
});

And it does as of 5.1.13.

However, 5.3.3 produces:

'use strict';

function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj['default'] = obj; return newObj; } }

var _reactToolsBuildModulesReact = require('react-tools/build/modules/React');

var React = _interopRequireWildcard(_reactToolsBuildModulesReact);

'use strict';

module.exports = React.createClass({
displayName: 'exports',

render: function render() {
return React.createElement('div', null);
}
});

Note the extra 'use strict'; on line 9.

Issue 2:
If you define a getter/setter in a class and then override the setter in a subclass without overriding the getter, the getter from the parent class gets erased. This is also an issue with Traceur.

Example:

class Foo {
get foo() {
return this._foo || "";
}

set foo(foo) {
this._foo = foo;
}
}

class Bar extends Foo {
set foo(foo) {
super.foo = foo;
}
}

let bar = new Bar();

console.log(typeof bar.foo); // undefined, should be string

Generates the following code:

var _set = function set(object, property, value, receiver) { var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent !== null) { set(parent, property, value, receiver); } } else if ("value" in desc && desc.writable) { desc.value = value; } else { var setter = desc.set; if (setter !== undefined) { setter.call(receiver, value); } } return value; };

var _get = function get(_x, _x2, _x3) { var _again = true; _function: while (_again) { var object = _x, property = _x2, receiver = _x3; desc = parent = getter = undefined; _again = false; if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { _x = parent; _x2 = property; _x3 = receiver; _again = true; continue _function; } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } } };

var _createClass = (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); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();

function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }

function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }

var Foo = (function () {
function Foo() {
_classCallCheck(this, Foo);
}

_createClass(Foo, [{
key: "foo",
get: function get() {
return this._foo || "";
},
set: function set(foo) {
this._foo = foo;
}
}]);

return Foo;
})();

var Bar = (function (_Foo) {
_inherits(Bar, _Foo);

function Bar() {
_classCallCheck(this, Bar);

_get(Object.getPrototypeOf(Bar.prototype), "constructor", this).apply(this, arguments);
}

_createClass(Bar, [{
key: "foo",
set: function set(foo) {
_set(Object.getPrototypeOf(Bar.prototype), "foo", foo, this);
}
// <---- getter is erased here
}]);

return Bar;
})(Foo);

var bar = new Bar();

console.log(typeof bar.foo); // undefined, should be string

If this was intended as part of the spec that would be unfortunate as it is quite jarring.