Skip to content

Commit b70bd90

Browse files
committed
No B64 inlining
1 parent d7d3582 commit b70bd90

File tree

4 files changed

+23
-26
lines changed

4 files changed

+23
-26
lines changed

ByteBuffer.js

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1591,9 +1591,8 @@
15911591
/**
15921592
* Base64 alphabet.
15931593
* @type {string}
1594-
* @const
1595-
*/
1596-
var b64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
1594+
*/ // @const will inline this, which is not so smart
1595+
var B64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
15971596

15981597
/**
15991598
* Encodes a ByteBuffer's contents to a base64 string.
@@ -1619,7 +1618,7 @@
16191618
h2 = bits >> 12 & 0x3f;
16201619
h3 = bits >> 6 & 0x3f;
16211620
h4 = bits & 0x3f;
1622-
out[oi++] = b64.charAt(h1) + b64.charAt(h2) + b64.charAt(h3) + b64.charAt(h4);
1621+
out[oi++] = B64.charAt(h1) + B64.charAt(h2) + B64.charAt(h3) + B64.charAt(h4);
16231622
} while (i < bb.length);
16241623
var enc = out.join(''),
16251624
r = (bb.length - bb.offset) % 3;
@@ -1642,10 +1641,10 @@
16421641
var o1, o2, o3, h1, h2, h3, h4, bits, i = 0,
16431642
out = new ByteBuffer(Math.ceil(str.length / 3), littleEndian);
16441643
do {
1645-
h1 = b64.indexOf(str.charAt(i++));
1646-
h2 = b64.indexOf(str.charAt(i++));
1647-
h3 = b64.indexOf(str.charAt(i++));
1648-
h4 = b64.indexOf(str.charAt(i++));
1644+
h1 = B64.indexOf(str.charAt(i++));
1645+
h2 = B64.indexOf(str.charAt(i++));
1646+
h3 = B64.indexOf(str.charAt(i++));
1647+
h4 = B64.indexOf(str.charAt(i++));
16491648
if (h1 < 0 || h2 < 0 || h3 < 0 || h4 < 0) {
16501649
throw(new Error("Illegal argument: Not a valid base64 encoded string"));
16511650
}

ByteBuffer.min.map

Lines changed: 2 additions & 2 deletions
Large diffs are not rendered by default.

ByteBuffer.noexpose.js

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1505,9 +1505,8 @@
15051505
/**
15061506
* Base64 alphabet.
15071507
* @type {string}
1508-
* @const
1509-
*/
1510-
var b64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
1508+
*/ // @const will inline this, which is not so smart
1509+
var B64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
15111510

15121511
/**
15131512
* Encodes a ByteBuffer's contents to a base64 string.
@@ -1532,7 +1531,7 @@
15321531
h2 = bits >> 12 & 0x3f;
15331532
h3 = bits >> 6 & 0x3f;
15341533
h4 = bits & 0x3f;
1535-
out[oi++] = b64.charAt(h1) + b64.charAt(h2) + b64.charAt(h3) + b64.charAt(h4);
1534+
out[oi++] = B64.charAt(h1) + B64.charAt(h2) + B64.charAt(h3) + B64.charAt(h4);
15361535
} while (i < bb.length);
15371536
var enc = out.join(''),
15381537
r = (bb.length - bb.offset) % 3;
@@ -1554,10 +1553,10 @@
15541553
var o1, o2, o3, h1, h2, h3, h4, bits, i = 0,
15551554
out = new ByteBuffer(Math.ceil(str.length / 3), littleEndian);
15561555
do {
1557-
h1 = b64.indexOf(str.charAt(i++));
1558-
h2 = b64.indexOf(str.charAt(i++));
1559-
h3 = b64.indexOf(str.charAt(i++));
1560-
h4 = b64.indexOf(str.charAt(i++));
1556+
h1 = B64.indexOf(str.charAt(i++));
1557+
h2 = B64.indexOf(str.charAt(i++));
1558+
h3 = B64.indexOf(str.charAt(i++));
1559+
h4 = B64.indexOf(str.charAt(i++));
15611560
if (h1 < 0 || h2 < 0 || h3 < 0 || h4 < 0) {
15621561
throw(new Error("Illegal argument: Not a valid base64 encoded string"));
15631562
}

src/ByteBuffer.js

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1591,9 +1591,8 @@
15911591
/**
15921592
* Base64 alphabet.
15931593
* @type {string}
1594-
* @const
1595-
*/
1596-
var b64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
1594+
*/ // @const will inline this, which is not so smart
1595+
var B64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
15971596

15981597
/**
15991598
* Encodes a ByteBuffer's contents to a base64 string.
@@ -1619,7 +1618,7 @@
16191618
h2 = bits >> 12 & 0x3f;
16201619
h3 = bits >> 6 & 0x3f;
16211620
h4 = bits & 0x3f;
1622-
out[oi++] = b64.charAt(h1) + b64.charAt(h2) + b64.charAt(h3) + b64.charAt(h4);
1621+
out[oi++] = B64.charAt(h1) + B64.charAt(h2) + B64.charAt(h3) + B64.charAt(h4);
16231622
} while (i < bb.length);
16241623
var enc = out.join(''),
16251624
r = (bb.length - bb.offset) % 3;
@@ -1642,10 +1641,10 @@
16421641
var o1, o2, o3, h1, h2, h3, h4, bits, i = 0,
16431642
out = new ByteBuffer(Math.ceil(str.length / 3), littleEndian);
16441643
do {
1645-
h1 = b64.indexOf(str.charAt(i++));
1646-
h2 = b64.indexOf(str.charAt(i++));
1647-
h3 = b64.indexOf(str.charAt(i++));
1648-
h4 = b64.indexOf(str.charAt(i++));
1644+
h1 = B64.indexOf(str.charAt(i++));
1645+
h2 = B64.indexOf(str.charAt(i++));
1646+
h3 = B64.indexOf(str.charAt(i++));
1647+
h4 = B64.indexOf(str.charAt(i++));
16491648
if (h1 < 0 || h2 < 0 || h3 < 0 || h4 < 0) {
16501649
throw(new Error("Illegal argument: Not a valid base64 encoded string"));
16511650
}

0 commit comments

Comments
 (0)