GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Decorators and forwarding, call/apply by nazarepiedady · Pull Request #218 · javascript-tutorial/pt.javascript.info

Conversation

@nazarepiedady

@nazarepiedady nazarepiedady commented Jul 20, 2021

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.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@nazarepiedady
add portuguese translations for 09-call-apply-decorators
6f24e24
@javascript-translate-bot javascript-translate-bot added the review needed label Jul 20, 2021
@javascript-translate-bot
javascript-translate-bot requested a review from a team July 20, 2021 23:38
@CLAassistant

CLAassistant commented Jul 20, 2021 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@odsantos odsantos changed the title add portuguese translations for 09-call-apply-decorators Decorators and forwarding, call/apply Jul 21, 2021
@odsantos odsantos mentioned this pull request Jul 21, 2021
Portuguese Translation Progress #1
Open
odsantos
odsantos requested changes Jul 21, 2021
View reviewed changes

@odsantos odsantos left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

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.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread 1-js/06-advanced-functions/09-call-apply-decorators/01-spy-decorator/task.md Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread 1-js/06-advanced-functions/09-call-apply-decorators/01-spy-decorator/task.md Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread 1-js/06-advanced-functions/09-call-apply-decorators/01-spy-decorator/task.md Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread 1-js/06-advanced-functions/09-call-apply-decorators/01-spy-decorator/solution.md Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread 1-js/06-advanced-functions/09-call-apply-decorators/02-delay/solution.md Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread 1-js/06-advanced-functions/09-call-apply-decorators/04-throttle/task.md Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread 1-js/06-advanced-functions/09-call-apply-decorators/04-throttle/task.md Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread 1-js/06-advanced-functions/09-call-apply-decorators/04-throttle/task.md Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread 1-js/06-advanced-functions/09-call-apply-decorators/04-throttle/task.md Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread 1-js/06-advanced-functions/09-call-apply-decorators/04-throttle/task.md Resolved

Uh oh!

There was an error while loading. Please reload this page.

@javascript-translate-bot javascript-translate-bot added changes requested and removed review needed labels Jul 21, 2021
@javascript-translate-bot

javascript-translate-bot commented Jul 21, 2021

Copy link
Copy Markdown

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

odsantos
odsantos requested changes Jul 22, 2021
View reviewed changes

@odsantos odsantos left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

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.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread 1-js/06-advanced-functions/09-call-apply-decorators/article.md Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread 1-js/06-advanced-functions/09-call-apply-decorators/article.md Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread 1-js/06-advanced-functions/09-call-apply-decorators/article.md Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread 1-js/06-advanced-functions/09-call-apply-decorators/article.md Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread 1-js/06-advanced-functions/09-call-apply-decorators/article.md Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread 1-js/06-advanced-functions/09-call-apply-decorators/article.md Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread 1-js/06-advanced-functions/09-call-apply-decorators/article.md Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread 1-js/06-advanced-functions/09-call-apply-decorators/article.md Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread 1-js/06-advanced-functions/09-call-apply-decorators/article.md Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread 1-js/06-advanced-functions/09-call-apply-decorators/article.md Resolved

Uh oh!

There was an error while loading. Please reload this page.

@javascript-translate-bot

javascript-translate-bot commented Jul 22, 2021

Copy link
Copy Markdown

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

nazarepiedady and others added 18 commits July 24, 2021 11:18
@nazarepiedady @odsantos
Update 1-js/06-advanced-functions/09-call-apply-decorators/01-spy-dec…
f61fc2a
…orator/task.md

Co-authored-by: Osvaldo Dias dos Santos <[email protected]>
@nazarepiedady @odsantos
Update 1-js/06-advanced-functions/09-call-apply-decorators/01-spy-dec…
75233f9
…orator/task.md

Co-authored-by: Osvaldo Dias dos Santos <[email protected]>
@nazarepiedady @odsantos
Update 1-js/06-advanced-functions/09-call-apply-decorators/01-spy-dec…
df22c3a
…orator/solution.md

