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

377
Visualizações
which is the outer lexical reference and callee of the class constructor?

I'm figuring out the lexical environment of the constructor in class.

class Func {
  constructor() {}
}

As far as I concerned, new Func() would call the internal method [[Construct]] which refers to Func.prototype.constructor and it points at Func at the end.

The point is, what would be the Outer Lexical Environment Reference of this constructor? and how the Execution Context goes on this?

For example, when you try to make a new Promise, an example starts like this;

const foo = new Promise((resolve, reject) => {
  setTimeout(() => {
    resolve('good');
  }, 5000);
});

new Promise() calls [[Construct]] in Promise, and it goes to Promise.prototype.constructor() which is exactly same as Promise.

At this moment, does the executed constructor behave as it is called from the global scope? It is very vague for me to figure out who's calling who.

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