mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-26 10:08:06 +02:00
Enable the ESLint no-var
rule in the examples/
folder
Updating the examples to use `let`/`const` should be fine, given that they are available in all browsers/platforms that the PDF.js library now supports; please note the following compatibility information: - https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/let#browser_compatibility - https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/const#browser_compatibility
This commit is contained in:
parent
276fa4ad8f
commit
5c712f2131
3 changed files with 10 additions and 3 deletions
|
@ -8,4 +8,9 @@
|
|||
"pdfjsLib": false,
|
||||
"pdfjsViewer": false,
|
||||
},
|
||||
|
||||
"rules": {
|
||||
// ECMAScript 6
|
||||
"no-var": "error",
|
||||
},
|
||||
}
|
||||
|
|
|
@ -35,7 +35,7 @@ const MIN_SCALE = 0.25;
|
|||
const MAX_SCALE = 10.0;
|
||||
const DEFAULT_SCALE_VALUE = "auto";
|
||||
|
||||
var PDFViewerApplication = {
|
||||
const PDFViewerApplication = {
|
||||
pdfLoadingTask: null,
|
||||
pdfDocument: null,
|
||||
pdfViewer: null,
|
||||
|
@ -425,6 +425,8 @@ var PDFViewerApplication = {
|
|||
},
|
||||
};
|
||||
|
||||
window.PDFViewerApplication = PDFViewerApplication;
|
||||
|
||||
document.addEventListener(
|
||||
"DOMContentLoaded",
|
||||
function () {
|
||||
|
|
|
@ -188,9 +188,9 @@ DOMElementSerializer.prototype = {
|
|||
this._loopIndex = 0;
|
||||
/* falls through */
|
||||
case 5: // Serialize child nodes (only for non-tspan/style elements).
|
||||
var value;
|
||||
while (true) {
|
||||
value = this._childSerializer && this._childSerializer.getNext();
|
||||
const value =
|
||||
this._childSerializer && this._childSerializer.getNext();
|
||||
if (value !== null) {
|
||||
return value;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue