Enable the ESLint no-var
rule in the src/core/cff_parser.js
file
Note that the majority of these changes were done automatically, by using `gulp lint --fix`, and the manual changes were limited to the following diff: ```diff diff --git a/src/core/cff_parser.js b/src/core/cff_parser.js index d684c200e..2e2b811e4 100644 --- a/src/core/cff_parser.js +++ b/src/core/cff_parser.js @@ -555,7 +555,7 @@ const CFFParser = (function CFFParserClosure() { stackSize %= 2; validationCommand = CharstringValidationData[value]; } else if (value === 10 || value === 29) { - var subrsIndex; + let subrsIndex; if (value === 10) { subrsIndex = localSubrIndex; } else { @@ -886,15 +886,15 @@ const CFFParser = (function CFFParserClosure() { format = bytes[pos++]; switch (format & 0x7f) { case 0: - var glyphsCount = bytes[pos++]; + const glyphsCount = bytes[pos++]; for (i = 1; i <= glyphsCount; i++) { encoding[bytes[pos++]] = i; } break; case 1: - var rangesCount = bytes[pos++]; - var gid = 1; + const rangesCount = bytes[pos++]; + let gid = 1; for (i = 0; i < rangesCount; i++) { const start = bytes[pos++]; const left = bytes[pos++]; @@ -938,7 +938,7 @@ const CFFParser = (function CFFParserClosure() { } break; case 3: - var rangesCount = (bytes[pos++] << 8) | bytes[pos++]; + const rangesCount = (bytes[pos++] << 8) | bytes[pos++]; for (i = 0; i < rangesCount; ++i) { let first = (bytes[pos++] << 8) | bytes[pos++]; if (i === 0 && first !== 0) { @@ -1173,7 +1173,7 @@ class CFFDict { } } -var CFFTopDict = (function CFFTopDictClosure() { +const CFFTopDict = (function CFFTopDictClosure() { const layout = [ [[12, 30], "ROS", ["sid", "sid", "num"], null], [[12, 20], "SyntheticBase", "num", null], @@ -1229,7 +1229,7 @@ var CFFTopDict = (function CFFTopDictClosure() { return CFFTopDict; })(); -var CFFPrivateDict = (function CFFPrivateDictClosure() { +const CFFPrivateDict = (function CFFPrivateDictClosure() { const layout = [ [6, "BlueValues", "delta", null], [7, "OtherBlues", "delta", null], @@ -1265,11 +1265,12 @@ var CFFPrivateDict = (function CFFPrivateDictClosure() { return CFFPrivateDict; })(); -var CFFCharsetPredefinedTypes = { +const CFFCharsetPredefinedTypes = { ISO_ADOBE: 0, EXPERT: 1, EXPERT_SUBSET: 2, }; + class CFFCharset { constructor(predefined, format, charset, raw) { this.predefined = predefined; @@ -1695,7 +1696,7 @@ class CFFCompiler { // For offsets we just insert a 32bit integer so we don't have to // deal with figuring out the length of the offset when it gets // replaced later on by the compiler. - var name = dict.keyToNameMap[key]; + const name = dict.keyToNameMap[key]; // Some offsets have the offset and the length, so just record the // position of the first one. if (!offsetTracker.isTracking(name)) { ```
This commit is contained in:
parent
f3948aeb90
commit
82062f7e0d
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user