summaryrefslogtreecommitdiffstats
path: root/js/src/tests/test262/built-ins/DataView/prototype/setFloat16/no-value-arg.js
blob: 75f634b0a92ca2732d4fdfdf11299c3ec287636d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
// |reftest| shell-option(--enable-float16array) skip-if(!this.hasOwnProperty('Float16Array')||!xulRuntime.shell) -- Float16Array is not enabled unconditionally, requires shell-options
// Copyright (C) 2024 Kevin Gibbons. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.

/*---
esid: sec-dataview.prototype.setfloat16
description: >
  Set value as undefined (cast to NaN) when value argument is not present
features: [Float16Array]
---*/

var buffer = new ArrayBuffer(8);
var sample = new DataView(buffer, 0);

var result = sample.setFloat16(0);

assert.sameValue(sample.getFloat16(0), NaN);
assert.sameValue(result, undefined);

reportCompare(0, 0);