summaryrefslogtreecommitdiffstats
path: root/js/src/tests/test262/built-ins/ArrayBuffer/prototype/transferToFixedLength/new-length-excessive.js
blob: cb679f227908af84a7e507d5bb7e859588f74e7e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
// Copyright (C) 2023 the V8 project authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-arraybuffer.prototype.transfertofixedlength
description: >
  Throws a RangeError if the newLength is larger than 2^53 - 1 due to clamping
  in ToIndex.
features: [arraybuffer-transfer]
---*/

var ab = new ArrayBuffer(0);

assert.throws(RangeError, function() {
  // Math.pow(2, 53) = 9007199254740992
  ab.transferToFixedLength(9007199254740992);
});

reportCompare(0, 0);