Commit e1f3c50
committed
[fixed] rename to support inherited properties
Previously, `rename` would fail on `UIEvent`, because `event.hasOwnProperty('x') === false`. Switching to the `in` operator allows `rename` to work as expected without polluting the resulting object with undefined values.
I'm not sure why I was checking if `value` had a given key in the first place. I probably did it without thinking too hard about it; perhaps to avoid trying to get a value from `undefined`. Since I don't recall why that check is there, I'm going to leave it until I have a good reason to remove it. In most cases, it shouldn't matter. What the correct behavior is for garbage value like `undefined` isn't something I have mental capacity to think about right now.1 parent caedb27 commit e1f3c50
2 files changed
Lines changed: 24 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
67 | 67 | | |
68 | 68 | | |
69 | 69 | | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
70 | 93 | | |
71 | 94 | | |
72 | 95 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
79 | 79 | | |
80 | 80 | | |
81 | 81 | | |
82 | | - | |
| 82 | + | |
83 | 83 | | |
84 | 84 | | |
85 | 85 | | |
| |||
0 commit comments