From d53f6ca305da14cea431433601ba20835872c83d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ale=C5=A1=20Smodi=C5=A1?= Date: Fri, 18 Sep 2015 10:04:07 +0200 Subject: Bugfix: handle arrays as a static hint. --- js/codeq/hint.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'js/codeq') diff --git a/js/codeq/hint.js b/js/codeq/hint.js index 6b8d12f..a94f571 100644 --- a/js/codeq/hint.js +++ b/js/codeq/hint.js @@ -153,14 +153,14 @@ } } t = typeof hintDef; - if (t === 'object') { - hintType = hintDef.type; - hintTemplate = hintDef.message; - } - else if (t === 'string') { + if ((t === 'string') || (hintDef instanceof Array)) { hintType = 'static'; hintTemplate = hintDef; } + else if (t === 'object') { + hintType = hintDef.type; + hintTemplate = hintDef.message; + } else { codeq.log.error('Unsupported hint definition: ' + t); continue; -- cgit v1.2.1