diff --git a/build-aux/list2typedef b/build-aux/list2typedef index fdb5c59a..3a18cf39 100755 --- a/build-aux/list2typedef +++ b/build-aux/list2typedef @@ -66,7 +66,7 @@ output-item() local name; read -r name local -r const=$( constify "$typedef" <<< "$name" ) - local -r value=$( hash-name "$bytes" <<< "$name" ) + local -r value=$( echo -n "$name" | hash-name "$bytes" ) assert-collision "$const" "$value" diff --git a/build-aux/test/test-list2typedef b/build-aux/test/test-list2typedef index e417c022..62a5bd8d 100755 --- a/build-aux/test/test-list2typedef +++ b/build-aux/test/test-list2typedef @@ -41,9 +41,9 @@ Second'\''s @ @Line title="FooType Type"> - - - + + + ' @@ -79,11 +79,11 @@ test-collision-value-check() # we can easily force a collision by reducing the number of bytes to 1 and # calculating hashes from /usr/share/dict/words; this is one example - local err=$( ../list2typedef Foo 1 2>&1 >/dev/null <<< 'abacist -abatis + local err=$( ../list2typedef Foo 1 2>&1 >/dev/null <<< 'abase +abate ' && echo 'EXPECTED FAILURE' ) - [[ "$err" =~ ABATIS && "$err" =~ '44' ]] || { + [[ "$err" =~ ABATE && "$err" =~ '157' ]] || { echo 'expecting useful error message for value collion' >&2 return 1 } diff --git a/src/current/compiler/js.xsl b/src/current/compiler/js.xsl index 78afb0c4..cfc5ccfa 100644 --- a/src/current/compiler/js.xsl +++ b/src/current/compiler/js.xsl @@ -2,7 +2,7 @@ + + + + + + + + + + + + + + + + + + + + @@ -752,27 +782,71 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +