• adamk's avatar
    Remove AssignmentExpressionFlags enum, handle error checking in callers · 1003785c
    adamk authored
    This is hopefully the last in a series of cleanup patches around
    destructuring assignment. It simplifies the ParseAssignmentExpression
    API, making the callers call CheckDestructuringElement() where appropriate.
    CheckDestructuringElement has been further simplified to only emit the
    errors that the parser depends on it emitting.
    
    I've also beefed up the test coverage in test-parsing.cc to
    handling all the destructuring flags being on, which caught an oddity
    in how we disallow initializers in spreads in patterns (we need to treat
    RewritableAssignmentExpressions as Assignments for the purpose of
    error checking).
    
    Finally, I added a few helper methods to ParserBase to handle a few
    classes of expressions (assignments and literals-as-patterns).
    
    Review URL: https://codereview.chromium.org/1696603002
    
    Cr-Commit-Position: refs/heads/master@{#33961}
    1003785c
test-parsing.cc 254 KB