Skip to content

Commit

Permalink
minor style/jsdoc fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
vapier committed Sep 28, 2019
1 parent 227d7d2 commit 13a5b4f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions text.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ FastTextEncoder.prototype.encode = function(string, options={stream: false}) {

let pos = 0;
const len = string.length;
const out = [];

let at = 0; // output position
let tlen = Math.max(32, len + (len >> 1) + 7); // 1.5x size
Expand Down Expand Up @@ -133,6 +132,7 @@ Object.defineProperty(FastTextDecoder.prototype, 'ignoreBOM', {value: false});
/**
* @param {(!ArrayBuffer|!ArrayBufferView)} buffer
* @param {{stream: boolean}=} options
* @return {string}
*/
FastTextDecoder.prototype.decode = function(buffer, options={stream: false}) {
if (options['stream']) {
Expand All @@ -149,7 +149,7 @@ FastTextDecoder.prototype.decode = function(buffer, options={stream: false}) {
if (byte1 === 0) {
break; // NULL
}

if ((byte1 & 0x80) === 0) { // 1-byte
out.push(byte1);
} else if ((byte1 & 0xe0) === 0xc0) { // 2-byte
Expand All @@ -169,7 +169,7 @@ FastTextDecoder.prototype.decode = function(buffer, options={stream: false}) {
if (codepoint > 0xffff) {
// codepoint &= ~0x10000;
codepoint -= 0x10000;
out.push((codepoint >>> 10) & 0x3ff | 0xd800)
out.push((codepoint >>> 10) & 0x3ff | 0xd800);
codepoint = 0xdc00 | codepoint & 0x3ff;
}
out.push(codepoint);
Expand Down

0 comments on commit 13a5b4f

Please sign in to comment.