Merge pull request #726 from domoritz/master

Fix #725
master
Evgeny Poberezkin 2018-03-02 06:32:53 +00:00 committed by GitHub
commit 33e2a41a94
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 1 deletions

View File

@ -34,7 +34,7 @@
for (;i--;) {
var item = {{=$data}}[i];
if (typeof item != '{{=$itemType}}') continue;
if (itemIndices[item] !== undefined) {
if (typeof itemIndices[item] == 'number') {
{{=$valid}} = false;
j = itemIndices[item];
break;

View File

@ -11,6 +11,11 @@
"data": ["foo", "bar", "baz"],
"valid": true
},
{
"description": "array of unique items with strings that are properties of hash are valid",
"data": ["toString", "foo"],
"valid": true
},
{
"description": "array of non-unique strings are invalid",
"data": ["foo", "bar", "bar"],