Renamed files
This commit is contained in:
committed by
Nicolò Ribaudo
parent
07e69c009b
commit
0f42accb87
@@ -0,0 +1,17 @@
|
||||
var _ref = <div>child</div>;
|
||||
|
||||
const AppItem = () => {
|
||||
return _ref;
|
||||
};
|
||||
|
||||
var _ref2 = <div>
|
||||
<p>Parent</p>
|
||||
<AppItem />
|
||||
</div>;
|
||||
|
||||
export default class App extends React.Component {
|
||||
render() {
|
||||
return _ref2;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
var _ref2 = <div>child</div>;
|
||||
|
||||
var _ref3 = <p>Parent</p>;
|
||||
|
||||
(function () {
|
||||
class App extends React.Component {
|
||||
render() {
|
||||
return _ref;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
const AppItem = () => {
|
||||
return _ref2;
|
||||
},
|
||||
_ref = <div>
|
||||
{_ref3}
|
||||
<AppItem />
|
||||
</div>;
|
||||
});
|
||||
@@ -0,0 +1,21 @@
|
||||
var _ref = <div>child</div>;
|
||||
|
||||
var _ref3 = <p>Parent</p>;
|
||||
|
||||
(function () {
|
||||
const AppItem = () => {
|
||||
return _ref;
|
||||
};
|
||||
|
||||
var _ref2 = <div>
|
||||
{_ref3}
|
||||
<AppItem />
|
||||
</div>;
|
||||
|
||||
class App extends React.Component {
|
||||
render() {
|
||||
return _ref2;
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
@@ -0,0 +1,16 @@
|
||||
export default class App extends React.Component {
|
||||
render() {
|
||||
return _ref;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
var _ref2 = <div>child</div>;
|
||||
|
||||
const AppItem = () => {
|
||||
return _ref2;
|
||||
},
|
||||
_ref = <div>
|
||||
<p>Parent</p>
|
||||
<AppItem />
|
||||
</div>;
|
||||
@@ -0,0 +1,12 @@
|
||||
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } } function _next(value) { step("next", value); } function _throw(err) { step("throw", err); } _next(); }); }; }
|
||||
|
||||
export default {
|
||||
function(name) {
|
||||
return _asyncToGenerator(function* () {
|
||||
const uppercasedName = name.upperCase(); // awaits depending on uppercasedName go here
|
||||
|
||||
return <Foo name={uppercasedName} />;
|
||||
})();
|
||||
}
|
||||
|
||||
};
|
||||
@@ -0,0 +1,9 @@
|
||||
var _ref = <span />;
|
||||
|
||||
var Foo = React.createClass({
|
||||
render: function () {
|
||||
return <div className={this.props.className}>
|
||||
{_ref}
|
||||
</div>;
|
||||
}
|
||||
});
|
||||
@@ -0,0 +1,24 @@
|
||||
import React from 'react'; // Regression test for https://github.com/babel/babel/issues/5552
|
||||
|
||||
var _ref = <div />;
|
||||
|
||||
class BugReport extends React.Component {
|
||||
constructor(...args) {
|
||||
var _temp;
|
||||
|
||||
return _temp = super(...args), this.thisWontWork = ({
|
||||
color
|
||||
}) => data => {
|
||||
return <div color={color}>does not reference data</div>;
|
||||
}, this.thisWorks = ({
|
||||
color
|
||||
}) => data => {
|
||||
return <div color={color}>{data}</div>;
|
||||
}, _temp;
|
||||
}
|
||||
|
||||
render() {
|
||||
return _ref;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
import React from 'react';
|
||||
import Loader from 'loader';
|
||||
|
||||
var _ref = <Loader className="full-height" />;
|
||||
|
||||
var _ref2 = <Loader className="p-y-5" />;
|
||||
|
||||
const errorComesHere = () => _ref,
|
||||
thisWorksFine = () => _ref2;
|
||||
@@ -0,0 +1,7 @@
|
||||
var Foo = require("Foo");
|
||||
|
||||
var _ref = <Foo />;
|
||||
|
||||
function render() {
|
||||
return _ref;
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
var _ref = <b></b>;
|
||||
|
||||
var _ref2 = <span></span>;
|
||||
|
||||
function render() {
|
||||
var children = _ref;
|
||||
|
||||
if (someCondition) {
|
||||
children = _ref2;
|
||||
}
|
||||
|
||||
return <div>{children}</div>;
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
class AnchorLink extends Component {
|
||||
render() {
|
||||
const _props = this.props,
|
||||
isExternal = _props.isExternal,
|
||||
children = _props.children;
|
||||
|
||||
if (isExternal) {
|
||||
return <a>{children}</a>;
|
||||
}
|
||||
|
||||
return <Link>{children}</Link>;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
import React from "react";
|
||||
|
||||
const Parent = ({}) => _ref;
|
||||
|
||||
export default Parent;
|
||||
|
||||
var _ref2 = <div className="child">
|
||||
ChildTextContent
|
||||
</div>;
|
||||
|
||||
let Child = () => _ref2,
|
||||
_ref = <div className="parent">
|
||||
<Child />
|
||||
</div>;
|
||||
@@ -0,0 +1,16 @@
|
||||
function render() {
|
||||
const bar = "bar",
|
||||
_ref = <foo bar={bar} />,
|
||||
renderFoo = () => _ref;
|
||||
|
||||
return renderFoo();
|
||||
}
|
||||
|
||||
function render() {
|
||||
const bar = "bar",
|
||||
renderFoo = () => _ref2,
|
||||
baz = "baz",
|
||||
_ref2 = <foo bar={bar} baz={baz} />;
|
||||
|
||||
return renderFoo();
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
function render() {
|
||||
var title = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
|
||||
|
||||
var _ref = <Component title={title} />;
|
||||
|
||||
return () => _ref;
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
function render(Component) {
|
||||
var text = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '',
|
||||
_ref = <Component text={text} />;
|
||||
|
||||
return function () {
|
||||
return _ref;
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
import React from "react";
|
||||
|
||||
const HOC = component => component;
|
||||
|
||||
const Parent = ({}) => _ref;
|
||||
|
||||
export default Parent;
|
||||
|
||||
var _ref2 = <div className="child">
|
||||
ChildTextContent
|
||||
</div>;
|
||||
|
||||
let Child = () => _ref2;
|
||||
|
||||
Child = HOC(Child);
|
||||
|
||||
var _ref = <div className="parent">
|
||||
<Child />
|
||||
</div>;
|
||||
@@ -0,0 +1,9 @@
|
||||
function render(flag) {
|
||||
if (flag) {
|
||||
var bar = "bar";
|
||||
[].map(() => bar);
|
||||
return <foo bar={bar} />;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
function renderSome(a, b) {
|
||||
if (a) {
|
||||
return <div>{b}</div>;
|
||||
} else {
|
||||
return <span>{b}</span>;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
function render(text) {
|
||||
var _ref = <foo>{text}</foo>;
|
||||
|
||||
return function () {
|
||||
return _ref;
|
||||
};
|
||||
}
|
||||
|
||||
var Foo2 = require("Foo");
|
||||
|
||||
function createComponent(text) {
|
||||
var _ref2 = <Foo2>{text}</Foo2>;
|
||||
|
||||
return function render() {
|
||||
return _ref2;
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
var _ref = <div foo={notDeclared}></div>;
|
||||
|
||||
var Foo = React.createClass({
|
||||
render: function render() {
|
||||
return _ref;
|
||||
}
|
||||
});
|
||||
@@ -0,0 +1,11 @@
|
||||
var _ref = <foo />;
|
||||
|
||||
function render() {
|
||||
return _ref;
|
||||
}
|
||||
|
||||
var _ref2 = <div className="foo"><input type="checkbox" checked={true} /></div>;
|
||||
|
||||
function render() {
|
||||
return _ref2;
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
var REACT_ELEMENT_TYPE;
|
||||
|
||||
function _jsx(type, props, key, children) { if (!REACT_ELEMENT_TYPE) { REACT_ELEMENT_TYPE = typeof Symbol === "function" && Symbol.for && Symbol.for("react.element") || 0xeac7; } var defaultProps = type && type.defaultProps; var childrenLength = arguments.length - 3; if (!props && childrenLength !== 0) { props = {}; } if (props && defaultProps) { for (var propName in defaultProps) { if (props[propName] === void 0) { props[propName] = defaultProps[propName]; } } } else if (!props) { props = defaultProps || {}; } if (childrenLength === 1) { props.children = children; } else if (childrenLength > 1) { var childArray = new Array(childrenLength); for (var i = 0; i < childrenLength; i++) { childArray[i] = arguments[i + 3]; } props.children = childArray; } return { $$typeof: REACT_ELEMENT_TYPE, type: type, key: key === undefined ? null : '' + key, ref: null, props: props, _owner: null }; }
|
||||
|
||||
var _ref = _jsx("foo", {});
|
||||
|
||||
function render() {
|
||||
return _ref;
|
||||
}
|
||||
|
||||
function render() {
|
||||
var text = getText();
|
||||
|
||||
var _ref2 = _jsx("foo", {}, void 0, text);
|
||||
|
||||
return function () {
|
||||
return _ref2;
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
function render() {
|
||||
var text = getText();
|
||||
|
||||
var _ref = <foo>{text}</foo>;
|
||||
|
||||
return function () {
|
||||
return _ref;
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
function render() {
|
||||
this.component = "div";
|
||||
|
||||
var _ref = <this.component />;
|
||||
|
||||
return () => _ref;
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
var _ref = <span>Sub Component</span>;
|
||||
|
||||
class Component extends React.Component {
|
||||
constructor(...args) {
|
||||
var _temp;
|
||||
|
||||
var _ref2 = <this.subComponent />;
|
||||
|
||||
return _temp = super(...args), this.subComponent = () => _ref, this.render = () => _ref2, _temp;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
var _ref = <span>Sub Component</span>;
|
||||
|
||||
const els = {
|
||||
subComponent: () => _ref
|
||||
};
|
||||
|
||||
var _ref2 = <els.subComponent />;
|
||||
|
||||
class Component extends React.Component {
|
||||
constructor(...args) {
|
||||
var _temp;
|
||||
|
||||
return _temp = super(...args), this.render = () => _ref2, _temp;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
function fn(Component, obj) {
|
||||
var data = obj.data,
|
||||
_ref = <Component prop={data} />;
|
||||
|
||||
return () => _ref;
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
function render(_ref) {
|
||||
let text = _ref.text,
|
||||
className = _ref.className,
|
||||
id = _ref.id;
|
||||
|
||||
var _ref2 = <Component text={text} className={className} id={id} />;
|
||||
|
||||
return () => _ref2;
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
function render(_ref) {
|
||||
let text = _ref.text,
|
||||
className = _ref.className,
|
||||
id = _ref.id,
|
||||
props = babelHelpers.objectWithoutProperties(_ref, ["text", "className", "id"]);
|
||||
|
||||
var _ref2 = <Component text={text} className={className} id={id} />;
|
||||
|
||||
// intentionally ignoring props
|
||||
return () => _ref2;
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
function render(_ref) {
|
||||
let text = _ref.text,
|
||||
className = _ref.className,
|
||||
id = _ref.id,
|
||||
props = babelHelpers.objectWithoutProperties(_ref, ["text", "className", "id"]);
|
||||
return () => <Component text={text} className={className} id={id} {...props} />;
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
function render(_ref) {
|
||||
let text = _ref.text;
|
||||
|
||||
var _ref2 = <Component text={text} />;
|
||||
|
||||
return () => _ref2;
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
function render(text) {
|
||||
var _ref = <div>{text}</div>;
|
||||
|
||||
return function () {
|
||||
return _ref;
|
||||
};
|
||||
}
|
||||
|
||||
function render() {
|
||||
return function (text) {
|
||||
return <div>{text}</div>;
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
// https://github.com/facebook/react/issues/3226
|
||||
// Not safe to reuse because it is mutable
|
||||
function render() {
|
||||
return <div style={{
|
||||
width: 100
|
||||
}} />;
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
function render(offset) {
|
||||
var _ref = <div tabIndex={offset + 1} />;
|
||||
|
||||
return function () {
|
||||
return _ref;
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
const OFFSET = 3;
|
||||
|
||||
var _ref = <div tabIndex={OFFSET + 1} />;
|
||||
|
||||
var Foo = React.createClass({
|
||||
render: function () {
|
||||
return _ref;
|
||||
}
|
||||
});
|
||||
@@ -0,0 +1,9 @@
|
||||
// This is the same as the pure-expression-whitelist test, but 'FormattedMessage' is *not* whitelisted
|
||||
// so it should not be hoisted.
|
||||
var Foo = React.createClass({
|
||||
render: function () {
|
||||
return <FormattedMessage id="someMessage.foo" defaultMessage={"Some text, " + "and some more too. {someValue}"} description="A test message for babel." values={{
|
||||
someValue: "A value."
|
||||
}} />;
|
||||
}
|
||||
});
|
||||
@@ -0,0 +1,11 @@
|
||||
import Intl from 'react-intl';
|
||||
|
||||
var _ref = <Intl.FormattedMessage id="someMessage.foo" defaultMessage={"Some text, " + "and some more too. {someValue}"} description="A test message for babel." values={{
|
||||
someValue: "A value."
|
||||
}} />;
|
||||
|
||||
var Foo = React.createClass({
|
||||
render: function () {
|
||||
return _ref;
|
||||
}
|
||||
});
|
||||
@@ -0,0 +1,9 @@
|
||||
var _ref = <FormattedMessage id="someMessage.foo" defaultMessage={"Some text, " + "and some more too. {someValue}"} description="A test message for babel." values={{
|
||||
someValue: "A value."
|
||||
}} />;
|
||||
|
||||
var Foo = React.createClass({
|
||||
render: function () {
|
||||
return _ref;
|
||||
}
|
||||
});
|
||||
@@ -0,0 +1,7 @@
|
||||
var _ref = <div data-text={"Some text, " + "and some more too."} />;
|
||||
|
||||
var Foo = React.createClass({
|
||||
render: function () {
|
||||
return _ref;
|
||||
}
|
||||
});
|
||||
@@ -0,0 +1,9 @@
|
||||
function render(text) {
|
||||
text += "yes";
|
||||
|
||||
var _ref = <div>{text}</div>;
|
||||
|
||||
return function () {
|
||||
return _ref;
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
function render() {
|
||||
return <foo ref="foobar" />;
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
class A {
|
||||
render() {
|
||||
return _ref;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
export default class B {}
|
||||
|
||||
var _ref = React.createElement(B, null);
|
||||
@@ -0,0 +1,10 @@
|
||||
class A {
|
||||
render() {
|
||||
return _ref;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
export class B {}
|
||||
|
||||
var _ref = React.createElement(B, null);
|
||||
@@ -0,0 +1,3 @@
|
||||
function render() {
|
||||
return <foo {...foobar} />;
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
var _ref = <div className="class-name">
|
||||
Text
|
||||
</div>;
|
||||
|
||||
var Foo = React.createClass({
|
||||
render: function () {
|
||||
return _ref;
|
||||
}
|
||||
});
|
||||
@@ -0,0 +1,6 @@
|
||||
function fn(Component) {
|
||||
var data = "prop",
|
||||
_ref = <Component prop={data} />;
|
||||
|
||||
return () => _ref;
|
||||
}
|
||||
Reference in New Issue
Block a user