code: @EnsuresNonNull("fn")
    private Function getCompiledScript()
    {
      // JavaScript configuration should be checked when it's actually used because someone might still want Druid
      // nodes to be able to deserialize JavaScript-based objects even though JavaScript is disabled.
      Preconditions.checkState(config.isEnabled(), "JavaScript is disabled");
  
      Function syncedFn = fn;
      if (syncedFn == null) {
        synchronized (config) {
          syncedFn = fn;
          if (syncedFn == null) {
            syncedFn = compile(function);
            fn = syncedFn;
          }
        }
      }
      return syncedFn;
    }
docs: {@link #compute} can be called by multiple threads, so this function should be thread-safe to avoid extra
  script compilation.