google-code-export / esprima

Automatically exported from code.google.com/p/esprima
BSD 2-Clause "Simplified" License
1 stars 0 forks source link

Simplify exception throwing #629

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
The mechanism to throw an exception when there is a parsing error is rather 
convoluted. This demands a simplification.

From the requirement perspective, there are only two categories of exception:

  * Unexpected token exception
  * Other generic error

Also, depending whether tolerant flag is set to true or not, there is another 
variant of each of the above. Thus, a sufficient set of useful functions to 
permit the above cases are:

  * throwUnexpectedToken and tolerateUnexpectedToken
  * throwError and tolerateError

Original issue reported on code.google.com by ariya.hi...@gmail.com on 27 Jan 2015 at 8:21

GoogleCodeExporter commented 9 years ago
Simplify exception throwing.
https://github.com/jquery/esprima/commit/dc6a67d759

Original comment by ariya.hi...@gmail.com on 29 Jan 2015 at 7:39