estools / esvalid

confirm that a SpiderMonkey format AST represents an ECMAScript program
26 stars 7 forks source link

Error on valid break statement #48

Open lachrist opened 9 years ago

lachrist commented 9 years ago

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]; }
michaelficarra commented 9 years ago

Confirmed.