Co-authored-by: Osvaldo Dias dos Santos <[email protected]>
@nazarepiedady @odsantos
Update 1-js/06-advanced-functions/09-call-apply-decorators/02-delay/s…
f791dc2
…olution.md

Co-authored-by: Osvaldo Dias dos Santos <[email protected]>
@nazarepiedady @odsantos
Update 1-js/06-advanced-functions/09-call-apply-decorators/02-delay/s…
f21bfd1
…olution.md

Co-authored-by: Osvaldo Dias dos Santos <[email protected]>
@nazarepiedady @odsantos
Update 1-js/06-advanced-functions/09-call-apply-decorators/04-throttl…
ed2891f
…e/task.md

Co-authored-by: Osvaldo Dias dos Santos <[email protected]>
@nazarepiedady @odsantos
Update 1-js/06-advanced-functions/09-call-apply-decorators/02-delay/s…
e81827a
…olution.md

Co-authored-by: Osvaldo Dias dos Santos <[email protected]>
@nazarepiedady @odsantos
Update 1-js/06-advanced-functions/09-call-apply-decorators/02-delay/s…
5a1d081
…olution.md

Co-authored-by: Osvaldo Dias dos Santos <[email protected]>
@nazarepiedady @odsantos
Update 1-js/06-advanced-functions/09-call-apply-decorators/04-throttl…
65061ee
…e/task.md

Co-authored-by: Osvaldo Dias dos Santos <[email protected]>
@nazarepiedady @odsantos
Update 1-js/06-advanced-functions/09-call-apply-decorators/04-throttl…
a940f62
…e/task.md

Co-authored-by: Osvaldo Dias dos Santos <[email protected]>
@nazarepiedady @odsantos
Update 1-js/06-advanced-functions/09-call-apply-decorators/04-throttl…
beb803e
…e/task.md

Co-authored-by: Osvaldo Dias dos Santos <[email protected]>
@nazarepiedady @odsantos
Update 1-js/06-advanced-functions/09-call-apply-decorators/04-throttl…
8daf648
…e/task.md

Co-authored-by: Osvaldo Dias dos Santos <[email protected]>
@nazarepiedady @odsantos
Update 1-js/06-advanced-functions/09-call-apply-decorators/04-throttl…
e035343
…e/task.md

Co-authored-by: Osvaldo Dias dos Santos <[email protected]>
@nazarepiedady @odsantos
Update 1-js/06-advanced-functions/09-call-apply-decorators/02-delay/s…
e64df68
…olution.md

Co-authored-by: Osvaldo Dias dos Santos <[email protected]>
@nazarepiedady @odsantos
Update 1-js/06-advanced-functions/09-call-apply-decorators/02-delay/t…
2ac8f34
…ask.md

Co-authored-by: Osvaldo Dias dos Santos <[email protected]>
@nazarepiedady @odsantos
Update 1-js/06-advanced-functions/09-call-apply-decorators/02-delay/t…
1fe7c8e
…ask.md

Co-authored-by: Osvaldo Dias dos Santos <[email protected]>
@nazarepiedady @odsantos
Update 1-js/06-advanced-functions/09-call-apply-decorators/article.md
6ec0c37
Co-authored-by: Osvaldo Dias dos Santos <[email protected]>
@nazarepiedady @odsantos
Update 1-js/06-advanced-functions/09-call-apply-decorators/article.md
27720a9
Co-authored-by: Osvaldo Dias dos Santos <[email protected]>
nazarepiedady and others added 10 commits March 5, 2024 04:37
@nazarepiedady
docs: update call-apply-decorators/delay article
58420f8
@nazarepiedady
docs: update call-apply-decorators/debounce/debounce.svg
626cf58
@nazarepiedady
docs: update call-apply-decorators/decorator-makecaching-wrapper.svg
bf3e634
@nazarepiedady
docs: update call-apply-decorators/spy-decorator article
07f5a47
@nazarepiedady
docs: update call-apply-decorators/article.md english content
5a2cc59
@nazarepiedady
docs: translate the first two section of `call-apply-decorators/artic…
8fc6d38
…le.md`
@nazarepiedady
docs: translate one more piece of call-apply-decorators article
23ed1bf
@nazarepiedady
docs: translate one more piece of call-apply-decorators article
fe966ce
@nazarepiedady
docs: finish the translation of call-apply-decorators article
a75c9f4
@nazarepiedady
Merge branch 'master' into decorators-forwarding-call-apply
00481c7
@nazarepiedady

