public static void encodeScriptTypeIfNecessary(FacesContext context) throws IOException {
        if (isOutputHtml5Doctype(context)) {
            return;
        }
        ResponseWriter writer = context.getResponseWriter();
        writer.writeAttribute("type", SCRIPT_TYPE, null);
    }
HTML5 Doctype does not require the script type on JavaScript files.

@param context the FacesContext
@throws IOException if any error occurs
primefaces/src/main/java/org/primefaces/renderkit/RendererUtils.java