support es6.constants by default. Fixes #2932

Summary: In javascriptcore(ios9), this code will run as expected(output 0 1):

```js
for(let i=0; i<2; i++) {
  const data = i;
  console.log(data);
}
```

But when debug in chrome, the above code will fail without `use strict` prologue (if you add prologue, rn will fail with red screen `Const declarations are not supported in strict mode`): https://code.google.com/p/v8/issues/detail?id=4432.

So it's better to transpile contant by default.

Closes https://github.com/facebook/react-native/pull/2955

Reviewed By: @​svcscm

Differential Revision: D2483398

Pulled By: @vjeux
This commit is contained in:
yiminghe 2015-09-26 15:48:28 -07:00 committed by facebook-github-bot-6
parent fa0da5682b
commit 4978855d72
2 changed files with 2 additions and 2 deletions

View File

@ -6,9 +6,8 @@
"whitelist": [ "whitelist": [
"es6.arrowFunctions", "es6.arrowFunctions",
"es6.blockScoping", "es6.blockScoping",
// This is the only place where we differ from transformer.js
"es6.constants",
"es6.classes", "es6.classes",
"es6.constants",
"es6.destructuring", "es6.destructuring",
"es6.parameters", "es6.parameters",
"es6.properties.computed", "es6.properties.computed",

View File

@ -35,6 +35,7 @@ function transform(src, filename, options) {
'es6.arrowFunctions', 'es6.arrowFunctions',
'es6.blockScoping', 'es6.blockScoping',
'es6.classes', 'es6.classes',
'es6.constants',
'es6.destructuring', 'es6.destructuring',
'es6.parameters', 'es6.parameters',
'es6.properties.computed', 'es6.properties.computed',