js.writeCall(null, "_addMessageObject");
js.writeMethodCall("_addMessageObject");
    static IJavaScriptWriter writeMessage(IJavaScriptWriter js,            FacesMessage facesMessage, String componentId, boolean isGlobal,            String bundleVar) throws WriterException {        IHtmlRenderContext htmlRenderContext = (IHtmlRenderContext) js                .getComponentRenderContext().getRenderContext();        IJavaScriptRenderContext javascriptRenderContext = htmlRenderContext                .getJavaScriptRenderContext();        FacesContext facesContext = js.getFacesContext();        boolean declare[] = new boolean[1];        String key = javascriptRenderContext.allocateFacesMessage(facesMessage,                declare);        int pred;        if (declare[0]) {            String summary = facesMessage.getSummary();            if (summary != null) {                if (bundleVar != null) {                    summary = ContextTools.resolveText(facesContext, bundleVar,                            summary);                }                summary = js.allocateString(summary);            }            String detail = facesMessage.getDetail();            if (detail != null) {                if (bundleVar != null) {                    detail = ContextTools.resolveText(facesContext, bundleVar,                            detail);                }                detail = js.allocateString(detail);            }            js.write("var ").write(key).write("=new ").writeCall(null,                    "f_messageObject");            pred = 0;            Severity severity = facesMessage.getSeverity();            // La severity ne peut etre null !            js.writeInt(severity.getOrdinal());            if (summary != null) {                for (; pred > 0; pred--) {                    js.write(',').writeNull();                }                js.write(',').write(summary);            } else {                pred++;            }            if (detail != null && detail.equals(summary) == false) {                for (; pred > 0; pred--) {                    js.write(',').writeNull();                }                js.write(',').write(detail);            } else {                pred++;            }            js.writeln(");");        }        js.writeCall(null, "_addMessageObject");        pred = 0;        if (componentId != null) {            js.writeString(componentId);        } else if (isGlobal) {            js.write("true");        } else {            js.writeNull();        }        js.write(',').write(key).writeln(");");        return js;    }