Permalink
Browse files

Adding "date" detection to `detectType`

  • Loading branch information...
1 parent 4c5e96d commit 7c7d1f961c0ba4d67d645ddc546faa68f1969937 @detro detro committed Oct 18, 2012
Showing with 3 additions and 0 deletions.
  1. +2 −0 src/bootstrap.js
  2. +1 −0 src/modules/webpage.js
View
2 src/bootstrap.js
@@ -303,6 +303,8 @@ window.detectType = function (value) {
s = 'array';
} else if (value instanceof RegExp) {
s = 'regexp';
+ } else if (value instanceof Date) {
+ s = 'date';
}
} else {
s = 'null';
View
1 src/modules/webpage.js
@@ -282,6 +282,7 @@ function decorateNewPage(opts, page) {
switch (argType) {
case "object": //< for type "object"
case "array": //< for type "array"
+ case "date": //< for type "date"
str += "JSON.parse(" + JSON.stringify(JSON.stringify(arg)) + "),"
break;
case "string": //< for type "string"

0 comments on commit 7c7d1f9

Please sign in to comment.