Merge pull request #15309 from Snuffleupagus/function-rm-closure

Remove the remaining closure in the `src/core/function.js` file
This commit is contained in:
Tim van der Meij 2022-08-13 15:05:17 +02:00 committed by GitHub
commit c81903d72d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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 { class AstNode {
constructor(type) { constructor(type) {
this.type = type; this.type = type;
@ -1061,7 +1054,12 @@ const PostScriptCompiler = (function PostScriptCompilerClosure() {
return new AstMin(num1, max); 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 { class PostScriptCompiler {
compile(code, domain, range) { compile(code, domain, range) {
const stack = []; const stack = [];
@ -1246,9 +1244,6 @@ const PostScriptCompiler = (function PostScriptCompilerClosure() {
} }
} }
return PostScriptCompiler;
})();
export { export {
isPDFFunction, isPDFFunction,
PDFFunctionFactory, PDFFunctionFactory,