mirror of
https://github.com/donl/JSON-js.git
synced 2026-05-25 22:06:23 -06:00
cosmetic change: follow the author code style
This commit is contained in:
parent
b56ae55720
commit
133e0f2106
1 changed files with 3 additions and 2 deletions
5
json2.js
5
json2.js
|
|
@ -244,7 +244,8 @@ if (typeof JSON !== "object") {
|
|||
// Emulate [].includes(). It's actual for old-fashioned JScript.
|
||||
|
||||
function includes(array, value) {
|
||||
for (var i = 0; i < array.length; i++) {
|
||||
var i;
|
||||
for (i = 0; i < array.length; i += 1) {
|
||||
if (value === array[i]) {
|
||||
return true;
|
||||
}
|
||||
|
|
@ -320,7 +321,7 @@ if (typeof JSON !== "object") {
|
|||
// Check the value is not circular object. Otherwise throw TypeError.
|
||||
|
||||
if (includes(seen, value)) {
|
||||
throw new TypeError('Converting circular structure to JSON');
|
||||
throw new TypeError("Converting circular structure to JSON");
|
||||
}
|
||||
|
||||
// Keep the value for the further check on circular references.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue