GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — Async/await by diogoosz · Pull Request #470 · javascript-tutorial/pt.javascript.info Conversation
Contributor
Tradução do artigo "Async/await" para o português, incluindo os 4 exercícios. Conforme comentado na #1.
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
gabifs
reviewed
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. "também resolve com o primeiro erro" contradiz o código logo abaixo:
Suggested change
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
gabifs
reviewed
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. "travar" em português costuma significar congelar/ficar parado, mas "crash" aqui quer dizer que o processo do Node.js é encerrado por causa da rejeição não tratada. O leitor pode entender que o processo só fica pendurado.
Suggested change
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
gabifs
reviewed
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. "eventually" é falso cognato: "eventualmente" em português significa "ocasionalmente/talvez", enquanto o original quer dizer "por fim/no final". Do jeito que está, parece que desconectar é opcional.
Suggested change
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
gabifs
reviewed
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. "wrapper" é estrangeirismo (aqui e na linha 87: "escrever um wrapper ao redor dele"). As diretrizes de tradução do repositório pedem para evitar palavras estrangeiras. Uma sugestão é "função que envolve o
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
gabifs
reviewed
|
| Mas no nível superior do código, quando estamos fora de qualquer função `async`, não conseguimos usar `await` sintaticamente, então é uma prática normal adicionar `.then/catch` para tratar o resultado final ou o erro que "cai através", como na linha `(*)` do exemplo acima. | |
| Mas no nível superior do código, quando estamos fora de qualquer função `async`, não conseguimos usar `await` sintaticamente, então é uma prática normal adicionar `.then/catch` para tratar o resultado final ou algum erro que não foi tratado, como na linha `(*)` do exemplo acima. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| ````warn header="Can't use `await` in regular functions" | ||
| If we try to use `await` in a non-async function, there would be a syntax error: | ||
| ````warn header="Não dá para usar `await` em funções comuns" | ||
| Se tentarmos usar `await` em uma função que não seja `async`, haveria um erro de sintaxe: |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Os tempos verbais não combinam: "Se tentarmos" (futuro do subjuntivo) pede futuro do presente, não "haveria".
| Se tentarmos usar `await` em uma função que não seja `async`, haveria um erro de sintaxe: | |
| Se tentarmos usar `await` em uma função que não seja `async`, teremos um erro de sintaxe: |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| ````smart header="Modern browsers allow top-level `await` in modules" | ||
| In modern browsers, `await` on top level works just fine, when we're inside a module. We'll cover modules in article <info:modules-intro>. | ||
| ````smart header="Navegadores modernos permitem `await` de nível superior em módulos" | ||
| Em navegadores modernos, o `await` em nível superior funciona perfeitamente bem, quando estamos dentro de um módulo. Vamos cobrir módulos no artigo <info:modules-intro>. |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
"Vamos cobrir módulos" é uma tradução literal de "cover". Em português, "abordar" soa mais natural.
| Em navegadores modernos, o `await` em nível superior funciona perfeitamente bem, quando estamos dentro de um módulo. Vamos cobrir módulos no artigo <info:modules-intro>. | |
| Em navegadores modernos, o `await` em nível superior funciona perfeitamente bem, quando estamos dentro de um módulo. Vamos abordar módulos no artigo <info:modules-intro>. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Obrigado, @gabifs! Apliquei tudo: corrigi "resolve"→"rejeita" (batendo com o código), "travar"→"ser encerrado", o falso cognato "eventualmente"→"por fim", "wrapper"→"função que envolve" (2x), "cai através"→"algo que não foi tratado", concordância verbal "haveria"→"teremos", e "cobrir"→"abordar". |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.