Enforce explicit semi-colons

This commit is contained in:
Pierre Ossman 2018-09-06 17:25:02 +02:00
parent 426a8c927b
commit 0ae5c54ab3
7 changed files with 13 additions and 12 deletions

View File

@ -38,5 +38,6 @@
"key-spacing": ["error"], "key-spacing": ["error"],
"keyword-spacing": ["error"], "keyword-spacing": ["error"],
"no-trailing-spaces": ["error"], "no-trailing-spaces": ["error"],
"semi": ["error"],
} }
} }

View File

@ -1942,7 +1942,7 @@ RFB.encodingHandlers = {
let data = this._sock.get_rQ(); let data = this._sock.get_rQ();
let index = this._sock.get_rQi(); let index = this._sock.get_rQi();
if (this._fb_depth == 8) { if (this._fb_depth == 8) {
const pixels = this._FBU.width * curr_height const pixels = this._FBU.width * curr_height;
const newdata = new Uint8Array(pixels * 4); const newdata = new Uint8Array(pixels * 4);
for (let i = 0; i < pixels; i++) { for (let i = 0; i < pixels; i++) {
newdata[i * 4 + 0] = ((data[index + i] >> 0) & 0x3) * 255 / 3; newdata[i * 4 + 0] = ((data[index + i] >> 0) & 0x3) * 255 / 3;
@ -2558,4 +2558,4 @@ RFB.encodingHandlers = {
// Do nothing // Do nothing
} }
} }
} };

View File

@ -85,7 +85,7 @@ export default class Cursor {
return; return;
} }
let cur = [] let cur = [];
for (let y = 0; y < h; y++) { for (let y = 0; y < h; y++) {
for (let x = 0; x < w; x++) { for (let x = 0; x < w; x++) {
let idx = y * Math.ceil(w / 8) + Math.floor(x / 8); let idx = y * Math.ceil(w / 8) + Math.floor(x / 8);

View File

@ -422,7 +422,7 @@ describe('Display/Canvas Helper', function () {
}); });
it('should wait until an image is loaded to attempt to draw it and the rest of the queue', function () { it('should wait until an image is loaded to attempt to draw it and the rest of the queue', function () {
const img = { complete: false, addEventListener: sinon.spy() } const img = { complete: false, addEventListener: sinon.spy() };
display._renderQ = [{ type: 'img', x: 3, y: 4, img: img }, display._renderQ = [{ type: 'img', x: 3, y: 4, img: img },
{ type: 'fill', x: 1, y: 2, width: 3, height: 4, color: 5 }]; { type: 'fill', x: 1, y: 2, width: 3, height: 4, color: 5 }];
display.drawImage = sinon.spy(); display.drawImage = sinon.spy();

View File

@ -195,7 +195,7 @@ describe('Websock', function() {
it('should actually send on the websocket', function () { it('should actually send on the websocket', function () {
sock._websocket.bufferedAmount = 8; sock._websocket.bufferedAmount = 8;
sock._websocket.readyState = WebSocket.OPEN sock._websocket.readyState = WebSocket.OPEN;
sock._sQ = new Uint8Array([1, 2, 3]); sock._sQ = new Uint8Array([1, 2, 3]);
sock._sQlen = 3; sock._sQlen = 3;
const encoded = sock._encode_message(); const encoded = sock._encode_message();

View File

@ -51,7 +51,7 @@ function promisify(original) {
resolve(value); resolve(value);
})); }));
}); });
} };
} }
const readFile = promisify(fs.readFile); const readFile = promisify(fs.readFile);
@ -199,7 +199,7 @@ function make_lib_files(import_format, source_maps, with_app_dir, only_legacy) {
.then(() => { .then(() => {
console.log(`Writing ${out_path}`); console.log(`Writing ${out_path}`);
return copy(filename, out_path); return copy(filename, out_path);
}) });
}) })
.then(() => ensureDir(path.dirname(legacy_path))) .then(() => ensureDir(path.dirname(legacy_path)))
.then(() => { .then(() => {

View File

@ -12,7 +12,7 @@ function promisify(original) {
resolve(value); resolve(value);
})); }));
}); });
} };
} }
const writeFile = promisify(fs.writeFile); const writeFile = promisify(fs.writeFile);
@ -27,7 +27,7 @@ module.exports = {
.then(() => { .then(() => {
console.log(`Please place RequireJS in ${path.join(script_base_path, 'require.js')}`); console.log(`Please place RequireJS in ${path.join(script_base_path, 'require.js')}`);
const require_path = path.relative(base_out_path, const require_path = path.relative(base_out_path,
path.join(script_base_path, 'require.js')) path.join(script_base_path, 'require.js'));
return [ require_path ]; return [ require_path ];
}); });
}, },
@ -57,9 +57,9 @@ module.exports = {
console.log(`Please place SystemJS in ${path.join(script_base_path, 'system-production.js')}`); console.log(`Please place SystemJS in ${path.join(script_base_path, 'system-production.js')}`);
// FIXME: Should probably be in the legacy directory // FIXME: Should probably be in the legacy directory
const promise_path = path.relative(base_out_path, const promise_path = path.relative(base_out_path,
path.join(base_out_path, 'vendor', 'promise.js')) path.join(base_out_path, 'vendor', 'promise.js'));
const systemjs_path = path.relative(base_out_path, const systemjs_path = path.relative(base_out_path,
path.join(script_base_path, 'system-production.js')) path.join(script_base_path, 'system-production.js'));
return [ promise_path, systemjs_path ]; return [ promise_path, systemjs_path ];
}); });
}, },
@ -73,4 +73,4 @@ module.exports = {
opts.plugins.unshift("add-module-exports"); opts.plugins.unshift("add-module-exports");
}, },
}, },
} };