mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-09 01:35:43 +02:00
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:
parent
f9c2a8d437
commit
317abd6d07
24 changed files with 117 additions and 122 deletions
|
@ -18,8 +18,8 @@
|
|||
|
||||
import {
|
||||
AbortException,
|
||||
createPromiseCapability,
|
||||
FeatureTest,
|
||||
PromiseCapability,
|
||||
Util,
|
||||
} from "../shared/util.js";
|
||||
import { deprecated, setLayerDimensions } from "./display_utils.js";
|
||||
|
@ -317,7 +317,7 @@ class TextLayerRenderTask {
|
|||
this._reader = null;
|
||||
this._textDivProperties = textDivProperties || new WeakMap();
|
||||
this._canceled = false;
|
||||
this._capability = createPromiseCapability();
|
||||
this._capability = new PromiseCapability();
|
||||
this._layoutTextParams = {
|
||||
prevFontSize: null,
|
||||
prevFontFamily: null,
|
||||
|
@ -417,7 +417,7 @@ class TextLayerRenderTask {
|
|||
* @private
|
||||
*/
|
||||
_render() {
|
||||
const capability = createPromiseCapability();
|
||||
const capability = new PromiseCapability();
|
||||
let styleCache = Object.create(null);
|
||||
|
||||
if (this._isReadableStream) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue