Interface: ContextEvalOptions

February 16, 2026 ยท View on GitHub

quickjs-emscripten


quickjs-emscripten / quickjs-emscripten-core / ContextEvalOptions

Interface: ContextEvalOptions

Defined in: packages/quickjs-emscripten-core/src/types.ts:244

Contents

Properties

backtraceBarrier?

optional backtraceBarrier: boolean

Defined in: packages/quickjs-emscripten-core/src/types.ts:263

don't include the stack frames before this eval in the Error() backtraces


compileOnly?

optional compileOnly: boolean

Defined in: packages/quickjs-emscripten-core/src/types.ts:261

compile but do not run. The result is an object with a JS_TAG_FUNCTION_BYTECODE or JS_TAG_MODULE tag. It can be executed with JS_EvalFunction().


strict?

optional strict: boolean

Defined in: packages/quickjs-emscripten-core/src/types.ts:253

Force "strict" mode


strip?

optional strip: boolean

Defined in: packages/quickjs-emscripten-core/src/types.ts:255

Force "strip" mode


type?

optional type: "global" | "module"

Defined in: packages/quickjs-emscripten-core/src/types.ts:251

Global code (default), or "module" code?

  • When type is "global", the code is evaluated in the global scope of the QuickJSContext, and the return value is the result of the last expression.
  • When type is "module", the code is evaluated is a module scope, may use import, export, and top-level await. The return value is the module's exports, or a promise for the module's exports.