Skip to content

Decorators and forwarding, call/apply - #218

Merged
nazarepiedady merged 139 commits into
javascript-tutorial:masterfrom
nazarepiedady:decorators-forwarding-call-apply
Mar 25, 2024
Merged

Decorators and forwarding, call/apply#218
nazarepiedady merged 139 commits into
javascript-tutorial:masterfrom
nazarepiedady:decorators-forwarding-call-apply

Conversation

@nazarepiedady

Copy link
Copy Markdown
Member

I did the possible to translate the better I could, if there is any grammar errors and I'll seek time to make right corrections to it.

@CLAassistant

CLAassistant commented Jul 20, 2021

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@odsantosodsantos changed the title add portuguese translations for 09-call-apply-decoratorsDecorators and forwarding, call/applyJul 21, 2021

@odsantosodsantos left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @nazarepiedady ,

Here is a partial review.

The comments and 'it' strings in the folder '1-js\06-advanced-functions\09-call-apply-decorators\01-spy-decorator_js.view' seem that were not translated.

The same for '1-js\06-advanced-functions\09-call-apply-decorators\02-delay_js.view\test.js', '1-js\06-advanced-functions\09-call-apply-decorators\03-debounce_js.view\test.js', and 1-js\06-advanced-functions\09-call-apply-decorators\03-debounce\debounce.view\index.html, except one-words like "delay", "test", 'a', and 'debounce' on _js.view or function names.

The article review is still missing, and hopefully shall be done at the earliest opportunity.

Thank you.

Comment thread1-js/06-advanced-functions/09-call-apply-decorators/02-delay/solution.md Outdated
Comment thread1-js/06-advanced-functions/09-call-apply-decorators/04-throttle/task.md Outdated
Comment thread1-js/06-advanced-functions/09-call-apply-decorators/04-throttle/task.md Outdated
Comment thread1-js/06-advanced-functions/09-call-apply-decorators/04-throttle/task.md Outdated
Comment thread1-js/06-advanced-functions/09-call-apply-decorators/04-throttle/task.md Outdated
Comment thread1-js/06-advanced-functions/09-call-apply-decorators/04-throttle/task.md Outdated
@javascript-translate-bot

Copy link
Copy Markdown

Please make the requested changes. After it, add a comment "/done".
Then I'll ask for a new review 👻

@odsantosodsantos left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @nazarepiedady , here is the article review as well.

I look forward to reviewing the files which still need to be translated under this main folder.

Thank you.

Comment thread1-js/06-advanced-functions/09-call-apply-decorators/article.md Outdated
Comment thread1-js/06-advanced-functions/09-call-apply-decorators/article.md Outdated
Comment thread1-js/06-advanced-functions/09-call-apply-decorators/article.md Outdated
Comment thread1-js/06-advanced-functions/09-call-apply-decorators/article.md Outdated
Comment thread1-js/06-advanced-functions/09-call-apply-decorators/article.md Outdated
Comment thread1-js/06-advanced-functions/09-call-apply-decorators/article.md Outdated
Comment thread1-js/06-advanced-functions/09-call-apply-decorators/article.md Outdated
Comment thread1-js/06-advanced-functions/09-call-apply-decorators/article.md Outdated
Comment thread1-js/06-advanced-functions/09-call-apply-decorators/article.md Outdated
Comment thread1-js/06-advanced-functions/09-call-apply-decorators/article.md Outdated
@javascript-translate-bot

Copy link
Copy Markdown

Please make the requested changes. After it, add a comment "/done".
Then I'll ask for a new review 👻

nazarepiedadyand others added 18 commits July 24, 2021 11:18
…orator/task.md
Co-authored-by: Osvaldo Dias dos Santos <vadodsantos@yahoo.com>
…orator/task.md
Co-authored-by: Osvaldo Dias dos Santos <vadodsantos@yahoo.com>
…orator/solution.md
Co-authored-by: Osvaldo Dias dos Santos <vadodsantos@yahoo.com>
…olution.md
Co-authored-by: Osvaldo Dias dos Santos <vadodsantos@yahoo.com>
…olution.md
Co-authored-by: Osvaldo Dias dos Santos <vadodsantos@yahoo.com>
…e/task.md
Co-authored-by: Osvaldo Dias dos Santos <vadodsantos@yahoo.com>
…olution.md
Co-authored-by: Osvaldo Dias dos Santos <vadodsantos@yahoo.com>
…olution.md
Co-authored-by: Osvaldo Dias dos Santos <vadodsantos@yahoo.com>
…e/task.md
Co-authored-by: Osvaldo Dias dos Santos <vadodsantos@yahoo.com>
…e/task.md
Co-authored-by: Osvaldo Dias dos Santos <vadodsantos@yahoo.com>
…e/task.md
Co-authored-by: Osvaldo Dias dos Santos <vadodsantos@yahoo.com>
…e/task.md
Co-authored-by: Osvaldo Dias dos Santos <vadodsantos@yahoo.com>
…e/task.md
Co-authored-by: Osvaldo Dias dos Santos <vadodsantos@yahoo.com>
…olution.md
Co-authored-by: Osvaldo Dias dos Santos <vadodsantos@yahoo.com>
…ask.md
Co-authored-by: Osvaldo Dias dos Santos <vadodsantos@yahoo.com>
…ask.md
Co-authored-by: Osvaldo Dias dos Santos <vadodsantos@yahoo.com>
Co-authored-by: Osvaldo Dias dos Santos <vadodsantos@yahoo.com>
Co-authored-by: Osvaldo Dias dos Santos <vadodsantos@yahoo.com>
@nazarepiedady

