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 — Decorators and forwarding, call/apply by nazarepiedady · Pull Request #218 · javascript-tutorial/pt.javascript.info Conversation
|
There was an error while loading. Please reload this page.
|
Please make the requested changes. After it, add a comment "/done". |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem 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.
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.
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.
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.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
Please make the requested changes. After it, add a comment "/done". |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
…orator/task.md Co-authored-by: Osvaldo Dias dos Santos <[email protected]>
…orator/task.md Co-authored-by: Osvaldo Dias dos Santos <[email protected]>
…orator/solution.md Co-authored-by: Osvaldo Dias dos Santos <[email protected]>
…olution.md Co-authored-by: Osvaldo Dias dos Santos <[email protected]>
…olution.md Co-authored-by: Osvaldo Dias dos Santos <[email protected]>
…e/task.md Co-authored-by: Osvaldo Dias dos Santos <[email protected]>
…olution.md Co-authored-by: Osvaldo Dias dos Santos <[email protected]>
…olution.md Co-authored-by: Osvaldo Dias dos Santos <[email protected]>
…e/task.md Co-authored-by: Osvaldo Dias dos Santos <[email protected]>
…e/task.md Co-authored-by: Osvaldo Dias dos Santos <[email protected]>
…e/task.md Co-authored-by: Osvaldo Dias dos Santos <[email protected]>
…e/task.md Co-authored-by: Osvaldo Dias dos Santos <[email protected]>
…e/task.md Co-authored-by: Osvaldo Dias dos Santos <[email protected]>
…olution.md Co-authored-by: Osvaldo Dias dos Santos <[email protected]>
…ask.md Co-authored-by: Osvaldo Dias dos Santos <[email protected]>
…ask.md Co-authored-by: Osvaldo Dias dos Santos <[email protected]>
Co-authored-by: Osvaldo Dias dos Santos <[email protected]>
Co-authored-by: Osvaldo Dias dos Santos <[email protected]>
|
/done |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@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. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@jonnathan-ls, @peruibeloko, do you have time to review it? |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| ``` | ||
|
|
||
| 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). |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
| 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). |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem 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" :)
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem 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.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| ``` | ||
|
|
||
| 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. |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
| 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
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem 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:
let getName = function(name) { return name } console.log(`${getName('Marcos')} was called by ${getName.name} function`) getName = (name) => name console.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.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
@nazarepiedady On your example, neither function is anonymous:
getName1getName2.An anonymous function is, by definition, a function without a name.
A better example would be:
// Anonymous function expression console.log((function() {}).name) // Named function declaration console.log((function namedDeclaration() {}).name) // Anonymous arrow function console.log((() => {}).name) // Named arrow function const namedArrow = () => {} console.log(namedArrow.name)
Which correctly prints out:
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem 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.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Please make the requested changes. After it, add a comment "/done". |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
/done |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@peruibeloko, could you review how things are now? |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@nazarepiedady I left a comment explaining my suggestion a little better, but the changes look ok! |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Thank you 💖 I updated the Progress Issue #1 🎉 🎉 🎉 |
Sorry, something went wrong.
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.