Skip to content

Commit

Permalink
[fix] Fix unsafe object iterations
Browse files Browse the repository at this point in the history
Fixes #175.
  • Loading branch information
mmalecki committed Jun 18, 2012
1 parent a785630 commit 4347cdd
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions lib/vows/suite.js
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,9 @@ this.Suite.prototype = new(function () {

options = options || {};

for (var k in options) { this.options[k] = options[k] }
Object.keys(options).forEach(function (k) {
that.options[k] = options[k];
});

this.matcher = this.options.matcher || this.matcher;
this.reporter = this.options.reporter || this.reporter;
Expand Down Expand Up @@ -309,7 +311,11 @@ this.Suite.prototype = new(function () {
this.runParallel = function () {};

this.export = function (module, options) {
for (var k in (options || {})) { this.options[k] = options[k] }
var that = this;

Object.keys(options || {}).forEach(function (k) {
that.options[k] = options[k];
});

if (require.main === module) {
return this.run();
Expand Down

0 comments on commit 4347cdd

Please sign in to comment.