pdf.js/test
Jonas Jenwald 160cfc4084 Slightly simplify the lookup of data in Dict.{get, getAsync, has}
Note that `Dict.set` will only be called with values returned through `Parser.getObj`, and thus indirectly via `Lexer.getObj`. Since neither of those methods will ever return `undefined`, we can simply assert that that's the case when inserting data into the `Dict` and thus get rid of `in` checks when doing the data lookups.
In this case, since `Dict.set` is fairly hot, the patch utilizes an *inline check* and when necessary a direct call to `unreachable` to not affect performance of `gulp server/test` too much (rather than always just calling `assert`).

For very large and complex PDF files this will help performance *slightly*, since `Dict.{get, getAsync, has}` is called *a lot* during parsing in the worker.

This patch was tested using the PDF file from issue 2618, i.e. http://bugzilla-attachments.gnome.org/attachment.cgi?id=226471, with the following manifest file:
```
[
    {  "id": "issue2618",
       "file": "../web/pdfs/issue2618.pdf",
       "md5": "",
       "rounds": 250,
       "type": "eq"
    }
]
```

which gave the following results when comparing this patch against the `master` branch:
```
-- Grouped By browser, stat --
browser | stat         | Count | Baseline(ms) | Current(ms) | +/- |    %  | Result(P<.05)
------- | ------------ | ----- | ------------ | ----------- | --- | ----- | -------------
Firefox | Overall      |   250 |         2838 |        2820 | -18 | -0.65 |        faster
Firefox | Page Request |   250 |            1 |           2 |   0 | 11.92 |        slower
Firefox | Rendering    |   250 |         2837 |        2818 | -19 | -0.65 |        faster
```
2020-03-06 14:12:14 +01:00
..
chromium Enable auto-formatting of the entire code-base using Prettier (issue 11444) 2019-12-26 12:34:24 +01:00
features Remove usage of mozFillRule 2017-01-29 23:24:44 +01:00
font Ensure that all import and require statements, in the entire code-base, have a .js file extension 2020-01-04 13:01:43 +01:00
pdfs Merge pull request #11653 from Snuffleupagus/ensureStateFont 2020-03-03 23:33:13 +01:00
resources Replace String.prototype.substr() occurrences with String.prototype.substring() 2018-09-28 11:41:07 +02:00
stats Enable auto-formatting of the entire code-base using Prettier (issue 11444) 2019-12-26 12:34:24 +01:00
ttx Update fonttools location and version (issue 6223) 2015-07-17 12:51:09 +02:00
unit Slightly simplify the lookup of data in Dict.{get, getAsync, has} 2020-03-06 14:12:14 +01:00
.eslintrc Fix badly formatted .eslintrc 2018-11-23 13:49:58 +01:00
.gitignore Ignore test snapshots directory. 2013-03-15 11:24:08 -07:00
add_test.js Enable the ESLint prefer-const rule globally (PR 11450 follow-up) 2020-01-25 00:20:22 +01:00
annotation_layer_builder_overrides.css Convert all three-digit HEX colors to RGBA colors 2020-01-01 14:52:37 +01:00
downloadutils.js Enable auto-formatting of the entire code-base using Prettier (issue 11444) 2019-12-26 12:34:24 +01:00
driver.js Enable the ESLint prefer-const rule globally (PR 11450 follow-up) 2020-01-25 00:20:22 +01:00
test_manifest.json Merge pull request #11653 from Snuffleupagus/ensureStateFont 2020-03-03 23:33:13 +01:00
test_slave.html Use the SimpleLinkService when running "annotations" reference tests 2017-09-12 15:24:46 +02:00
test.js Skip failing FBF tests in Google Chrome when running makeref on the bots 2020-01-14 00:54:44 +01:00
testutils.js Enable auto-formatting of the entire code-base using Prettier (issue 11444) 2019-12-26 12:34:24 +01:00
text_layer_test.css Use span instead of div in the text layer 2018-11-18 15:54:08 +01:00
webbrowser.js Enable auto-formatting of the entire code-base using Prettier (issue 11444) 2019-12-26 12:34:24 +01:00
webserver.js Enable auto-formatting of the entire code-base using Prettier (issue 11444) 2019-12-26 12:34:24 +01:00