diff --git a/src/languages/javascript.js b/src/languages/javascript.js index 18e8f75..16aa887 100644 --- a/src/languages/javascript.js +++ b/src/languages/javascript.js @@ -6,7 +6,7 @@ class JavaScript extends Language { highlight: 'js', aliases: ['javaScript', 'js'], options: { - harmony: () => true + harmony: () => '' } }); } diff --git a/src/listeners/messageInvalid.js b/src/listeners/messageInvalid.js index cb830f5..306c6bd 100644 --- a/src/listeners/messageInvalid.js +++ b/src/listeners/messageInvalid.js @@ -76,9 +76,13 @@ class MessageInvalidListener extends Listener { continue; } - const ok = Object.prototype.hasOwnProperty.call(language.options, key) && language.options[key](value); - if (ok) { - valid.set(key, value); + if (Object.prototype.hasOwnProperty.call(language.options, key)) { + const parse = language.options[key](value); + if (parse != null) { + valid.set(key, parse); + } else { + invalid.push(key); + } } else { invalid.push(key); }