suite.js performs unsafe Object iterations without hasOwnProperty #175

Closed
wants to merge 3 commits into
from

Conversation

Projects
None yet
3 participants
@Sembiance

Even in node.js, it's possible that the Object prototype can be modified with additional properties.

When this happens it is causing vows to fail because vows isn't checking hasOwnProperty() to ensure it's a real property.

This pull request adds the two checks needed in suite.js

I've run npm test and tests pass.

This pull request is ready to be merged.

Added hasOwnProperty() check to 'for(var key in obj)' loops so that e…
…xternal Object prototype manipulations can't cause vows to break
@Prinzhorn

This comment has been minimized.

Show comment Hide comment
@Prinzhorn

Prinzhorn Jan 19, 2012

I think your code still doesn't nail it 100%.

if (Object.prototype.hasOwnProperty.call(options, k))

I think your code still doesn't nail it 100%.

if (Object.prototype.hasOwnProperty.call(options, k))
@Sembiance

This comment has been minimized.

Show comment Hide comment
@Sembiance

Sembiance Jan 19, 2012

@Prinzhorn

fixed

@mmalecki mmalecki closed this in 4347cdd Jun 18, 2012

@mmalecki

This comment has been minimized.

Show comment Hide comment
@mmalecki

mmalecki Jun 18, 2012

I went with 4347cdd, but thanks!

I went with 4347cdd, but thanks!

@Sembiance

This comment has been minimized.

Show comment Hide comment
@Sembiance

Sembiance Jun 18, 2012

@mmalecki that works too! Thanks for fixing this, I can now use the official vows module instead of my fork :)

@mmalecki that works too! Thanks for fixing this, I can now use the official vows module instead of my fork :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment