4bef10308f
Bug: v8:11111,chromium:1377840 Change-Id: I0a3d86b9f160c0daf28f45b9ec7a37f0a88be614 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3976511 Reviewed-by: Shu-yu Guo <syg@chromium.org> Commit-Queue: Marja Hölttä <marja@chromium.org> Auto-Submit: Marja Hölttä <marja@chromium.org> Cr-Commit-Position: refs/heads/main@{#83942}
20 lines
495 B
JavaScript
20 lines
495 B
JavaScript
// Copyright 2022 the V8 project authors. All rights reserved.
|
|
// Use of this source code is governed by a BSD-style license that can be
|
|
// found in the LICENSE file.
|
|
|
|
// Flags: --harmony-rab-gsab
|
|
|
|
const rab = new ArrayBuffer(3782, {maxByteLength: 4096});
|
|
const u16a = new Int16Array(rab);
|
|
rab.resize(0);
|
|
|
|
function ctor() {
|
|
return u16a;
|
|
}
|
|
|
|
assertThrows(() => { Float64Array.of.call(ctor, 1); }, TypeError);
|
|
|
|
rab.resize(8);
|
|
const u16a2 = Int16Array.of.call(ctor, 3);
|
|
assertEquals(3, u16a2[0]);
|