1 // |reftest| shell-option(--enable-uint8array-base64) skip-if(!Uint8Array.fromBase64||!xulRuntime.shell) -- uint8array-base64 is not enabled unconditionally, requires shell-options
2 // Copyright (C) 2024 Kevin Gibbons. All rights reserved.
3 // This code is governed by the BSD license found in the LICENSE file.
5 esid: sec-uint8array.prototype.setfromhex
6 description: Uint8Array.prototype.setFromHex throws if its first argument is not a string
7 features: [uint8array-base64, TypedArray]
10 var toStringCalls = 0;
11 var throwyToString = {
12 toString: function() {
14 throw new Test262Error("toString called");
18 assert.throws(TypeError, function() {
19 var target = new Uint8Array(10);
20 target.setFromHex(throwyToString);
22 assert.sameValue(toStringCalls, 0);