pdf.js/test/unit
Jonas Jenwald 3e20d30afc Change the signatures of the PartialEvaluator "constructor" and its getOperatorList/getTextContent methods to take parameter objects
Currently these methods accept a large number of parameters, which creates quite unwieldy call-sites. When invoking them, you have to remember not only what arguments to supply, but also the correct order, to avoid runtime errors.
Furthermore, since some of the parameters are optional, you also have to remember to pass e.g. `null` or `undefined` for those ones.
Also, adding new parameters to these methods (which happens occasionally), often becomes unnecessarily tedious (based on personal experience).

Please note that I do *not* think that we need/should convert *every* single method in `evaluator.js` (or elsewhere in `/core` files) to take parameter objects. However, in my opinion, once a method starts relying on approximately five parameter (or even more), passing them in individually becomes quite cumbersome.

With these changes, I obviously needed to update the `evaluator_spec.js` unit-tests. The main change there, except the new method signatures[1], is that it's now re-using *one* `PartialEvalutor` instance, since I couldn't see any compelling reason for creating a new one in every single test.

*Note:* If this patch is accepted, my intention is to (time permitting) see if it makes sense to convert additional methods in `evaluator.js` (and other `/core` files) in a similar fashion, but I figured that it'd be a good idea to limit the initial scope somewhat.

---

[1] A fun fact here, note how the `PartialEvaluator` signature used in `evaluator_spec.js` wasn't even correct in the current `master`.
2017-05-03 12:10:20 +02:00
..
annotation_spec.js Enable the object-shorthand ESLint rule 2017-04-30 11:13:34 +02:00
api_spec.js Enable the object-shorthand ESLint rule 2017-04-30 11:13:34 +02:00
bidi_spec.js Convert the files in the /test/unit folder to ES6 modules 2017-04-30 00:34:02 +02:00
cff_parser_spec.js Convert the files in the /test/unit folder to ES6 modules 2017-04-30 00:34:02 +02:00
clitests.json Enable running the ui_utils unit-tests on Travis 2017-04-25 13:37:56 +02:00
cmap_spec.js Enable the object-shorthand ESLint rule 2017-04-30 11:13:34 +02:00
crypto_spec.js Convert the files in the /test/unit folder to ES6 modules 2017-04-30 00:34:02 +02:00
document_spec.js Convert the files in the /test/unit folder to ES6 modules 2017-04-30 00:34:02 +02:00
dom_utils_spec.js Convert the files in the /test/unit folder to ES6 modules 2017-04-30 00:34:02 +02:00
evaluator_spec.js Change the signatures of the PartialEvaluator "constructor" and its getOperatorList/getTextContent methods to take parameter objects 2017-05-03 12:10:20 +02:00
fonts_spec.js Enable the object-shorthand ESLint rule 2017-04-30 11:13:34 +02:00
function_spec.js Enable the object-shorthand ESLint rule 2017-04-30 11:13:34 +02:00
jasmine-boot.js Enable the object-shorthand ESLint rule 2017-04-30 11:13:34 +02:00
metadata_spec.js Convert the files in the /test/unit folder to ES6 modules 2017-04-30 00:34:02 +02:00
murmurhash3_spec.js Convert the files in the /test/unit folder to ES6 modules 2017-04-30 00:34:02 +02:00
network_spec.js Convert the files in the /test/unit folder to ES6 modules 2017-04-30 00:34:02 +02:00
parser_spec.js Convert the files in the /test/unit folder to ES6 modules 2017-04-30 00:34:02 +02:00
primitives_spec.js Enable the object-shorthand ESLint rule 2017-04-30 11:13:34 +02:00
stream_spec.js Enable the object-shorthand ESLint rule 2017-04-30 11:13:34 +02:00
test_utils.js Convert the files in the /test/unit folder to ES6 modules 2017-04-30 00:34:02 +02:00
testreporter.js Enable the object-shorthand ESLint rule 2017-04-30 11:13:34 +02:00
type1_parser_spec.js Convert the files in the /test/unit folder to ES6 modules 2017-04-30 00:34:02 +02:00
ui_utils_spec.js Convert the files in the /test/unit folder to ES6 modules 2017-04-30 00:34:02 +02:00
unicode_spec.js Convert the files in the /test/unit folder to ES6 modules 2017-04-30 00:34:02 +02:00
unit_test.html Replaces RequireJS to SystemJS. 2017-02-27 08:32:39 -06:00
util_spec.js Convert the files in the /test/unit folder to ES6 modules 2017-04-30 00:34:02 +02:00