Format the stack trace if not yet done, and return it. Cache the formatted stack trace on the holder.
function() {
  var formatted_stack_trace = UNDEFINED;
  var holder = this;
  while (holder) {
    var formatted_stack_trace =
      GET_PRIVATE(holder, formattedStackTraceSymbol);
    if (IS_UNDEFINED(formatted_stack_trace)) {
      // No formatted stack trace available.
      var stack_trace = GET_PRIVATE(holder, stackTraceSymbol);
      if (IS_UNDEFINED(stack_trace)) {
        // Neither formatted nor structured stack trace available.
        // Look further up the prototype chain.
        holder = %object_get_prototype_of(holder);
        continue;
      }
      formatted_stack_trace = FormatStackTrace(holder, stack_trace);
      SET_PRIVATE(holder, stackTraceSymbol, UNDEFINED);
      SET_PRIVATE(holder, formattedStackTraceSymbol, formatted_stack_trace);
    }
    return formatted_stack_trace;
  }
  return UNDEFINED;
}