property

CompileBuildOptions.aotHarden

aotHarden?: string | string[]

With aot: add run-time checks, so that a bug in the compiler is harder to turn into a memory bug. Each name costs speed, and none is on unless it is listed here.

  • "proof-checks": check the type that the compiler has proven of a value again at each read, and check again what the compiler remembers from earlier code. Objects stay on the heap, not on the stack. The build also runs the compiler's own verifier.
  • "ignore-told-ranges": check every index against the length, where the index is used.

A check that fails aborts the process.

Takes a list of names, or one string with commas between the names. Bun.build throws on a name that it doesn't know.

Equivalent CLI flag: --aot-harden