• Mathias Bynens's avatar
    [js] Remove CHECK_OBJECT_COERCIBLE for Array methods · 35b6aa38
    Mathias Bynens authored
    The spec got rid of `CheckObjectCoercible` a while back, and so should
    we. This change is not observable in most of the affected cases since
    `ToObject` is up near the top of most Array method algorithms. An
    example of an observable effect of this change occurs for the following
    input:
    
        Array.prototype.sort.call(null, 1);
    
    Behavior before applying the patch (incorrect message):
    
        TypeError: Array.prototype.sort called on null or undefined
    
    Expected behavior:
    
        TypeError: The comparison function must be either a function or
                   undefined
    
    This patch removes `CheckObjectCoercible` and adds tests to ensure the
    few observable cases are addressed correctly.
    
    The patch also adds a missing `ToObject(this)` to
    `Array.prototype.lastIndexOf` which would otherwise become observable
    as a result of `CheckObjectCoercible` being removed.
    
    BUG=v8:3577,v8:6921
    
    Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel
    Change-Id: Ia086095076c4bf4d8d58dab26bc28df02994ed01
    Reviewed-on: https://chromium-review.googlesource.com/718577Reviewed-by: 's avatarAdam Klein <adamk@chromium.org>
    Reviewed-by: 's avatarToon Verwaest <verwaest@chromium.org>
    Commit-Queue: Mathias Bynens <mathias@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#48800}
    35b6aa38
Name
Last commit
Last update
benchmarks Loading commit data...
build_overrides Loading commit data...
docs Loading commit data...
gni Loading commit data...
gypfiles 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...
.editorconfig Loading commit data...
.git-blame-ignore-revs Loading commit data...
.gitignore Loading commit data...
.gn 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...
Makefile Loading commit data...
Makefile.android 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...