THPDFQuickJS.Eval

Unit: HPDFQuickJS

Declaration

function Eval(const Script: string): THPDFQuickJSResult; overload;
function Eval(const Script: string; TimeoutMs: Cardinal;
  MaxInterruptChecks: NativeUInt): THPDFQuickJSResult; overload;

Behavior

Executes JavaScript in the engine context and returns success, value, error text and status

The original overload uses the constructor limits; the additional overload supplies per-evaluation timeout and interrupt bounds while retaining memory, stack and script-size limits

A zero timeout or interrupt limit disables that corresponding evaluation bound; callers enforcing a transaction deadline pass the remaining time instead of restarting a full timeout

The XFA session uses this overload to share one elapsed budget across replay and current execution

Delphi results and diagnostics use Unicode strings; Free Pascal preserves the bridge UTF-8 bytes and tags the managed string as UTF-8, avoiding conversion through the system ANSI code page

JavaScript arithmetic follows IEEE behavior for NaN, Infinity, overflow and underflow even when the calling application enables native floating-point traps

The engine temporarily masks floating-point exceptions during initialization and evaluation, clears flags produced by the engine, and restores the calling thread's original exception mask before returning or propagating an exception; application callbacks invoked after XFA request suspension run with the restored native mask

Related APIs

TXFAJavaScriptSession, HPDFXFAExecuteJavaScriptEvent and Interactive Dynamic XFA Widget Runtime