mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-25 09:38:06 +02:00
Re-factor the isLittleEndian
/isEvalSupported
caching
This functionality is very old, hence we should be able to improve the caching a little bit with modern JavaScript features.
This commit is contained in:
parent
27e738dff9
commit
1dc4713a0b
4 changed files with 17 additions and 18 deletions
|
@ -15,9 +15,9 @@
|
|||
|
||||
import { Dict, Ref } from "./primitives.js";
|
||||
import {
|
||||
FeatureTest,
|
||||
FormatError,
|
||||
info,
|
||||
IsEvalSupportedCached,
|
||||
shadow,
|
||||
unreachable,
|
||||
} from "../shared/util.js";
|
||||
|
@ -438,7 +438,7 @@ class PDFFunction {
|
|||
const parser = new PostScriptParser(lexer);
|
||||
const code = parser.parse();
|
||||
|
||||
if (isEvalSupported && IsEvalSupportedCached.value) {
|
||||
if (isEvalSupported && FeatureTest.isEvalSupported) {
|
||||
const compiled = new PostScriptCompiler().compile(code, domain, range);
|
||||
if (compiled) {
|
||||
// Compiled function consists of simple expressions such as addition,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue