map: Proper array check for translation iteration
The previous length check existed as a really bad array check (before Array.isArray was a thing). This has been broken since Nov 2012. The problem manifests itself when you want an empty array. We then have: [] => [[]] => [DEFAULT_VALUE] * src/current/compiler/map.xsl (lvmc:compile)[lvm:map//lvm:from[*]]: Use `Array.isArray' in place of length check.master
parent
017ca1f437
commit
c9ab302f53
|
@ -745,7 +745,7 @@
|
|||
<!-- TODO: support arbitrary depth -->
|
||||
<!-- oval = orig val -->
|
||||
<text>(function(oval){</text>
|
||||
<text>var val = ( (oval||'').length ) ? oval : [oval]; </text>
|
||||
<text>var val = Array.isArray(oval) ? oval : [oval||'']; </text>
|
||||
<text>var ret = []; </text>
|
||||
|
||||
<if test="$nested-depth = 0">
|
||||
|
|
Loading…
Reference in New Issue