pdf.js/test
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
..
chromium Enable the object-shorthand ESLint rule 2017-04-30 11:13:34 +02:00
features Remove usage of mozFillRule 2017-01-29 23:24:44 +01:00
font Enable the object-shorthand ESLint rule 2017-04-30 11:13:34 +02:00
pdfs Subtract the X/Y offsets when decoding refinement regions of JBIG2 images (issue 7145, 7308, 7401, 7850, 8270) 2017-04-26 16:06:15 +02:00
resources Bots: disable the default browser test and enable E10s 2017-04-27 20:39:57 +02:00
stats Adjust the brace-style ESLint rule to disallow single lines (and also enable no-iterator) 2017-02-04 15:53:08 +01:00
ttx Update fonttools location and version (issue 6223) 2015-07-17 12:51:09 +02:00
unit Change the signatures of the PartialEvaluator "constructor" and its getOperatorList/getTextContent methods to take parameter objects 2017-05-03 12:10:20 +02:00
.eslintrc Switch to using ESLint, instead of JSHint, for linting 2016-12-16 21:06:36 +01:00
.gitignore Ignore test snapshots directory. 2013-03-15 11:24:08 -07:00
annotation_layer_test.css Button widget annotations: improve unit tests, simplify code and remove labels 2016-12-17 20:38:48 +01:00
downloadutils.js Enable the object-shorthand ESLint rule 2017-04-30 11:13:34 +02:00
driver.js Enable the object-shorthand ESLint rule 2017-04-30 11:13:34 +02:00
test_manifest.json Subtract the X/Y offsets when decoding refinement regions of JBIG2 images (issue 7145, 7308, 7401, 7850, 8270) 2017-04-26 16:06:15 +02:00
test_slave.html Replaces RequireJS to SystemJS. 2017-02-27 08:32:39 -06:00
test.js Enable the object-shorthand ESLint rule 2017-04-30 11:13:34 +02:00
testutils.js Switch to using ESLint, instead of JSHint, for linting 2016-12-16 21:06:36 +01:00
text_layer_test.css Better "text" testing. 2015-11-19 11:03:52 -06:00
webbrowser.js Enable the object-shorthand ESLint rule 2017-04-30 11:13:34 +02:00
webserver.js Enable the object-shorthand ESLint rule 2017-04-30 11:13:34 +02:00