Assert that numberToString is called with a number (issue 19877)
*NOTE:* Given that this is an *internal* function, used only in the worker-thread, it's not clear to me that this is an entirely "necessary" change.
This commit is contained in:
parent
c1a398d932
commit
f5faf86180
@ -632,6 +632,13 @@ function recoverJsURL(str) {
|
||||
}
|
||||
|
||||
function numberToString(value) {
|
||||
if (typeof PDFJSDev === "undefined" || PDFJSDev.test("TESTING")) {
|
||||
assert(
|
||||
typeof value === "number",
|
||||
`numberToString - the value (${value}) should be a number.`
|
||||
);
|
||||
}
|
||||
|
||||
if (Number.isInteger(value)) {
|
||||
return value.toString();
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user