/
githubmirror
/
node
Обзор
Документация
Войти
/
githubmirror
/
node
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
deps/v8/test/mjsunit/wasm/memory-resizable-buffer-array-pop-shift.js
42 строки
1 KB
Michaël Zasso
deps: update V8 to 13.6.233.8
02 май 2025, 16:06
Не верифицирован
02 май 2025, 16:06
918fe04
Код
Авторство
О чём код?
// Copyright 2025 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: --allow-natives-syntax --js-staging // Flags: --experimental-wasm-rab-integration 'use strict'; d8.file.execute('test/mjsunit/typedarray-helpers.js'); const kPageSize = 0x10000; (function ArrayPopShift() { // These functions always fail since setting the length fails. for (let ctor of ctors) { const rab = CreateResizableArrayBufferViaWasm(1, 2); const fixedLength = new ctor(rab, 0, 4); const fixedLengthWithOffset = new ctor(rab, 2 * ctor.BYTES_PER_ELEMENT, 2); const lengthTracking = new ctor(rab, 0); const lengthTrackingWithOffset = new ctor(rab, kPageSize - 2 * ctor.BYTES_PER_ELEMENT); function testAllFuncsThrow() { for (let func of [Array.prototype.pop, Array.prototype.shift]) { assertThrows(() => { func.call(fixedLength); }, TypeError); assertThrows(() => { func.call(fixedLengthWithOffset); }, TypeError); assertThrows(() => { func.call(lengthTracking); }, TypeError); assertThrows(() => { func.call(lengthTrackingWithOffset); }, TypeError); } } testAllFuncsThrow(); %ArrayBufferDetachForceWasm(rab); testAllFuncsThrow(); } })();