code: public SafeScript toSafeScript() {
      Preconditions.checkState(
          getContentKind() == ContentKind.JS,
          "toSafeScript() only valid for SanitizedContent of kind JS, is: %s",
          getContentKind());
      return UncheckedConversions.safeScriptFromStringKnownToSatisfyTypeContract(getContent());
    }
docs: Converts a Soy {@link SanitizedContent} of kind JS into a {@link SafeScript}.
  
  @throws IllegalStateException if this SanitizedContent's content kind is not {@link
  ContentKind#JS}.