Patch from Mike Rylander to teach the IDL2js generator to include 'map'
attributes, which allow JS clients to step through mapped, linked
fields, particuarly useful for auto-fleshing these fields.
Signed-off-by: Bill Erickson <berickxx@gmail.com>
Signed-off-by: Dan Wells <dbw2@calvin.edu>
}
this.idl.classes[fmClass].fields
- .filter(f => f.datatype === 'link' && !f.virtual)
- .forEach(field => {
+ .filter(f =>
+ f.datatype === 'link' && (
+ f.reltype === 'has_a' || f.reltype === 'might_have'
+ )
+ ).forEach(field => {
const selector = this.idl.getLinkSelector(fmClass, field.name);
if (!selector) { return; }
<xsl:if test="$f/../../idl:links/idl:link[@field=$f/@name]">type:"link",<xsl:apply-templates select="$f/../../idl:links/idl:link[@field=$f/@name]"></xsl:apply-templates>,</xsl:if>
</xsl:template>
-<xsl:template match="idl:link">key:"<xsl:value-of select="@key"/>","class":"<xsl:value-of select="@class"/>",reltype:"<xsl:value-of select="@reltype"/>"</xsl:template>
+<xsl:template match="idl:link"><xsl:if test="@map != ''">map:"<xsl:value-of select="@map"/>",</xsl:if>key:"<xsl:value-of select="@key"/>","class":"<xsl:value-of select="@class"/>",reltype:"<xsl:value-of select="@reltype"/>"</xsl:template>
<xsl:template name="trueFalse">
<xsl:param name="tf"/>