esvalid icon indicating copy to clipboard operation
esvalid copied to clipboard

Error on valid break statement

Open lachrist opened this issue 10 years ago • 1 comments

Hi, first thank for your handy module!! I get a error on the code: a: try { break a; } finally { } which is legal I believe. Below is a minimal bug reproduction:

var Esprima = require('esprima');
var Esvalid = require('esvalid');

var code = 'a: try { break a; } finally { }';
var ast = Esprima.parse(code);
var errors = Esvalid.errors(ast);
if (errors.length > 0) { throw errors[0]; }

lachrist avatar Feb 11 '15 11:02 lachrist

Confirmed.

michaelficarra avatar Feb 13 '15 18:02 michaelficarra