Remove the remaining closure in the src/core/function.js file

Given that the code is written with JavaScript module-syntax, none of this functionality will "leak" outside of this file with these changes.
By removing this closure the file-size is decreased, even for the *built* `pdf.worker.js` file, since there's now less overall indentation in the code.
This commit is contained in:
Jonas Jenwald 2022-08-13 12:46:37 +02:00
parent 3cf31a8b17
commit 9dcfdb9578

View File

@ -815,13 +815,6 @@ class PostScriptEvaluator {
}
}
// Most of the PDFs functions consist of simple operations such as:
// roll, exch, sub, cvr, pop, index, dup, mul, if, gt, add.
//
// We can compile most of such programs, and at the same moment, we can
// optimize some expressions using basic math properties. Keeping track of
// min/max values will allow us to avoid extra Math.min/Math.max calls.
const PostScriptCompiler = (function PostScriptCompilerClosure() {
class AstNode {
constructor(type) {
this.type = type;
@ -1061,7 +1054,12 @@ const PostScriptCompiler = (function PostScriptCompilerClosure() {
return new AstMin(num1, max);
}
// eslint-disable-next-line no-shadow
// Most of the PDFs functions consist of simple operations such as:
// roll, exch, sub, cvr, pop, index, dup, mul, if, gt, add.
//
// We can compile most of such programs, and at the same moment, we can
// optimize some expressions using basic math properties. Keeping track of
// min/max values will allow us to avoid extra Math.min/Math.max calls.
class PostScriptCompiler {
compile(code, domain, range) {
const stack = [];
@ -1246,9 +1244,6 @@ const PostScriptCompiler = (function PostScriptCompilerClosure() {
}
}
return PostScriptCompiler;
})();
export {
isPDFFunction,
PDFFunctionFactory,