Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

111
Vistas
LexicallyScopedDeclarations operation doesn't make sense

let's assume we have a function and inside that function, we have a let declaration at the topmost level of the function.

now we run FunctionDeclarationInstantiation, but here comes the weird part, take a look at step 33.

Let lexDeclarations be the LexicallyScopedDeclarations of code.

so we invoked the LexicallyScopedDeclarations operation with the parse node FunctionBody.

therefore we run the implicit algorithm definition(because there is no algorithm for the FunctionBody production)

FunctionBody:FunctionStatementList
  Return LexicallyScopedDeclarations of FunctionStatementList 

so we get to this algorithm

FunctionStatementList:StatementList
  Return the TopLevelLexicallyScopedDeclarations of StatementList.

and that's where my confusion begins, because now when we invoke TopLevelLexicallyScopedDeclarations with StatementList

and we will get here

StatementList : StatementList StatementListItem
 1. Let declarations1 be TopLevelLexicallyScopedDeclarations of StatementList.
 2. Let declarations2 be TopLevelLexicallyScopedDeclarations of StatementListItem.
 3. Return the list-concatenation of declarations1 and declarations2.

finally, that will bring us to this algorithm

StatementListItem : Declaration
 1. If Declaration is Declaration : HoistableDeclaration , then
    a. Return a new empty List.
 2. Return « Declaration ».

now, how are we supposed to obtain the let variable that I've mentioned above, if step 1 says that if that Declaration is a Declaration: HoistableDeclaration then we return an empty list

it doesn't make any sense to me.

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda