Skip to content
This repository has been archived by the owner on May 28, 2019. It is now read-only.

Modified for loops so there are no Closure Compiler warnings #88

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .travis.yml
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ before_install:
- "npm i -g npm@\"$NPM_VERSION\""
- "[ $SAUCE_LABS == false ] || npm i chalk@\"^0.5.1\" ecstatic@\"^0.5.6\" request@\"^2.34.0\" sauce-tunnel@\"^2.0.0\" lodash@\"^3.5.0\""
# - "[ $BIN == 'istanbul' ] && npm i -g istanbul@\"~0.1.0\" || true"
- "[ $BIN == 'iojs' ] && wget https://iojs.org/dist/${IOJS_VERSION}/iojs-${IOJS_VERSION}-linux-x64.tar.xz && sudo tar xJf iojs-${IOJS_VERSION}-linux-x64.tar.xz -C /opt && rm iojs-${IOJS_VERSION}-linux-x64.tar.xz || true"
- "[ $BIN == 'iojs' ] && curl -O https://iojs.org/dist/${IOJS_VERSION}/iojs-${IOJS_VERSION}-linux-x64.tar.xz && sudo tar xJf iojs-${IOJS_VERSION}-linux-x64.tar.xz -C /opt && rm iojs-${IOJS_VERSION}-linux-x64.tar.xz || true"
- "[ $BIN == 'iojs' ] && sudo ln -s /opt/iojs-${IOJS_VERSION}-linux-x64/bin/iojs /usr/local/bin/iojs && sudo chmod +x /usr/local/bin/iojs || true"
- "[ $BIN == 'narwhal' ] && wget https://github.com/280north/narwhal/archive/v0.3.2.zip && sudo unzip v0.3.2 -d /opt/ && rm v0.3.2.zip || true"
- "[ $BIN == 'narwhal' ] && sudo ln -s /opt/narwhal-0.3.2/bin/narwhal /usr/local/bin/narwhal && sudo chmod +x /usr/local/bin/narwhal || true"
Expand Down
21 changes: 11 additions & 10 deletions lib/json3.js
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,8 @@
}
}
// Manually invoke the callback for each non-enumerable property.
for (length = members.length; property = members[--length]; hasProperty.call(object, property) && callback(property));
//for (length = members.length; property = members[--length]; hasProperty.call(object, property) && callback(property));
for (length = members.length; property = members[--length]; hasProperty.call(object, property) && callback(property)){}
};
} else {
// No bugs detected; use the standard `for...in` algorithm.
Expand Down Expand Up @@ -332,8 +333,8 @@
// seconds, and milliseconds if the `getUTC*` methods are
// buggy. Adapted from @Yaffle's `date-shim` project.
date = floor(value / 864e5);
for (year = floor(date / 365.2425) + 1970 - 1; getDay(year + 1, 0) <= date; year++);
for (month = floor((date - getDay(year, 0)) / 30.42); getDay(year, month + 1) <= date; month++);
for (year = floor(date / 365.2425) + 1970 - 1; getDay(year + 1, 0) <= date; year++){}
for (month = floor((date - getDay(year, 0)) / 30.42); getDay(year, month + 1) <= date; month++){}
date = 1 + date - getDay(year, month);
// The `time` value specifies the time within the day (see ES
// 5.1 section 15.9.1.2). The formula `(A % B + B) % B` is used
Expand Down Expand Up @@ -525,7 +526,7 @@
} else if (className == arrayClass) {
// Convert the property names array into a makeshift set.
properties = {};
for (var index = 0, length = filter.length, value; index < length; value = filter[index++], ((className = getClass.call(value)), className == stringClass || className == numberClass) && (properties[value] = 1));
for (var index = 0, length = filter.length, value; index < length; value = filter[index++], ((className = getClass.call(value)), className == stringClass || className == numberClass) && (properties[value] = 1)){}
}
}
if (width) {
Expand All @@ -534,7 +535,7 @@
// Convert the `width` to an integer and create a string containing
// `width` number of space characters.
if ((width -= width % 1) > 0) {
for (whitespace = "", width > 10 && (width = 10); whitespace.length < width; whitespace += " ");
for (whitespace = "", width > 10 && (width = 10); whitespace.length < width; whitespace += " "){}
}
} else if (className == stringClass) {
whitespace = width.length <= 10 ? width : width.slice(0, 10);
Expand Down Expand Up @@ -676,13 +677,13 @@
}
isSigned = false;
// Parse the integer component.
for (; Index < length && ((charCode = source.charCodeAt(Index)), charCode >= 48 && charCode <= 57); Index++);
for (; Index < length && ((charCode = source.charCodeAt(Index)), charCode >= 48 && charCode <= 57); Index++){}
// Floats cannot contain a leading decimal point; however, this
// case is already accounted for by the parser.
if (source.charCodeAt(Index) == 46) {
position = ++Index;
// Parse the decimal component.
for (; position < length && ((charCode = source.charCodeAt(position)), charCode >= 48 && charCode <= 57); position++);
for (; position < length && ((charCode = source.charCodeAt(position)), charCode >= 48 && charCode <= 57); position++){}
if (position == Index) {
// Illegal trailing decimal.
abort();
Expand All @@ -700,7 +701,7 @@
Index++;
}
// Parse the exponential component.
for (position = Index; position < length && ((charCode = source.charCodeAt(position)), charCode >= 48 && charCode <= 57); position++);
for (position = Index; position < length && ((charCode = source.charCodeAt(position)), charCode >= 48 && charCode <= 57); position++){}
if (position == Index) {
// Illegal empty exponent.
abort();
Expand Down Expand Up @@ -842,7 +843,7 @@
// because its `Object#hasOwnProperty` implementation returns `false`
// for array indices (e.g., `![1, 2, 3].hasOwnProperty("0")`).
if (getClass.call(value) == arrayClass) {
for (length = value.length; length--; update(value, length, callback));
for (length = value.length; length--; update(value, length, callback)){}
} else {
forOwn(value, function (property) {
update(value, property, callback);
Expand Down Expand Up @@ -908,4 +909,4 @@
return JSON3;
});
}
}).call(this);
}).call(this);