|
Last change
on this file was 9af201e, checked in by MBK <marija.karapandzova@…>, 12 days ago |
|
Fix frontend appearance
|
-
Property mode
set to
100644
|
|
File size:
1.0 KB
|
| Line | |
|---|
| 1 | 'use strict';
|
|---|
| 2 | var $ = require('../internals/export');
|
|---|
| 3 | var globalThis = require('../internals/global-this');
|
|---|
| 4 | var arrayFromConstructorAndList = require('../internals/array-from-constructor-and-list');
|
|---|
| 5 | var $fromBase64 = require('../internals/uint8-from-base64');
|
|---|
| 6 |
|
|---|
| 7 | var Uint8Array = globalThis.Uint8Array;
|
|---|
| 8 |
|
|---|
| 9 | var INCORRECT_BEHAVIOR_OR_DOESNT_EXISTS = !Uint8Array || !Uint8Array.fromBase64 || !function () {
|
|---|
| 10 | // Webkit not throw an error on odd length string
|
|---|
| 11 | try {
|
|---|
| 12 | Uint8Array.fromBase64('a');
|
|---|
| 13 | return;
|
|---|
| 14 | } catch (error) { /* empty */ }
|
|---|
| 15 | try {
|
|---|
| 16 | Uint8Array.fromBase64('', null);
|
|---|
| 17 | } catch (error) {
|
|---|
| 18 | return true;
|
|---|
| 19 | }
|
|---|
| 20 | }();
|
|---|
| 21 |
|
|---|
| 22 | // `Uint8Array.fromBase64` method
|
|---|
| 23 | // https://tc39.es/ecma262/#sec-uint8array.frombase64
|
|---|
| 24 | if (Uint8Array) $({ target: 'Uint8Array', stat: true, forced: INCORRECT_BEHAVIOR_OR_DOESNT_EXISTS }, {
|
|---|
| 25 | fromBase64: function fromBase64(string /* , options */) {
|
|---|
| 26 | var result = $fromBase64(string, arguments.length > 1 ? arguments[1] : undefined, null, 0x1FFFFFFFFFFFFF);
|
|---|
| 27 | return arrayFromConstructorAndList(Uint8Array, result.bytes);
|
|---|
| 28 | }
|
|---|
| 29 | });
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.