sebastienros / jint

Javascript Interpreter for .NET

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Got "Unexpected token {" using Destructuring assignment

carlosjorger opened this issue · comments

Version used

2.11.58

Describe the bug

The following code isnt working
var jsExpression = @"const person={name:'Carlos', age:26}; const {name}= person"; var engine = new Engine().Execute(jsExpression)
Got "Unexpected token {"

To Reproduce

Ideally code samples or better yet, xUnit test against current main.

Expected behavior

A clear and concise description of what you expected to happen.

Additional context

Add any other context about the problem here.

Please use v3 beta to get support for new ECMAScript features like destructuring.

Thank you very much, but my boss wants an stable version sadly

I can imagine - maybe you just have to tell the boss that such syntax shouldn't be used 😉

v3 beta has better coverage, passes all 2.x tests and generally I'd say it works more closer to the spec. And of course it is also multiple times faster 🤷🏻‍♂️

Thanks for this extra information and for your time lahma. I will convince my boss, I promise

We should rename it 3.0.0-nogenerators

image