Accepted baselines.
This commit is contained in:
parent
bb0ec3bbd4
commit
8ed7c76b43
6 changed files with 53 additions and 11 deletions
|
@ -13,8 +13,15 @@ declare var x: any;
|
|||
|
||||
|
||||
//// [reactNamespaceJSXEmit.js]
|
||||
var __assign = (this && this.__assign) || Object.assign || function(t) {
|
||||
for (var i = 1, n = arguments.length; i < n; i++) {
|
||||
var s = arguments[i];
|
||||
if (s != null) for (var p in s) if (s.hasOwnProperty(p)) t[p] = s[p];
|
||||
}
|
||||
return t;
|
||||
};
|
||||
myReactLib.createElement("foo", {data: true});
|
||||
myReactLib.createElement(Bar, {x: x});
|
||||
myReactLib.createElement("x-component", null);
|
||||
myReactLib.createElement(Bar, myReactLib.__spread({}, x));
|
||||
myReactLib.createElement(Bar, myReactLib.__spread({}, x, {y: 2}));
|
||||
myReactLib.createElement(Bar, __assign({}, x));
|
||||
myReactLib.createElement(Bar, __assign({}, x, {y: 2}));
|
||||
|
|
|
@ -19,8 +19,15 @@ declare var Foo, React;
|
|||
|
||||
//// [app.js]
|
||||
"use strict";
|
||||
var __assign = (this && this.__assign) || Object.assign || function(t) {
|
||||
for (var i = 1, n = arguments.length; i < n; i++) {
|
||||
var s = arguments[i];
|
||||
if (s != null) for (var p in s) if (s.hasOwnProperty(p)) t[p] = s[p];
|
||||
}
|
||||
return t;
|
||||
};
|
||||
var mod_1 = require('mod');
|
||||
// Should see mod_1['default'] in emit here
|
||||
React.createElement(Foo, {handler: mod_1["default"]});
|
||||
// Should see mod_1['default'] in emit here
|
||||
React.createElement(Foo, React.__spread({}, mod_1["default"]));
|
||||
React.createElement(Foo, __assign({}, mod_1["default"]));
|
||||
|
|
|
@ -16,9 +16,16 @@ var spreads5 = <div x={p2} {...p1} y={p3}>{p2}</div>;
|
|||
|
||||
|
||||
//// [file.js]
|
||||
var __assign = (this && this.__assign) || Object.assign || function(t) {
|
||||
for (var i = 1, n = arguments.length; i < n; i++) {
|
||||
var s = arguments[i];
|
||||
if (s != null) for (var p in s) if (s.hasOwnProperty(p)) t[p] = s[p];
|
||||
}
|
||||
return t;
|
||||
};
|
||||
var p1, p2, p3;
|
||||
var spreads1 = React.createElement("div", React.__spread({}, p1), p2);
|
||||
var spreads2 = React.createElement("div", React.__spread({}, p1), p2);
|
||||
var spreads3 = React.createElement("div", React.__spread({x: p3}, p1), p2);
|
||||
var spreads4 = React.createElement("div", React.__spread({}, p1, {x: p3}), p2);
|
||||
var spreads5 = React.createElement("div", React.__spread({x: p2}, p1, {y: p3}), p2);
|
||||
var spreads1 = React.createElement("div", __assign({}, p1), p2);
|
||||
var spreads2 = React.createElement("div", __assign({}, p1), p2);
|
||||
var spreads3 = React.createElement("div", __assign({x: p3}, p1), p2);
|
||||
var spreads4 = React.createElement("div", __assign({}, p1, {x: p3}), p2);
|
||||
var spreads5 = React.createElement("div", __assign({x: p2}, p1, {y: p3}), p2);
|
||||
|
|
|
@ -18,7 +18,14 @@ var openClosed1 = <div>
|
|||
var spread1 = <div {...p} x={0} />;
|
||||
|
||||
//// [file.js]
|
||||
var __assign = (this && this.__assign) || Object.assign || function(t) {
|
||||
for (var i = 1, n = arguments.length; i < n; i++) {
|
||||
var s = arguments[i];
|
||||
if (s != null) for (var p in s) if (s.hasOwnProperty(p)) t[p] = s[p];
|
||||
}
|
||||
return t;
|
||||
};
|
||||
var p;
|
||||
var openClosed1 = React.createElement("div", null, blah);
|
||||
// Should emit React.__spread({}, p, {x: 0})
|
||||
var spread1 = React.createElement("div", React.__spread({}, p, {x: 0}));
|
||||
var spread1 = React.createElement("div", __assign({}, p, {x: 0}));
|
||||
|
|
|
@ -23,8 +23,15 @@ var spread1 = <div x='' {...foo} y='' />;
|
|||
//// [file.js]
|
||||
//// [react-consumer.js]
|
||||
"use strict";
|
||||
var __assign = (this && this.__assign) || Object.assign || function(t) {
|
||||
for (var i = 1, n = arguments.length; i < n; i++) {
|
||||
var s = arguments[i];
|
||||
if (s != null) for (var p in s) if (s.hasOwnProperty(p)) t[p] = s[p];
|
||||
}
|
||||
return t;
|
||||
};
|
||||
var test_1 = require("./test");
|
||||
// Should emit test_1.React.createElement
|
||||
// and React.__spread
|
||||
var foo;
|
||||
var spread1 = test_1.React.createElement("div", test_1.React.__spread({x: ''}, foo, {y: ''}));
|
||||
var spread1 = test_1.React.createElement("div", __assign({x: ''}, foo, {y: ''}));
|
||||
|
|
|
@ -28,6 +28,13 @@ namespace M {
|
|||
|
||||
//// [file.js]
|
||||
//// [react-consumer.js]
|
||||
var __assign = (this && this.__assign) || Object.assign || function(t) {
|
||||
for (var i = 1, n = arguments.length; i < n; i++) {
|
||||
var s = arguments[i];
|
||||
if (s != null) for (var p in s) if (s.hasOwnProperty(p)) t[p] = s[p];
|
||||
}
|
||||
return t;
|
||||
};
|
||||
var M;
|
||||
(function (M) {
|
||||
})(M || (M = {}));
|
||||
|
@ -36,7 +43,7 @@ var M;
|
|||
// Should emit M.React.createElement
|
||||
// and M.React.__spread
|
||||
var foo;
|
||||
var spread1 = M.React.createElement("div", M.React.__spread({x: ''}, foo, {y: ''}));
|
||||
var spread1 = M.React.createElement("div", __assign({x: ''}, foo, {y: ''}));
|
||||
// Quotes
|
||||
var x = M.React.createElement("div", null, "This \"quote\" thing");
|
||||
})(M || (M = {}));
|
||||
|
|
Loading…
Reference in a new issue