Skip to content

Commit

Permalink
raising exceptions on incompatible features
Browse files Browse the repository at this point in the history
  • Loading branch information
tenderlove committed Aug 28, 2008
1 parent d5d265d commit 21a4dbc
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 19 deletions.
4 changes: 3 additions & 1 deletion Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ task :get_dom1 => DOM_ZIP
# [unzip] Expanding: /Users/aaron/git/DOM-Test-Suite/lib/specs/DOM.zip into /Users/aaron/git/DOM-Test-Suite/lib/specs/Level-1
# [unzip] Expanding: /Users/aaron/git/DOM-Test-Suite/lib/specs/Level-1/xml-source.zip into /Users/aaron/git/DOM-Test-Suite/lib/specs/Level-1
#
task :dom1_init => [:get_dom1] do
file File.join(SPECS_DIR, "Level-1") => [:get_dom1] do
chdir(SPECS_DIR)
FileUtils.rm_rf("Level-1")
sh("unzip DOM.zip -d Level-1")
Expand All @@ -47,6 +47,8 @@ task :dom1_init => [:get_dom1] do
}
end

task :dom1_init => File.join(SPECS_DIR, "Level-1")

#dom1-interfaces-init:
#
#dom1-interfaces-gen:
Expand Down
30 changes: 12 additions & 18 deletions transforms/test-to-ruby.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,8 @@

<xsl:if test="$featureConditions">
<xsl:for-each select="$featureConditions">
<xsl:text> if (factory.hasFeature(</xsl:text>
<xsl:text>
if (factory.hasFeature(</xsl:text>
<xsl:value-of select="@feature"/>
<xsl:text>, </xsl:text>
<xsl:choose>
Expand All @@ -175,8 +176,8 @@
<xsl:when test="@value='false'">false</xsl:when>
<xsl:otherwise>true</xsl:otherwise>
</xsl:choose>
<xsl:text>) {
throw org.w3c.domts.DOMTestIncompatibleException.incompatibleFeature(</xsl:text>
<xsl:text>)
raise "org.w3c.domts.DOMTestIncompatibleException.incompatibleFeature(</xsl:text>
<xsl:value-of select="@feature"/>
<xsl:choose>
<xsl:when test="@version">
Expand All @@ -187,8 +188,8 @@
<xsl:text>, null</xsl:text>
</xsl:otherwise>
</xsl:choose>
<xsl:text>)
}
<xsl:text>)"
end
</xsl:text>
</xsl:for-each>
</xsl:if>
Expand Down Expand Up @@ -1262,17 +1263,15 @@ require 'helper'
<xsl:apply-templates select="*[position() &gt; 1 and local-name() != 'else']" mode="body">
<xsl:with-param name="vardefs" select="$vardefs"/>
</xsl:apply-templates>
<xsl:text>
end</xsl:text>
<xsl:for-each select="*[local-name()='else']">
<xsl:text> FUCK else {
</xsl:text>
else
<xsl:apply-templates mode="body">
<xsl:with-param name="vardefs" select="$vardefs"/>
</xsl:apply-templates>}
</xsl:apply-templates>
</xsl:for-each>
<xsl:text>
</xsl:text>
<xsl:text>
end
</xsl:text>
</xsl:template>

<xsl:template match="*[local-name()='try']" mode="body">
Expand Down Expand Up @@ -1404,16 +1403,11 @@ require 'helper'


<xsl:otherwise>
<xsl:text>(</xsl:text>
<xsl:call-template name="produce-type">
<xsl:with-param name="type" select="$memberType"/>
</xsl:call-template>
<xsl:text>) </xsl:text>
<xsl:call-template name="produce-indexer">
<xsl:with-param name="indexvar" select="$indexvar"/>
<xsl:with-param name="vartype" select="$vartype"/>
</xsl:call-template>
<xsl:text>;
<xsl:text>
</xsl:text>
</xsl:otherwise>
</xsl:choose>
Expand Down

0 comments on commit 21a4dbc

Please sign in to comment.