• clemensh's avatar
    [wasm] Fix ToNumber conversion · ae1c5746
    clemensh authored
    There were two bugs, one partly hiding the other one:
    1) We generate the ToNumber conversion for each WASM_TO_JS wrapper,
       even if the expected return type is void.
    2) The return node in the WASM_TO_JS wrapper did not use the effect of
       the ToNumber conversion.
    
    This CL fixes both, and adds test cases to check that we do throw an
    error trying to convert (e.g.) Symbol to a number, but only if the
    return type is not void.
    Additional test check that a user-provided valueOf method is actually
    called the correct number of times.
    
    R=titzer@chromium.org, bradnelson@chromium.org
    BUG=v8:4203
    
    Review-Url: https://codereview.chromium.org/2552123004
    Cr-Commit-Position: refs/heads/master@{#41552}
    ae1c5746
wasm-compiler.cc 130 KB