code: private static String getScriptName(ScriptContext context) {
  		if (context == null) {
  			throw new IllegalArgumentException("Invalid context - must be non null");
  		}
  		Object scriptName = context.getAttribute(ExtensionScript.SCRIPT_NAME_ATT);
  		if (scriptName == null) {
  			throw new IllegalArgumentException("Failed to find script name in the script context.");
  		}
  		if (!(scriptName instanceof String)) {
  			throw new IllegalArgumentException("The script name is not a String: " + scriptName.getClass().getCanonicalName());
  		}
  		return (String) scriptName;
  	}
docs: Gets the script name from the given context.
  
  @param context the context of the script.
  @return the name of the script, never {@code null}.
  @throws IllegalArgumentException if the {@code context} is {@code null} or it does not contain the name of the script.