• Andreas Haas's avatar
    [wasm] Allow WebAssembly.Global.value.set to be called with undefined · ad938456
    Andreas Haas authored
    A spec test (wasm-js/global/value-get-set) requires
    WebAssembly.Global.value.set to throw an exception if it is called with
    0 arguments. The implementation in V8, however, just checked if the
    first parameter is `undefined`. This implementation indeed threw an
    exception if 0 arguments were provided, but it also threw an exception
    when `undefined` is provided as a parameter. This, however, violates
    the spec, because globals can be reset to `undefined`.
    
    With this CL we replace the checking for `undefined` by checking the
    length of the arguments that get provided.
    
    R=ecmziegler@chromium.org
    
    Bug: chromium:1211342
    Change-Id: Ic87a0b369dea3e49eddb8f71f2c29dc6a8f5f558
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2940901Reviewed-by: 's avatarEmanuel Ziegler <ecmziegler@chromium.org>
    Commit-Queue: Andreas Haas <ahaas@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#74982}
    ad938456
globals.js 6.56 KB