Replace unnecessary bind(this)
and var self = this
statements with arrow functions in src/core/evaluator.js
#8355
+51
−58
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Note that by using
let
instead ofvar
inPartialEvaluator.setGState
andTranslatedFont.loadType3Data
, we can get rid of furtherbind
usages sincelet
is block-scoped.Also, the fact that
bind
wasn't used in theFont
case inside ofsetGState
is actually a bug which has been present ever since PR #5205, where a closure was replaced by a standard loop.[1][1] I'm not aware of any bugs caused by this, but that is probably more a happy accident than anything else, since e.g. just removing the
bind
from theSMask
case without using block-scoped variables causes test failures.Edit: Slightly smaller diff with https://github.com/mozilla/pdf.js/pull/8355/files?w=1.