From cee9c6fe8066be0f27104e8c8b6d38bfcb24c695 Mon Sep 17 00:00:00 2001 From: Gabriele Petronella Date: Sat, 10 Oct 2015 15:18:07 +0200 Subject: [PATCH 1/3] Update list of babel transformations in JavascriptEnvironment documentation Re-sync the documentation with https://github.com/facebook/react-native/blob/master/packager/transformer.js#L35-L48 --- docs/JavaScriptEnvironment.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docs/JavaScriptEnvironment.md b/docs/JavaScriptEnvironment.md index a3035fe77..89092b7e5 100644 --- a/docs/JavaScriptEnvironment.md +++ b/docs/JavaScriptEnvironment.md @@ -31,8 +31,10 @@ ES5 ES6 * [Arrow functions](http://babeljs.io/docs/learn-es2015/#arrows): ` this.setState({pressed: true})}` +* [Block scoping](https://babeljs.io/docs/learn-es2015/#let-const): `let greeting = 'hi';` * [Call spread](http://babeljs.io/docs/learn-es2015/#default-rest-spread): `Math.max(...array);` * [Classes](http://babeljs.io/docs/learn-es2015/#classes): `class C extends React.Component { render() { return ; } }` +* [Constants](https://babeljs.io/docs/learn-es2015/#let-const): `const answer = 42;` * [Destructuring](http://babeljs.io/docs/learn-es2015/#destructuring): `var {isActive, style} = this.props;` * [Modules](http://babeljs.io/docs/learn-es2015/#modules): `import React, { Component } from 'react-native';` * [Computed Properties](http://babeljs.io/docs/learn-es2015/#enhanced-object-literals): `var key = 'abc'; var obj = {[key]: 10};` @@ -45,3 +47,4 @@ ES7 * [Object Spread](https://github.com/sebmarkbage/ecmascript-rest-spread): `var extended = { ...obj, a: 10 };` * [Function Trailing Comma](https://github.com/jeffmo/es-trailing-function-commas): `function f(a, b, c,) { }` +* [Async Functions](https://github.com/tc39/ecmascript-asyncawait): `async function doStuffAsync(){ }; const foo = await doStuffAsync()`; From 72ac2f3c27fc3c76c75b8c5c84c49c9785738ab4 Mon Sep 17 00:00:00 2001 From: Gabriele Petronella Date: Sun, 11 Oct 2015 00:45:27 +0200 Subject: [PATCH 2/3] move await inside async function in async/await example --- docs/JavaScriptEnvironment.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/JavaScriptEnvironment.md b/docs/JavaScriptEnvironment.md index 89092b7e5..e4a71ed0b 100644 --- a/docs/JavaScriptEnvironment.md +++ b/docs/JavaScriptEnvironment.md @@ -47,4 +47,4 @@ ES7 * [Object Spread](https://github.com/sebmarkbage/ecmascript-rest-spread): `var extended = { ...obj, a: 10 };` * [Function Trailing Comma](https://github.com/jeffmo/es-trailing-function-commas): `function f(a, b, c,) { }` -* [Async Functions](https://github.com/tc39/ecmascript-asyncawait): `async function doStuffAsync(){ }; const foo = await doStuffAsync()`; +* [Async Functions](https://github.com/tc39/ecmascript-asyncawait): `async function doStuffAsync() { const foo = await doOtherStuffAsync() };`; From df1a6d5beddb94d5a6132f69ac89d0bebf7d5730 Mon Sep 17 00:00:00 2001 From: Gabriele Petronella Date: Sun, 11 Oct 2015 00:47:12 +0200 Subject: [PATCH 3/3] Add missing semicolon in example and remove extra one --- docs/JavaScriptEnvironment.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/JavaScriptEnvironment.md b/docs/JavaScriptEnvironment.md index e4a71ed0b..dcd866156 100644 --- a/docs/JavaScriptEnvironment.md +++ b/docs/JavaScriptEnvironment.md @@ -47,4 +47,4 @@ ES7 * [Object Spread](https://github.com/sebmarkbage/ecmascript-rest-spread): `var extended = { ...obj, a: 10 };` * [Function Trailing Comma](https://github.com/jeffmo/es-trailing-function-commas): `function f(a, b, c,) { }` -* [Async Functions](https://github.com/tc39/ecmascript-asyncawait): `async function doStuffAsync() { const foo = await doOtherStuffAsync() };`; +* [Async Functions](https://github.com/tc39/ecmascript-asyncawait): `async function doStuffAsync() { const foo = await doOtherStuffAsync(); }`;