Turn var into const or let

This commit is contained in:
Martin von Gagern
2017-01-07 02:25:50 +01:00
committed by Kevin Barabash
parent 9b565a6375
commit bd9db332d2
33 changed files with 1308 additions and 1318 deletions

View File

@@ -33,25 +33,25 @@ function defineSymbol(mode, font, group, replace, name) {
// This helps minify the code, and also spotting typos using jshint.
// modes:
var math = "math";
var text = "text";
const math = "math";
const text = "text";
// fonts:
var main = "main";
var ams = "ams";
const main = "main";
const ams = "ams";
// groups:
var accent = "accent";
var bin = "bin";
var close = "close";
var inner = "inner";
var mathord = "mathord";
var op = "op";
var open = "open";
var punct = "punct";
var rel = "rel";
var spacing = "spacing";
var textord = "textord";
const accent = "accent";
const bin = "bin";
const close = "close";
const inner = "inner";
const mathord = "mathord";
const op = "op";
const open = "open";
const punct = "punct";
const rel = "rel";
const spacing = "spacing";
const textord = "textord";
// Now comes the symbol table
@@ -616,50 +616,48 @@ defineSymbol(text, main, spacing, "\u00a0", " ");
defineSymbol(text, main, spacing, "\u00a0", "~");
// There are lots of symbols which are the same, so we add them in afterwards.
var i;
var ch;
// All of these are textords in math mode
var mathTextSymbols = "0123456789/@.\"";
for (i = 0; i < mathTextSymbols.length; i++) {
ch = mathTextSymbols.charAt(i);
const mathTextSymbols = "0123456789/@.\"";
for (let i = 0; i < mathTextSymbols.length; i++) {
const ch = mathTextSymbols.charAt(i);
defineSymbol(math, main, textord, ch, ch);
}
// All of these are textords in text mode
var textSymbols = "0123456789!@*()-=+[]\";:?/.,";
for (i = 0; i < textSymbols.length; i++) {
ch = textSymbols.charAt(i);
const textSymbols = "0123456789!@*()-=+[]\";:?/.,";
for (let i = 0; i < textSymbols.length; i++) {
const ch = textSymbols.charAt(i);
defineSymbol(text, main, textord, ch, ch);
}
// All of these are textords in text mode, and mathords in math mode
var letters = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
for (i = 0; i < letters.length; i++) {
ch = letters.charAt(i);
const letters = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
for (let i = 0; i < letters.length; i++) {
const ch = letters.charAt(i);
defineSymbol(math, main, mathord, ch, ch);
defineSymbol(text, main, textord, ch, ch);
}
// Latin-1 letters
for (i = 0x00C0; i <= 0x00D6; i++) {
ch = String.fromCharCode(i);
for (let i = 0x00C0; i <= 0x00D6; i++) {
const ch = String.fromCharCode(i);
defineSymbol(text, main, textord, ch, ch);
}
for (i = 0x00D8; i <= 0x00F6; i++) {
ch = String.fromCharCode(i);
for (let i = 0x00D8; i <= 0x00F6; i++) {
const ch = String.fromCharCode(i);
defineSymbol(text, main, textord, ch, ch);
}
for (i = 0x00F8; i <= 0x00FF; i++) {
ch = String.fromCharCode(i);
for (let i = 0x00F8; i <= 0x00FF; i++) {
const ch = String.fromCharCode(i);
defineSymbol(text, main, textord, ch, ch);
}
// Cyrillic
for (i = 0x0410; i <= 0x044F; i++) {
ch = String.fromCharCode(i);
for (let i = 0x0410; i <= 0x044F; i++) {
const ch = String.fromCharCode(i);
defineSymbol(text, main, textord, ch, ch);
}