{"record":{"id":"0aff0df0c82fc52c","repo":"mozilla/pdf.js","slug":"postscript-function-unexpected-tok-value-ope","errorCode":null,"errorMessage":"PostScript function: unexpected '${tok.value}' operator.","messagePattern":"PostScript function: unexpected '(.+?)' operator\\.","errorType":"exception","errorClass":"FormatError","httpStatus":null,"severity":"error","filePath":"src/core/postscript/ast.js","lineNumber":309,"sourceCode":"            this._expect(TOKEN.ifelse);\n            instructions.push(new PsIfElse(thenBlock, elseBlock));\n          } else {\n            throw new FormatError(\n              \"PostScript function: a procedure block must be followed by 'if' or '{…} ifelse'.\"\n            );\n          }\n          break;\n        }\n\n        case TOKEN.rbrace:\n        case TOKEN.eof:\n          // End of this block; let the caller consume the '}'.\n          return new PsBlock(instructions);\n\n        case TOKEN.if:\n        case TOKEN.ifelse:\n          // 'if'/'ifelse' without a preceding block.\n          throw new FormatError(\n            `PostScript function: unexpected '${tok.value}' operator.`\n          );\n\n        default:\n          if (Parser._isRegularOperator(tok.id)) {\n            instructions.push(new PsOperator(tok.id));\n            this._advance();\n            break;\n          }\n          throw new FormatError(\n            `PostScript function: unexpected token id ${tok.id}.`\n          );\n      }\n    }\n  }\n}\n\n/**","sourceCodeStart":291,"sourceCodeEnd":327,"githubUrl":"https://github.com/mozilla/pdf.js/blob/5903d58d58e4dd9ce6ffa3834aea8480f06b4ada/src/core/postscript/ast.js#L291-L327","documentation":"Error \"PostScript function: unexpected '${tok.value}' operator.\" thrown in mozilla/pdf.js.","triggerScenarios":"Thrown at src/core/postscript/ast.js:309 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Remove the unsupported operator from the Type 4 calculator function; only the PostScript operators allowed by the PDF spec (arithmetic, stack, boolean, conditional) may be used."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"5903d58d58e4dd9ce6ffa3834aea8480f06b4ada","analyzedAt":"2026-08-13T02:28:27.364Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}