Skip to content

Commit

Permalink
Added note about Object.create
Browse files Browse the repository at this point in the history
  • Loading branch information
arb committed Jan 12, 2015
1 parent 59d73d5 commit 1e58102
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/reporter.js
Expand Up @@ -34,6 +34,9 @@ internals.GoodTransform.prototype._transform = function (data, enc, next) {
// events hash of events and tags
internals.GoodTransform.subscription = function (events) {

// Because we are attaching unrestricted keys from the user to result
// we want to null the prototype to prevent issues with "hasOwnPropery" or
// other built in keys to Object.
var result = Object.create(null);
var subs = Object.keys(events);

Expand Down

0 comments on commit 1e58102

Please sign in to comment.