Remove trailing commas for IE 9 compatibility

Summary: IE 9 doesn't like trailing commas. When we introduced eslint, we added
a bunch of trailing commas, which makes IE 9 sad.

Test Plan:
 - `make lint`
 - Visit http://localhost:7936/ using IE 9 on browserstack.
 - See that the math loads, and there are no errors in the F12 developer tools.

@kevinb
This commit is contained in:
Emily Eisenberg
2017-01-06 19:06:01 -08:00
parent 74d55ee0ea
commit 4d2e46e7f6
31 changed files with 292 additions and 290 deletions

View File

@@ -25,52 +25,52 @@ var opts = require("nomnom")
.option("browser", {
abbr: "b",
"default": "firefox",
help: "Name of the browser to use",
help: "Name of the browser to use"
})
.option("container", {
abbr: "c",
type: "string",
help: "Name or ID of a running docker container to contact",
help: "Name or ID of a running docker container to contact"
})
.option("seleniumURL", {
full: "selenium-url",
help: "Full URL of the Selenium web driver",
help: "Full URL of the Selenium web driver"
})
.option("seleniumIP", {
full: "selenium-ip",
help: "IP address of the Selenium web driver",
help: "IP address of the Selenium web driver"
})
.option("seleniumPort", {
full: "selenium-port",
"default": 4444,
help: "Port number of the Selenium web driver",
help: "Port number of the Selenium web driver"
})
.option("katexURL", {
full: "katex-url",
help: "Full URL of the KaTeX development server",
help: "Full URL of the KaTeX development server"
})
.option("katexIP", {
full: "katex-ip",
help: "Full URL of the KaTeX development server",
help: "Full URL of the KaTeX development server"
})
.option("katexPort", {
full: "katex-port",
help: "Port number of the KaTeX development server",
help: "Port number of the KaTeX development server"
})
.option("include", {
abbr: "i",
help: "Comma-separated list of test cases to process",
help: "Comma-separated list of test cases to process"
})
.option("exclude", {
abbr: "x",
help: "Comma-separated list of test cases to exclude",
help: "Comma-separated list of test cases to exclude"
})
.option("verify", {
flag: true,
help: "Check whether screenshot matches current file content",
help: "Check whether screenshot matches current file content"
})
.option("wait", {
help: "Wait this many seconds between page load and screenshot",
help: "Wait this many seconds between page load and screenshot"
})
.parse();
@@ -208,7 +208,7 @@ function tryConnect() {
}
var sock = net.connect({
host: seleniumIP,
port: +seleniumPort,
port: +seleniumPort
});
sock.on("connect", function() {
sock.end();
@@ -278,7 +278,7 @@ function imageDimensions(img) {
return {
buf: buf,
width: buf.readUInt32BE(16),
height: buf.readUInt32BE(20),
height: buf.readUInt32BE(20)
};
}
@@ -399,7 +399,7 @@ function takeScreenshot(key) {
}
}
var opt = new jspngopt.Optimizer({
pako: pako,
pako: pako
});
var buf = opt.bufferSync(img.buf);
if (loadExpected) {

View File

@@ -48,7 +48,7 @@ Q.all([
readFile(path.join(ssDir, "test.tex"), "utf-8"),
ensureDir(tmpDir),
ensureDir(teximgDir),
ensureDir(diffDir),
ensureDir(diffDir)
]).spread(function(data) {
template = data;
// dirs have been created, template has been read, now rasterize.
@@ -79,14 +79,14 @@ function processTestCase(key) {
var fftLatex = writeFile(texFile, tex).then(function() {
// Step 2: call "pdflatex key" to create key.pdf
return execFile("pdflatex", [
"-interaction", "nonstopmode", key,
"-interaction", "nonstopmode", key
], {cwd: tmpDir});
}).then(function() {
console.log("Typeset " + key);
// Step 3: call "convert ... key.pdf key.png" to create key.png
return execFile("convert", [
"-density", dpi, "-units", "PixelsPerInch", "-flatten",
"-depth", "8", pdfFile, pngFile,
"-depth", "8", pdfFile, pngFile
]);
}).then(function() {
console.log("Rasterized " + key);
@@ -167,7 +167,7 @@ function processTestCase(key) {
// First image is red, second green, third blue channel of result
"-channel", "RGB", "-combine",
"-trim", // remove everything with the same color as the corners
diffFile, // output file name
diffFile // output file name
]);
}).then(function() {
console.log("Compared " + key);
@@ -244,7 +244,7 @@ function fftImage(image) {
real: real,
imag: imag,
width: image.width,
height: image.height,
height: image.height
};
}