Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

187
Visualizações
javascript Proxy of function apply trap gives no access to the receiver Proxy

When I have a Proxy the get and set traps both provide access to the underlying target Object as well as the Proxy receiver of the initial access request. This is good, because for some "pseudo properties" of the Proxy that I need, I look up the Proxy on a WeakMap to find an extension object which has such properties that apply to the Proxy but not to the underlying target object.

When the underlying target Object is a Function, then the apply trap will work, but its arguments are only the naked function, and the thisArg and the arguments, not the Proxy receiver of the initial apply. So now my ability to look up extension properties to the Proxy fail.

Is there any other way that I can get back to the Proxy from within the apply trap? Shouldn't that be considered a bug in the Proxy specification? Or at least an inconsistency? If the Proxy is considered useful in get and set traps, why is it not considered useful in the apply trap?

about 4 years ago · Santiago Gelvez
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda