Do not quote JSX attribute keys for IdentifierName (#8045)

Given the following

```js
a = <F new/>
```

We used to generate:

```js
a = React.createElement(F, {"new": true})
```

but now we generate

```js
a = React.createElement(F, {new: true})
```

If you need to quote these (ie for ES3 you can use
transform-property-literals)
This commit is contained in:
Erik Arvidsson
2018-05-27 09:48:18 -07:00
committed by Justin Ridgewell
parent d45ee5e025
commit 7846eaebaa
7 changed files with 28 additions and 7 deletions

View File

@@ -0,0 +1 @@
var es3 = <F aaa new const var default foo-bar/>;

View File

@@ -0,0 +1,3 @@
{
"plugins": ["transform-react-jsx", "transform-property-literals"]
}

View File

@@ -0,0 +1,8 @@
var es3 = React.createElement(F, {
aaa: true,
"new": true,
"const": true,
"var": true,
"default": true,
"foo-bar": true
});

View File

@@ -0,0 +1 @@
var e = <F aaa new const var default foo-bar/>;

View File

@@ -0,0 +1,8 @@
var e = React.createElement(F, {
aaa: true,
new: true,
const: true,
var: true,
default: true,
"foo-bar": true
});