You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Call the following API for the given piece of code: esprima.parseModule(sourceCode, { loc: true, tolerant: true });
classMyClass{async;foo(){}}
Expected output
The parsing goes through fine
Actual output
Error
description: "Unexpected token ;"
index: 28
lineNumber: 2
column: 10
stack: "Error: Line 2: Unexpected token ;\n at ErrorHandler.constructError (http://localhost:8000/esprima-next/esprima-next.js:1482:17) at ErrorHandler.createError (http://localhost:8000/esprima-next/esprima-next.js:1495:25) at Parser.unexpectedTokenError (http://localhost:8000/esprima-next/esprima-next.js:2890:32) at Parser.throwUnexpectedToken (http://localhost:8000/esprima-next/esprima-next.js:2899:16) at Parser.parseObjectPropertyKey (http://localhost:8000/esprima-next/esprima-next.js:3403:22) at Parser.parseClassElement (http://localhost:8000/esprima-next/esprima-next.js:5696:24) at Parser.parseClassElementList (http://localhost:8000/esprima-next/esprima-next.js:5797:24) at Parser.parseClassBody (http://localhost:8000/esprima-next/esprima-next.js:5805:30) at Parser.parseClassDeclaration (http://localhost:8000/esprima-next/esprima-next.js:5821:28) at Parser.parseStatementListItem (http://localhost:8000/esprima-next/esprima-next.js:4405:28)"
Some keywords are reserved, meaning that they cannot be used as an identifier for variable declarations, function declarations, etc. They are often called reserved words. A list of these reserved words is provided below. Not all keywords are reserved — for example, async can be used as an identifier anywhere.
The text was updated successfully, but these errors were encountered:
Steps to reproduce
Call the following API for the given piece of code:
esprima.parseModule(sourceCode, { loc: true, tolerant: true });
Expected output
The parsing goes through fine
Actual output
Relevant references
"async" is a valid identifier. See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Lexical_grammar
The text was updated successfully, but these errors were encountered: