Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

134
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!