Bug 1892041 - Part 2: Update test262. r=spidermonkey-reviewers,dminor
[gecko.git] / js / src / tests / test262 / built-ins / DataView / prototype / getFloat16 / this-is-not-object.js
blob4a000962c8510cd3f1b784321a5eec99d7378378
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.
5 /*---
6 esid: sec-dataview.prototype.getfloat16
7 description: Throws a TypeError if this is not Object
8 features: [Float16Array, Symbol]
9 ---*/
11 var getFloat16 = DataView.prototype.getFloat16;
13 assert.throws(TypeError, function() {
14   getFloat16.call(undefined);
15 }, "undefined");
17 assert.throws(TypeError, function() {
18   getFloat16.call(null);
19 }, "null");
21 assert.throws(TypeError, function() {
22   getFloat16.call(1);
23 }, "1");
25 assert.throws(TypeError, function() {
26   getFloat16.call("string");
27 }, "string");
29 assert.throws(TypeError, function() {
30   getFloat16.call(true);
31 }, "true");
33 assert.throws(TypeError, function() {
34   getFloat16.call(false);
35 }, "false");
37 var s = Symbol("1");
38 assert.throws(TypeError, function() {
39   getFloat16.call(s);
40 }, "symbol");
42 reportCompare(0, 0);