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',
|
highlight: 'js',
|
||||||
aliases: ['javaScript', 'js'],
|
aliases: ['javaScript', 'js'],
|
||||||
options: {
|
options: {
|
||||||
harmony: () => true
|
harmony: () => ''
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -76,9 +76,13 @@ class MessageInvalidListener extends Listener {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
const ok = Object.prototype.hasOwnProperty.call(language.options, key) && language.options[key](value);
|
if (Object.prototype.hasOwnProperty.call(language.options, key)) {
|
||||||
if (ok) {
|
const parse = language.options[key](value);
|
||||||
valid.set(key, value);
|
if (parse != null) {
|
||||||
|
valid.set(key, parse);
|
||||||
|
} else {
|
||||||
|
invalid.push(key);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
invalid.push(key);
|
invalid.push(key);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue