Skip to content

Commit

Permalink
The body of a for in should be wrapped in an if statement to filter u…
Browse files Browse the repository at this point in the history
  • Loading branch information
Søren Louv-Jansen committed Jul 26, 2013
1 parent 11346d4 commit 7a90a7d
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions js/OAuthSimple.js
Original file line number Diff line number Diff line change
Expand Up @@ -290,8 +290,8 @@ if (OAuthSimple === undefined)
}

var j, pName, pLength, result = 'OAuth ';
for (pName in this._parameters)
{
for (pName in this._parameters){
if(this._parameters.hasOwnProperty(pName)){
if (pName.match(/^oauth/) === undefined) {
continue;
}
Expand All @@ -307,6 +307,7 @@ if (OAuthSimple === undefined)
{
result += pName + '="' + this._oauthEscape(this._parameters[pName]) + '", ';
}
}
}
return result.replace(/,\s+$/, '');
};
Expand Down Expand Up @@ -412,12 +413,13 @@ if (OAuthSimple === undefined)
paramNames = [],
i = 0,
ra = 0;
for (var paramName in this._parameters)
{
for (var paramName in this._parameters){
if (this._parameters.hasOwnProperty(paramNam)) {
if (ra++ > 1000) {
throw ('runaway 1');
}
throw ('runaway 1');
}
paramNames.unshift(paramName);
}
}
paramNames = paramNames.sort();
var pLen = paramNames.length;
Expand Down Expand Up @@ -470,7 +472,9 @@ if (OAuthSimple === undefined)
if (target === undefined)
target = {};
for (var key in source) {
if (source.hasOwnProperty(key)) {
target[key] = source[key];
}
}
return target;
};
Expand Down

0 comments on commit 7a90a7d

Please sign in to comment.