pdf.js/src/core
Jonas Jenwald ae5a34c520 [api-minor] Ensure that the Array.prototype doesn't contain any enumerable properties
Over the years there's been a fair number of issues/PRs opened, where people have wanted to add `hasOwnProperty` checks in (hot) loops in the font parsing code. This has always been rejected, since we don't want to risk reducing performance in the Firefox PDF viewer simply because some users of the general PDF.js library are *incorrectly* extending the `Array.prototype` with enumerable properties.

With this patch the general PDF.js library will now fail immediately with a hopefully useful Error message, rather than having (some) fonts fail to render, when the `Array.prototype` is incorrectly extended.

Note that I did consider making this a warning, but ultimately decided against it since it's first of all possible to disable those (with the `verbosity` parameter). Secondly, even when printed, warnings can be easy to overlook and finally a warning may also *seem* OK to ignore (as opposed to an actual Error).
2020-02-10 14:17:27 +01:00
..
annotation.js Enable the ESLint prefer-const rule globally (PR 11450 follow-up) 2020-01-25 00:20:22 +01:00
arithmetic_decoder.js Enable auto-formatting of the entire code-base using Prettier (issue 11444) 2019-12-26 12:34:24 +01:00
bidi.js Enable the no-nested-ternary ESLint rule (PR 11488 follow-up) 2020-01-14 17:49:39 +01:00
ccitt_stream.js Enable the ESLint prefer-const rule globally (PR 11450 follow-up) 2020-01-25 00:20:22 +01:00
ccitt.js Enable the ESLint prefer-const rule globally (PR 11450 follow-up) 2020-01-25 00:20:22 +01:00
cff_parser.js Enable the ESLint prefer-const rule globally (PR 11450 follow-up) 2020-01-25 00:20:22 +01:00
charsets.js Enable auto-formatting of the entire code-base using Prettier (issue 11444) 2019-12-26 12:34:24 +01:00
chunked_stream.js Enable the ESLint prefer-const rule globally (PR 11450 follow-up) 2020-01-25 00:20:22 +01:00
cmap.js Allow skipping of errors when reading broken/corrupt ToUnicode data (issue 11549) 2020-01-30 13:19:05 +01:00
colorspace.js Enable the ESLint prefer-const rule globally (PR 11450 follow-up) 2020-01-25 00:20:22 +01:00
core_utils.js Move additional worker-thread only functions from src/shared/util.js and into a src/core/core_utils.js instead 2020-01-25 00:33:52 +01:00
crypto.js Fix remaining linting errors, from enabling the prefer-const ESLint rule globally 2020-01-25 00:20:23 +01:00
document.js Ensure that the PDF header contains an actual number (PR 11463 follow-up) 2020-02-07 12:25:07 +01:00
encodings.js Enable auto-formatting of the entire code-base using Prettier (issue 11444) 2019-12-26 12:34:24 +01:00
evaluator.js Merge pull request #11551 from Snuffleupagus/issue-11549 2020-02-09 17:32:35 +01:00
font_renderer.js Fix remaining linting errors, from enabling the prefer-const ESLint rule globally 2020-01-25 00:20:23 +01:00
fonts.js Ignore spaces when normalizing the font name in Font.fallbackToSystemFont (issue 11578) 2020-02-08 19:59:04 +01:00
function.js Enable the ESLint prefer-const rule globally (PR 11450 follow-up) 2020-01-25 00:20:22 +01:00
glyphlist.js 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
image_utils.js 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
image.js Enable the ESLint prefer-const rule globally (PR 11450 follow-up) 2020-01-25 00:20:22 +01:00
jbig2_stream.js Enable the ESLint prefer-const rule globally (PR 11450 follow-up) 2020-01-25 00:20:22 +01:00
jbig2.js Move additional worker-thread only functions from src/shared/util.js and into a src/core/core_utils.js instead 2020-01-25 00:33:52 +01:00
jpeg_stream.js Enable the ESLint prefer-const rule globally (PR 11450 follow-up) 2020-01-25 00:20:22 +01:00
jpg.js Merge pull request #11547 from Snuffleupagus/convertCmykToRgb-scale 2020-02-09 17:06:23 +01:00
jpx_stream.js Enable the ESLint prefer-const rule globally (PR 11450 follow-up) 2020-01-25 00:20:22 +01:00
jpx.js Move additional worker-thread only functions from src/shared/util.js and into a src/core/core_utils.js instead 2020-01-25 00:33:52 +01:00
metrics.js 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
murmurhash3.js 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
obj.js Enable the ESLint prefer-const rule globally (PR 11450 follow-up) 2020-01-25 00:20:22 +01:00
operator_list.js 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
parser.js Move additional worker-thread only functions from src/shared/util.js and into a src/core/core_utils.js instead 2020-01-25 00:33:52 +01:00
pattern.js Enable the ESLint prefer-const rule globally (PR 11450 follow-up) 2020-01-25 00:20:22 +01:00
pdf_manager.js 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
primitives.js Enable the ESLint prefer-const rule globally (PR 11450 follow-up) 2020-01-25 00:20:22 +01:00
ps_parser.js Move additional worker-thread only functions from src/shared/util.js and into a src/core/core_utils.js instead 2020-01-25 00:33:52 +01:00
standard_fonts.js 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
stream.js Move additional worker-thread only functions from src/shared/util.js and into a src/core/core_utils.js instead 2020-01-25 00:33:52 +01:00
type1_parser.js Move additional worker-thread only functions from src/shared/util.js and into a src/core/core_utils.js instead 2020-01-25 00:33:52 +01:00
unicode.js 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
worker_stream.js 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
worker.js [api-minor] Ensure that the Array.prototype doesn't contain any enumerable properties 2020-02-10 14:17:27 +01:00