public void declare (@Nonnull final JSFormatter aFormatter) { if (m_aJSDoc != null) aFormatter.nl ().generatable (m_aJSDoc); // Emit the constructor first (a function) aFormatter.decl (constructor ()); final JSAssocArray aPrototypefields = new JSAssocArray (); // Add all fields for (final JSFieldVar aField : m_aFields.values ()) aPrototypefields.add (aField.name (), aField.hasInit () ? aField.init () : JSExpr.NULL); // Add all methods for (final JSMethod aMethod : m_aMethods) aPrototypefields.add (aMethod.name (), aMethod.getAsAnonymousFunction ()); // Start with the prototype methods JSExpr.assign (prototype (), aPrototypefields).generate (aFormatter); }
public void declare (@Nonnull final JSFormatter aFormatter) { if (m_aJSDoc != null) aFormatter.nl ().generatable (m_aJSDoc); // Emit the constructor first (a function) aFormatter.decl (constructor ()); final JSAssocArray aPrototypefields = new JSAssocArray (); // Add all fields for (final JSFieldVar aField : m_aFields.values ()) aPrototypefields.add (aField.name (), aField.hasInit () ? aField.init () : JSExpr.NULL); // Add all methods for (final JSMethod aMethod : m_aMethods) aPrototypefields.add (aMethod.name (), aMethod.getAsAnonymousFunction ()); // Start with the prototype methods JSExpr.assign (prototype (), aPrototypefields).generate (aFormatter); }