Copy link
Copy Markdown
MemberAuthor

/done

@nazarepiedady

Copy link
Copy Markdown
MemberAuthor

@odsantos, I finally updated this pull request, so I think we can go ahead to review it to start to translate others as soon as possible.

@nazarepiedady

Copy link
Copy Markdown
MemberAuthor

@jonnathan-ls, @peruibeloko, do you have time to review it?
To me, it seems the most clear translated that I already reviewed in this project.
I am open to correct the grammatical mistakes and improve the comprehension, but I am close to sacrifice the Portuguese language just to please people that do not have any interest to learn what they do not know.

```

P.S. That decorator is sometimes useful for unit-testing. Its advanced form is `sinon.spy` in [Sinon.JS](http://sinonjs.org/) library.
Pós-escrito: Este decorador é algumas vezes útil para testes unitários. Sua forma avançada é `sinon.spy` na biblioteca [Sinon.JS](http://sinonjs.org).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Pós-escrito: Este decorador é algumas vezes útil para testes unitários. Sua forma avançada é `sinon.spy` na biblioteca [Sinon.JS](http://sinonjs.org).
P.S. Esse decorador pode eventualmente ser útil para testes unitários. Sua forma avançada é `sinon.spy` na biblioteca [Sinon.JS](http://sinonjs.org).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fique a vontade para manter o "Pós-escrito" :)

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@peruibeloko, I need to keep it because it helps increase the comprehension of the content.

```

Please note how an arrow function is used here. As we know, arrow functions do not have own `this` and `arguments`, so `f.apply(this, arguments)` takes `this` and `arguments` from the wrapper.
Nota como é utilizada aqui uma função de seta (ou função anónima). Como sabemos, as funções de seta não possuem `this` e `arguments` próprios, então `f.apply(this, arguments)` recebe o `this` e `arguments` da função envolvente.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Nota como é utilizada aqui uma função de seta (ou função anónima). Como sabemos, as funções de seta não possuem `this` e `arguments` próprios, então `f.apply(this, arguments)` recebe o `this` e `arguments` da função envolvente.
Note como é utilizada aqui uma função de seta. Como sabemos, as funções de seta não possuem `this` e `arguments` próprios, então `f.apply(this, arguments)` recebe o `this` e `arguments` da função envolvente.

Funções de seta e funções anônimas não são conceitos equivalentes, funções de seta podem ser nomeadas e funções anônimas podem ser declaradas usando function

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@peruibeloko, I think you are not remembering that anonymous functions could be named.

To illustrate what I want to tell, consider this humble example below:

letgetName=function(name){returnname}console.log(`${getName('Marcos')} was called by ${getName.name} function`)getName=(name)=>nameconsole.log(`${getName('Marcos')} was called by ${getName.name} function`)

I recommend you to try to run the code above to see what I am talking about.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nazarepiedady On your example, neither function is anonymous:

image

  • The first one creates an anonymous function, which then gets named as getName1
  • The second one creates a named arrow function called getName2.

An anonymous function is, by definition, a function without a name.

A better example would be:

// Anonymous function expressionconsole.log((function(){}).name)// Named function declarationconsole.log((functionnamedDeclaration(){}).name)// Anonymous arrow functionconsole.log((()=>{}).name)// Named arrow functionconstnamedArrow=()=>{}console.log(namedArrow.name)

Which correctly prints out:

image

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@peruibeloko, You are absolutely correct, I was not remembered about this approach.

@javascript-translate-bot

Copy link
Copy Markdown

Please make the requested changes. After it, add a comment "/done".
Then I'll ask for a new review 👻

@nazarepiedady

Copy link
Copy Markdown
MemberAuthor

/done

@nazarepiedady

Copy link
Copy Markdown
MemberAuthor

@peruibeloko, could you review how things are now?

@peruibeloko

Copy link
Copy Markdown
Contributor

@nazarepiedady I left a comment explaining my suggestion a little better, but the changes look ok!

@nazarepiedady
nazarepiedady merged commit eca3fe6 into javascript-tutorial:masterMar 25, 2024
@javascript-translate-bot

Copy link
Copy Markdown

Thank you 💖 I updated the Progress Issue #1 🎉 🎉 🎉

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants

@nazarepiedady@CLAassistant@javascript-translate-bot@odsantos@peruibeloko