fix(dataset): check if property exist before deleting

in Safari, when it is `use strict`, if the dataset property is removed in DOM
deleting it again will cause an error

closes #309
pull/313/head
Churchill Lee 8 years ago
parent 7b45afea49
commit 06c9cfbb47
No known key found for this signature in database
GPG Key ID: 009EEF0BF3F174E1

@ -19,7 +19,7 @@ function updateDataset(oldVnode: VNode, vnode: VNode): void {
for (key in oldDataset) { for (key in oldDataset) {
if (!dataset[key]) { if (!dataset[key]) {
if (d) { if (d && d[key]) {
delete d[key]; delete d[key];
} else { } else {
elm.removeAttribute('data-' + key.replace(CAPS_REGEX, '-$&').toLowerCase()); elm.removeAttribute('data-' + key.replace(CAPS_REGEX, '-$&').toLowerCase());

Loading…
Cancel
Save