segmentio/analytics.js-integrations — pull request #408 by chiplay (2014-09-12 00:59:23+00:00)
Title: Return cloned props for setGlobalProperties

keen-js modifies the props object after its returned from the setGlobalProperties factory method:

https://github.com/keenlabs/keen-js/blob/master/src/track.js#L91

```
// Add properties from client.globalProperties
if (this.client.globalProperties) {
newEvent = this.client.globalProperties(eventCollection);
}

// Add properties from user-defined event
for (var property in payload) {
if (payload.hasOwnProperty(property)) {
newEvent[property] = payload[property];
}
}
```

Because `props` captured in the closure, we need to return a `cloned` version of it, so that the keen library wont continue to build up more properties on the props object with each track call.

@dustinlarimer @lancejpollard