• caitpotter88's avatar
    [es6] implement default parameters via desugaring · 892c8548
    caitpotter88 authored
    Stage 1 implementation:
    
    - Parameters can't be referenced before initialized (from left-to-right)
    - SingleNameBindings only, no support for BindingPatterns
    
    Known issues:
    
    - Incorrect scoping (parameter expressions may reference variables declared in function body)
    - Function arity is untouched
    - Hole-checking needs work
    - Rest parameters are broken when mixed with optional arguments
    
    BUG=v8:2160
    LOG=N
    R=arv@chromium.org, rossberg@chromium.org
    
    Review URL: https://codereview.chromium.org/1127063003
    
    Cr-Commit-Position: refs/heads/master@{#28739}
    892c8548
default-parameters.js 4.07 KB