nazarepiedady commented Mar 18, 2024

Copy link
Copy Markdown
Member Author

/done

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@javascript-translate-bot javascript-translate-bot added the review needed label Mar 18, 2024
@javascript-translate-bot
javascript-translate-bot requested a review from a team March 18, 2024 20:53
@nazarepiedady

nazarepiedady commented Mar 18, 2024

Copy link
Copy Markdown
Member Author

@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.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@nazarepiedady

nazarepiedady commented Mar 18, 2024

Copy link
Copy Markdown
Member Author

@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.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

peruibeloko
peruibeloko suggested changes Mar 23, 2024
View reviewed changes
Comment thread 1-js/06-advanced-functions/09-call-apply-decorators/01-spy-decorator/task.md Outdated
```

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).

@peruibeloko peruibeloko Mar 23, 2024

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

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).

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@peruibeloko peruibeloko Mar 23, 2024

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

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" :)

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@nazarepiedady nazarepiedady Mar 24, 2024

Copy link
Copy Markdown
Member Author

There was a problem hiding this comment.

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.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread 1-js/06-advanced-functions/09-call-apply-decorators/02-delay/solution.md Outdated
```

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.

@peruibeloko peruibeloko Mar 23, 2024

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

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

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@nazarepiedady nazarepiedady Mar 24, 2024

Copy link
Copy Markdown
Member Author

There was a problem hiding this comment.

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:

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.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@peruibeloko peruibeloko Mar 24, 2024

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

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 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:

image

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@nazarepiedady nazarepiedady Mar 25, 2024

Copy link
Copy Markdown
Member Author

There was a problem hiding this comment.

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.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

peruibeloko reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
@javascript-translate-bot javascript-translate-bot removed the review needed label Mar 23, 2024
@javascript-translate-bot

javascript-translate-bot commented Mar 23, 2024

Copy link
Copy Markdown

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@javascript-translate-bot javascript-translate-bot added the changes requested label Mar 23, 2024
nazarepiedady added 3 commits March 24, 2024 06:51
@nazarepiedady
docs: update call-apply-decorators/spy-decorator/task.md
79b2b8c
@nazarepiedady
docs: update call-apply-decorators/delay/solution.md
f60fbb7
@nazarepiedady
docs: update call-apply-decorators/spy-decorator/task.md
9f2d639
@nazarepiedady

nazarepiedady commented Mar 24, 2024

Copy link
Copy Markdown
Member Author

/done

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@javascript-translate-bot javascript-translate-bot added review needed and removed changes requested labels Mar 24, 2024
@nazarepiedady

nazarepiedady commented Mar 24, 2024

Copy link
Copy Markdown
Member Author

@peruibeloko, could you review how things are now?

peruibeloko reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@peruibeloko

peruibeloko commented Mar 24, 2024

Copy link
Copy Markdown
Contributor

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

nazarepiedady reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

peruibeloko
peruibeloko approved these changes Mar 24, 2024
View reviewed changes
@nazarepiedady
nazarepiedady merged commit eca3fe6 into javascript-tutorial:master Mar 25, 2024
@javascript-translate-bot

javascript-translate-bot commented Mar 25, 2024

Copy link
Copy Markdown

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

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

Reviewers

@odsantos odsantos odsantos approved these changes
+1 more reviewer
@peruibeloko peruibeloko peruibeloko approved these changes
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

needs +1 review needed

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

5 participants

@nazarepiedady @CLAassistant @javascript-translate-bot @odsantos @peruibeloko
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.