Debian Codegraph @

js/src/tests/test262/built-ins/DataView/return-abrupt-tonumber-bytelength-symbol.js

raw
1 // Copyright (C) 2016 the V8 project authors. All rights reserved.
2 // This code is governed by the BSD license found in the LICENSE file.
3
4 /*---
5 esid: sec-dataview-buffer-byteoffset-bytelength
6 description: >
7 Return abrupt from ToLength(symbol byteLength)
8 info: |
9 24.2.2.1 DataView (buffer, byteOffset, byteLength )
10
11 ...
12 10. If byteLength is undefined, then
13 a. Let viewByteLength be bufferByteLength - offset.
14 11. Else,
15 a. Let viewByteLength be ? ToLength(byteLength).
16 ...
17 features: [Symbol]
18 ---*/
19
20 var buffer = new ArrayBuffer(8);
21 var s = Symbol("1");
22
23 assert.throws(TypeError, function() {
24 new DataView(buffer, 0, s);
25 });
26
27 reportCompare(0, 0);