explanation + fix [skip ci]

This commit is contained in:
Henry Zhu 2016-09-17 23:11:41 -04:00 committed by GitHub
parent c04a8594ae
commit 399bc6e931

View File

@ -19,6 +19,10 @@ See the [Babel Changelog](https://github.com/babel/babel/blob/master/CHANGELOG.m
* Implement ES2016 check for simple parameter list in strict mode ([#106](https://github.com/babel/babylon/pull/106)) (Timothy Gu) * Implement ES2016 check for simple parameter list in strict mode ([#106](https://github.com/babel/babylon/pull/106)) (Timothy Gu)
> It is a Syntax Error if ContainsUseStrict of FunctionBody is true and IsSimpleParameterList of FormalParameters is false. https://tc39.github.io/ecma262/2016/#sec-function-definitions-static-semantics-early-errors
More Context: [tc39-notes](https://github.com/rwaldron/tc39-notes/blob/master/es7/2015-07/july-29.md#611-the-scope-of-use-strict-with-respect-to-destructuring-in-parameter-lists)
For example: For example:
```js ```js
@ -29,6 +33,8 @@ function a([ option1, option2 ] = []) {
} }
``` ```
The solution would be to use a top level "use strict" or to remove the destructuring or default parameters when using a function + "use strict" or to.
### New Feature ### New Feature
* Exact object type annotations for Flow plugin ([#104](https://github.com/babel/babylon/pull/104)) (Basil Hosmer) * Exact object type annotations for Flow plugin ([#104](https://github.com/babel/babylon/pull/104)) (Basil Hosmer)