• Andreas Haas's avatar
    [mjsunit] Move the implementation of testAsync into a separate file · 8c3c1b6c
    Andreas Haas authored
    The original implementation of 'testAsync' in mjsunit.js required to
    put the call to '%AbortJS' into an 'eval' statement. The reason is that
    this call requires the flag --allow-natives-syntax to be set, but the
    flag is not set in all mjsunit tests. With the use of 'eval'
    compilation errors can be avoided.
    
    The problem with this approach was that the fuzzer started to produce
    test cases which include the line 'eval("%AbortJS(message)");', and
    this line crashes intentionally. Different to the line
    '%Abort(message)', however, the 'eval' statement cannot be filtered
    so easily in the fuzzer. Therefore I pulled the implementation of
    'testAsync' into a separate file to avoid the 'eval'.
    
    Additional changes: I use '===' now instead of 'deepEquals' in
    AsyncAssertion.equals because 'deepEquals' is not available outside
    mjsunit.js. Using '===' seems more appropriate anyways because for
    all tests but one it is sufficient, and it is more precise than
    deepEquals.
    
    R=gsathya@chromium.org
    
    Bug: chromium:774841
    Change-Id: I47270aa63ff5a1d6aa76a771f9276eaaf579c5ac
    Reviewed-on: https://chromium-review.googlesource.com/1156598Reviewed-by: 's avatarSathya Gunasekaran <gsathya@chromium.org>
    Commit-Queue: Andreas Haas <ahaas@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#54833}
    8c3c1b6c
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...
.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...