compiler/js-calc: Make unknown calculation type a compile-time error

When the Summary Page was _first written_ (the first part of TAME), it was
compiled in the browser---development consisted of refreshing the page,
which was familiar to how we wrote PHP at the time.  No compile process.

In that situation, we couldn't have the XSLT stylesheet failing to
translate.  But of course those days are long since gone, and this must be a
compile-time error.

It shouldn't ever get to this point, granted.
master
Mike Gerwitz 2021-01-14 13:51:58 -05:00
parent 9ed6d40386
commit ce0f51db2f
1 changed files with 2 additions and 5 deletions

View File

@ -1254,11 +1254,8 @@
@return self-executing anonymous error function
-->
<template match="c:*" mode="compile-calc">
<text>( function () {</text>
<text>throw Error( "Unknown calculation: </text>
<value-of select="name()" />
<text>" ); </text>
<text>} )() </text>
<message terminate="yes"
select="'unknown calculation type:', name()" />
</template>
</stylesheet>