Bug 1885337 - Part 3: Import tests from test262 PR. r=spidermonkey-reviewers,dminor
[gecko.git] / js / src / tests / test262 / prs / 3994 / built-ins / Uint8Array / prototype / setFromBase64 / nonconstructor.js
blob46f5078ff51307fa37043157567897ef0f6a1713
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.
4 /*---
5 esid: sec-uint8array.prototype.setfrombase64
6 description: >
7   Uint8Array.prototype.setFromBase64 is not a constructor function.
8 includes: [isConstructor.js]
9 features: [uint8array-base64, TypedArray, Reflect.construct]
10 ---*/
12 assert(!isConstructor(Uint8Array.prototype.setFromBase64), "Uint8Array.prototype.setFromBase64 is not a constructor");
14 assert.throws(TypeError, function() {
15   var target = new Uint8Array(10);
16   new target.setFromBase64('');
17 });
19 reportCompare(0, 0);