Change how options parsing works
This commit is contained in:
parent
db79b4b026
commit
318a485bfb
2 changed files with 8 additions and 4 deletions
|
@ -6,7 +6,7 @@ class JavaScript extends Language {
|
|||
highlight: 'js',
|
||||
aliases: ['javaScript', 'js'],
|
||||
options: {
|
||||
harmony: () => true
|
||||
harmony: () => ''
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue