Skip to content

Commit

Permalink
v2.0.0 Spread operator bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
deamme committed Mar 14, 2018
1 parent b65eb42 commit 84892da
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ts-transform-inferno",
"version": "1.8.2",
"version": "2.0.0",
"description": "A typescript transformer for InfernoJS",
"bugs": {
"url": "https://github.com/deamme/ts-transform-inferno/issues"
Expand Down
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@ export default () => {
if (astProp.kind === ts.SyntaxKind.JsxSpreadAttribute) {
assignArgs = [
ts.createObjectLiteral(),
ts.createIdentifier(astProp.expression.text)
astProp.expression
];
} else {
let propName = astProp.name.text;
Expand Down
File renamed without changes.
1 change: 1 addition & 0 deletions tests/cases/spreadAttribute2.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<div {...this.props} foo="bar" />;
File renamed without changes.
11 changes: 11 additions & 0 deletions tests/references/spreadAttribute2.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
var __assign = (this && this.__assign) || Object.assign || function(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
t[p] = s[p];
}
return t;
};
var Inferno = require("inferno");
var createVNode = Inferno.createVNode;
createVNode(1, "div", null, null, 1, __assign({}, this.props, { "foo": "bar" }));

0 comments on commit 84892da

Please sign in to comment.