mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-19 22:58:07 +02:00
Merge pull request #13497 from Snuffleupagus/HTMLResult-lazy
Initialize `HTMLResult.{FAILURE, EMPTY}` lazily
This commit is contained in:
commit
eba6db9dc6
1 changed files with 10 additions and 3 deletions
|
@ -13,6 +13,8 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { shadow } from "../../shared/util.js";
|
||||
|
||||
const dimConverters = {
|
||||
pt: x => x,
|
||||
cm: x => (x / 2.54) * 72,
|
||||
|
@ -165,6 +167,14 @@ function getBBox(data) {
|
|||
}
|
||||
|
||||
class HTMLResult {
|
||||
static get FAILURE() {
|
||||
return shadow(this, "FAILURE", new HTMLResult(false, null, null));
|
||||
}
|
||||
|
||||
static get EMPTY() {
|
||||
return shadow(this, "EMPTY", new HTMLResult(true, null, null));
|
||||
}
|
||||
|
||||
constructor(success, html, bbox) {
|
||||
this.success = success;
|
||||
this.html = html;
|
||||
|
@ -176,9 +186,6 @@ class HTMLResult {
|
|||
}
|
||||
}
|
||||
|
||||
HTMLResult.FAILURE = new HTMLResult(false, null, null);
|
||||
HTMLResult.EMPTY = new HTMLResult(true, null, null);
|
||||
|
||||
export {
|
||||
getBBox,
|
||||
getColor,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue