From cf0797dfbd7fe1f7dcd9f1d4e60848a3a2a5de19 Mon Sep 17 00:00:00 2001 From: Jonas Jenwald Date: Mon, 22 Jan 2024 12:17:20 +0100 Subject: [PATCH] Use `await` consistently in the `PartialEvaluator.setGState` method --- src/core/evaluator.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/core/evaluator.js b/src/core/evaluator.js index 5bccea9ae..1958a3520 100644 --- a/src/core/evaluator.js +++ b/src/core/evaluator.js @@ -1188,15 +1188,15 @@ class PartialEvaluator { break; } } - return promise.then(function () { - if (gStateObj.length > 0) { - operatorList.addOp(OPS.setGState, [gStateObj]); - } + await promise; - if (isSimpleGState) { - localGStateCache.set(cacheKey, gStateRef, gStateObj); - } - }); + if (gStateObj.length > 0) { + operatorList.addOp(OPS.setGState, [gStateObj]); + } + + if (isSimpleGState) { + localGStateCache.set(cacheKey, gStateRef, gStateObj); + } } loadFont(