Fix: don't assign undefined to style object (#764)

This commit is contained in:
eight 2019-09-09 12:48:44 +08:00 committed by narcolepticinsomniac
parent 34dfd83056
commit 450984abf3

View File

@ -43,7 +43,9 @@ const usercss = (() => {
style.usercssData = metadata; style.usercssData = metadata;
// https://github.com/openstyles/stylus/issues/560#issuecomment-440561196 // https://github.com/openstyles/stylus/issues/560#issuecomment-440561196
for (const [key, value] of Object.entries(GLOBAL_METAS)) { for (const [key, value] of Object.entries(GLOBAL_METAS)) {
style[value || key] = metadata[key]; if (metadata[key] !== undefined) {
style[value || key] = metadata[key];
}
} }
return style; return style;
}); });