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:
parent
3cf31a8b17
commit
9dcfdb9578
@ -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,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user