diff --git a/RELEASES.md b/RELEASES.md index 1fa20bc5..ab80df3f 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -14,6 +14,17 @@ commits that introduce the changes. To make a new release, run `tools/mkrelease`, which will handle updating the heading for you. +NEXT +==== +This is a bugfix release. + +Compiler +-------- +- Input maps will now ensure that non-numeric string values result in `0` + rather than `NaN`, the latter of which results in undefined behavior in + the new classification system. + + v19.0.0 (2022-03-01) ==================== This version includes a backwards-incomplatible change to enable the new diff --git a/src/current/compiler/js.xsl b/src/current/compiler/js.xsl index 65777141..1e2a9ade 100644 --- a/src/current/compiler/js.xsl +++ b/src/current/compiler/js.xsl @@ -2414,7 +2414,7 @@ { // TODO: error if ( Array.isArray( input ) ) input = input[0]; - return ( input === '' || input === undefined ) ? value : +input; + return ( input === '' || input === undefined ) ? value : +input||0; } // TODO: error for both @@ -2428,9 +2428,9 @@ return input.map( function( x ) { return ( depth === 2 ) ? Array.isArray( x ) - ? x.map( function(s) { return +s; } ) + ? x.map( function(s) { return +s||0; } ) : [ x ] - : ( x === '' || x === undefined ) ? value : +x; + : ( x === '' || x === undefined ) ? value : +x||0; } ); } diff --git a/src/current/compiler/map.xsl b/src/current/compiler/map.xsl index 15acbb74..9a6e5d58 100644 --- a/src/current/compiler/map.xsl +++ b/src/current/compiler/map.xsl @@ -796,7 +796,7 @@ - ''+val[i] + +val[i]||0