sebastienros / esprima-dotnet

Esprima .NET (BSD license) is a .NET port of the esprima.org project. It is a standard-compliant ECMAScript parser (also popularly known as JavaScript).
BSD 3-Clause "New" or "Revised" License
425 stars 75 forks source link

Update syntax validation rules to align better with the spec #387

Closed lahma closed 1 year ago

lahma commented 1 year ago

While working with support for class members in Jint I've found some problems when running eval() code that uses parser and which expects to certain validation rules to apply. I've made things stricter here and basically breaking some very legacy code that might use old constructs under "use strict" which should anyway be opt-int decision.

There's new options flag AllowReturnOutsideFunction which ensures that Jint can use "sloppy test code" but by default return outside of functions is not allowed like the spec mandates.

lahma commented 1 year ago

Hey @adams85 , I would need to get this released to complete my class implementation work on Jint side. If we'd release a new RC is there something you would like to get into that train?

adams85 commented 1 year ago

Hi! Yep, it'd be nice to fit #386 in if you could verify that's ok with Jint. It should be, just makes the parser stricter so we'd better check that it doesn't break anything. However, it's not something critical so if it's urgent for you to make the release, we can as well postpone merging my PR.