Skip to content

Commit

Permalink
Fix building JSX that contains a large object
Browse files Browse the repository at this point in the history
When building a JSX node with an object with more than 5 properties and a JSX prop, this fixes the following error:
```
TypeError: this[node.value.type] is not a function
```
  • Loading branch information
lPadier committed Aug 29, 2021
1 parent d8b948c commit be5cda0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/seven-birds-refuse.md
@@ -0,0 +1,5 @@
---
'wmr': patch
---

Fix building JSX nodes with object with more than 5 properties and then JSX in ap
2 changes: 1 addition & 1 deletion packages/wmr/src/lib/acorn-traverse.js
Expand Up @@ -82,7 +82,7 @@ let codeGenerator = {
} else {
// Astring inserts line indents by default
// eslint-disable-next-line new-cap
astring.baseGenerator.ObjectExpression(node, state);
astring.baseGenerator.ObjectExpression.call(this, node, state);
}
},

Expand Down

0 comments on commit be5cda0

Please sign in to comment.