[go: nahoru, domu]

Skip to content

Commit

Permalink
Use the classic function foo() { ... } for top level functions or f…
Browse files Browse the repository at this point in the history
…unctions that depend on the scope
  • Loading branch information
juanjoDiaz committed Jul 12, 2018
1 parent 651c23e commit 885363a
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 11 deletions.
4 changes: 2 additions & 2 deletions po/xgettext-html
Original file line number Diff line number Diff line change
Expand Up @@ -89,11 +89,11 @@ for (let i = 0; i < opt.argv.length; i++) {
const dom = new jsdom.JSDOM(file, { includeNodeLocations: true });
const body = dom.window.document.body;

const locator = (elem) => {
function locator(elem) {
const offset = dom.nodeLocation(elem).startOffset;
const line = file.slice(0, offset).split("\n").length;
return fn + ":" + line;
};
}

process(body, locator, true);
}
Expand Down
5 changes: 2 additions & 3 deletions tests/playback.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ if (window.setImmediate === undefined) {
_immediateFuncs[id];
};

const _onMessage = (event) => {
window.addEventListener("message", (event) => {
if ((typeof event.data !== "string") ||
(event.data.indexOf("noVNC immediate trigger:") !== 0)) {
return;
Expand All @@ -40,8 +40,7 @@ if (window.setImmediate === undefined) {
delete _immediateFuncs[index];

callback();
};
window.addEventListener("message", _onMessage);
});
}

export default class RecordingPlayer {
Expand Down
12 changes: 6 additions & 6 deletions tests/test.rfb.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,24 +23,24 @@ import sinon from '../vendor/sinon.js';
window.UIEvent = UIEvent;
})();

const push8 = (arr, num) => {
function push8(arr, num) {
"use strict";
arr.push(num & 0xFF);
};
}

const push16 = (arr, num) => {
function push16(arr, num) {
"use strict";
arr.push((num >> 8) & 0xFF,
num & 0xFF);
};
}

const push32 = (arr, num) => {
function push32(arr, num) {
"use strict";
arr.push((num >> 24) & 0xFF,
(num >> 16) & 0xFF,
(num >> 8) & 0xFF,
num & 0xFF);
};
}

describe('Remote Frame Buffer Protocol Client', function() {
let clock;
Expand Down

0 comments on commit 885363a

Please sign in to comment.