mirror of
https://github.com/airbnb/javascript.git
synced 2026-01-14 03:28:02 -05:00
Allow reserved words as keys in ES6 module context
`<script type="module">` and *node*/*iojs* code imply full support of ES5.
Code transpiled by *babel* is also perfecly safe:
```js
$ cat <<––– | babel
const superman = {
default: { clark: 'kent' },
private: true
};
–––
"use strict";
var superman = {
"default": { clark: "kent" },
"private": true
};
```
This commit is contained in:
@@ -140,7 +140,7 @@
|
||||
const item = {};
|
||||
```
|
||||
|
||||
- [3.2](#3.2) <a name='3.2'></a> Don't use [reserved words](http://es5.github.io/#x7.6.1) as keys. It won't work in IE8. [More info](https://github.com/airbnb/javascript/issues/61).
|
||||
- [3.2](#3.2) <a name='3.2'></a> If your code will be executed in browsers in script context, don't use [reserved words](http://es5.github.io/#x7.6.1) as keys. It won't work in IE8. [More info](https://github.com/airbnb/javascript/issues/61). It’s OK to use them in ES6 modules and server-side code.
|
||||
|
||||
```javascript
|
||||
// bad
|
||||
|
||||
Reference in New Issue
Block a user