Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
For Kyle
  • Loading branch information
douglascrockford committed Aug 19, 2012
1 parent f89de62 commit 40f3377
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions cycle.js
@@ -1,6 +1,6 @@
/* /*
cycle.js cycle.js
2012-07-18 2012-08-19
Public Domain. Public Domain.
Expand Down Expand Up @@ -54,9 +54,15 @@ if (typeof JSON.decycle !== 'function') {
case 'object': case 'object':


// typeof null === 'object', so get out if this value is not really an object. // typeof null === 'object', so get out if this value is not really an object.

// Also get out if it is a weird builtin object.
if (!value) {
return null; if (value === null ||
value instanceof Boolean ||
value instanceof Date ||
value instanceof Number ||
value instanceof RegExp ||
value instanceof String) {
return value;
} }


// If the value is an object or array, look to see if we have already // If the value is an object or array, look to see if we have already
Expand Down

0 comments on commit 40f3377

Please sign in to comment.