Support constant refs with lv:match/@on
We've never done this before (thus this bug lasting so many years), but only because it doesn't really make much sense in practice; this was caught when writing test cases. * src/current/compiler/js.xsl (compile)[lv:match]: Compile `consts' instead of `args' when referencing a constant.master
parent
a62d155eb0
commit
107581017b
|
@ -710,6 +710,9 @@
|
|||
|
||||
<variable name="name" select="@on" />
|
||||
|
||||
<variable name="sym-on" as="element( preproc:sym )"
|
||||
select="root(.)/preproc:symtable/preproc:sym[ @name = $name ]" />
|
||||
|
||||
<text> tmp = </text>
|
||||
|
||||
<variable name="input-raw">
|
||||
|
@ -721,7 +724,16 @@
|
|||
</when>
|
||||
|
||||
<otherwise>
|
||||
<text>args['</text>
|
||||
<choose>
|
||||
<when test="$sym-on/@type = 'const'">
|
||||
<text>consts</text>
|
||||
</when>
|
||||
<otherwise>
|
||||
<text>args</text>
|
||||
</otherwise>
|
||||
</choose>
|
||||
|
||||
<text>['</text>
|
||||
<value-of select="translate( @on, "'", '' )" />
|
||||
<text>']</text>
|
||||
</otherwise>
|
||||
|
|
Loading…
Reference in New Issue