• Leszek Swirski's avatar
    [parser] Fix AST func reindexing for function fields · a769ea7a
    Leszek Swirski authored
    AST reindexing has to skip visiting fields that are already in the
    member initializer, as they will have already been visited when
    visiting said initializer. This is the case for private fields and
    fields with computed names.
    
    However, the reindexer was incorrectly assuming that all properties
    with a FunctionLiteral value are methods (and thus not fields, and
    can safely be visited). This is not the case for fields with
    function expression values.
    
    Now, we correctly use the class property's "kind" when making this
    visitation decision.
    
    Fixed: chromium:1132111
    Change-Id: Ia53d1fe713453e361b818dfb0b5f88a90cecdf21
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2440519
    Auto-Submit: Leszek Swirski <leszeks@chromium.org>
    Commit-Queue: Sathya Gunasekaran  <gsathya@chromium.org>
    Reviewed-by: 's avatarSathya Gunasekaran  <gsathya@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#70247}
    a769ea7a
regress-1132111.js 636 Bytes