• Toon Verwaest's avatar
    [parser] Give hoisting sloppy block functions a valid position · 8436715f
    Toon Verwaest authored
    A sloppy function in a block scope implicitily creates a var in the outer
    declaration scope if it's not blocked. The assignment created reads the local
    lexical declaration for the function. The reference introduced automatically
    takes part in NeedsHoleCheck, requiring the reference to have a valid position.
    Since the assignment will happen after the local declaration, we give the
    end_position() of the closure as the position of the reference, so hole checks
    can be omitted.
    
    Bug: chromium:917755
    Change-Id: Iee0e042b2463f97f05075f9eec09dac8c6eaf539
    Reviewed-on: https://chromium-review.googlesource.com/c/1408991Reviewed-by: 's avatarLeszek Swirski <leszeks@chromium.org>
    Commit-Queue: Toon Verwaest <verwaest@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#58823}
    8436715f
BasicLoops.golden 16.2 KB