1 // |reftest| skip -- Float16Array is not supported
2 // Copyright (C) 2024 Kevin Gibbons. All rights reserved.
3 // This code is governed by the BSD license found in the LICENSE file.
6 esid: sec-dataview.prototype.setfloat16
8 Throws a RangeError if getIndex < 0
9 features: [Float16Array]
12 var buffer = new ArrayBuffer(12);
13 var sample = new DataView(buffer, 0);
15 assert.throws(RangeError, function() {
16 sample.setFloat16(-1, 39);
18 assert.sameValue(sample.getFloat32(0), 0, "-1 - no value was set");
20 assert.throws(RangeError, function() {
21 sample.setFloat16(-Infinity, 39);
23 assert.sameValue(sample.getFloat32(0), 0, "-Infinity - no value was set");