• Leszek Swirski's avatar
    [destructuring] Get non-coercible message contents in runtime · 5e2c23e2
    Leszek Swirski authored
    For desrtucturing assignments from null/undefined, we throw an error
    that references the destructuring object literal's property name, e.g.
    for
      var { x } = null;
    we report that we cannot destructure 'x' from null.
    
    Rather than calculating this property during bytecode generation (and
    including it in the bytecode as an argument to the type error
    constructor), we can calculate it at exception throwing time, by
    re-parsing the source in a similar way to the existing call site
    rendering.
    
    This slightly decreases bytecode size and slightly decreases the amount
    of work the bytecode compiler needs to do. In the future, it could also
    allow us to give more detailed error messages, as we now have access to
    the entire AST and are on the slow path anyway.
    
    Bug: v8:6499
    Change-Id: Icdbd4667db548b4e5e62ef97797a3771b5c1bf72
    Reviewed-on: https://chromium-review.googlesource.com/c/1396080Reviewed-by: 's avatarToon Verwaest <verwaest@chromium.org>
    Reviewed-by: 's avatarSathya Gunasekaran <gsathya@chromium.org>
    Commit-Queue: Leszek Swirski <leszeks@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#58706}
    5e2c23e2
Name
Last commit
Last update
benchmarks Loading commit data...
build_overrides Loading commit data...
custom_deps Loading commit data...
docs Loading commit data...
gni 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 Loading commit data...
tools Loading commit data...
.clang-format Loading commit data...
.clang-tidy Loading commit data...
.editorconfig Loading commit data...
.git-blame-ignore-revs Loading commit data...
.gitattributes Loading commit data...
.gitignore Loading commit data...
.gn Loading commit data...
.vpython Loading commit data...
.ycm_extra_conf.py Loading commit data...
AUTHORS Loading commit data...
BUILD.gn Loading commit data...
CODE_OF_CONDUCT.md Loading commit data...
ChangeLog Loading commit data...
DEPS Loading commit data...
LICENSE Loading commit data...
LICENSE.fdlibm Loading commit data...
LICENSE.strongtalk Loading commit data...
LICENSE.v8 Loading commit data...
LICENSE.valgrind 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...
snapshot_toolchain.gni Loading commit data...