summaryrefslogtreecommitdiffstats
path: root/js/src/tests/test262/built-ins/DataView/return-abrupt-tonumber-bytelength-symbol.js
blob: bfb97019f21e501a2c7dce6b79f3241aad8f4682 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
// Copyright (C) 2016 the V8 project authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.

/*---
esid: sec-dataview-buffer-byteoffset-bytelength
description: >
  Return abrupt from ToLength(symbol byteLength)
info: |
  24.2.2.1 DataView (buffer, byteOffset, byteLength )

  ...
  10. If byteLength is undefined, then
    a. Let viewByteLength be bufferByteLength - offset.
  11. Else,
    a. Let viewByteLength be ? ToLength(byteLength).
  ...
features: [Symbol]
---*/

var buffer = new ArrayBuffer(8);
var s = Symbol("1");

assert.throws(TypeError, function() {
  new DataView(buffer, 0, s);
});

reportCompare(0, 0);