Matt-Esch/vdom — pull request #14 by wesleytodd (2014-10-27 21:24:24+00:00)
Title: Fix for removal of data attributes durring patch operations

After removing a data attribute a patch operation will set the value to the string 'undefined'.

The original dom looks like this:

```html

```

The new dom like this:

```html

```

And the patch contains this:

```javascript
{
patch: {
dataset: {
collection: undefined
}
}
}
```

Which results in this:

```html

```

It has to do with this:

https://github.com/Matt-Esch/vdom/blob/master/apply-properties.js#L80
```javascript
for (var k in propValue) {
var value = propValue[k]
node[propName][k] = (value === undefined) ? replacer : value
}
```

`replacer` is undefined, as is value. So you still end up setting the property to `undefined`. You get the same result by just running this in your console:

```javascript
document.body.dataset.foo = undefined; // Body now has:

```

This is one possible fix for this issue. If you see any problems with calling out this directly like this let me know and I will update.