From 92141e04688d9e2c7a2503532eb8b71e594db6da Mon Sep 17 00:00:00 2001 From: Jonas Jenwald Date: Tue, 13 Apr 2021 18:25:57 +0200 Subject: [PATCH] Enable the `no-var` rule in the `src/core/file_spec.js` file --- src/core/file_spec.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/core/file_spec.js b/src/core/file_spec.js index 40306d2a8..151a48e7a 100644 --- a/src/core/file_spec.js +++ b/src/core/file_spec.js @@ -12,7 +12,6 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/* eslint-disable no-var */ import { isDict, isStream } from "./primitives.js"; import { stringToPDFString, warn } from "../shared/util.js"; @@ -66,7 +65,7 @@ class FileSpec { get filename() { if (!this._filename && this.root) { - var filename = pickPlatformItem(this.root) || "unnamed"; + const filename = pickPlatformItem(this.root) || "unnamed"; this._filename = stringToPDFString(filename) .replace(/\\\\/g, "\\") .replace(/\\\//g, "/") @@ -82,10 +81,9 @@ class FileSpec { if (!this.contentRef && this.root) { this.contentRef = pickPlatformItem(this.root.get("EF")); } - var content = null; + let content = null; if (this.contentRef) { - var xref = this.xref; - var fileObj = xref.fetchIfRef(this.contentRef); + const fileObj = this.xref.fetchIfRef(this.contentRef); if (fileObj && isStream(fileObj)) { content = fileObj.getBytes(); } else {