mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-09 09:45:42 +02:00
Adds Promise to the getOperatorList
This commit is contained in:
parent
37a6aac972
commit
d8eb8b1de1
6 changed files with 568 additions and 488 deletions
|
@ -507,11 +507,17 @@ var Catalog = (function CatalogClosure() {
|
|||
},
|
||||
|
||||
cleanup: function Catalog_cleanup() {
|
||||
this.fontCache.forEach(function (font) {
|
||||
delete font.sent;
|
||||
delete font.translated;
|
||||
var promises = [];
|
||||
this.fontCache.forEach(function (promise) {
|
||||
promises.push(promise);
|
||||
});
|
||||
this.fontCache.clear();
|
||||
return Promise.all(promises).then(function (fonts) {
|
||||
for (var i = 0, ii = fonts.length; i < ii; i++) {
|
||||
delete fonts[i].sent;
|
||||
delete fonts[i].translated;
|
||||
}
|
||||
this.fontCache.clear();
|
||||
}.bind(this));
|
||||
},
|
||||
|
||||
getPage: function Catalog_getPage(pageIndex) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue