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

144
Visualizações
Different this in Object.defineProperty getter in safari devtools, browser bug?

Run this code in the console in Safari (15.1) and another browser (eg. Brave/Chrome):

const a = {b: {c: 5}}
Object.defineProperty(a.b, 'self', {get () {return this}})
console.log(a.b.self) // expected: {c: 5}
console.log(a) // when expanding a.b.self in inspector, expects the same, ie. {c: 5}

Then, expand the last object, until you get self: (...), now, expanding it should be equivalent to running a.b.self? It is in Brave, but I get the a object in Safari.

Hypothesis: Safari devtools has a bug where it uses the object logged, and not the prop parent, as this.

Or is this UB and I've gotten something wrong?

safari result brave results

about 4 years ago · Juan Pablo Isaza
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