Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

For Kyle

  • Loading branch information...
commit 40f3377a631eaedeec877379f9cb338046cac0e0 1 parent f89de62
@douglascrockford authored
Showing with 10 additions and 4 deletions.
  1. +10 −4 cycle.js
View
14 cycle.js
@@ -1,6 +1,6 @@
/*
cycle.js
- 2012-07-18
+ 2012-08-19
Public Domain.
@@ -54,9 +54,15 @@ if (typeof JSON.decycle !== 'function') {
case 'object':
// typeof null === 'object', so get out if this value is not really an object.
-
- if (!value) {
- return null;
+// Also get out if it is a weird builtin object.
+
+ 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
Please sign in to comment.
Something went wrong with that request. Please try again.