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

140
Vistas
Why can't @babel/parser parse objects?

When i input an object in astexplorer like below code, this will get a mistake: Missing semicolon. (3:9), what is that mean? @babel/parser can't parse object correctly?

{
  name: 'test',
  company: 'test company',
}

mistake

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

Your code is interpreted as a block statement, not an object literal. However, the contents of the block are not valid statements, hence the error.

If you wrap the code in parenthesis to force the evaluation as an expression (and thus as an object literal) it works as expected:

({
  name: 'test',
  company: 'test company',
})
about 4 years ago · Juan Pablo Isaza Denunciar
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