Change the createPromiseCapability helper function into a PromiseCapability class

This is not only slightly more compact, but it also simplifies the handling of the `settled` getter.
This commit is contained in:
Jonas Jenwald 2022-03-07 17:41:41 +01:00
parent f9c2a8d437
commit 317abd6d07
24 changed files with 117 additions and 122 deletions

View file

@ -18,7 +18,6 @@ import {
AbortException,
assert,
CMapCompressionType,
createPromiseCapability,
FONT_IDENTITY_MATRIX,
FormatError,
IDENTITY_MATRIX,
@ -26,6 +25,7 @@ import {
isArrayEqual,
normalizeUnicode,
OPS,
PromiseCapability,
shadow,
stringToPDFString,
TextRenderingMode,
@ -1253,7 +1253,7 @@ class PartialEvaluator {
return this.fontCache.get(font.cacheKey);
}
const fontCapability = createPromiseCapability();
const fontCapability = new PromiseCapability();
let preEvaluatedFont;
try {