ChakraCore icon indicating copy to clipboard operation
ChakraCore copied to clipboard

Object destructuring issue: Initializer on shorthand should not throw syntax error

Open abchatra opened this issue 10 years ago • 5 comments

Following should parse

var x = 10;
({x = 10} = {});

Actual: Syntax error

Refer OS bug 3887967

abchatra avatar Jan 07 '16 01:01 abchatra

these sorts of frontend fixes are probably good first bugs, if you want to attract volunteer contributors to work on actual language features.

I'm hoping I can encourage some local youth to tackle some of these bugs.

caitp avatar Jan 15 '16 16:01 caitp

Hey, I'm a newbie. Can I work on this bug and also get some help on how to tackle this bug ?

kepta avatar Jan 20 '16 04:01 kepta

@kepta absolutely. Tracing from the parser is the easiest thing to do. Add breakpoint at Parser::Parse. Also look at the call sites of IsES6DestructuringEnabled. That code amounts to destructuring related.

See this for building instructions. Let me know if you have more questions.

abchatra avatar Jan 20 '16 14:01 abchatra

@kepta also take a read through test/runtests.cmd to learn how to run tests. Of particular note, consider providing the options -dirs es6 -variant interpreter to reduce the number of tests run to those surrounding the new language features and running them against front end, so you can have quicker code, build, test, debug loops.

So for example, after building x64 debug in VS, cd to the test directory and execute runtests.cmd -x64debug -dirs es6 -variant interpreter to run tests appropriate for this bug.

Of course once you're satisfied with your change you'll want to run all tests to make sure nothing broke by accident (run all tests by only specifying the build flavor, e.g. runtests.cmd -x64debug).

ianwjhalliday avatar Jan 20 '16 19:01 ianwjhalliday

This is fixed.

akroshg avatar Feb 25 '16 22:02 akroshg