• littledan's avatar
    Implement sloppy-mode block-defined functions (Annex B 3.3) · e5ff10d7
    littledan authored
    ES2015 specifies very particular semantics for functions defined in blocks.
    In strict mode, it is simply a lexical binding scoped to that block. In sloppy
    mode, in addition to that lexical binding, there is a var-style binding in
    the outer scope, which is overwritten with the local binding when the function
    declaration is evaluated, *as long as* introducing ths var binding would not
    create a var/let conflict in the outer scope.
    
    This patch implements the semantics by introducing a DelegateStatement, which
    is initially filled in with the EmptyStatement and overwritten with the
    assignment when the scope is closed out and it can be checked that there is
    no conflict.
    
    This patch is tested with a new mjsunit test, and I tried staging it and running
    test262, finding that the tests that we have disabled due to lack of Annex B
    support now pass.
    
    R=adamk,rossberg
    LOG=Y
    BUG=v8:4285
    
    Review URL: https://codereview.chromium.org/1332873003
    
    Cr-Commit-Position: refs/heads/master@{#30842}
    e5ff10d7
Name
Last commit
Last update
benchmarks Loading commit data...
build Loading commit data...
include Loading commit data...
infra Loading commit data...
samples Loading commit data...
src Loading commit data...
test Loading commit data...
testing Loading commit data...
third_party/binutils Loading commit data...
tools Loading commit data...
.clang-format Loading commit data...
.gitignore Loading commit data...
.ycm_extra_conf.py Loading commit data...
AUTHORS Loading commit data...
BUILD.gn Loading commit data...
ChangeLog Loading commit data...
DEPS Loading commit data...
LICENSE Loading commit data...
LICENSE.strongtalk Loading commit data...
LICENSE.v8 Loading commit data...
LICENSE.valgrind Loading commit data...
Makefile Loading commit data...
Makefile.android Loading commit data...
Makefile.nacl Loading commit data...
OWNERS Loading commit data...
PRESUBMIT.py Loading commit data...
README.md Loading commit data...
WATCHLISTS Loading commit data...
codereview.settings Loading commit data...