Always initialize SMI variables
MODIFY
packages/@romejs/codec-source-map/base64.ts
packages/@romejs/codec-source-map/base64.ts
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-const intToCharMap = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'.split(
- '',
+const intToCharMap = Array.from(
+ 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/',
);
/**
@@ -174,14 +174,13 @@ export function decodeVLQ(aStr: string, aIndex: number): [number, number] {
let result = 0;
let shift = 0;
let continuation = false;
- let digit;
do {
if (aIndex >= strLen) {
throw new Error('Expected more digits in base 64 VLQ value.');
}
- digit = decode(aStr.charCodeAt(aIndex++));
+ let digit = decode(aStr.charCodeAt(aIndex++));
if (digit === -1) {
throw new Error(`Invalid base64 digit: ${aStr.charAt(aIndex - 1)}`);
}

Always initialize SMI variables