Commit cb455106 authored by Robert Knight's avatar Robert Knight

Fix remaining usages of "var" manually

Fix the uses which js-codemod's "no vars" transform was unable to change
automatically.
parent 15b11fce
......@@ -103,7 +103,7 @@ function isNew(annotation) {
/** Return `true` if the given annotation is public, `false` otherwise. */
function isPublic(annotation) {
var isPublic = false;
let isPublic = false;
if (!annotation.permissions) {
return isPublic;
......
......@@ -284,7 +284,7 @@ function AnnotationController(
if (self.annotation.target.length === 0) {
return null;
}
var target = self.annotation.target[0];
const target = self.annotation.target[0];
if (!target.selector) {
return null;
}
......
......@@ -241,7 +241,7 @@ describe('groupList', function () {
},
];
const element = createGroupList();
var links = element.find('.share-link-container');
const links = element.find('.share-link-container');
assert.equal(links.length, 0);
});
......
......@@ -22,7 +22,7 @@ class FakeSearchClient extends EventEmitter {
assert.ok(query.uri);
for (let i = 0; i < query.uri.length; i++) {
var uri = query.uri[i];
const uri = query.uri[i];
this.emit('results', [{id: uri + '123', group: '__world__'}]);
this.emit('results', [{id: uri + '456', group: 'private-group'}]);
}
......
......@@ -31,7 +31,7 @@ function Tooltip(rootElement) {
return;
}
var target = this.state.target;
const target = this.state.target;
const label = target.getAttribute('aria-label');
this._labelEl.textContent = label;
......
......@@ -8,7 +8,7 @@ const queryString = require('query-string');
*/
function hostPageConfig(window) {
const configJSON = queryString.parse(window.location.search).config;
var config = JSON.parse(configJSON || '{}');
const config = JSON.parse(configJSON || '{}');
// Known configuration parameters which we will import from the host page.
// Note that since the host page is untrusted code, the filtering needs to
......
......@@ -50,7 +50,7 @@ function features($log, $rootScope, bridge, session) {
return false;
}
var features = session.state.features;
const features = session.state.features;
if (!(flag in features)) {
$log.warn('looked up unknown feature', flag);
return false;
......
......@@ -102,7 +102,7 @@ function FrameSync($rootScope, $window, Discovery, store, bridge) {
inFrame.delete(annot.$tag);
});
var frames = store.frames();
const frames = store.frames();
if (frames.length > 0) {
if (frames.every(function (frame) { return frame.isAnnotationFetchComplete; })) {
if (publicAnns === 0 || publicAnns !== prevPublicAnns) {
......
......@@ -298,7 +298,7 @@ describe('rootThread', function () {
unroll('adds or updates annotations when #event event occurs', function (testCase) {
$rootScope.$broadcast(testCase.event, testCase.annotations);
var annotations = [].concat(testCase.annotations);
const annotations = [].concat(testCase.annotations);
assert.notCalled(fakeStore.removeAnnotations);
assert.calledWith(fakeStore.addAnnotations, sinon.match(annotations));
}, [
......@@ -316,7 +316,7 @@ describe('rootThread', function () {
unroll('removes annotations when #event event occurs', function (testCase) {
$rootScope.$broadcast(testCase.event, testCase.annotations);
var annotations = [].concat(testCase.annotations);
const annotations = [].concat(testCase.annotations);
assert.calledWith(fakeStore.removeAnnotations, sinon.match(annotations));
}, [
{event: events.ANNOTATION_DELETED, annotations: annot},
......
......@@ -90,7 +90,7 @@ function viewFilter(unicode) {
// not be required.
return '';
}
var target = annotation.target[0];
const target = annotation.target[0];
const selectors = target.selector || [];
return selectors
......
......@@ -208,7 +208,7 @@ const update = {
},
};
var actions = util.actionTypes(update);
const actions = util.actionTypes(update);
/**
* Updating the flagged status of an annotation.
......
......@@ -43,7 +43,7 @@ function shouldShowInTab(ann, tab) {
* @param {Annotation[]} annotations - List of annotations to display
*/
function counts(annotations) {
var counts = {
const counts = {
notes: countIf(annotations, metadata.isPageNote),
annotations: countIf(annotations, metadata.isAnnotation),
orphans: countIf(annotations, metadata.isOrphan),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment