ignores-receiver.js (788B)
1 // |reftest| skip-if(!Uint8Array.fromBase64) -- uint8array-base64 is not enabled unconditionally 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.frombase64 6 description: Uint8Array.fromBase64 ignores its receiver 7 features: [uint8array-base64, TypedArray] 8 ---*/ 9 10 var fromBase64 = Uint8Array.fromBase64; 11 var noReceiver = fromBase64("Zg=="); 12 assert.sameValue(Object.getPrototypeOf(noReceiver), Uint8Array.prototype); 13 14 class Subclass extends Uint8Array { 15 constructor() { 16 throw new Test262Error("subclass constructor called"); 17 } 18 } 19 var fromSubclass = Subclass.fromBase64("Zg=="); 20 assert.sameValue(Object.getPrototypeOf(fromSubclass), Uint8Array.prototype); 21 22 reportCompare(0, 0);