1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-25 17:48:07 +02:00

Ensure that Cmd/Name is only initialized with string arguments

Trying to use a non-string argument in either a `Cmd` or a `Name` is not intended, and would basically be an implementation error. Hence we can add a non-PRODUCTION check to enforce this, similar to the existing one used e.g. in the `Dict.set` method.
This commit is contained in:
Jonas Jenwald 2022-02-23 22:39:12 +01:00
parent 2bb96a708c
commit ec87995050
3 changed files with 27 additions and 1 deletions

View file

@ -901,7 +901,7 @@ const CMapFactory = (function CMapFactoryClosure() {
function parseCMapName(cMap, lexer) {
const obj = lexer.getObj();
if (obj instanceof Name && isString(obj.name)) {
if (obj instanceof Name) {
cMap.name = obj.name;
}
}