• vabr's avatar
    Fix error message for invalid buffer offset · 1dd803f9
    vabr authored
    The constructor for TypedArray in js/typedarray.js emitted
    kInvalidTypedArrayAlignment if the array offset exceeded the size of the
    underlying buffer. This seems like a typo introduced in
    https://codereview.chromium.org/2090353003.
    
    The error message to be emitted instead coincides with the already existing
    kInvalidDataViewOffset. The message string is independent of whether the
    object in question is a DataView or a typed array, so this CL:
      (1) renames kInvalidDataViewOffset to just kInvalidOffset, and
      (2) uses kInvalidOffset instead of kInvalidTypedArrayAlignment for cases
          when the TypedArray is constructed with an offset exceeding the buffer
          size.
    
    BUG=v8:5733
    TEST=Run d8, execute "new Uint8Array(new ArrayBuffer(1),2)", see the error message mention the invalid offset 2.
    
    Review-Url: https://codereview.chromium.org/2692753002
    Cr-Commit-Position: refs/heads/master@{#43151}
    1dd803f9
Name
Last commit
Last update
..
benchmarks Loading commit data...
cctest Loading commit data...
common Loading commit data...
debugger Loading commit data...
fuzzer Loading commit data...
inspector Loading commit data...
intl Loading commit data...
js-perf-test Loading commit data...
memory Loading commit data...
message Loading commit data...
mjsunit Loading commit data...
mozilla Loading commit data...
preparser Loading commit data...
promises-aplus Loading commit data...
simdjs Loading commit data...
test262 Loading commit data...
unittests Loading commit data...
webkit Loading commit data...
BUILD.gn Loading commit data...
bot_default.gyp Loading commit data...
bot_default.isolate Loading commit data...
default.gyp Loading commit data...
default.isolate Loading commit data...
optimize_for_size.gyp Loading commit data...
optimize_for_size.isolate Loading commit data...
perf.gyp Loading commit data...
perf.isolate Loading commit data...